/* Generated by Cython 0.29.15 */

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
    #error Cython requires Python 2.6+ or Python 3.3+.
#else
#define CYTHON_ABI "0_29_15"
#define CYTHON_HEX_VERSION 0x001D0FF0
#define CYTHON_FUTURE_DIVISION 1
#include <stddef.h>
#ifndef offsetof
  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#define __PYX_COMMA ,
#ifndef HAVE_LONG_LONG
  #if PY_VERSION_HEX >= 0x02070000
    #define HAVE_LONG_LONG
  #endif
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
  #define CYTHON_COMPILING_IN_PYPY 1
  #define CYTHON_COMPILING_IN_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #if PY_VERSION_HEX < 0x03050000
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #undef CYTHON_AVOID_BORROWED_REFS
  #define CYTHON_AVOID_BORROWED_REFS 1
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
#elif defined(PYSTON_VERSION)
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 1
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #undef CYTHON_USE_ASYNC_SLOTS
  #define CYTHON_USE_ASYNC_SLOTS 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
#else
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 1
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #if PY_VERSION_HEX < 0x02070000
    #undef CYTHON_USE_PYTYPE_LOOKUP
    #define CYTHON_USE_PYTYPE_LOOKUP 0
  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
    #define CYTHON_USE_PYTYPE_LOOKUP 1
  #endif
  #if PY_MAJOR_VERSION < 3
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #if PY_VERSION_HEX < 0x02070000
    #undef CYTHON_USE_PYLONG_INTERNALS
    #define CYTHON_USE_PYLONG_INTERNALS 0
  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
    #define CYTHON_USE_PYLONG_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_PYLIST_INTERNALS
    #define CYTHON_USE_PYLIST_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #if PY_VERSION_HEX < 0x030300F0
    #undef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #elif !defined(CYTHON_USE_UNICODE_WRITER)
    #define CYTHON_USE_UNICODE_WRITER 1
  #endif
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #ifndef CYTHON_FAST_THREAD_STATE
    #define CYTHON_FAST_THREAD_STATE 1
  #endif
  #ifndef CYTHON_FAST_PYCALL
    #define CYTHON_FAST_PYCALL 1
  #endif
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
  #endif
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
  #endif
  #ifndef CYTHON_USE_DICT_VERSIONS
    #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
  #endif
  #ifndef CYTHON_USE_EXC_INFO_STACK
    #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
  #endif
#endif
#if !defined(CYTHON_FAST_PYCCALL)
#define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
#endif
#if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
  #undef SHIFT
  #undef BASE
  #undef MASK
  #ifdef SIZEOF_VOID_P
    enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
  #endif
#endif
#ifndef __has_attribute
  #define __has_attribute(x) 0
#endif
#ifndef __has_cpp_attribute
  #define __has_cpp_attribute(x) 0
#endif
#ifndef CYTHON_RESTRICT
  #if defined(__GNUC__)
    #define CYTHON_RESTRICT __restrict__
  #elif defined(_MSC_VER) && _MSC_VER >= 1400
    #define CYTHON_RESTRICT __restrict
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_RESTRICT restrict
  #else
    #define CYTHON_RESTRICT
  #endif
#endif
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_MAYBE_UNUSED_VAR
#  if defined(__cplusplus)
     template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
#  else
#    define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
#  endif
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
#ifdef _MSC_VER
    #ifndef _MSC_STDINT_H_
        #if _MSC_VER < 1300
           typedef unsigned char     uint8_t;
           typedef unsigned int      uint32_t;
        #else
           typedef unsigned __int8   uint8_t;
           typedef unsigned __int32  uint32_t;
        #endif
    #endif
#else
   #include <stdint.h>
#endif
#ifndef CYTHON_FALLTHROUGH
  #if defined(__cplusplus) && __cplusplus >= 201103L
    #if __has_cpp_attribute(fallthrough)
      #define CYTHON_FALLTHROUGH [[fallthrough]]
    #elif __has_cpp_attribute(clang::fallthrough)
      #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
    #elif __has_cpp_attribute(gnu::fallthrough)
      #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
    #endif
  #endif
  #ifndef CYTHON_FALLTHROUGH
    #if __has_attribute(fallthrough)
      #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
    #else
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
  #if defined(__clang__ ) && defined(__apple_build_version__)
    #if __apple_build_version__ < 7000000
      #undef  CYTHON_FALLTHROUGH
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
#endif

#ifndef __cplusplus
  #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
#endif
#ifndef CYTHON_INLINE
  #if defined(__clang__)
    #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
  #else
    #define CYTHON_INLINE inline
  #endif
#endif
template<typename T>
void __Pyx_call_destructor(T& x) {
    x.~T();
}
template<typename T>
class __Pyx_FakeReference {
  public:
    __Pyx_FakeReference() : ptr(NULL) { }
    __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
    T *operator->() { return ptr; }
    T *operator&() { return ptr; }
    operator T&() { return *ptr; }
    template<typename U> bool operator ==(U other) { return *ptr == other; }
    template<typename U> bool operator !=(U other) { return *ptr != other; }
  private:
    T *ptr;
};

#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
  #define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyClass_Type
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
#if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#endif
  #define __Pyx_DefaultClassType PyType_Type
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
  #define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#ifndef METH_STACKLESS
  #define METH_STACKLESS 0
#endif
#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
  #ifndef METH_FASTCALL
     #define METH_FASTCALL 0x80
  #endif
  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
                                                          Py_ssize_t nargs, PyObject *kwnames);
#else
  #define __Pyx_PyCFunctionFast _PyCFunctionFast
  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
#endif
#if CYTHON_FAST_PYCCALL
#define __Pyx_PyFastCFunction_Check(func)\
    ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
#else
#define __Pyx_PyFastCFunction_Check(func) 0
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
  #define PyObject_Malloc(s)   PyMem_Malloc(s)
  #define PyObject_Free(p)     PyMem_Free(p)
  #define PyObject_Realloc(p)  PyMem_Realloc(p)
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
  #define PyMem_RawMalloc(n)           PyMem_Malloc(n)
  #define PyMem_RawRealloc(p, n)       PyMem_Realloc(p, n)
  #define PyMem_RawFree(p)             PyMem_Free(p)
#endif
#if CYTHON_COMPILING_IN_PYSTON
  #define __Pyx_PyCode_HasFreeVars(co)  PyCode_HasFreeVars(co)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
#else
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
#endif
#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#elif PY_VERSION_HEX >= 0x03060000
  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
#elif PY_VERSION_HEX >= 0x03000000
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#else
  #define __Pyx_PyThreadState_Current _PyThreadState_Current
#endif
#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
#include "pythread.h"
#define Py_tss_NEEDS_INIT 0
typedef int Py_tss_t;
static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
  *key = PyThread_create_key();
  return 0;
}
static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
  *key = Py_tss_NEEDS_INIT;
  return key;
}
static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
  PyObject_Free(key);
}
static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
  return *key != Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
  PyThread_delete_key(*key);
  *key = Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
  return PyThread_set_key_value(*key, value);
}
static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
  return PyThread_get_key_value(*key);
}
#endif
#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
#define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
#else
#define __Pyx_PyDict_NewPresized(n)  PyDict_New()
#endif
#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#else
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
#define __Pyx_PyDict_GetItemStr(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
#else
#define __Pyx_PyDict_GetItemStr(dict, name)  PyDict_GetItem(dict, name)
#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, ch)
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
#else
  #define CYTHON_PEP393_ENABLED 0
  #define PyUnicode_1BYTE_KIND  1
  #define PyUnicode_2BYTE_KIND  2
  #define PyUnicode_4BYTE_KIND  4
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
  #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
  #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
  #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
#endif
#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
#else
  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
#endif
#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
  #define PyObject_ASCII(o)            PyObject_Repr(o)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
  #define PyObject_Unicode             PyObject_Str
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
#else
  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif
#if CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
#else
  #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  #define PyNumber_Int                 PyNumber_Long
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  #ifndef PyUnicode_InternFromString
    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  #endif
#endif
#if PY_VERSION_HEX < 0x030200A4
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
#else
  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
#if CYTHON_USE_ASYNC_SLOTS
  #if PY_VERSION_HEX >= 0x030500B1
    #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
    #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
  #else
    #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
  #endif
#else
  #define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef __Pyx_PyAsyncMethodsStruct
    typedef struct {
        unaryfunc am_await;
        unaryfunc am_aiter;
        unaryfunc am_anext;
    } __Pyx_PyAsyncMethodsStruct;
#endif

#if defined(WIN32) || defined(MS_WINDOWS)
  #define _USE_MATH_DEFINES
#endif
#include <math.h>
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
  float value;
  memset(&value, 0xFF, sizeof(value));
  return value;
}
#endif
#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
#define __Pyx_truncl trunc
#else
#define __Pyx_truncl truncl
#endif


#define __PYX_ERR(f_index, lineno, Ln_error) \
{ \
  __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
}

#ifndef __PYX_EXTERN_C
  #ifdef __cplusplus
    #define __PYX_EXTERN_C extern "C"
  #else
    #define __PYX_EXTERN_C extern
  #endif
#endif

#define __PYX_HAVE__pyarrow__lib
#define __PYX_HAVE_API__pyarrow__lib
/* Early includes */
#include <string.h>
#include <stdio.h>
#include "pythread.h"
#include "ios"
#include "new"
#include "stdexcept"
#include "typeinfo"
#include <stdint.h>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include "datetime.h"

    #include <type_traits>
    #include <utility>
    namespace cymove {
    template <typename T>
    inline typename std::remove_reference<T>::type&& cymove(T& t) {
        return std::move(t);
    }
    template <typename T>
    inline typename std::remove_reference<T>::type&& cymove(T&& t) {
        return std::move(t);
    }
    }  // namespace cymove
    
#include "arrow/python/platform.h"
#include <Python.h>
#include "numpy/halffloat.h"
#include "arrow/api.h"
#include "arrow/result.h"
#include "arrow/python/common.h"
#include "arrow/util/key_value_metadata.h"
#include "arrow/builder.h"
#include "arrow/io/api.h"
#include "arrow/ipc/api.h"
#include "arrow/csv/api.h"
#include "arrow/json/options.h"
#include "arrow/json/reader.h"
#include "arrow/compute/api.h"
#include "arrow/python/api.h"
#include "arrow/python/init.h"
#include "arrow/python/pyarrow.h"
#include "arrow/python/config.h"
#include "arrow/python/inference.h"
#include "arrow/extension_type.h"
#include "arrow/python/extension_type.h"
#include "arrow/python/benchmark.h"
#include "arrow/util/compression.h"
#include "arrow/util/io_util.h"
#include "arrow/util/iterator.h"
#include "arrow/util/thread_pool.h"
#include "arrow/array/concatenate.h"
#include <stdlib.h>
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
#define CYTHON_WITHOUT_ASSERTIONS
#endif

typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;

#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
    (sizeof(type) < sizeof(Py_ssize_t))  ||\
    (sizeof(type) > sizeof(Py_ssize_t) &&\
          likely(v < (type)PY_SSIZE_T_MAX ||\
                 v == (type)PY_SSIZE_T_MAX)  &&\
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
                                v == (type)PY_SSIZE_T_MIN)))  ||\
    (sizeof(type) == sizeof(Py_ssize_t) &&\
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
                               v == (type)PY_SSIZE_T_MAX)))  )
static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
    return (size_t) i < (size_t) limit;
}
#if defined (__cplusplus) && __cplusplus >= 201103L
    #include <cstdlib>
    #define __Pyx_sst_abs(value) std::abs(value)
#elif SIZEOF_INT >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) abs(value)
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) labs(value)
#elif defined (_MSC_VER)
    #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define __Pyx_sst_abs(value) llabs(value)
#elif defined (__GNUC__)
    #define __Pyx_sst_abs(value) __builtin_llabs(value)
#else
    #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString        PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if PY_MAJOR_VERSION < 3
    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#else
    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
#endif
#define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyObject_AsWritableString(s)    ((char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
    const Py_UNICODE *u_end = u;
    while (*u_end++) ;
    return (size_t)(u_end - u - 1);
}
#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
#define __Pyx_PySequence_Tuple(obj)\
    (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
#if CYTHON_ASSUME_SAFE_MACROS
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
#else
#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
#endif
#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    PyObject* ascii_chars_u = NULL;
    PyObject* ascii_chars_b = NULL;
    const char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    if (strcmp(default_encoding_c, "ascii") == 0) {
        __Pyx_sys_getdefaultencoding_not_ascii = 0;
    } else {
        char ascii_chars[128];
        int c;
        for (c = 0; c < 128; c++) {
            ascii_chars[c] = c;
        }
        __Pyx_sys_getdefaultencoding_not_ascii = 1;
        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
        if (!ascii_chars_u) goto bad;
        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
        if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
            PyErr_Format(
                PyExc_ValueError,
                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
                default_encoding_c);
            goto bad;
        }
        Py_DECREF(ascii_chars_u);
        Py_DECREF(ascii_chars_b);
    }
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    Py_XDECREF(ascii_chars_u);
    Py_XDECREF(ascii_chars_b);
    return -1;
}
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#else
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
static char* __PYX_DEFAULT_STRING_ENCODING;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
    if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    return -1;
}
#endif
#endif


/* Test for GCC > 2.95 */
#if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
  #define likely(x)   __builtin_expect(!!(x), 1)
  #define unlikely(x) __builtin_expect(!!(x), 0)
#else /* !__GNUC__ or GCC < 2.95 */
  #define likely(x)   (x)
  #define unlikely(x) (x)
#endif /* __GNUC__ */
static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }

static PyObject *__pyx_m = NULL;
static PyObject *__pyx_d;
static PyObject *__pyx_b;
static PyObject *__pyx_cython_runtime = NULL;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static PyObject *__pyx_empty_unicode;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;


static const char *__pyx_f[] = {
  "pyarrow\\error.pxi",
  "pyarrow\\array.pxi",
  "pyarrow\\io-hdfs.pxi",
  "pyarrow\\pandas-shim.pxi",
  "pyarrow\\types.pxi",
  "pyarrow\\scalar.pxi",
  "pyarrow\\table.pxi",
  "pyarrow\\io.pxi",
  "pyarrow\\ipc.pxi",
  "pyarrow\\lib.pyx",
  "stringsource",
  "pyarrow\\memory.pxi",
  "pyarrow\\builder.pxi",
  "pyarrow\\tensor.pxi",
  "pyarrow\\compute.pxi",
  "pyarrow\\feather.pxi",
  "pyarrow\\serialization.pxi",
  "pyarrow\\benchmark.pxi",
  "pyarrow\\public-api.pxi",
  "datetime.pxd",
  "pyarrow\\lib.pxd",
  "type.pxd",
  "bool.pxd",
  "complex.pxd",
};
/* ForceInitThreads.proto */
#ifndef __PYX_FORCE_INIT_THREADS
  #define __PYX_FORCE_INIT_THREADS 0
#endif

/* NoFastGil.proto */
#define __Pyx_PyGILState_Ensure PyGILState_Ensure
#define __Pyx_PyGILState_Release PyGILState_Release
#define __Pyx_FastGIL_Remember()
#define __Pyx_FastGIL_Forget()
#define __Pyx_FastGilFuncInit()


/*--- Type declarations ---*/
struct __pyx_obj_7pyarrow_3lib_Message;
struct __pyx_obj_7pyarrow_3lib_MemoryPool;
struct __pyx_obj_7pyarrow_3lib_DataType;
struct __pyx_obj_7pyarrow_3lib_ListType;
struct __pyx_obj_7pyarrow_3lib_LargeListType;
struct __pyx_obj_7pyarrow_3lib_MapType;
struct __pyx_obj_7pyarrow_3lib_FixedSizeListType;
struct __pyx_obj_7pyarrow_3lib_StructType;
struct __pyx_obj_7pyarrow_3lib_DictionaryMemo;
struct __pyx_obj_7pyarrow_3lib_DictionaryType;
struct __pyx_obj_7pyarrow_3lib_TimestampType;
struct __pyx_obj_7pyarrow_3lib_Time32Type;
struct __pyx_obj_7pyarrow_3lib_Time64Type;
struct __pyx_obj_7pyarrow_3lib_DurationType;
struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType;
struct __pyx_obj_7pyarrow_3lib_Decimal128Type;
struct __pyx_obj_7pyarrow_3lib_BaseExtensionType;
struct __pyx_obj_7pyarrow_3lib_ExtensionType;
struct __pyx_obj_7pyarrow_3lib_PyExtensionType;
struct __pyx_obj_7pyarrow_3lib_Field;
struct __pyx_obj_7pyarrow_3lib_Schema;
struct __pyx_obj_7pyarrow_3lib_Scalar;
struct __pyx_obj_7pyarrow_3lib_NAType;
struct __pyx_obj_7pyarrow_3lib_ArrayValue;
struct __pyx_obj_7pyarrow_3lib_ScalarValue;
struct __pyx_obj_7pyarrow_3lib_Int8Value;
struct __pyx_obj_7pyarrow_3lib_Int64Value;
struct __pyx_obj_7pyarrow_3lib_ListValue;
struct __pyx_obj_7pyarrow_3lib_LargeListValue;
struct __pyx_obj_7pyarrow_3lib_MapValue;
struct __pyx_obj_7pyarrow_3lib_FixedSizeListValue;
struct __pyx_obj_7pyarrow_3lib_StructValue;
struct __pyx_obj_7pyarrow_3lib_UnionValue;
struct __pyx_obj_7pyarrow_3lib_StringValue;
struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryValue;
struct __pyx_obj_7pyarrow_3lib__PandasConvertible;
struct __pyx_obj_7pyarrow_3lib_Array;
struct __pyx_obj_7pyarrow_3lib_Tensor;
struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix;
struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor;
struct __pyx_obj_7pyarrow_3lib_NullArray;
struct __pyx_obj_7pyarrow_3lib_BooleanArray;
struct __pyx_obj_7pyarrow_3lib_NumericArray;
struct __pyx_obj_7pyarrow_3lib_IntegerArray;
struct __pyx_obj_7pyarrow_3lib_FloatingPointArray;
struct __pyx_obj_7pyarrow_3lib_Int8Array;
struct __pyx_obj_7pyarrow_3lib_UInt8Array;
struct __pyx_obj_7pyarrow_3lib_Int16Array;
struct __pyx_obj_7pyarrow_3lib_UInt16Array;
struct __pyx_obj_7pyarrow_3lib_Int32Array;
struct __pyx_obj_7pyarrow_3lib_UInt32Array;
struct __pyx_obj_7pyarrow_3lib_Int64Array;
struct __pyx_obj_7pyarrow_3lib_UInt64Array;
struct __pyx_obj_7pyarrow_3lib_HalfFloatArray;
struct __pyx_obj_7pyarrow_3lib_FloatArray;
struct __pyx_obj_7pyarrow_3lib_DoubleArray;
struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryArray;
struct __pyx_obj_7pyarrow_3lib_Decimal128Array;
struct __pyx_obj_7pyarrow_3lib_StructArray;
struct __pyx_obj_7pyarrow_3lib_ListArray;
struct __pyx_obj_7pyarrow_3lib_LargeListArray;
struct __pyx_obj_7pyarrow_3lib_MapArray;
struct __pyx_obj_7pyarrow_3lib_FixedSizeListArray;
struct __pyx_obj_7pyarrow_3lib_UnionArray;
struct __pyx_obj_7pyarrow_3lib_StringArray;
struct __pyx_obj_7pyarrow_3lib_BinaryArray;
struct __pyx_obj_7pyarrow_3lib_DictionaryArray;
struct __pyx_obj_7pyarrow_3lib_ExtensionArray;
struct __pyx_obj_7pyarrow_3lib_ChunkedArray;
struct __pyx_obj_7pyarrow_3lib_Table;
struct __pyx_obj_7pyarrow_3lib_RecordBatch;
struct __pyx_obj_7pyarrow_3lib_Buffer;
struct __pyx_obj_7pyarrow_3lib_ResizableBuffer;
struct __pyx_obj_7pyarrow_3lib_NativeFile;
struct __pyx_obj_7pyarrow_3lib_BufferedInputStream;
struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream;
struct __pyx_obj_7pyarrow_3lib_CompressedInputStream;
struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream;
struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter;
struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader;
struct __pyx_obj_7pyarrow_3lib_CastOptions;
struct __pyx_obj_7pyarrow_3lib__PandasAPIShim;
struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool;
struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool;
struct __pyx_obj_7pyarrow_3lib_UnionType;
struct __pyx_obj_7pyarrow_3lib_UnknownExtensionType;
struct __pyx_obj_7pyarrow_3lib__ExtensionRegistryNanny;
struct __pyx_obj_7pyarrow_3lib_NullType;
struct __pyx_obj_7pyarrow_3lib_BooleanValue;
struct __pyx_obj_7pyarrow_3lib_UInt8Value;
struct __pyx_obj_7pyarrow_3lib_Int16Value;
struct __pyx_obj_7pyarrow_3lib_UInt16Value;
struct __pyx_obj_7pyarrow_3lib_Int32Value;
struct __pyx_obj_7pyarrow_3lib_UInt32Value;
struct __pyx_obj_7pyarrow_3lib_UInt64Value;
struct __pyx_obj_7pyarrow_3lib_Date32Value;
struct __pyx_obj_7pyarrow_3lib_Date64Value;
struct __pyx_obj_7pyarrow_3lib_Time32Value;
struct __pyx_obj_7pyarrow_3lib_Time64Value;
struct __pyx_obj_7pyarrow_3lib_TimestampValue;
struct __pyx_obj_7pyarrow_3lib_DurationValue;
struct __pyx_obj_7pyarrow_3lib_HalfFloatValue;
struct __pyx_obj_7pyarrow_3lib_FloatValue;
struct __pyx_obj_7pyarrow_3lib_DoubleValue;
struct __pyx_obj_7pyarrow_3lib_DecimalValue;
struct __pyx_obj_7pyarrow_3lib_LargeStringValue;
struct __pyx_obj_7pyarrow_3lib_BinaryValue;
struct __pyx_obj_7pyarrow_3lib_LargeBinaryValue;
struct __pyx_obj_7pyarrow_3lib_DictionaryValue;
struct __pyx_obj_7pyarrow_3lib_UInt8Scalar;
struct __pyx_obj_7pyarrow_3lib_Int8Scalar;
struct __pyx_obj_7pyarrow_3lib_UInt16Scalar;
struct __pyx_obj_7pyarrow_3lib_Int16Scalar;
struct __pyx_obj_7pyarrow_3lib_UInt32Scalar;
struct __pyx_obj_7pyarrow_3lib_Int32Scalar;
struct __pyx_obj_7pyarrow_3lib_UInt64Scalar;
struct __pyx_obj_7pyarrow_3lib_Int64Scalar;
struct __pyx_obj_7pyarrow_3lib_FloatScalar;
struct __pyx_obj_7pyarrow_3lib_DoubleScalar;
struct __pyx_obj_7pyarrow_3lib__FunctionContext;
struct __pyx_obj_7pyarrow_3lib_Date32Array;
struct __pyx_obj_7pyarrow_3lib_Date64Array;
struct __pyx_obj_7pyarrow_3lib_TimestampArray;
struct __pyx_obj_7pyarrow_3lib_Time32Array;
struct __pyx_obj_7pyarrow_3lib_Time64Array;
struct __pyx_obj_7pyarrow_3lib_DurationArray;
struct __pyx_obj_7pyarrow_3lib_LargeStringArray;
struct __pyx_obj_7pyarrow_3lib_LargeBinaryArray;
struct __pyx_obj_7pyarrow_3lib_StringBuilder;
struct __pyx_obj_7pyarrow_3lib_PythonFile;
struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile;
struct __pyx_obj_7pyarrow_3lib_OSFile;
struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter;
struct __pyx_obj_7pyarrow_3lib_BufferOutputStream;
struct __pyx_obj_7pyarrow_3lib_MockOutputStream;
struct __pyx_obj_7pyarrow_3lib_BufferReader;
struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem;
struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny;
struct __pyx_obj_7pyarrow_3lib_HdfsFile;
struct __pyx_obj_7pyarrow_3lib_MessageReader;
struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter;
struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader;
struct __pyx_obj_7pyarrow_3lib__RecordBatchFileWriter;
struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader;
struct __pyx_obj_7pyarrow_3lib_FeatherWriter;
struct __pyx_obj_7pyarrow_3lib_FeatherReader;
struct __pyx_obj_7pyarrow_3lib_SerializationContext;
struct __pyx_obj_7pyarrow_3lib_SerializedPyObject;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7___iter__;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8___iter__;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9___iter__;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10___iter__;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11_iterchunks;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12_itercolumns;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13___get__;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_genexpr;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_15___get__;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_16_genexpr;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_17_download;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_18_upload;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_19___iter__;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_20___iter__;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_22_genexpr;
struct __pyx_opt_args_7pyarrow_3lib_ensure_type;
struct __pyx_opt_args_7pyarrow_3lib_14_PandasAPIShim__check_import;
struct __pyx_opt_args_7pyarrow_3lib_decimal128;
struct __pyx_opt_args_7pyarrow_3lib_map_;
struct __pyx_opt_args_7pyarrow_3lib_dictionary;

/* "pyarrow/lib.pxd":553
 * 
 * # Default is allow_none=False
 * cdef DataType ensure_type(object type, c_bool allow_none=*)             # <<<<<<<<<<<<<<
 * 
 * cdef shared_ptr[CKeyValueMetadata] pyarrow_unwrap_metadata(object meta)
 */
struct __pyx_opt_args_7pyarrow_3lib_ensure_type {
  int __pyx_n;
  bool allow_none;
};

/* "pyarrow/pandas-shim.pxi":95
 *         self._pd024 = self._loose_version >= LooseVersion('0.24')
 * 
 *     cdef inline _check_import(self, bint raise_=True):             # <<<<<<<<<<<<<<
 *         if self._tried_importing_pandas:
 *             if not self._have_pandas and raise_:
 */
struct __pyx_opt_args_7pyarrow_3lib_14_PandasAPIShim__check_import {
  int __pyx_n;
  int raise_;
};

/* "pyarrow/types.pxi":93
 * # Workaround for Cython parsing bug
 * # https://github.com/cython/cython/issues/2143
 * ctypedef CFixedWidthType* _CFixedWidthTypePtr             # <<<<<<<<<<<<<<
 * 
 * 
 */
typedef  arrow::FixedWidthType *__pyx_t_7pyarrow_3lib__CFixedWidthTypePtr;

/* "pyarrow/types.pxi":1772
 * 
 * 
 * cpdef DataType decimal128(int precision, int scale=0):             # <<<<<<<<<<<<<<
 *     """
 *     Create decimal type with precision and scale and 128bit width
 */
struct __pyx_opt_args_7pyarrow_3lib_decimal128 {
  int __pyx_n;
  int scale;
};

/* "pyarrow/types.pxi":1922
 * 
 * 
 * cpdef MapType map_(key_type, item_type, keys_sorted=False):             # <<<<<<<<<<<<<<
 *     """
 *     Create MapType instance from key and item data types
 */
struct __pyx_opt_args_7pyarrow_3lib_map_ {
  int __pyx_n;
  PyObject *keys_sorted;
};

/* "pyarrow/types.pxi":1948
 * 
 * 
 * cpdef DictionaryType dictionary(index_type, value_type, bint ordered=False):             # <<<<<<<<<<<<<<
 *     """
 *     Dictionary (categorical, or simply encoded) type
 */
struct __pyx_opt_args_7pyarrow_3lib_dictionary {
  int __pyx_n;
  int ordered;
};

/* "pyarrow/io.pxi":1243
 * 
 * 
 * ctypedef CBufferedInputStream* _CBufferedInputStreamPtr             # <<<<<<<<<<<<<<
 * ctypedef CBufferedOutputStream* _CBufferedOutputStreamPtr
 * ctypedef CRandomAccessFile* _RandomAccessFilePtr
 */
typedef  arrow::io::BufferedInputStream *__pyx_t_7pyarrow_3lib__CBufferedInputStreamPtr;

/* "pyarrow/io.pxi":1244
 * 
 * ctypedef CBufferedInputStream* _CBufferedInputStreamPtr
 * ctypedef CBufferedOutputStream* _CBufferedOutputStreamPtr             # <<<<<<<<<<<<<<
 * ctypedef CRandomAccessFile* _RandomAccessFilePtr
 * 
 */
typedef  arrow::io::BufferedOutputStream *__pyx_t_7pyarrow_3lib__CBufferedOutputStreamPtr;

/* "pyarrow/io.pxi":1245
 * ctypedef CBufferedInputStream* _CBufferedInputStreamPtr
 * ctypedef CBufferedOutputStream* _CBufferedOutputStreamPtr
 * ctypedef CRandomAccessFile* _RandomAccessFilePtr             # <<<<<<<<<<<<<<
 * 
 * 
 */
typedef  arrow::io::RandomAccessFile *__pyx_t_7pyarrow_3lib__RandomAccessFilePtr;

/* "pyarrow/public-api.pxi":70
 * # Workaround for Cython parsing bug
 * # https://github.com/cython/cython/issues/2143
 * ctypedef const CPyExtensionType* _CPyExtensionTypePtr             # <<<<<<<<<<<<<<
 * 
 * 
 */
typedef  arrow::py::PyExtensionType const *__pyx_t_7pyarrow_3lib__CPyExtensionTypePtr;

/* "pyarrow/lib.pxd":36
 * cdef int check_status(const CStatus& status) nogil except -1
 * 
 * cdef class Message:             # <<<<<<<<<<<<<<
 *     cdef:
 *         unique_ptr[CMessage] message
 */
struct __pyx_obj_7pyarrow_3lib_Message {
  PyObject_HEAD
  std::unique_ptr< arrow::ipc::Message>  message;
};


/* "pyarrow/lib.pxd":41
 * 
 * 
 * cdef class MemoryPool:             # <<<<<<<<<<<<<<
 *     cdef:
 *         CMemoryPool* pool
 */
struct __pyx_obj_7pyarrow_3lib_MemoryPool {
  PyObject_HEAD
  struct __pyx_vtabstruct_7pyarrow_3lib_MemoryPool *__pyx_vtab;
   arrow::MemoryPool *pool;
};


/* "pyarrow/lib.pxd":51
 * 
 * 
 * cdef class DataType:             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CDataType] sp_type
 */
struct __pyx_obj_7pyarrow_3lib_DataType {
  PyObject_HEAD
  struct __pyx_vtabstruct_7pyarrow_3lib_DataType *__pyx_vtab;
  std::shared_ptr< arrow::DataType>  sp_type;
   arrow::DataType *type;
  PyObject *pep3118_format;
  PyObject *__weakref__;
};


/* "pyarrow/lib.pxd":62
 * 
 * 
 * cdef class ListType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CListType* list_type
 */
struct __pyx_obj_7pyarrow_3lib_ListType {
  struct __pyx_obj_7pyarrow_3lib_DataType __pyx_base;
   arrow::ListType const *list_type;
};


/* "pyarrow/lib.pxd":67
 * 
 * 
 * cdef class LargeListType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CLargeListType* list_type
 */
struct __pyx_obj_7pyarrow_3lib_LargeListType {
  struct __pyx_obj_7pyarrow_3lib_DataType __pyx_base;
   arrow::LargeListType const *list_type;
};


/* "pyarrow/lib.pxd":72
 * 
 * 
 * cdef class MapType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CMapType* map_type
 */
struct __pyx_obj_7pyarrow_3lib_MapType {
  struct __pyx_obj_7pyarrow_3lib_DataType __pyx_base;
   arrow::MapType const *map_type;
};


/* "pyarrow/lib.pxd":77
 * 
 * 
 * cdef class FixedSizeListType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CFixedSizeListType* list_type
 */
struct __pyx_obj_7pyarrow_3lib_FixedSizeListType {
  struct __pyx_obj_7pyarrow_3lib_DataType __pyx_base;
   arrow::FixedSizeListType const *list_type;
};


/* "pyarrow/lib.pxd":82
 * 
 * 
 * cdef class StructType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CStructType* struct_type
 */
struct __pyx_obj_7pyarrow_3lib_StructType {
  struct __pyx_obj_7pyarrow_3lib_DataType __pyx_base;
   arrow::StructType const *struct_type;
};


/* "pyarrow/lib.pxd":90
 * 
 * 
 * cdef class DictionaryMemo:             # <<<<<<<<<<<<<<
 *     cdef:
 *         # Even though the CDictionaryMemo instance is private, we allocate
 */
struct __pyx_obj_7pyarrow_3lib_DictionaryMemo {
  PyObject_HEAD
  std::shared_ptr< arrow::ipc::DictionaryMemo>  sp_memo;
   arrow::ipc::DictionaryMemo *memo;
};


/* "pyarrow/lib.pxd":98
 * 
 * 
 * cdef class DictionaryType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CDictionaryType* dict_type
 */
struct __pyx_obj_7pyarrow_3lib_DictionaryType {
  struct __pyx_obj_7pyarrow_3lib_DataType __pyx_base;
   arrow::DictionaryType const *dict_type;
};


/* "pyarrow/lib.pxd":103
 * 
 * 
 * cdef class TimestampType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CTimestampType* ts_type
 */
struct __pyx_obj_7pyarrow_3lib_TimestampType {
  struct __pyx_obj_7pyarrow_3lib_DataType __pyx_base;
   arrow::TimestampType const *ts_type;
};


/* "pyarrow/lib.pxd":108
 * 
 * 
 * cdef class Time32Type(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CTime32Type* time_type
 */
struct __pyx_obj_7pyarrow_3lib_Time32Type {
  struct __pyx_obj_7pyarrow_3lib_DataType __pyx_base;
   arrow::Time32Type const *time_type;
};


/* "pyarrow/lib.pxd":113
 * 
 * 
 * cdef class Time64Type(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CTime64Type* time_type
 */
struct __pyx_obj_7pyarrow_3lib_Time64Type {
  struct __pyx_obj_7pyarrow_3lib_DataType __pyx_base;
   arrow::Time64Type const *time_type;
};


/* "pyarrow/lib.pxd":118
 * 
 * 
 * cdef class DurationType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CDurationType* duration_type
 */
struct __pyx_obj_7pyarrow_3lib_DurationType {
  struct __pyx_obj_7pyarrow_3lib_DataType __pyx_base;
   arrow::DurationType const *duration_type;
};


/* "pyarrow/lib.pxd":123
 * 
 * 
 * cdef class FixedSizeBinaryType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CFixedSizeBinaryType* fixed_size_binary_type
 */
struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType {
  struct __pyx_obj_7pyarrow_3lib_DataType __pyx_base;
   arrow::FixedSizeBinaryType const *fixed_size_binary_type;
};


/* "pyarrow/lib.pxd":128
 * 
 * 
 * cdef class Decimal128Type(FixedSizeBinaryType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CDecimal128Type* decimal128_type
 */
struct __pyx_obj_7pyarrow_3lib_Decimal128Type {
  struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType __pyx_base;
   arrow::Decimal128Type const *decimal128_type;
};


/* "pyarrow/lib.pxd":133
 * 
 * 
 * cdef class BaseExtensionType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CExtensionType* ext_type
 */
struct __pyx_obj_7pyarrow_3lib_BaseExtensionType {
  struct __pyx_obj_7pyarrow_3lib_DataType __pyx_base;
   arrow::ExtensionType const *ext_type;
};


/* "pyarrow/lib.pxd":138
 * 
 * 
 * cdef class ExtensionType(BaseExtensionType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CPyExtensionType* cpy_ext_type
 */
struct __pyx_obj_7pyarrow_3lib_ExtensionType {
  struct __pyx_obj_7pyarrow_3lib_BaseExtensionType __pyx_base;
   arrow::py::PyExtensionType const *cpy_ext_type;
};


/* "pyarrow/lib.pxd":143
 * 
 * 
 * cdef class PyExtensionType(ExtensionType):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_PyExtensionType {
  struct __pyx_obj_7pyarrow_3lib_ExtensionType __pyx_base;
};


/* "pyarrow/lib.pxd":147
 * 
 * 
 * cdef class Field:             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CField] sp_field
 */
struct __pyx_obj_7pyarrow_3lib_Field {
  PyObject_HEAD
  struct __pyx_vtabstruct_7pyarrow_3lib_Field *__pyx_vtab;
  std::shared_ptr< arrow::Field>  sp_field;
   arrow::Field *field;
  struct __pyx_obj_7pyarrow_3lib_DataType *type;
};


/* "pyarrow/lib.pxd":158
 * 
 * 
 * cdef class Schema:             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CSchema] sp_schema
 */
struct __pyx_obj_7pyarrow_3lib_Schema {
  PyObject_HEAD
  struct __pyx_vtabstruct_7pyarrow_3lib_Schema *__pyx_vtab;
  std::shared_ptr< arrow::Schema>  sp_schema;
   arrow::Schema *schema;
};


/* "pyarrow/lib.pxd":167
 * 
 * 
 * cdef class Scalar:             # <<<<<<<<<<<<<<
 *     cdef readonly:
 *         DataType type
 */
struct __pyx_obj_7pyarrow_3lib_Scalar {
  PyObject_HEAD
  struct __pyx_obj_7pyarrow_3lib_DataType *type;
};


/* "pyarrow/lib.pxd":172
 * 
 * 
 * cdef class NAType(Scalar):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_NAType {
  struct __pyx_obj_7pyarrow_3lib_Scalar __pyx_base;
};


/* "pyarrow/lib.pxd":176
 * 
 * 
 * cdef class ArrayValue(Scalar):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CArray] sp_array
 */
struct __pyx_obj_7pyarrow_3lib_ArrayValue {
  struct __pyx_obj_7pyarrow_3lib_Scalar __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue *__pyx_vtab;
  std::shared_ptr< arrow::Array>  sp_array;
  int64_t index;
};


/* "pyarrow/lib.pxd":186
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array)
 * 
 * cdef class ScalarValue(Scalar):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CScalar] sp_scalar
 */
struct __pyx_obj_7pyarrow_3lib_ScalarValue {
  struct __pyx_obj_7pyarrow_3lib_Scalar __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue *__pyx_vtab;
  std::shared_ptr< arrow::Scalar>  sp_scalar;
};


/* "pyarrow/lib.pxd":192
 *     cdef void init(self, const shared_ptr[CScalar]& sp_scalar)
 * 
 * cdef class Int8Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_Int8Value {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/lib.pxd":196
 * 
 * 
 * cdef class Int64Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_Int64Value {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/lib.pxd":200
 * 
 * 
 * cdef class ListValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     cdef readonly:
 *         DataType value_type
 */
struct __pyx_obj_7pyarrow_3lib_ListValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
  struct __pyx_obj_7pyarrow_3lib_DataType *value_type;
   arrow::ListArray *ap;
};


/* "pyarrow/lib.pxd":211
 * 
 * 
 * cdef class LargeListValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     cdef readonly:
 *         DataType value_type
 */
struct __pyx_obj_7pyarrow_3lib_LargeListValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
  struct __pyx_obj_7pyarrow_3lib_DataType *value_type;
   arrow::LargeListArray *ap;
};


/* "pyarrow/lib.pxd":222
 * 
 * 
 * cdef class MapValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     cdef readonly:
 *         DataType key_type
 */
struct __pyx_obj_7pyarrow_3lib_MapValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
  struct __pyx_obj_7pyarrow_3lib_DataType *key_type;
  struct __pyx_obj_7pyarrow_3lib_DataType *item_type;
   arrow::MapArray *ap;
};


/* "pyarrow/lib.pxd":234
 * 
 * 
 * cdef class FixedSizeListValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     cdef readonly:
 *         DataType value_type
 */
struct __pyx_obj_7pyarrow_3lib_FixedSizeListValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
  struct __pyx_obj_7pyarrow_3lib_DataType *value_type;
   arrow::FixedSizeListArray *ap;
};


/* "pyarrow/lib.pxd":245
 * 
 * 
 * cdef class StructValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     cdef:
 *         CStructArray* ap
 */
struct __pyx_obj_7pyarrow_3lib_StructValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
   arrow::StructArray *ap;
};


/* "pyarrow/lib.pxd":250
 * 
 * 
 * cdef class UnionValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     cdef:
 *         CUnionArray* ap
 */
struct __pyx_obj_7pyarrow_3lib_UnionValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
   arrow::UnionArray *ap;
  PyObject *value_types;
};


/* "pyarrow/lib.pxd":258
 * 
 * 
 * cdef class StringValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_StringValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/lib.pxd":262
 * 
 * 
 * cdef class FixedSizeBinaryValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/lib.pxd":266
 * 
 * 
 * cdef class _PandasConvertible:             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib__PandasConvertible {
  PyObject_HEAD
};


/* "pyarrow/lib.pxd":270
 * 
 * 
 * cdef class Array(_PandasConvertible):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CArray] sp_array
 */
struct __pyx_obj_7pyarrow_3lib_Array {
  struct __pyx_obj_7pyarrow_3lib__PandasConvertible __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_Array *__pyx_vtab;
  std::shared_ptr< arrow::Array>  sp_array;
   arrow::Array *ap;
  PyObject *__weakref__;
  struct __pyx_obj_7pyarrow_3lib_DataType *type;
  PyObject *_name;
};


/* "pyarrow/lib.pxd":286
 * 
 * 
 * cdef class Tensor:             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CTensor] sp_tensor
 */
struct __pyx_obj_7pyarrow_3lib_Tensor {
  PyObject_HEAD
  struct __pyx_vtabstruct_7pyarrow_3lib_Tensor *__pyx_vtab;
  std::shared_ptr< arrow::Tensor>  sp_tensor;
   arrow::Tensor *tp;
  struct __pyx_obj_7pyarrow_3lib_DataType *type;
};


/* "pyarrow/lib.pxd":297
 * 
 * 
 * cdef class SparseCSRMatrix:             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CSparseCSRMatrix] sp_sparse_tensor
 */
struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix {
  PyObject_HEAD
  struct __pyx_vtabstruct_7pyarrow_3lib_SparseCSRMatrix *__pyx_vtab;
  std::shared_ptr< arrow::SparseCSRMatrix>  sp_sparse_tensor;
   arrow::SparseCSRMatrix *stp;
  struct __pyx_obj_7pyarrow_3lib_DataType *type;
};


/* "pyarrow/lib.pxd":308
 * 
 * 
 * cdef class SparseCOOTensor:             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CSparseCOOTensor] sp_sparse_tensor
 */
struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor {
  PyObject_HEAD
  struct __pyx_vtabstruct_7pyarrow_3lib_SparseCOOTensor *__pyx_vtab;
  std::shared_ptr< arrow::SparseCOOTensor>  sp_sparse_tensor;
   arrow::SparseCOOTensor *stp;
  struct __pyx_obj_7pyarrow_3lib_DataType *type;
};


/* "pyarrow/lib.pxd":319
 * 
 * 
 * cdef class NullArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_NullArray {
  struct __pyx_obj_7pyarrow_3lib_Array __pyx_base;
};


/* "pyarrow/lib.pxd":323
 * 
 * 
 * cdef class BooleanArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_BooleanArray {
  struct __pyx_obj_7pyarrow_3lib_Array __pyx_base;
};


/* "pyarrow/lib.pxd":327
 * 
 * 
 * cdef class NumericArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_NumericArray {
  struct __pyx_obj_7pyarrow_3lib_Array __pyx_base;
};


/* "pyarrow/lib.pxd":331
 * 
 * 
 * cdef class IntegerArray(NumericArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_IntegerArray {
  struct __pyx_obj_7pyarrow_3lib_NumericArray __pyx_base;
};


/* "pyarrow/lib.pxd":335
 * 
 * 
 * cdef class FloatingPointArray(NumericArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_FloatingPointArray {
  struct __pyx_obj_7pyarrow_3lib_NumericArray __pyx_base;
};


/* "pyarrow/lib.pxd":339
 * 
 * 
 * cdef class Int8Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_Int8Array {
  struct __pyx_obj_7pyarrow_3lib_IntegerArray __pyx_base;
};


/* "pyarrow/lib.pxd":343
 * 
 * 
 * cdef class UInt8Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_UInt8Array {
  struct __pyx_obj_7pyarrow_3lib_IntegerArray __pyx_base;
};


/* "pyarrow/lib.pxd":347
 * 
 * 
 * cdef class Int16Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_Int16Array {
  struct __pyx_obj_7pyarrow_3lib_IntegerArray __pyx_base;
};


/* "pyarrow/lib.pxd":351
 * 
 * 
 * cdef class UInt16Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_UInt16Array {
  struct __pyx_obj_7pyarrow_3lib_IntegerArray __pyx_base;
};


/* "pyarrow/lib.pxd":355
 * 
 * 
 * cdef class Int32Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_Int32Array {
  struct __pyx_obj_7pyarrow_3lib_IntegerArray __pyx_base;
};


/* "pyarrow/lib.pxd":359
 * 
 * 
 * cdef class UInt32Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_UInt32Array {
  struct __pyx_obj_7pyarrow_3lib_IntegerArray __pyx_base;
};


/* "pyarrow/lib.pxd":363
 * 
 * 
 * cdef class Int64Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_Int64Array {
  struct __pyx_obj_7pyarrow_3lib_IntegerArray __pyx_base;
};


/* "pyarrow/lib.pxd":367
 * 
 * 
 * cdef class UInt64Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_UInt64Array {
  struct __pyx_obj_7pyarrow_3lib_IntegerArray __pyx_base;
};


/* "pyarrow/lib.pxd":371
 * 
 * 
 * cdef class HalfFloatArray(FloatingPointArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_HalfFloatArray {
  struct __pyx_obj_7pyarrow_3lib_FloatingPointArray __pyx_base;
};


/* "pyarrow/lib.pxd":375
 * 
 * 
 * cdef class FloatArray(FloatingPointArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_FloatArray {
  struct __pyx_obj_7pyarrow_3lib_FloatingPointArray __pyx_base;
};


/* "pyarrow/lib.pxd":379
 * 
 * 
 * cdef class DoubleArray(FloatingPointArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_DoubleArray {
  struct __pyx_obj_7pyarrow_3lib_FloatingPointArray __pyx_base;
};


/* "pyarrow/lib.pxd":383
 * 
 * 
 * cdef class FixedSizeBinaryArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryArray {
  struct __pyx_obj_7pyarrow_3lib_Array __pyx_base;
};


/* "pyarrow/lib.pxd":387
 * 
 * 
 * cdef class Decimal128Array(FixedSizeBinaryArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_Decimal128Array {
  struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryArray __pyx_base;
};


/* "pyarrow/lib.pxd":391
 * 
 * 
 * cdef class StructArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_StructArray {
  struct __pyx_obj_7pyarrow_3lib_Array __pyx_base;
};


/* "pyarrow/lib.pxd":395
 * 
 * 
 * cdef class ListArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_ListArray {
  struct __pyx_obj_7pyarrow_3lib_Array __pyx_base;
};


/* "pyarrow/lib.pxd":399
 * 
 * 
 * cdef class LargeListArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_LargeListArray {
  struct __pyx_obj_7pyarrow_3lib_Array __pyx_base;
};


/* "pyarrow/lib.pxd":403
 * 
 * 
 * cdef class MapArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_MapArray {
  struct __pyx_obj_7pyarrow_3lib_Array __pyx_base;
};


/* "pyarrow/lib.pxd":407
 * 
 * 
 * cdef class FixedSizeListArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_FixedSizeListArray {
  struct __pyx_obj_7pyarrow_3lib_Array __pyx_base;
};


/* "pyarrow/lib.pxd":411
 * 
 * 
 * cdef class UnionArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_UnionArray {
  struct __pyx_obj_7pyarrow_3lib_Array __pyx_base;
};


/* "pyarrow/lib.pxd":415
 * 
 * 
 * cdef class StringArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_StringArray {
  struct __pyx_obj_7pyarrow_3lib_Array __pyx_base;
};


/* "pyarrow/lib.pxd":419
 * 
 * 
 * cdef class BinaryArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_BinaryArray {
  struct __pyx_obj_7pyarrow_3lib_Array __pyx_base;
};


/* "pyarrow/lib.pxd":423
 * 
 * 
 * cdef class DictionaryArray(Array):             # <<<<<<<<<<<<<<
 *     cdef:
 *         object _indices, _dictionary
 */
struct __pyx_obj_7pyarrow_3lib_DictionaryArray {
  struct __pyx_obj_7pyarrow_3lib_Array __pyx_base;
  PyObject *_indices;
  PyObject *_dictionary;
};


/* "pyarrow/lib.pxd":428
 * 
 * 
 * cdef class ExtensionArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_ExtensionArray {
  struct __pyx_obj_7pyarrow_3lib_Array __pyx_base;
};


/* "pyarrow/lib.pxd":439
 * 
 * 
 * cdef class ChunkedArray(_PandasConvertible):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CChunkedArray] sp_chunked_array
 */
struct __pyx_obj_7pyarrow_3lib_ChunkedArray {
  struct __pyx_obj_7pyarrow_3lib__PandasConvertible __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_ChunkedArray *__pyx_vtab;
  std::shared_ptr< arrow::ChunkedArray>  sp_chunked_array;
   arrow::ChunkedArray *chunked_array;
  PyObject *_name;
};


/* "pyarrow/lib.pxd":452
 * 
 * 
 * cdef class Table(_PandasConvertible):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CTable] sp_table
 */
struct __pyx_obj_7pyarrow_3lib_Table {
  struct __pyx_obj_7pyarrow_3lib__PandasConvertible __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_Table *__pyx_vtab;
  std::shared_ptr< arrow::Table>  sp_table;
   arrow::Table *table;
};


/* "pyarrow/lib.pxd":460
 * 
 * 
 * cdef class RecordBatch(_PandasConvertible):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CRecordBatch] sp_batch
 */
struct __pyx_obj_7pyarrow_3lib_RecordBatch {
  struct __pyx_obj_7pyarrow_3lib__PandasConvertible __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_RecordBatch *__pyx_vtab;
  std::shared_ptr< arrow::RecordBatch>  sp_batch;
   arrow::RecordBatch *batch;
  struct __pyx_obj_7pyarrow_3lib_Schema *_schema;
};


/* "pyarrow/lib.pxd":469
 * 
 * 
 * cdef class Buffer:             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CBuffer] buffer
 */
struct __pyx_obj_7pyarrow_3lib_Buffer {
  PyObject_HEAD
  struct __pyx_vtabstruct_7pyarrow_3lib_Buffer *__pyx_vtab;
  std::shared_ptr< arrow::Buffer>  buffer;
  Py_ssize_t shape[1];
  Py_ssize_t strides[1];
};


/* "pyarrow/lib.pxd":479
 * 
 * 
 * cdef class ResizableBuffer(Buffer):             # <<<<<<<<<<<<<<
 * 
 *     cdef void init_rz(self, const shared_ptr[CResizableBuffer]& buffer)
 */
struct __pyx_obj_7pyarrow_3lib_ResizableBuffer {
  struct __pyx_obj_7pyarrow_3lib_Buffer __pyx_base;
};


/* "pyarrow/lib.pxd":484
 * 
 * 
 * cdef class NativeFile:             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CInputStream] input_stream
 */
struct __pyx_obj_7pyarrow_3lib_NativeFile {
  PyObject_HEAD
  struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *__pyx_vtab;
  std::shared_ptr< arrow::io::InputStream>  input_stream;
  std::shared_ptr< arrow::io::RandomAccessFile>  random_access;
  std::shared_ptr< arrow::io::OutputStream>  output_stream;
  int is_readable;
  int is_writable;
  int is_seekable;
  int own_file;
  PyObject *__weakref__;
};


/* "pyarrow/lib.pxd":508
 * 
 * 
 * cdef class BufferedInputStream(NativeFile):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_BufferedInputStream {
  struct __pyx_obj_7pyarrow_3lib_NativeFile __pyx_base;
};


/* "pyarrow/lib.pxd":512
 * 
 * 
 * cdef class BufferedOutputStream(NativeFile):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream {
  struct __pyx_obj_7pyarrow_3lib_NativeFile __pyx_base;
};


/* "pyarrow/lib.pxd":516
 * 
 * 
 * cdef class CompressedInputStream(NativeFile):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_CompressedInputStream {
  struct __pyx_obj_7pyarrow_3lib_NativeFile __pyx_base;
};


/* "pyarrow/lib.pxd":520
 * 
 * 
 * cdef class CompressedOutputStream(NativeFile):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream {
  struct __pyx_obj_7pyarrow_3lib_NativeFile __pyx_base;
};


/* "pyarrow/lib.pxd":524
 * 
 * 
 * cdef class _CRecordBatchWriter:             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CRecordBatchWriter] writer
 */
struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter {
  PyObject_HEAD
  std::shared_ptr< arrow::ipc::RecordBatchWriter>  writer;
};


/* "pyarrow/lib.pxd":529
 * 
 * 
 * cdef class _CRecordBatchReader:             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CRecordBatchReader] reader
 */
struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader {
  PyObject_HEAD
  std::shared_ptr< arrow::RecordBatchReader>  reader;
};


/* "pyarrow/lib.pxd":534
 * 
 * 
 * cdef class CastOptions:             # <<<<<<<<<<<<<<
 *     cdef:
 *         CCastOptions options
 */
struct __pyx_obj_7pyarrow_3lib_CastOptions {
  PyObject_HEAD
  struct __pyx_vtabstruct_7pyarrow_3lib_CastOptions *__pyx_vtab;
   arrow::compute::CastOptions options;
};


/* "pyarrow/pandas-shim.pxi":20
 * # pandas lazy-loading API shim that reduces API call and import overhead
 * 
 * cdef class _PandasAPIShim(object):             # <<<<<<<<<<<<<<
 *     """
 *     Lazy pandas importer that isolates usages of pandas APIs and avoids
 */
struct __pyx_obj_7pyarrow_3lib__PandasAPIShim {
  PyObject_HEAD
  struct __pyx_vtabstruct_7pyarrow_3lib__PandasAPIShim *__pyx_vtab;
  int _tried_importing_pandas;
  int _have_pandas;
  PyObject *_loose_version;
  PyObject *_version;
  PyObject *_pd;
  PyObject *_types_api;
  PyObject *_compat_module;
  PyObject *_data_frame;
  PyObject *_index;
  PyObject *_series;
  PyObject *_categorical_type;
  PyObject *_datetimetz_type;
  PyObject *_extension_array;
  PyObject *_extension_dtype;
  PyObject *_array_like_types;
  int has_sparse;
  int _pd024;
};


/* "pyarrow/memory.pxi":65
 * 
 * 
 * cdef class LoggingMemoryPool(MemoryPool):             # <<<<<<<<<<<<<<
 *     cdef:
 *         unique_ptr[CLoggingMemoryPool] logging_pool
 */
struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool {
  struct __pyx_obj_7pyarrow_3lib_MemoryPool __pyx_base;
  std::unique_ptr< arrow::LoggingMemoryPool>  logging_pool;
};


/* "pyarrow/memory.pxi":75
 * 
 * 
 * cdef class ProxyMemoryPool(MemoryPool):             # <<<<<<<<<<<<<<
 *     """
 *     Memory pool implementation that tracks the number of bytes and
 */
struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool {
  struct __pyx_obj_7pyarrow_3lib_MemoryPool __pyx_base;
  std::unique_ptr< arrow::ProxyMemoryPool>  proxy_pool;
};


/* "pyarrow/types.pxi":398
 * 
 * 
 * cdef class UnionType(DataType):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for struct data types.
 */
struct __pyx_obj_7pyarrow_3lib_UnionType {
  struct __pyx_obj_7pyarrow_3lib_DataType __pyx_base;
};


/* "pyarrow/types.pxi":728
 * 
 * 
 * cdef class UnknownExtensionType(PyExtensionType):             # <<<<<<<<<<<<<<
 *     """
 *     A concrete class for Python-defined extension types that refer to
 */
struct __pyx_obj_7pyarrow_3lib_UnknownExtensionType {
  struct __pyx_obj_7pyarrow_3lib_PyExtensionType __pyx_base;
  PyObject *serialized;
};


/* "pyarrow/types.pxi":2246
 * 
 * 
 * cdef class _ExtensionRegistryNanny:             # <<<<<<<<<<<<<<
 *     # Keep the registry alive until we have unregistered PyExtensionType
 *     cdef:
 */
struct __pyx_obj_7pyarrow_3lib__ExtensionRegistryNanny {
  PyObject_HEAD
  std::shared_ptr< arrow::ExtensionTypeRegistry>  registry;
};


/* "pyarrow/scalar.pxi":28
 * 
 * 
 * cdef class NullType(Scalar):             # <<<<<<<<<<<<<<
 *     """
 *     Singleton for null array elements.
 */
struct __pyx_obj_7pyarrow_3lib_NullType {
  struct __pyx_obj_7pyarrow_3lib_Scalar __pyx_base;
};


/* "pyarrow/scalar.pxi":100
 * 
 * 
 * cdef class BooleanValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for boolean array elements.
 */
struct __pyx_obj_7pyarrow_3lib_BooleanValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":126
 * 
 * 
 * cdef class UInt8Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for uint8 array elements.
 */
struct __pyx_obj_7pyarrow_3lib_UInt8Value {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":139
 * 
 * 
 * cdef class Int16Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for int16 array elements.
 */
struct __pyx_obj_7pyarrow_3lib_Int16Value {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":152
 * 
 * 
 * cdef class UInt16Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for uint16 array elements.
 */
struct __pyx_obj_7pyarrow_3lib_UInt16Value {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":165
 * 
 * 
 * cdef class Int32Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for int32 array elements.
 */
struct __pyx_obj_7pyarrow_3lib_Int32Value {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":178
 * 
 * 
 * cdef class UInt32Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for uint32 array elements.
 */
struct __pyx_obj_7pyarrow_3lib_UInt32Value {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":204
 * 
 * 
 * cdef class UInt64Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for uint64 array elements.
 */
struct __pyx_obj_7pyarrow_3lib_UInt64Value {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":217
 * 
 * 
 * cdef class Date32Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for date32 array elements.
 */
struct __pyx_obj_7pyarrow_3lib_Date32Value {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":233
 * 
 * 
 * cdef class Date64Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for date64 array elements.
 */
struct __pyx_obj_7pyarrow_3lib_Date64Value {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":248
 * 
 * 
 * cdef class Time32Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for time32 array elements.
 */
struct __pyx_obj_7pyarrow_3lib_Time32Value {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":268
 * 
 * 
 * cdef class Time64Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for time64 array elements.
 */
struct __pyx_obj_7pyarrow_3lib_Time64Value {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":373
 * 
 * 
 * cdef class TimestampValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for timestamp array elements.
 */
struct __pyx_obj_7pyarrow_3lib_TimestampValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":445
 * 
 * 
 * cdef class DurationValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for duration array elements.
 */
struct __pyx_obj_7pyarrow_3lib_DurationValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":468
 * 
 * 
 * cdef class HalfFloatValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for float16 array elements.
 */
struct __pyx_obj_7pyarrow_3lib_HalfFloatValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":481
 * 
 * 
 * cdef class FloatValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for float32 array elements.
 */
struct __pyx_obj_7pyarrow_3lib_FloatValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":494
 * 
 * 
 * cdef class DoubleValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for float64 array elements.
 */
struct __pyx_obj_7pyarrow_3lib_DoubleValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":507
 * 
 * 
 * cdef class DecimalValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for decimal128 array elements.
 */
struct __pyx_obj_7pyarrow_3lib_DecimalValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":547
 * 
 * 
 * cdef class LargeStringValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for large string (utf8) array elements.
 */
struct __pyx_obj_7pyarrow_3lib_LargeStringValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":572
 * 
 * 
 * cdef class BinaryValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for variable-sized binary array elements.
 */
struct __pyx_obj_7pyarrow_3lib_BinaryValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":602
 * 
 * 
 * cdef class LargeBinaryValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for large variable-sized binary array elements.
 */
struct __pyx_obj_7pyarrow_3lib_LargeBinaryValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":931
 * 
 * 
 * cdef class DictionaryValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for dictionary-encoded array elements.
 */
struct __pyx_obj_7pyarrow_3lib_DictionaryValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":1035
 * 
 * 
 * cdef class UInt8Scalar(ScalarValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for uint8 scalars.
 */
struct __pyx_obj_7pyarrow_3lib_UInt8Scalar {
  struct __pyx_obj_7pyarrow_3lib_ScalarValue __pyx_base;
};


/* "pyarrow/scalar.pxi":1048
 * 
 * 
 * cdef class Int8Scalar(ScalarValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for int8 scalars.
 */
struct __pyx_obj_7pyarrow_3lib_Int8Scalar {
  struct __pyx_obj_7pyarrow_3lib_ScalarValue __pyx_base;
};


/* "pyarrow/scalar.pxi":1061
 * 
 * 
 * cdef class UInt16Scalar(ScalarValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for uint16 scalars.
 */
struct __pyx_obj_7pyarrow_3lib_UInt16Scalar {
  struct __pyx_obj_7pyarrow_3lib_ScalarValue __pyx_base;
};


/* "pyarrow/scalar.pxi":1074
 * 
 * 
 * cdef class Int16Scalar(ScalarValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for int16 scalars.
 */
struct __pyx_obj_7pyarrow_3lib_Int16Scalar {
  struct __pyx_obj_7pyarrow_3lib_ScalarValue __pyx_base;
};


/* "pyarrow/scalar.pxi":1087
 * 
 * 
 * cdef class UInt32Scalar(ScalarValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for uint32 scalars.
 */
struct __pyx_obj_7pyarrow_3lib_UInt32Scalar {
  struct __pyx_obj_7pyarrow_3lib_ScalarValue __pyx_base;
};


/* "pyarrow/scalar.pxi":1100
 * 
 * 
 * cdef class Int32Scalar(ScalarValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for int32 scalars.
 */
struct __pyx_obj_7pyarrow_3lib_Int32Scalar {
  struct __pyx_obj_7pyarrow_3lib_ScalarValue __pyx_base;
};


/* "pyarrow/scalar.pxi":1113
 * 
 * 
 * cdef class UInt64Scalar(ScalarValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for uint64 scalars.
 */
struct __pyx_obj_7pyarrow_3lib_UInt64Scalar {
  struct __pyx_obj_7pyarrow_3lib_ScalarValue __pyx_base;
};


/* "pyarrow/scalar.pxi":1126
 * 
 * 
 * cdef class Int64Scalar(ScalarValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for int64 scalars.
 */
struct __pyx_obj_7pyarrow_3lib_Int64Scalar {
  struct __pyx_obj_7pyarrow_3lib_ScalarValue __pyx_base;
};


/* "pyarrow/scalar.pxi":1139
 * 
 * 
 * cdef class FloatScalar(ScalarValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for float scalars.
 */
struct __pyx_obj_7pyarrow_3lib_FloatScalar {
  struct __pyx_obj_7pyarrow_3lib_ScalarValue __pyx_base;
};


/* "pyarrow/scalar.pxi":1152
 * 
 * 
 * cdef class DoubleScalar(ScalarValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for double scalars.
 */
struct __pyx_obj_7pyarrow_3lib_DoubleScalar {
  struct __pyx_obj_7pyarrow_3lib_ScalarValue __pyx_base;
};


/* "pyarrow/array.pxi":366
 * 
 * 
 * cdef class _FunctionContext:             # <<<<<<<<<<<<<<
 *     cdef:
 *         unique_ptr[CFunctionContext] ctx
 */
struct __pyx_obj_7pyarrow_3lib__FunctionContext {
  PyObject_HEAD
  std::unique_ptr< arrow::compute::FunctionContext>  ctx;
};


/* "pyarrow/array.pxi":1246
 * 
 * 
 * cdef class Date32Array(NumericArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of date32 data type.
 */
struct __pyx_obj_7pyarrow_3lib_Date32Array {
  struct __pyx_obj_7pyarrow_3lib_NumericArray __pyx_base;
};


/* "pyarrow/array.pxi":1252
 * 
 * 
 * cdef class Date64Array(NumericArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of date64 data type.
 */
struct __pyx_obj_7pyarrow_3lib_Date64Array {
  struct __pyx_obj_7pyarrow_3lib_NumericArray __pyx_base;
};


/* "pyarrow/array.pxi":1258
 * 
 * 
 * cdef class TimestampArray(NumericArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of timestamp data type.
 */
struct __pyx_obj_7pyarrow_3lib_TimestampArray {
  struct __pyx_obj_7pyarrow_3lib_NumericArray __pyx_base;
};


/* "pyarrow/array.pxi":1264
 * 
 * 
 * cdef class Time32Array(NumericArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of time32 data type.
 */
struct __pyx_obj_7pyarrow_3lib_Time32Array {
  struct __pyx_obj_7pyarrow_3lib_NumericArray __pyx_base;
};


/* "pyarrow/array.pxi":1270
 * 
 * 
 * cdef class Time64Array(NumericArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of time64 data type.
 */
struct __pyx_obj_7pyarrow_3lib_Time64Array {
  struct __pyx_obj_7pyarrow_3lib_NumericArray __pyx_base;
};


/* "pyarrow/array.pxi":1276
 * 
 * 
 * cdef class DurationArray(NumericArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of duration data type.
 */
struct __pyx_obj_7pyarrow_3lib_DurationArray {
  struct __pyx_obj_7pyarrow_3lib_NumericArray __pyx_base;
};


/* "pyarrow/array.pxi":1686
 * 
 * 
 * cdef class LargeStringArray(Array):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of large string (or utf8) data type.
 */
struct __pyx_obj_7pyarrow_3lib_LargeStringArray {
  struct __pyx_obj_7pyarrow_3lib_Array __pyx_base;
};


/* "pyarrow/array.pxi":1724
 * 
 * 
 * cdef class LargeBinaryArray(Array):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of large variable-sized binary data type.
 */
struct __pyx_obj_7pyarrow_3lib_LargeBinaryArray {
  struct __pyx_obj_7pyarrow_3lib_Array __pyx_base;
};


/* "pyarrow/builder.pxi":23
 * 
 * 
 * cdef class StringBuilder:             # <<<<<<<<<<<<<<
 *     """
 *     Builder class for UTF8 strings. This class exposes facilities for
 */
struct __pyx_obj_7pyarrow_3lib_StringBuilder {
  PyObject_HEAD
  std::unique_ptr< arrow::StringBuilder>  builder;
};


/* "pyarrow/io.pxi":619
 * 
 * 
 * cdef class PythonFile(NativeFile):             # <<<<<<<<<<<<<<
 *     """
 *     A stream backed by a Python file object.
 */
struct __pyx_obj_7pyarrow_3lib_PythonFile {
  struct __pyx_obj_7pyarrow_3lib_NativeFile __pyx_base;
  PyObject *handle;
};


/* "pyarrow/io.pxi":701
 * 
 * 
 * cdef class MemoryMappedFile(NativeFile):             # <<<<<<<<<<<<<<
 *     """
 *     A stream that represents a memory-mapped file.
 */
struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile {
  struct __pyx_obj_7pyarrow_3lib_NativeFile __pyx_base;
  std::shared_ptr< arrow::io::MemoryMappedFile>  handle;
  PyObject *path;
};


/* "pyarrow/io.pxi":812
 * 
 * 
 * cdef class OSFile(NativeFile):             # <<<<<<<<<<<<<<
 *     """
 *     A stream backed by a regular file descriptor.
 */
struct __pyx_obj_7pyarrow_3lib_OSFile {
  struct __pyx_obj_7pyarrow_3lib_NativeFile __pyx_base;
  PyObject *path;
};


/* "pyarrow/io.pxi":853
 * 
 * 
 * cdef class FixedSizeBufferWriter(NativeFile):             # <<<<<<<<<<<<<<
 *     """
 *     A stream writing to a Arrow buffer.
 */
struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter {
  struct __pyx_obj_7pyarrow_3lib_NativeFile __pyx_base;
};


/* "pyarrow/io.pxi":1131
 * 
 * 
 * cdef class BufferOutputStream(NativeFile):             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */
struct __pyx_obj_7pyarrow_3lib_BufferOutputStream {
  struct __pyx_obj_7pyarrow_3lib_NativeFile __pyx_base;
  std::shared_ptr< arrow::ResizableBuffer>  buffer;
};


/* "pyarrow/io.pxi":1155
 * 
 * 
 * cdef class MockOutputStream(NativeFile):             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
 */
struct __pyx_obj_7pyarrow_3lib_MockOutputStream {
  struct __pyx_obj_7pyarrow_3lib_NativeFile __pyx_base;
};


/* "pyarrow/io.pxi":1166
 * 
 * 
 * cdef class BufferReader(NativeFile):             # <<<<<<<<<<<<<<
 *     """
 *     Zero-copy reader from objects convertible to Arrow buffer
 */
struct __pyx_obj_7pyarrow_3lib_BufferReader {
  struct __pyx_obj_7pyarrow_3lib_NativeFile __pyx_base;
  struct __pyx_obj_7pyarrow_3lib_Buffer *buffer;
};


/* "pyarrow/io-hdfs.pxi":56
 * 
 * 
 * cdef class HadoopFileSystem:             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CIOHadoopFileSystem] client
 */
struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem {
  PyObject_HEAD
  struct __pyx_vtabstruct_7pyarrow_3lib_HadoopFileSystem *__pyx_vtab;
  std::shared_ptr<arrow::io::HadoopFileSystem>  client;
  int is_open;
  PyObject *host;
  PyObject *user;
  PyObject *kerb_ticket;
  PyObject *driver;
  int port;
  PyObject *extra_conf;
};


/* "pyarrow/io-hdfs.pxi":466
 * # decref'd which can cause the client to get closed first if the file has the
 * # last remaining reference
 * cdef class _HdfsFileNanny:             # <<<<<<<<<<<<<<
 *     cdef:
 *         object client
 */
struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny {
  PyObject_HEAD
  PyObject *client;
  PyObject *file_handle_ref;
};


/* "pyarrow/io-hdfs.pxi":485
 * 
 * 
 * cdef class HdfsFile(NativeFile):             # <<<<<<<<<<<<<<
 *     cdef readonly:
 *         int32_t buffer_size
 */
struct __pyx_obj_7pyarrow_3lib_HdfsFile {
  struct __pyx_obj_7pyarrow_3lib_NativeFile __pyx_base;
  int32_t buffer_size;
  PyObject *mode;
  PyObject *parent;
};


/* "pyarrow/ipc.pxi":122
 * 
 * 
 * cdef class MessageReader:             # <<<<<<<<<<<<<<
 *     """
 *     Interface for reading Message objects from some source (like an
 */
struct __pyx_obj_7pyarrow_3lib_MessageReader {
  PyObject_HEAD
  std::unique_ptr< arrow::ipc::MessageReader>  reader;
};


/* "pyarrow/ipc.pxi":254
 * 
 * 
 * cdef class _RecordBatchStreamWriter(_CRecordBatchWriter):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[COutputStream] sink
 */
struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter {
  struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter __pyx_base;
  std::shared_ptr< arrow::io::OutputStream>  sink;
   arrow::ipc::IpcOptions options;
  int closed;
};


/* "pyarrow/ipc.pxi":339
 * 
 * 
 * cdef class _RecordBatchStreamReader(_CRecordBatchReader):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CInputStream] in_stream
 */
struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader {
  struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader __pyx_base;
  std::shared_ptr< arrow::io::InputStream>  in_stream;
  struct __pyx_obj_7pyarrow_3lib_Schema *schema;
};


/* "pyarrow/ipc.pxi":358
 * 
 * 
 * cdef class _RecordBatchFileWriter(_RecordBatchStreamWriter):             # <<<<<<<<<<<<<<
 * 
 *     def _open(self, sink, Schema schema, use_legacy_format=False):
 */
struct __pyx_obj_7pyarrow_3lib__RecordBatchFileWriter {
  struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter __pyx_base;
};


/* "pyarrow/ipc.pxi":369
 * 
 * 
 * cdef class _RecordBatchFileReader:             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CRecordBatchFileReader] reader
 */
struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader {
  PyObject_HEAD
  std::shared_ptr< arrow::ipc::RecordBatchFileReader>  reader;
  std::shared_ptr< arrow::io::RandomAccessFile>  file;
  struct __pyx_obj_7pyarrow_3lib_Schema *schema;
};


/* "pyarrow/feather.pxi":26
 * 
 * 
 * cdef class FeatherWriter:             # <<<<<<<<<<<<<<
 *     cdef:
 *         unique_ptr[CFeatherWriter] writer
 */
struct __pyx_obj_7pyarrow_3lib_FeatherWriter {
  PyObject_HEAD
  std::unique_ptr< arrow::ipc::feather::TableWriter>  writer;
  int64_t num_rows;
};


/* "pyarrow/feather.pxi":71
 * 
 * 
 * cdef class FeatherReader:             # <<<<<<<<<<<<<<
 *     cdef:
 *         unique_ptr[CFeatherReader] reader
 */
struct __pyx_obj_7pyarrow_3lib_FeatherReader {
  PyObject_HEAD
  std::unique_ptr< arrow::ipc::feather::TableReader>  reader;
};


/* "pyarrow/serialization.pxi":48
 * 
 * 
 * cdef class SerializationContext:             # <<<<<<<<<<<<<<
 *     cdef:
 *         object type_to_type_id
 */
struct __pyx_obj_7pyarrow_3lib_SerializationContext {
  PyObject_HEAD
  PyObject *type_to_type_id;
  PyObject *whitelisted_types;
  PyObject *types_to_pickle;
  PyObject *custom_serializers;
  PyObject *custom_deserializers;
  PyObject *pickle_serializer;
  PyObject *pickle_deserializer;
};


/* "pyarrow/serialization.pxi":235
 * 
 * 
 * cdef class SerializedPyObject:             # <<<<<<<<<<<<<<
 *     """
 *     Arrow-serialized representation of Python object
 */
struct __pyx_obj_7pyarrow_3lib_SerializedPyObject {
  PyObject_HEAD
  struct __pyx_vtabstruct_7pyarrow_3lib_SerializedPyObject *__pyx_vtab;
   arrow::py::SerializedPyObject data;
  PyObject *base;
};


/* "pyarrow/types.pxi":376
 *         return self.type.num_children()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterate over struct fields, in order.
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__ {
  PyObject_HEAD
  Py_ssize_t __pyx_v_i;
  struct __pyx_obj_7pyarrow_3lib_StructType *__pyx_v_self;
  Py_ssize_t __pyx_t_0;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
};


/* "pyarrow/types.pxi":433
 *         return self.type.num_children()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterate over union members, in order.
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__ {
  PyObject_HEAD
  Py_ssize_t __pyx_v_i;
  struct __pyx_obj_7pyarrow_3lib_UnionType *__pyx_v_self;
  Py_ssize_t __pyx_t_0;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
};


/* "pyarrow/types.pxi":931
 *         return self._field(key)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         for i in range(len(self)):
 *             yield self[i]
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__ {
  PyObject_HEAD
  Py_ssize_t __pyx_v_i;
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self;
  Py_ssize_t __pyx_t_0;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
};


/* "pyarrow/scalar.pxi":347
 * 
 * 
 * def _datetime_conversion_functions():             # <<<<<<<<<<<<<<
 *     global _datetime_conversion_initialized
 *     if _datetime_conversion_initialized:
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions {
  PyObject_HEAD
  PyObject *__pyx_v_pd;
};


/* "pyarrow/scalar.pxi":423
 * 
 * 
 * def _timedelta_conversion_functions():             # <<<<<<<<<<<<<<
 *     if _TIMEDELTA_CONVERSION_FUNCTIONS:
 *         return _TIMEDELTA_CONVERSION_FUNCTIONS
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions {
  PyObject_HEAD
  PyObject *__pyx_v_pd;
};


/* "pyarrow/scalar.pxi":649
 *         return self.getitem(_normalize_index(i, self.length()))
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterate over this element's values.
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__ {
  PyObject_HEAD
  Py_ssize_t __pyx_v_i;
  struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self;
  Py_ssize_t __pyx_t_0;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
};


/* "pyarrow/scalar.pxi":700
 *         return self.getitem(_normalize_index(i, self.length()))
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterate over this element's values.
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__ {
  PyObject_HEAD
  Py_ssize_t __pyx_v_i;
  struct __pyx_obj_7pyarrow_3lib_LargeListValue *__pyx_v_self;
  Py_ssize_t __pyx_t_0;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
};


/* "pyarrow/scalar.pxi":751
 *         return self.getitem(_normalize_index(i, self.length()))
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterate over this element's values.
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7___iter__ {
  PyObject_HEAD
  Py_ssize_t __pyx_v_i;
  struct __pyx_obj_7pyarrow_3lib_MapValue *__pyx_v_self;
  Py_ssize_t __pyx_t_0;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
};


/* "pyarrow/scalar.pxi":806
 *         return self.getitem(_normalize_index(i, self.length()))
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterate over this element's values.
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8___iter__ {
  PyObject_HEAD
  Py_ssize_t __pyx_v_i;
  struct __pyx_obj_7pyarrow_3lib_FixedSizeListValue *__pyx_v_self;
  Py_ssize_t __pyx_t_0;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
};


/* "pyarrow/array.pxi":837
 *         return super(Array, self).__sizeof__() + self.nbytes
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         for i in range(len(self)):
 *             yield self.getitem(i)
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9___iter__ {
  PyObject_HEAD
  Py_ssize_t __pyx_v_i;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self;
  Py_ssize_t __pyx_t_0;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
};


/* "pyarrow/table.pxi":131
 *         return super(ChunkedArray, self).__sizeof__() + self.nbytes
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         for chunk in self.iterchunks():
 *             for item in chunk:
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10___iter__ {
  PyObject_HEAD
  PyObject *__pyx_v_chunk;
  PyObject *__pyx_v_item;
  struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self;
  PyObject *__pyx_t_0;
  PyObject *__pyx_t_1;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
};


/* "pyarrow/table.pxi":362
 *         return list(self.iterchunks())
 * 
 *     def iterchunks(self):             # <<<<<<<<<<<<<<
 *         for i in range(self.num_chunks):
 *             yield self.chunk(i)
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11_iterchunks {
  PyObject_HEAD
  PyObject *__pyx_v_i;
  struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "pyarrow/table.pxi":1459
 *         return result
 * 
 *     def itercolumns(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterator over all columns in their numerical order
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12_itercolumns {
  PyObject_HEAD
  PyObject *__pyx_v_i;
  struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "pyarrow/tensor.pxi":335
 * 
 *     @property
 *     def dim_names(self):             # <<<<<<<<<<<<<<
 *         return tuple(frombytes(x) for x in tuple(self.stp.dim_names()))
 * 
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13___get__ {
  PyObject_HEAD
  struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *__pyx_v_self;
};


/* "pyarrow/tensor.pxi":336
 *     @property
 *     def dim_names(self):
 *         return tuple(frombytes(x) for x in tuple(self.stp.dim_names()))             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13___get__ *__pyx_outer_scope;
  PyObject *__pyx_v_x;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
};


/* "pyarrow/tensor.pxi":517
 * 
 *     @property
 *     def dim_names(self):             # <<<<<<<<<<<<<<
 *         return tuple(frombytes(x) for x in tuple(self.stp.dim_names()))
 * 
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_15___get__ {
  PyObject_HEAD
  struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *__pyx_v_self;
};


/* "pyarrow/tensor.pxi":518
 *     @property
 *     def dim_names(self):
 *         return tuple(frombytes(x) for x in tuple(self.stp.dim_names()))             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_16_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_15___get__ *__pyx_outer_scope;
  PyObject *__pyx_v_x;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
};


/* "pyarrow/io.pxi":477
 *             self.write(line)
 * 
 *     def download(self, stream_or_path, buffer_size=None):             # <<<<<<<<<<<<<<
 *         """
 *         Read file completely to local path (rather than reading completely into
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_17_download {
  PyObject_HEAD
  PyObject *__pyx_v_cleanup;
  int __pyx_v_done;
  PyObject *__pyx_v_stream;
  PyObject *__pyx_v_write_queue;
};


/* "pyarrow/io.pxi":565
 *             raise exc_info[0], exc_info[1], exc_info[2]
 * 
 *     def upload(self, stream, buffer_size=None):             # <<<<<<<<<<<<<<
 *         """
 *         Pipe file-like object to file
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_18_upload {
  PyObject_HEAD
  int __pyx_v_done;
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self;
  PyObject *__pyx_v_write_queue;
};


/* "pyarrow/ipc.pxi":152
 *         return result
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         while True:
 *             yield self.read_next_message()
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_19___iter__ {
  PyObject_HEAD
  struct __pyx_obj_7pyarrow_3lib_MessageReader *__pyx_v_self;
};


/* "pyarrow/ipc.pxi":298
 *     # cdef block is in lib.pxd
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         while True:
 *             yield self.read_next_batch()
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_20___iter__ {
  PyObject_HEAD
  struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *__pyx_v_self;
};


/* "pyarrow/serialization.pxi":25
 * 
 * 
 * def is_named_tuple(cls):             # <<<<<<<<<<<<<<
 *     """Return True if cls is a namedtuple and False otherwise."""
 *     b = cls.__bases__
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple {
  PyObject_HEAD
  PyObject *__pyx_v_f;
};


/* "pyarrow/serialization.pxi":33
 *     if not isinstance(f, tuple):
 *         return False
 *     return all(isinstance(n, six.string_types) for n in f)             # <<<<<<<<<<<<<<
 * 
 * 
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_22_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple *__pyx_outer_scope;
  PyObject *__pyx_v_n;
};



/* "pyarrow/memory.pxi":23
 * 
 * 
 * cdef class MemoryPool:             # <<<<<<<<<<<<<<
 *     """
 *     Base class for memory allocation.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_MemoryPool {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_MemoryPool *,  arrow::MemoryPool *);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_MemoryPool *__pyx_vtabptr_7pyarrow_3lib_MemoryPool;


/* "pyarrow/types.pxi":96
 * 
 * 
 * cdef class DataType:             # <<<<<<<<<<<<<<
 *     """
 *     Base class of all Arrow data types.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_DataType {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::DataType>  const &);
  struct __pyx_obj_7pyarrow_3lib_Field *(*child)(struct __pyx_obj_7pyarrow_3lib_DataType *, int);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DataType *__pyx_vtabptr_7pyarrow_3lib_DataType;


/* "pyarrow/types.pxi":244
 * 
 * 
 * cdef class ListType(DataType):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for list data types.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_ListType {
  struct __pyx_vtabstruct_7pyarrow_3lib_DataType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ListType *__pyx_vtabptr_7pyarrow_3lib_ListType;


/* "pyarrow/types.pxi":264
 * 
 * 
 * cdef class LargeListType(DataType):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for large list data types
 */

struct __pyx_vtabstruct_7pyarrow_3lib_LargeListType {
  struct __pyx_vtabstruct_7pyarrow_3lib_DataType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_LargeListType *__pyx_vtabptr_7pyarrow_3lib_LargeListType;


/* "pyarrow/types.pxi":285
 * 
 * 
 * cdef class MapType(DataType):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for map data types.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_MapType {
  struct __pyx_vtabstruct_7pyarrow_3lib_DataType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_MapType *__pyx_vtabptr_7pyarrow_3lib_MapType;


/* "pyarrow/types.pxi":312
 * 
 * 
 * cdef class FixedSizeListType(DataType):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for fixed size list data types.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeListType {
  struct __pyx_vtabstruct_7pyarrow_3lib_DataType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeListType *__pyx_vtabptr_7pyarrow_3lib_FixedSizeListType;


/* "pyarrow/types.pxi":339
 * 
 * 
 * cdef class StructType(DataType):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for struct data types.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_StructType {
  struct __pyx_vtabstruct_7pyarrow_3lib_DataType __pyx_base;
  struct __pyx_obj_7pyarrow_3lib_Field *(*field)(struct __pyx_obj_7pyarrow_3lib_StructType *, int);
  struct __pyx_obj_7pyarrow_3lib_Field *(*field_by_name)(struct __pyx_obj_7pyarrow_3lib_StructType *, PyObject *);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_StructType *__pyx_vtabptr_7pyarrow_3lib_StructType;


/* "pyarrow/types.pxi":208
 * 
 * 
 * cdef class DictionaryType(DataType):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for dictionary data types.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_DictionaryType {
  struct __pyx_vtabstruct_7pyarrow_3lib_DataType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DictionaryType *__pyx_vtabptr_7pyarrow_3lib_DictionaryType;


/* "pyarrow/types.pxi":450
 * 
 * 
 * cdef class TimestampType(DataType):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for timestamp data types.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_TimestampType {
  struct __pyx_vtabstruct_7pyarrow_3lib_DataType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_TimestampType *__pyx_vtabptr_7pyarrow_3lib_TimestampType;


/* "pyarrow/types.pxi":491
 * 
 * 
 * cdef class Time32Type(DataType):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for time32 data types.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Time32Type {
  struct __pyx_vtabstruct_7pyarrow_3lib_DataType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Time32Type *__pyx_vtabptr_7pyarrow_3lib_Time32Type;


/* "pyarrow/types.pxi":508
 * 
 * 
 * cdef class Time64Type(DataType):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for time64 data types.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Time64Type {
  struct __pyx_vtabstruct_7pyarrow_3lib_DataType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Time64Type *__pyx_vtabptr_7pyarrow_3lib_Time64Type;


/* "pyarrow/types.pxi":525
 * 
 * 
 * cdef class DurationType(DataType):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for duration data types.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_DurationType {
  struct __pyx_vtabstruct_7pyarrow_3lib_DataType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DurationType *__pyx_vtabptr_7pyarrow_3lib_DurationType;


/* "pyarrow/types.pxi":542
 * 
 * 
 * cdef class FixedSizeBinaryType(DataType):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for fixed-size binary data types.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBinaryType {
  struct __pyx_vtabstruct_7pyarrow_3lib_DataType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBinaryType *__pyx_vtabptr_7pyarrow_3lib_FixedSizeBinaryType;


/* "pyarrow/types.pxi":563
 * 
 * 
 * cdef class Decimal128Type(FixedSizeBinaryType):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for decimal128 data types.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Decimal128Type {
  struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBinaryType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Decimal128Type *__pyx_vtabptr_7pyarrow_3lib_Decimal128Type;


/* "pyarrow/types.pxi":590
 * 
 * 
 * cdef class BaseExtensionType(DataType):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete base class for extension types.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_BaseExtensionType {
  struct __pyx_vtabstruct_7pyarrow_3lib_DataType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BaseExtensionType *__pyx_vtabptr_7pyarrow_3lib_BaseExtensionType;


/* "pyarrow/types.pxi":614
 * 
 * 
 * cdef class ExtensionType(BaseExtensionType):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete base class for Python-defined extension types.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_ExtensionType {
  struct __pyx_vtabstruct_7pyarrow_3lib_BaseExtensionType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ExtensionType *__pyx_vtabptr_7pyarrow_3lib_ExtensionType;


/* "pyarrow/types.pxi":689
 * 
 * 
 * cdef class PyExtensionType(ExtensionType):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete base class for Python-defined extension types based on pickle
 */

struct __pyx_vtabstruct_7pyarrow_3lib_PyExtensionType {
  struct __pyx_vtabstruct_7pyarrow_3lib_ExtensionType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_PyExtensionType *__pyx_vtabptr_7pyarrow_3lib_PyExtensionType;


/* "pyarrow/types.pxi":792
 * 
 * 
 * cdef class Field:             # <<<<<<<<<<<<<<
 *     """
 *     A named field, with a data type, nullability, and optional metadata.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Field {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_Field *, std::shared_ptr< arrow::Field>  const &);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Field *__pyx_vtabptr_7pyarrow_3lib_Field;


/* "pyarrow/types.pxi":915
 * 
 * 
 * cdef class Schema:             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Schema {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_Schema *, std::vector<std::shared_ptr< arrow::Field> >  const &);
  void (*init_schema)(struct __pyx_obj_7pyarrow_3lib_Schema *, std::shared_ptr< arrow::Schema>  const &);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Schema *__pyx_vtabptr_7pyarrow_3lib_Schema;


/* "pyarrow/scalar.pxi":56
 * 
 * 
 * cdef class ArrayValue(Scalar):             # <<<<<<<<<<<<<<
 *     """
 *     The base class for non-null array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_ArrayValue *, struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::Array>  const &, int64_t);
  void (*_set_array)(struct __pyx_obj_7pyarrow_3lib_ArrayValue *, std::shared_ptr< arrow::Array>  const &);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;


/* "pyarrow/scalar.pxi":998
 * }
 * 
 * cdef class ScalarValue(Scalar):             # <<<<<<<<<<<<<<
 *     """
 *     The base class for scalars.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_ScalarValue *, std::shared_ptr< arrow::Scalar>  const &);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue *__pyx_vtabptr_7pyarrow_3lib_ScalarValue;


/* "pyarrow/scalar.pxi":113
 * 
 * 
 * cdef class Int8Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for int8 array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Int8Value {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int8Value *__pyx_vtabptr_7pyarrow_3lib_Int8Value;


/* "pyarrow/scalar.pxi":191
 * 
 * 
 * cdef class Int64Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for int64 array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Int64Value {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int64Value *__pyx_vtabptr_7pyarrow_3lib_Int64Value;


/* "pyarrow/scalar.pxi":632
 * 
 * 
 * cdef class ListValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for list array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_ListValue {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
  PyObject *(*getitem)(struct __pyx_obj_7pyarrow_3lib_ListValue *, int64_t);
  int64_t (*length)(struct __pyx_obj_7pyarrow_3lib_ListValue *);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ListValue *__pyx_vtabptr_7pyarrow_3lib_ListValue;


/* "pyarrow/scalar.pxi":683
 * 
 * 
 * cdef class LargeListValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for large list array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_LargeListValue {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
  PyObject *(*getitem)(struct __pyx_obj_7pyarrow_3lib_LargeListValue *, int64_t);
  int64_t (*length)(struct __pyx_obj_7pyarrow_3lib_LargeListValue *);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_LargeListValue *__pyx_vtabptr_7pyarrow_3lib_LargeListValue;


/* "pyarrow/scalar.pxi":734
 * 
 * 
 * cdef class MapValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for map array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_MapValue {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
  PyObject *(*getitem)(struct __pyx_obj_7pyarrow_3lib_MapValue *, int64_t);
  int64_t (*length)(struct __pyx_obj_7pyarrow_3lib_MapValue *);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_MapValue *__pyx_vtabptr_7pyarrow_3lib_MapValue;


/* "pyarrow/scalar.pxi":789
 * 
 * 
 * cdef class FixedSizeListValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for fixed size list array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeListValue {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
  PyObject *(*getitem)(struct __pyx_obj_7pyarrow_3lib_FixedSizeListValue *, int64_t);
  int64_t (*length)(struct __pyx_obj_7pyarrow_3lib_FixedSizeListValue *);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeListValue *__pyx_vtabptr_7pyarrow_3lib_FixedSizeListValue;


/* "pyarrow/scalar.pxi":888
 * 
 * 
 * cdef class StructValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for struct array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_StructValue {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_StructValue *__pyx_vtabptr_7pyarrow_3lib_StructValue;


/* "pyarrow/scalar.pxi":840
 * 
 * 
 * cdef class UnionValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for union array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_UnionValue {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
  PyObject *(*getitem)(struct __pyx_obj_7pyarrow_3lib_UnionValue *, int64_t);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UnionValue *__pyx_vtabptr_7pyarrow_3lib_UnionValue;


/* "pyarrow/scalar.pxi":522
 * 
 * 
 * cdef class StringValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for string (utf8) array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_StringValue {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_StringValue *__pyx_vtabptr_7pyarrow_3lib_StringValue;


/* "pyarrow/scalar.pxi":867
 * 
 * 
 * cdef class FixedSizeBinaryValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for fixed-size binary array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBinaryValue {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBinaryValue *__pyx_vtabptr_7pyarrow_3lib_FixedSizeBinaryValue;


/* "pyarrow/array.pxi":578
 * 
 * 
 * cdef class Array(_PandasConvertible):             # <<<<<<<<<<<<<<
 *     """
 *     The base class for all Arrow arrays.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Array {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_Array *, std::shared_ptr< arrow::Array>  const &);
  PyObject *(*getitem)(struct __pyx_obj_7pyarrow_3lib_Array *, int64_t);
  int64_t (*length)(struct __pyx_obj_7pyarrow_3lib_Array *);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Array *__pyx_vtabptr_7pyarrow_3lib_Array;


/* "pyarrow/tensor.pxi":19
 * 
 * 
 * cdef class Tensor:             # <<<<<<<<<<<<<<
 *     """
 *     A n-dimensional array a.k.a Tensor.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Tensor {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_Tensor *, std::shared_ptr< arrow::Tensor>  const &);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Tensor *__pyx_vtabptr_7pyarrow_3lib_Tensor;


/* "pyarrow/tensor.pxi":343
 * 
 * 
 * cdef class SparseCSRMatrix:             # <<<<<<<<<<<<<<
 *     """
 *     A sparse CSR tensor.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_SparseCSRMatrix {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *, std::shared_ptr< arrow::SparseCSRMatrix>  const &);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_SparseCSRMatrix *__pyx_vtabptr_7pyarrow_3lib_SparseCSRMatrix;


/* "pyarrow/tensor.pxi":129
 * 
 * 
 * cdef class SparseCOOTensor:             # <<<<<<<<<<<<<<
 *     """
 *     A sparse COO tensor.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_SparseCOOTensor {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *, std::shared_ptr< arrow::SparseCOOTensor>  const &);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_SparseCOOTensor *__pyx_vtabptr_7pyarrow_3lib_SparseCOOTensor;


/* "pyarrow/array.pxi":1168
 * 
 * 
 * cdef class NullArray(Array):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of null data type.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_NullArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_Array __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_NullArray *__pyx_vtabptr_7pyarrow_3lib_NullArray;


/* "pyarrow/array.pxi":1174
 * 
 * 
 * cdef class BooleanArray(Array):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of boolean data type.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_BooleanArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_Array __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BooleanArray *__pyx_vtabptr_7pyarrow_3lib_BooleanArray;


/* "pyarrow/array.pxi":1180
 * 
 * 
 * cdef class NumericArray(Array):             # <<<<<<<<<<<<<<
 *     """
 *     A base class for Arrow numeric arrays.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_NumericArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_Array __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_NumericArray *__pyx_vtabptr_7pyarrow_3lib_NumericArray;


/* "pyarrow/array.pxi":1186
 * 
 * 
 * cdef class IntegerArray(NumericArray):             # <<<<<<<<<<<<<<
 *     """
 *     A base class for Arrow integer arrays.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_IntegerArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_NumericArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_IntegerArray *__pyx_vtabptr_7pyarrow_3lib_IntegerArray;


/* "pyarrow/array.pxi":1192
 * 
 * 
 * cdef class FloatingPointArray(NumericArray):             # <<<<<<<<<<<<<<
 *     """
 *     A base class for Arrow floating-point arrays.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_FloatingPointArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_NumericArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FloatingPointArray *__pyx_vtabptr_7pyarrow_3lib_FloatingPointArray;


/* "pyarrow/array.pxi":1198
 * 
 * 
 * cdef class Int8Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of int8 data type.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Int8Array {
  struct __pyx_vtabstruct_7pyarrow_3lib_IntegerArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int8Array *__pyx_vtabptr_7pyarrow_3lib_Int8Array;


/* "pyarrow/array.pxi":1204
 * 
 * 
 * cdef class UInt8Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of uint8 data type.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_UInt8Array {
  struct __pyx_vtabstruct_7pyarrow_3lib_IntegerArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt8Array *__pyx_vtabptr_7pyarrow_3lib_UInt8Array;


/* "pyarrow/array.pxi":1210
 * 
 * 
 * cdef class Int16Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of int16 data type.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Int16Array {
  struct __pyx_vtabstruct_7pyarrow_3lib_IntegerArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int16Array *__pyx_vtabptr_7pyarrow_3lib_Int16Array;


/* "pyarrow/array.pxi":1216
 * 
 * 
 * cdef class UInt16Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of uint16 data type.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_UInt16Array {
  struct __pyx_vtabstruct_7pyarrow_3lib_IntegerArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt16Array *__pyx_vtabptr_7pyarrow_3lib_UInt16Array;


/* "pyarrow/array.pxi":1222
 * 
 * 
 * cdef class Int32Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of int32 data type.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Int32Array {
  struct __pyx_vtabstruct_7pyarrow_3lib_IntegerArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int32Array *__pyx_vtabptr_7pyarrow_3lib_Int32Array;


/* "pyarrow/array.pxi":1228
 * 
 * 
 * cdef class UInt32Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of uint32 data type.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_UInt32Array {
  struct __pyx_vtabstruct_7pyarrow_3lib_IntegerArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt32Array *__pyx_vtabptr_7pyarrow_3lib_UInt32Array;


/* "pyarrow/array.pxi":1234
 * 
 * 
 * cdef class Int64Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of int64 data type.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Int64Array {
  struct __pyx_vtabstruct_7pyarrow_3lib_IntegerArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int64Array *__pyx_vtabptr_7pyarrow_3lib_Int64Array;


/* "pyarrow/array.pxi":1240
 * 
 * 
 * cdef class UInt64Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of uint64 data type.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_UInt64Array {
  struct __pyx_vtabstruct_7pyarrow_3lib_IntegerArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt64Array *__pyx_vtabptr_7pyarrow_3lib_UInt64Array;


/* "pyarrow/array.pxi":1281
 *     """
 * 
 * cdef class HalfFloatArray(FloatingPointArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of float16 data type.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_HalfFloatArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_FloatingPointArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_HalfFloatArray *__pyx_vtabptr_7pyarrow_3lib_HalfFloatArray;


/* "pyarrow/array.pxi":1287
 * 
 * 
 * cdef class FloatArray(FloatingPointArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of float32 data type.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_FloatArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_FloatingPointArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FloatArray *__pyx_vtabptr_7pyarrow_3lib_FloatArray;


/* "pyarrow/array.pxi":1293
 * 
 * 
 * cdef class DoubleArray(FloatingPointArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of float64 data type.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_DoubleArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_FloatingPointArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DoubleArray *__pyx_vtabptr_7pyarrow_3lib_DoubleArray;


/* "pyarrow/array.pxi":1299
 * 
 * 
 * cdef class FixedSizeBinaryArray(Array):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of a fixed-size binary data type.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBinaryArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_Array __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBinaryArray *__pyx_vtabptr_7pyarrow_3lib_FixedSizeBinaryArray;


/* "pyarrow/array.pxi":1305
 * 
 * 
 * cdef class Decimal128Array(FixedSizeBinaryArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of decimal128 data type.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Decimal128Array {
  struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBinaryArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Decimal128Array *__pyx_vtabptr_7pyarrow_3lib_Decimal128Array;


/* "pyarrow/array.pxi":1829
 * 
 * 
 * cdef class StructArray(Array):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of a struct data type.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_StructArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_Array __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_StructArray *__pyx_vtabptr_7pyarrow_3lib_StructArray;


/* "pyarrow/array.pxi":1311
 * 
 * 
 * cdef class ListArray(Array):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of a list data type.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_ListArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_Array __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ListArray *__pyx_vtabptr_7pyarrow_3lib_ListArray;


/* "pyarrow/array.pxi":1391
 * 
 * 
 * cdef class LargeListArray(Array):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of a large list data type
 */

struct __pyx_vtabstruct_7pyarrow_3lib_LargeListArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_Array __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_LargeListArray *__pyx_vtabptr_7pyarrow_3lib_LargeListArray;


/* "pyarrow/array.pxi":1473
 * 
 * 
 * cdef class MapArray(Array):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of a map data type.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_MapArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_Array __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_MapArray *__pyx_vtabptr_7pyarrow_3lib_MapArray;


/* "pyarrow/array.pxi":1519
 * 
 * 
 * cdef class FixedSizeListArray(Array):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of a fixed size list data type.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeListArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_Array __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeListArray *__pyx_vtabptr_7pyarrow_3lib_FixedSizeListArray;


/* "pyarrow/array.pxi":1568
 * 
 * 
 * cdef class UnionArray(Array):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of a Union data type.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_UnionArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_Array __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UnionArray *__pyx_vtabptr_7pyarrow_3lib_UnionArray;


/* "pyarrow/array.pxi":1654
 * 
 * 
 * cdef class StringArray(Array):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of string (or utf8) data type.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_StringArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_Array __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_StringArray *__pyx_vtabptr_7pyarrow_3lib_StringArray;


/* "pyarrow/array.pxi":1718
 * 
 * 
 * cdef class BinaryArray(Array):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of variable-sized binary data type.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_BinaryArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_Array __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BinaryArray *__pyx_vtabptr_7pyarrow_3lib_BinaryArray;


/* "pyarrow/array.pxi":1730
 * 
 * 
 * cdef class DictionaryArray(Array):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for dictionary-encoded Arrow arrays.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_DictionaryArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_Array __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DictionaryArray *__pyx_vtabptr_7pyarrow_3lib_DictionaryArray;


/* "pyarrow/array.pxi":1956
 * 
 * 
 * cdef class ExtensionArray(Array):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow extension arrays.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_ExtensionArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_Array __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ExtensionArray *__pyx_vtabptr_7pyarrow_3lib_ExtensionArray;


/* "pyarrow/table.pxi":21
 * 
 * 
 * cdef class ChunkedArray(_PandasConvertible):             # <<<<<<<<<<<<<<
 *     """
 *     Array backed via one or more memory chunks.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_ChunkedArray {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *, std::shared_ptr< arrow::ChunkedArray>  const &);
  PyObject *(*getitem)(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *, int64_t);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ChunkedArray *__pyx_vtabptr_7pyarrow_3lib_ChunkedArray;


/* "pyarrow/table.pxi":889
 * 
 * 
 * cdef class Table(_PandasConvertible):             # <<<<<<<<<<<<<<
 *     """
 *     A collection of top-level named, equal length Arrow arrays.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Table {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_Table *, std::shared_ptr< arrow::Table>  const &);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Table *__pyx_vtabptr_7pyarrow_3lib_Table;


/* "pyarrow/table.pxi":494
 * 
 * 
 * cdef class RecordBatch(_PandasConvertible):             # <<<<<<<<<<<<<<
 *     """
 *     Batch of rows of columns of equal length
 */

struct __pyx_vtabstruct_7pyarrow_3lib_RecordBatch {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_RecordBatch *, std::shared_ptr< arrow::RecordBatch>  const &);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_RecordBatch *__pyx_vtabptr_7pyarrow_3lib_RecordBatch;


/* "pyarrow/io.pxi":882
 * 
 * 
 * cdef class Buffer:             # <<<<<<<<<<<<<<
 *     """
 *     The base class for all Arrow buffers.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Buffer {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_Buffer *, std::shared_ptr< arrow::Buffer>  const &);
  PyObject *(*getitem)(struct __pyx_obj_7pyarrow_3lib_Buffer *, int64_t);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Buffer *__pyx_vtabptr_7pyarrow_3lib_Buffer;


/* "pyarrow/io.pxi":1063
 * 
 * 
 * cdef class ResizableBuffer(Buffer):             # <<<<<<<<<<<<<<
 *     """
 *     A base class for buffers that can be resized.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_ResizableBuffer {
  struct __pyx_vtabstruct_7pyarrow_3lib_Buffer __pyx_base;
  void (*init_rz)(struct __pyx_obj_7pyarrow_3lib_ResizableBuffer *, std::shared_ptr< arrow::ResizableBuffer>  const &);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ResizableBuffer *__pyx_vtabptr_7pyarrow_3lib_ResizableBuffer;


/* "pyarrow/io.pxi":46
 * 
 * 
 * cdef class NativeFile:             # <<<<<<<<<<<<<<
 *     """
 *     The base class for all Arrow streams.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile {
  PyObject *(*set_random_access_file)(struct __pyx_obj_7pyarrow_3lib_NativeFile *, std::shared_ptr< arrow::io::RandomAccessFile> );
  PyObject *(*set_input_stream)(struct __pyx_obj_7pyarrow_3lib_NativeFile *, std::shared_ptr< arrow::io::InputStream> );
  PyObject *(*set_output_stream)(struct __pyx_obj_7pyarrow_3lib_NativeFile *, std::shared_ptr< arrow::io::OutputStream> );
  std::shared_ptr< arrow::io::RandomAccessFile>  (*get_random_access_file)(struct __pyx_obj_7pyarrow_3lib_NativeFile *);
  std::shared_ptr< arrow::io::InputStream>  (*get_input_stream)(struct __pyx_obj_7pyarrow_3lib_NativeFile *);
  std::shared_ptr< arrow::io::OutputStream>  (*get_output_stream)(struct __pyx_obj_7pyarrow_3lib_NativeFile *);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *__pyx_vtabptr_7pyarrow_3lib_NativeFile;


/* "pyarrow/io.pxi":1248
 * 
 * 
 * cdef class BufferedInputStream(NativeFile):             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, NativeFile stream, int buffer_size,
 */

struct __pyx_vtabstruct_7pyarrow_3lib_BufferedInputStream {
  struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BufferedInputStream *__pyx_vtabptr_7pyarrow_3lib_BufferedInputStream;


/* "pyarrow/io.pxi":1298
 * 
 * 
 * cdef class BufferedOutputStream(NativeFile):             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, NativeFile stream, int buffer_size,
 */

struct __pyx_vtabstruct_7pyarrow_3lib_BufferedOutputStream {
  struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BufferedOutputStream *__pyx_vtabptr_7pyarrow_3lib_BufferedOutputStream;


/* "pyarrow/io.pxi":1184
 * 
 * 
 * cdef class CompressedInputStream(NativeFile):             # <<<<<<<<<<<<<<
 *     """
 *     An input stream wrapper which decompresses data on the fly.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_CompressedInputStream {
  struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_CompressedInputStream *__pyx_vtabptr_7pyarrow_3lib_CompressedInputStream;


/* "pyarrow/io.pxi":1213
 * 
 * 
 * cdef class CompressedOutputStream(NativeFile):             # <<<<<<<<<<<<<<
 *     """
 *     An output stream wrapper which compresses data on the fly.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_CompressedOutputStream {
  struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_CompressedOutputStream *__pyx_vtabptr_7pyarrow_3lib_CompressedOutputStream;


/* "pyarrow/compute.pxi":19
 * 
 * 
 * cdef class CastOptions:             # <<<<<<<<<<<<<<
 * 
 *     __slots__ = ()  # avoid mistakingly creating attributes
 */

struct __pyx_vtabstruct_7pyarrow_3lib_CastOptions {
  PyObject *(*wrap)( arrow::compute::CastOptions);
   arrow::compute::CastOptions (*unwrap)(struct __pyx_obj_7pyarrow_3lib_CastOptions *);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_CastOptions *__pyx_vtabptr_7pyarrow_3lib_CastOptions;
static CYTHON_INLINE  arrow::compute::CastOptions __pyx_f_7pyarrow_3lib_11CastOptions_unwrap(struct __pyx_obj_7pyarrow_3lib_CastOptions *);


/* "pyarrow/pandas-shim.pxi":20
 * # pandas lazy-loading API shim that reduces API call and import overhead
 * 
 * cdef class _PandasAPIShim(object):             # <<<<<<<<<<<<<<
 *     """
 *     Lazy pandas importer that isolates usages of pandas APIs and avoids
 */

struct __pyx_vtabstruct_7pyarrow_3lib__PandasAPIShim {
  PyObject *(*_import_pandas)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, int);
  PyObject *(*_check_import)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, struct __pyx_opt_args_7pyarrow_3lib_14_PandasAPIShim__check_import *__pyx_optional_args);
  int (*_have_pandas_internal)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *);
  PyObject *(*infer_dtype)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*pandas_dtype)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*is_array_like)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*is_categorical)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*is_datetimetz)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*is_sparse)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*is_data_frame)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*is_series)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*is_index)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*get_values)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, PyObject *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_7pyarrow_3lib__PandasAPIShim *__pyx_vtabptr_7pyarrow_3lib__PandasAPIShim;
static CYTHON_INLINE PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim__check_import(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, struct __pyx_opt_args_7pyarrow_3lib_14_PandasAPIShim__check_import *__pyx_optional_args);
static CYTHON_INLINE int __pyx_f_7pyarrow_3lib_14_PandasAPIShim__have_pandas_internal(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *);


/* "pyarrow/memory.pxi":65
 * 
 * 
 * cdef class LoggingMemoryPool(MemoryPool):             # <<<<<<<<<<<<<<
 *     cdef:
 *         unique_ptr[CLoggingMemoryPool] logging_pool
 */

struct __pyx_vtabstruct_7pyarrow_3lib_LoggingMemoryPool {
  struct __pyx_vtabstruct_7pyarrow_3lib_MemoryPool __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_LoggingMemoryPool *__pyx_vtabptr_7pyarrow_3lib_LoggingMemoryPool;


/* "pyarrow/memory.pxi":75
 * 
 * 
 * cdef class ProxyMemoryPool(MemoryPool):             # <<<<<<<<<<<<<<
 *     """
 *     Memory pool implementation that tracks the number of bytes and
 */

struct __pyx_vtabstruct_7pyarrow_3lib_ProxyMemoryPool {
  struct __pyx_vtabstruct_7pyarrow_3lib_MemoryPool __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ProxyMemoryPool *__pyx_vtabptr_7pyarrow_3lib_ProxyMemoryPool;


/* "pyarrow/types.pxi":398
 * 
 * 
 * cdef class UnionType(DataType):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for struct data types.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_UnionType {
  struct __pyx_vtabstruct_7pyarrow_3lib_DataType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UnionType *__pyx_vtabptr_7pyarrow_3lib_UnionType;


/* "pyarrow/types.pxi":728
 * 
 * 
 * cdef class UnknownExtensionType(PyExtensionType):             # <<<<<<<<<<<<<<
 *     """
 *     A concrete class for Python-defined extension types that refer to
 */

struct __pyx_vtabstruct_7pyarrow_3lib_UnknownExtensionType {
  struct __pyx_vtabstruct_7pyarrow_3lib_PyExtensionType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UnknownExtensionType *__pyx_vtabptr_7pyarrow_3lib_UnknownExtensionType;


/* "pyarrow/scalar.pxi":100
 * 
 * 
 * cdef class BooleanValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for boolean array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_BooleanValue {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BooleanValue *__pyx_vtabptr_7pyarrow_3lib_BooleanValue;


/* "pyarrow/scalar.pxi":126
 * 
 * 
 * cdef class UInt8Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for uint8 array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_UInt8Value {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt8Value *__pyx_vtabptr_7pyarrow_3lib_UInt8Value;


/* "pyarrow/scalar.pxi":139
 * 
 * 
 * cdef class Int16Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for int16 array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Int16Value {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int16Value *__pyx_vtabptr_7pyarrow_3lib_Int16Value;


/* "pyarrow/scalar.pxi":152
 * 
 * 
 * cdef class UInt16Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for uint16 array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_UInt16Value {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt16Value *__pyx_vtabptr_7pyarrow_3lib_UInt16Value;


/* "pyarrow/scalar.pxi":165
 * 
 * 
 * cdef class Int32Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for int32 array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Int32Value {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int32Value *__pyx_vtabptr_7pyarrow_3lib_Int32Value;


/* "pyarrow/scalar.pxi":178
 * 
 * 
 * cdef class UInt32Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for uint32 array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_UInt32Value {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt32Value *__pyx_vtabptr_7pyarrow_3lib_UInt32Value;


/* "pyarrow/scalar.pxi":204
 * 
 * 
 * cdef class UInt64Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for uint64 array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_UInt64Value {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt64Value *__pyx_vtabptr_7pyarrow_3lib_UInt64Value;


/* "pyarrow/scalar.pxi":217
 * 
 * 
 * cdef class Date32Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for date32 array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Date32Value {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Date32Value *__pyx_vtabptr_7pyarrow_3lib_Date32Value;


/* "pyarrow/scalar.pxi":233
 * 
 * 
 * cdef class Date64Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for date64 array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Date64Value {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Date64Value *__pyx_vtabptr_7pyarrow_3lib_Date64Value;


/* "pyarrow/scalar.pxi":248
 * 
 * 
 * cdef class Time32Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for time32 array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Time32Value {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Time32Value *__pyx_vtabptr_7pyarrow_3lib_Time32Value;


/* "pyarrow/scalar.pxi":268
 * 
 * 
 * cdef class Time64Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for time64 array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Time64Value {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Time64Value *__pyx_vtabptr_7pyarrow_3lib_Time64Value;


/* "pyarrow/scalar.pxi":373
 * 
 * 
 * cdef class TimestampValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for timestamp array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_TimestampValue {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_TimestampValue *__pyx_vtabptr_7pyarrow_3lib_TimestampValue;


/* "pyarrow/scalar.pxi":445
 * 
 * 
 * cdef class DurationValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for duration array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_DurationValue {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DurationValue *__pyx_vtabptr_7pyarrow_3lib_DurationValue;


/* "pyarrow/scalar.pxi":468
 * 
 * 
 * cdef class HalfFloatValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for float16 array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_HalfFloatValue {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_HalfFloatValue *__pyx_vtabptr_7pyarrow_3lib_HalfFloatValue;


/* "pyarrow/scalar.pxi":481
 * 
 * 
 * cdef class FloatValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for float32 array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_FloatValue {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FloatValue *__pyx_vtabptr_7pyarrow_3lib_FloatValue;


/* "pyarrow/scalar.pxi":494
 * 
 * 
 * cdef class DoubleValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for float64 array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_DoubleValue {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DoubleValue *__pyx_vtabptr_7pyarrow_3lib_DoubleValue;


/* "pyarrow/scalar.pxi":507
 * 
 * 
 * cdef class DecimalValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for decimal128 array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_DecimalValue {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DecimalValue *__pyx_vtabptr_7pyarrow_3lib_DecimalValue;


/* "pyarrow/scalar.pxi":547
 * 
 * 
 * cdef class LargeStringValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for large string (utf8) array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_LargeStringValue {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_LargeStringValue *__pyx_vtabptr_7pyarrow_3lib_LargeStringValue;


/* "pyarrow/scalar.pxi":572
 * 
 * 
 * cdef class BinaryValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for variable-sized binary array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_BinaryValue {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BinaryValue *__pyx_vtabptr_7pyarrow_3lib_BinaryValue;


/* "pyarrow/scalar.pxi":602
 * 
 * 
 * cdef class LargeBinaryValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for large variable-sized binary array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_LargeBinaryValue {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_LargeBinaryValue *__pyx_vtabptr_7pyarrow_3lib_LargeBinaryValue;


/* "pyarrow/scalar.pxi":931
 * 
 * 
 * cdef class DictionaryValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for dictionary-encoded array elements.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_DictionaryValue {
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DictionaryValue *__pyx_vtabptr_7pyarrow_3lib_DictionaryValue;


/* "pyarrow/scalar.pxi":1035
 * 
 * 
 * cdef class UInt8Scalar(ScalarValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for uint8 scalars.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_UInt8Scalar {
  struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt8Scalar *__pyx_vtabptr_7pyarrow_3lib_UInt8Scalar;


/* "pyarrow/scalar.pxi":1048
 * 
 * 
 * cdef class Int8Scalar(ScalarValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for int8 scalars.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Int8Scalar {
  struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int8Scalar *__pyx_vtabptr_7pyarrow_3lib_Int8Scalar;


/* "pyarrow/scalar.pxi":1061
 * 
 * 
 * cdef class UInt16Scalar(ScalarValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for uint16 scalars.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_UInt16Scalar {
  struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt16Scalar *__pyx_vtabptr_7pyarrow_3lib_UInt16Scalar;


/* "pyarrow/scalar.pxi":1074
 * 
 * 
 * cdef class Int16Scalar(ScalarValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for int16 scalars.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Int16Scalar {
  struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int16Scalar *__pyx_vtabptr_7pyarrow_3lib_Int16Scalar;


/* "pyarrow/scalar.pxi":1087
 * 
 * 
 * cdef class UInt32Scalar(ScalarValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for uint32 scalars.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_UInt32Scalar {
  struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt32Scalar *__pyx_vtabptr_7pyarrow_3lib_UInt32Scalar;


/* "pyarrow/scalar.pxi":1100
 * 
 * 
 * cdef class Int32Scalar(ScalarValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for int32 scalars.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Int32Scalar {
  struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int32Scalar *__pyx_vtabptr_7pyarrow_3lib_Int32Scalar;


/* "pyarrow/scalar.pxi":1113
 * 
 * 
 * cdef class UInt64Scalar(ScalarValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for uint64 scalars.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_UInt64Scalar {
  struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt64Scalar *__pyx_vtabptr_7pyarrow_3lib_UInt64Scalar;


/* "pyarrow/scalar.pxi":1126
 * 
 * 
 * cdef class Int64Scalar(ScalarValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for int64 scalars.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Int64Scalar {
  struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int64Scalar *__pyx_vtabptr_7pyarrow_3lib_Int64Scalar;


/* "pyarrow/scalar.pxi":1139
 * 
 * 
 * cdef class FloatScalar(ScalarValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for float scalars.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_FloatScalar {
  struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FloatScalar *__pyx_vtabptr_7pyarrow_3lib_FloatScalar;


/* "pyarrow/scalar.pxi":1152
 * 
 * 
 * cdef class DoubleScalar(ScalarValue):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for double scalars.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_DoubleScalar {
  struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DoubleScalar *__pyx_vtabptr_7pyarrow_3lib_DoubleScalar;


/* "pyarrow/array.pxi":1246
 * 
 * 
 * cdef class Date32Array(NumericArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of date32 data type.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Date32Array {
  struct __pyx_vtabstruct_7pyarrow_3lib_NumericArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Date32Array *__pyx_vtabptr_7pyarrow_3lib_Date32Array;


/* "pyarrow/array.pxi":1252
 * 
 * 
 * cdef class Date64Array(NumericArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of date64 data type.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Date64Array {
  struct __pyx_vtabstruct_7pyarrow_3lib_NumericArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Date64Array *__pyx_vtabptr_7pyarrow_3lib_Date64Array;


/* "pyarrow/array.pxi":1258
 * 
 * 
 * cdef class TimestampArray(NumericArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of timestamp data type.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_TimestampArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_NumericArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_TimestampArray *__pyx_vtabptr_7pyarrow_3lib_TimestampArray;


/* "pyarrow/array.pxi":1264
 * 
 * 
 * cdef class Time32Array(NumericArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of time32 data type.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Time32Array {
  struct __pyx_vtabstruct_7pyarrow_3lib_NumericArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Time32Array *__pyx_vtabptr_7pyarrow_3lib_Time32Array;


/* "pyarrow/array.pxi":1270
 * 
 * 
 * cdef class Time64Array(NumericArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of time64 data type.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Time64Array {
  struct __pyx_vtabstruct_7pyarrow_3lib_NumericArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Time64Array *__pyx_vtabptr_7pyarrow_3lib_Time64Array;


/* "pyarrow/array.pxi":1276
 * 
 * 
 * cdef class DurationArray(NumericArray):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of duration data type.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_DurationArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_NumericArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DurationArray *__pyx_vtabptr_7pyarrow_3lib_DurationArray;


/* "pyarrow/array.pxi":1686
 * 
 * 
 * cdef class LargeStringArray(Array):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of large string (or utf8) data type.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_LargeStringArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_Array __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_LargeStringArray *__pyx_vtabptr_7pyarrow_3lib_LargeStringArray;


/* "pyarrow/array.pxi":1724
 * 
 * 
 * cdef class LargeBinaryArray(Array):             # <<<<<<<<<<<<<<
 *     """
 *     Concrete class for Arrow arrays of large variable-sized binary data type.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_LargeBinaryArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_Array __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_LargeBinaryArray *__pyx_vtabptr_7pyarrow_3lib_LargeBinaryArray;


/* "pyarrow/io.pxi":619
 * 
 * 
 * cdef class PythonFile(NativeFile):             # <<<<<<<<<<<<<<
 *     """
 *     A stream backed by a Python file object.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_PythonFile {
  struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_PythonFile *__pyx_vtabptr_7pyarrow_3lib_PythonFile;


/* "pyarrow/io.pxi":701
 * 
 * 
 * cdef class MemoryMappedFile(NativeFile):             # <<<<<<<<<<<<<<
 *     """
 *     A stream that represents a memory-mapped file.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_MemoryMappedFile {
  struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_MemoryMappedFile *__pyx_vtabptr_7pyarrow_3lib_MemoryMappedFile;


/* "pyarrow/io.pxi":812
 * 
 * 
 * cdef class OSFile(NativeFile):             # <<<<<<<<<<<<<<
 *     """
 *     A stream backed by a regular file descriptor.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_OSFile {
  struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile __pyx_base;
  PyObject *(*_open_readable)(struct __pyx_obj_7pyarrow_3lib_OSFile *, std::string,  arrow::MemoryPool *);
  PyObject *(*_open_writable)(struct __pyx_obj_7pyarrow_3lib_OSFile *, std::string);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_OSFile *__pyx_vtabptr_7pyarrow_3lib_OSFile;


/* "pyarrow/io.pxi":853
 * 
 * 
 * cdef class FixedSizeBufferWriter(NativeFile):             # <<<<<<<<<<<<<<
 *     """
 *     A stream writing to a Arrow buffer.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBufferWriter {
  struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBufferWriter *__pyx_vtabptr_7pyarrow_3lib_FixedSizeBufferWriter;


/* "pyarrow/io.pxi":1131
 * 
 * 
 * cdef class BufferOutputStream(NativeFile):             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */

struct __pyx_vtabstruct_7pyarrow_3lib_BufferOutputStream {
  struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BufferOutputStream *__pyx_vtabptr_7pyarrow_3lib_BufferOutputStream;


/* "pyarrow/io.pxi":1155
 * 
 * 
 * cdef class MockOutputStream(NativeFile):             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
 */

struct __pyx_vtabstruct_7pyarrow_3lib_MockOutputStream {
  struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_MockOutputStream *__pyx_vtabptr_7pyarrow_3lib_MockOutputStream;


/* "pyarrow/io.pxi":1166
 * 
 * 
 * cdef class BufferReader(NativeFile):             # <<<<<<<<<<<<<<
 *     """
 *     Zero-copy reader from objects convertible to Arrow buffer
 */

struct __pyx_vtabstruct_7pyarrow_3lib_BufferReader {
  struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BufferReader *__pyx_vtabptr_7pyarrow_3lib_BufferReader;


/* "pyarrow/io-hdfs.pxi":56
 * 
 * 
 * cdef class HadoopFileSystem:             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CIOHadoopFileSystem] client
 */

struct __pyx_vtabstruct_7pyarrow_3lib_HadoopFileSystem {
  PyObject *(*_ensure_client)(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *);
  PyObject *(*_path_info)(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *, PyObject *, arrow::io::HdfsPathInfo *);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_HadoopFileSystem *__pyx_vtabptr_7pyarrow_3lib_HadoopFileSystem;


/* "pyarrow/io-hdfs.pxi":485
 * 
 * 
 * cdef class HdfsFile(NativeFile):             # <<<<<<<<<<<<<<
 *     cdef readonly:
 *         int32_t buffer_size
 */

struct __pyx_vtabstruct_7pyarrow_3lib_HdfsFile {
  struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_HdfsFile *__pyx_vtabptr_7pyarrow_3lib_HdfsFile;


/* "pyarrow/serialization.pxi":235
 * 
 * 
 * cdef class SerializedPyObject:             # <<<<<<<<<<<<<<
 *     """
 *     Arrow-serialized representation of Python object
 */

struct __pyx_vtabstruct_7pyarrow_3lib_SerializedPyObject {
  PyObject *(*_write_to)(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *,  arrow::io::OutputStream *);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_SerializedPyObject *__pyx_vtabptr_7pyarrow_3lib_SerializedPyObject;

/* --- Runtime support code (head) --- */
/* Refnanny.proto */
#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, int);
    void (*DECREF)(void*, PyObject*, int);
    void (*GOTREF)(void*, PyObject*, int);
    void (*GIVEREF)(void*, PyObject*, int);
    void* (*SetupContext)(const char*, int, const char*);
    void (*FinishContext)(void**);
  } __Pyx_RefNannyAPIStruct;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
#ifdef WITH_THREAD
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
          if (acquire_gil) {\
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
              PyGILState_Release(__pyx_gilstate_save);\
          } else {\
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
          }
#else
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
          __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
  #define __Pyx_RefNannyFinishContext()\
          __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
  #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
  #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
#else
  #define __Pyx_RefNannyDeclarations
  #define __Pyx_RefNannySetupContext(name, acquire_gil)
  #define __Pyx_RefNannyFinishContext()
  #define __Pyx_INCREF(r) Py_INCREF(r)
  #define __Pyx_DECREF(r) Py_DECREF(r)
  #define __Pyx_GOTREF(r)
  #define __Pyx_GIVEREF(r)
  #define __Pyx_XINCREF(r) Py_XINCREF(r)
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
  #define __Pyx_XGOTREF(r)
  #define __Pyx_XGIVEREF(r)
#endif
#define __Pyx_XDECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_XDECREF(tmp);\
    } while (0)
#define __Pyx_DECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_DECREF(tmp);\
    } while (0)
#define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
#define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)

/* PyObjectGetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif

/* GetBuiltinName.proto */
static PyObject *__Pyx_GetBuiltinName(PyObject *name);

/* PyObjectCall.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif

/* PyThreadStateGet.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
#define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
#define __Pyx_PyErr_Occurred()  __pyx_tstate->curexc_type
#else
#define __Pyx_PyThreadState_declare
#define __Pyx_PyThreadState_assign
#define __Pyx_PyErr_Occurred()  PyErr_Occurred()
#endif

/* PyErrFetchRestore.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
#define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
#else
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
#endif
#else
#define __Pyx_PyErr_Clear() PyErr_Clear()
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
#define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestoreInState(tstate, type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchInState(tstate, type, value, tb)  PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
#endif

/* RaiseException.proto */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);

/* RaiseArgTupleInvalid.proto */
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);

/* KeywordStringCheck.proto */
static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);

/* Import.proto */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);

/* GetTopmostException.proto */
#if CYTHON_USE_EXC_INFO_STACK
static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
#endif

/* SaveResetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSave(type, value, tb)  __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#define __Pyx_ExceptionReset(type, value, tb)  __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
#else
#define __Pyx_ExceptionSave(type, value, tb)   PyErr_GetExcInfo(type, value, tb)
#define __Pyx_ExceptionReset(type, value, tb)  PyErr_SetExcInfo(type, value, tb)
#endif

/* PyErrExceptionMatches.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
#else
#define __Pyx_PyErr_ExceptionMatches(err)  PyErr_ExceptionMatches(err)
#endif

/* GetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_GetException(type, value, tb)  __Pyx__GetException(__pyx_tstate, type, value, tb)
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
#endif

/* ImportFrom.proto */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);

/* PyCFunctionFastCall.proto */
#if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
#else
#define __Pyx_PyCFunction_FastCall(func, args, nargs)  (assert(0), NULL)
#endif

/* PyFunctionFastCall.proto */
#if CYTHON_FAST_PYCALL
#define __Pyx_PyFunction_FastCall(func, args, nargs)\
    __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
#else
#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
#endif
#define __Pyx_BUILD_ASSERT_EXPR(cond)\
    (sizeof(char [1 - 2*!(cond)]) - 1)
#ifndef Py_MEMBER_SIZE
#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
#endif
  static size_t __pyx_pyframe_localsplus_offset = 0;
  #include "frameobject.h"
  #define __Pxy_PyFrame_Initialize_Offsets()\
    ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
     (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
  #define __Pyx_PyFrame_GetLocalsplus(frame)\
    (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
#endif

/* PyObjectCall2Args.proto */
static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);

/* PyObjectCallMethO.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif

/* PyObjectCallOneArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);

/* WriteUnraisableException.proto */
static void __Pyx_WriteUnraisable(const char *name, int clineno,
                                  int lineno, const char *filename,
                                  int full_traceback, int nogil);

/* PyDictVersioning.proto */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
#define __PYX_DICT_VERSION_INIT  ((PY_UINT64_T) -1)
#define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
    (version_var) = __PYX_GET_DICT_VERSION(dict);\
    (cache_var) = (value);
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
    static PY_UINT64_T __pyx_dict_version = 0;\
    static PyObject *__pyx_dict_cached_value = NULL;\
    if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
        (VAR) = __pyx_dict_cached_value;\
    } else {\
        (VAR) = __pyx_dict_cached_value = (LOOKUP);\
        __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
    }\
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
#else
#define __PYX_GET_DICT_VERSION(dict)  (0)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP)  (VAR) = (LOOKUP);
#endif

/* RaiseDoubleKeywords.proto */
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);

/* ParseKeywords.proto */
static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
    PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
    const char* function_name);

/* GetAttr.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);

/* HasAttr.proto */
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);

/* GetAttr3.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);

/* GetModuleGlobalName.proto */
#if CYTHON_USE_DICT_VERSIONS
#define __Pyx_GetModuleGlobalName(var, name)  {\
    static PY_UINT64_T __pyx_dict_version = 0;\
    static PyObject *__pyx_dict_cached_value = NULL;\
    (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
        (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
        __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
}
#define __Pyx_GetModuleGlobalNameUncached(var, name)  {\
    PY_UINT64_T __pyx_dict_version;\
    PyObject *__pyx_dict_cached_value;\
    (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
}
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
#else
#define __Pyx_GetModuleGlobalName(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
#define __Pyx_GetModuleGlobalNameUncached(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
#endif

/* ArgTypeTest.proto */
#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
    ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
        __Pyx__ArgTypeTest(obj, type, name, exact))
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);

/* DictGetItem.proto */
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
#define __Pyx_PyObject_Dict_GetItem(obj, name)\
    (likely(PyDict_CheckExact(obj)) ?\
     __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
#else
#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
#define __Pyx_PyObject_Dict_GetItem(obj, name)  PyObject_GetItem(obj, name)
#endif

/* PySequenceContains.proto */
static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
    int result = PySequence_Contains(seq, item);
    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}

/* ExtTypeTest.proto */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);

/* PyDictContains.proto */
static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) {
    int result = PyDict_Contains(dict, item);
    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}

/* GetItemInt.proto */
#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
    (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
               __Pyx_GetItemInt_Generic(o, to_py_func(i))))
#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
                                                     int is_list, int wraparound, int boundscheck);

/* ListAppend.proto */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
        Py_INCREF(x);
        PyList_SET_ITEM(list, len, x);
        Py_SIZE(list) = len+1;
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif

/* PyObjectGetMethod.proto */
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);

/* PyObjectCallMethod1.proto */
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);

/* append.proto */
static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x);

/* PyObjectCallNoArg.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
#else
#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
#endif

/* ListCompAppend.proto */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len)) {
        Py_INCREF(x);
        PyList_SET_ITEM(list, len, x);
        Py_SIZE(list) = len+1;
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
#endif

/* IterFinish.proto */
static CYTHON_INLINE int __Pyx_IterFinish(void);

/* PyObjectCallMethod0.proto */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);

/* RaiseNeedMoreValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

/* RaiseTooManyValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

/* UnpackItemEndCheck.proto */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);

/* RaiseNoneIterError.proto */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);

/* UnpackTupleError.proto */
static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index);

/* UnpackTuple2.proto */
#define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\
    (likely(is_tuple || PyTuple_Check(tuple)) ?\
        (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\
            __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\
            (__Pyx_UnpackTupleError(tuple, 2), -1)) :\
        __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple))
static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
    PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple);
static int __Pyx_unpack_tuple2_generic(
    PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple);

/* dict_iter.proto */
static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name,
                                                   Py_ssize_t* p_orig_length, int* p_is_dict);
static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos,
                                              PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict);

/* ObjectGetItem.proto */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
#else
#define __Pyx_PyObject_GetItem(obj, key)  PyObject_GetItem(obj, key)
#endif

/* py_abs.proto */
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject *__Pyx_PyLong_AbsNeg(PyObject *num);
#define __Pyx_PyNumber_Absolute(x)\
    ((likely(PyLong_CheckExact(x))) ?\
         (likely(Py_SIZE(x) >= 0) ? (Py_INCREF(x), (x)) : __Pyx_PyLong_AbsNeg(x)) :\
         PyNumber_Absolute(x))
#else
#define __Pyx_PyNumber_Absolute(x)  PyNumber_Absolute(x)
#endif

/* FetchCommonType.proto */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);

/* CythonFunction.proto */
#define __Pyx_CyFunction_USED 1
#define __Pyx_CYFUNCTION_STATICMETHOD  0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD   0x02
#define __Pyx_CYFUNCTION_CCLASS        0x04
#define __Pyx_CyFunction_GetClosure(f)\
    (((__pyx_CyFunctionObject *) (f))->func_closure)
#define __Pyx_CyFunction_GetClassObj(f)\
    (((__pyx_CyFunctionObject *) (f))->func_classobj)
#define __Pyx_CyFunction_Defaults(type, f)\
    ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
    ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
typedef struct {
    PyCFunctionObject func;
#if PY_VERSION_HEX < 0x030500A0
    PyObject *func_weakreflist;
#endif
    PyObject *func_dict;
    PyObject *func_name;
    PyObject *func_qualname;
    PyObject *func_doc;
    PyObject *func_globals;
    PyObject *func_code;
    PyObject *func_closure;
    PyObject *func_classobj;
    void *defaults;
    int defaults_pyobjects;
    int flags;
    PyObject *defaults_tuple;
    PyObject *defaults_kwdict;
    PyObject *(*defaults_getter)(PyObject *);
    PyObject *func_annotations;
} __pyx_CyFunctionObject;
static PyTypeObject *__pyx_CyFunctionType = 0;
#define __Pyx_CyFunction_Check(obj)  (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\
    __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *self,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
                                                         size_t size,
                                                         int pyobjects);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
                                                            PyObject *tuple);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
                                                             PyObject *dict);
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
                                                              PyObject *dict);
static int __pyx_CyFunction_init(void);

/* IncludeStringH.proto */
#include <string.h>

/* BytesEquals.proto */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);

/* UnicodeEquals.proto */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);

/* PyIntCompare.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, long intval, long inplace);

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_RemainderObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyInt_RemainderObjC(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceRemainder(op1, op2) : PyNumber_Remainder(op1, op2))
#endif

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_FloorDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyInt_FloorDivideObjC(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceFloorDivide(op1, op2) : PyNumber_FloorDivide(op1, op2))
#endif

/* None.proto */
static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);

/* UnpackUnboundCMethod.proto */
typedef struct {
    PyObject *type;
    PyObject **method_name;
    PyCFunction func;
    PyObject *method;
    int flag;
} __Pyx_CachedCFunction;

/* CallUnboundCMethod1.proto */
static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
#else
#define __Pyx_CallUnboundCMethod1(cfunc, self, arg)  __Pyx__CallUnboundCMethod1(cfunc, self, arg)
#endif

/* IncludeCppStringH.proto */
#include <string>

/* decode_c_string_utf16.proto */
static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
    int byteorder = 0;
    return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
}
static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
    int byteorder = -1;
    return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
}
static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
    int byteorder = 1;
    return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
}

/* decode_c_bytes.proto */
static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
         const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));

/* decode_cpp_string.proto */
static CYTHON_INLINE PyObject* __Pyx_decode_cpp_string(
         std::string cppstring, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
    return __Pyx_decode_c_bytes(
        cppstring.data(), cppstring.size(), start, stop, encoding, errors, decode_func);
}

/* PyIntCompare.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace);

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#endif

/* decode_bytes.proto */
static CYTHON_INLINE PyObject* __Pyx_decode_bytes(
         PyObject* string, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
    return __Pyx_decode_c_bytes(
        PyBytes_AS_STRING(string), PyBytes_GET_SIZE(string),
        start, stop, encoding, errors, decode_func);
}

/* PyObjectFormatAndDecref.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f);
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f);

/* JoinPyUnicode.proto */
static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      Py_UCS4 max_char);

/* PyObjectSetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
#else
#define __Pyx_PyObject_DelAttrStr(o,n)   PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif

/* StringJoin.proto */
#if PY_MAJOR_VERSION < 3
#define __Pyx_PyString_Join __Pyx_PyBytes_Join
#define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v))
#else
#define __Pyx_PyString_Join PyUnicode_Join
#define __Pyx_PyBaseString_Join PyUnicode_Join
#endif
#if CYTHON_COMPILING_IN_CPYTHON
    #if PY_MAJOR_VERSION < 3
    #define __Pyx_PyBytes_Join _PyString_Join
    #else
    #define __Pyx_PyBytes_Join _PyBytes_Join
    #endif
#else
static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);
#endif

/* FastTypeChecks.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
#else
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
#endif
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)

/* SwapException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSwap(type, value, tb)  __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
#endif

/* None.proto */
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);

/* PyObjectLookupSpecial.proto */
#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) {
    PyObject *res;
    PyTypeObject *tp = Py_TYPE(obj);
#if PY_MAJOR_VERSION < 3
    if (unlikely(PyInstance_Check(obj)))
        return __Pyx_PyObject_GetAttrStr(obj, attr_name);
#endif
    res = _PyType_Lookup(tp, attr_name);
    if (likely(res)) {
        descrgetfunc f = Py_TYPE(res)->tp_descr_get;
        if (!f) {
            Py_INCREF(res);
        } else {
            res = f(res, obj, (PyObject *)tp);
        }
    } else {
        PyErr_SetObject(PyExc_AttributeError, attr_name);
    }
    return res;
}
#else
#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
#endif

/* CallNextTpTraverse.proto */
static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse);

/* CallNextTpClear.proto */
static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc);

/* PyObject_GenericGetAttrNoDict.proto */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
#endif

/* PyObject_GenericGetAttr.proto */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
#endif

/* SetupReduce.proto */
static int __Pyx_setup_reduce(PyObject* type_obj);

/* SetVTable.proto */
static int __Pyx_SetVtable(PyObject *dict, void *vtable);

/* TypeImport.proto */
#ifndef __PYX_HAVE_RT_ImportType_proto
#define __PYX_HAVE_RT_ImportType_proto
enum __Pyx_ImportType_CheckSize {
   __Pyx_ImportType_CheckSize_Error = 0,
   __Pyx_ImportType_CheckSize_Warn = 1,
   __Pyx_ImportType_CheckSize_Ignore = 2
};
static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
#endif

/* CalculateMetaclass.proto */
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);

/* Py3ClassCreate.proto */
static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
                                           PyObject *mkw, PyObject *modname, PyObject *doc);
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
                                      PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);

/* SetNameInClass.proto */
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
#define __Pyx_SetNameInClass(ns, name, value)\
    (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
#elif CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_SetNameInClass(ns, name, value)\
    (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
#else
#define __Pyx_SetNameInClass(ns, name, value)  PyObject_SetItem(ns, name, value)
#endif

/* ClassMethod.proto */
#include "descrobject.h"
static CYTHON_UNUSED PyObject* __Pyx_Method_ClassMethod(PyObject *method);

/* GetNameInClass.proto */
#define __Pyx_GetNameInClass(var, nmspace, name)  (var) = __Pyx__GetNameInClass(nmspace, name)
static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name);

/* CLineInTraceback.proto */
#ifdef CYTHON_CLINE_IN_TRACEBACK
#define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
#else
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
#endif

/* CodeObjectCache.proto */
typedef struct {
    PyCodeObject* code_object;
    int code_line;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
    int count;
    int max_count;
    __Pyx_CodeObjectCacheEntry* entries;
};
static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
static PyCodeObject *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);

/* AddTraceback.proto */
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename);

/* None.proto */
#include <new>

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type(enum  arrow::Type::type value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____arrow_3a__3a_UnionMode_3a__3a_type(enum  arrow::UnionMode::type value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value);

/* CppExceptionConversion.proto */
#ifndef __Pyx_CppExn2PyErr
#include <new>
#include <typeinfo>
#include <stdexcept>
#include <ios>
static void __Pyx_CppExn2PyErr() {
  try {
    if (PyErr_Occurred())
      ; // let the latest Python exn pass through and ignore the current one
    else
      throw;
  } catch (const std::bad_alloc& exn) {
    PyErr_SetString(PyExc_MemoryError, exn.what());
  } catch (const std::bad_cast& exn) {
    PyErr_SetString(PyExc_TypeError, exn.what());
  } catch (const std::bad_typeid& exn) {
    PyErr_SetString(PyExc_TypeError, exn.what());
  } catch (const std::domain_error& exn) {
    PyErr_SetString(PyExc_ValueError, exn.what());
  } catch (const std::invalid_argument& exn) {
    PyErr_SetString(PyExc_ValueError, exn.what());
  } catch (const std::ios_base::failure& exn) {
    PyErr_SetString(PyExc_IOError, exn.what());
  } catch (const std::out_of_range& exn) {
    PyErr_SetString(PyExc_IndexError, exn.what());
  } catch (const std::overflow_error& exn) {
    PyErr_SetString(PyExc_OverflowError, exn.what());
  } catch (const std::range_error& exn) {
    PyErr_SetString(PyExc_ArithmeticError, exn.what());
  } catch (const std::underflow_error& exn) {
    PyErr_SetString(PyExc_ArithmeticError, exn.what());
  } catch (const std::exception& exn) {
    PyErr_SetString(PyExc_RuntimeError, exn.what());
  }
  catch (...)
  {
    PyErr_SetString(PyExc_RuntimeError, "Unknown exception");
  }
}
#endif

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int8_t(int8_t value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type(enum  arrow::TimeUnit::type value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int16_t(int16_t value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);

/* None.proto */
static CYTHON_INLINE int __Pyx_ErrOccurredWithGIL(void); /* proto */

/* CIntFromPy.proto */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE enum  arrow::Type::type __Pyx_PyInt_As_enum____arrow_3a__3a_Type_3a__3a_type(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE int32_t __Pyx_PyInt_As_int32_t(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE int8_t __Pyx_PyInt_As_int8_t(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE int16_t __Pyx_PyInt_As_int16_t(PyObject *);

/* CoroutineBase.proto */
typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *);
#if CYTHON_USE_EXC_INFO_STACK
#define __Pyx_ExcInfoStruct  _PyErr_StackItem
#else
typedef struct {
    PyObject *exc_type;
    PyObject *exc_value;
    PyObject *exc_traceback;
} __Pyx_ExcInfoStruct;
#endif
typedef struct {
    PyObject_HEAD
    __pyx_coroutine_body_t body;
    PyObject *closure;
    __Pyx_ExcInfoStruct gi_exc_state;
    PyObject *gi_weakreflist;
    PyObject *classobj;
    PyObject *yieldfrom;
    PyObject *gi_name;
    PyObject *gi_qualname;
    PyObject *gi_modulename;
    PyObject *gi_code;
    int resume_label;
    char is_running;
} __pyx_CoroutineObject;
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
    PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
    PyObject *name, PyObject *qualname, PyObject *module_name);
static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name);
static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self);
static int __Pyx_Coroutine_clear(PyObject *self);
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value);
static PyObject *__Pyx_Coroutine_Close(PyObject *self);
static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
#if CYTHON_USE_EXC_INFO_STACK
#define __Pyx_Coroutine_SwapException(self)
#define __Pyx_Coroutine_ResetAndClearException(self)  __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state)
#else
#define __Pyx_Coroutine_SwapException(self) {\
    __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\
    __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\
    }
#define __Pyx_Coroutine_ResetAndClearException(self) {\
    __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\
    (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\
    }
#endif
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
    __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue)
#else
#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue)
#endif
static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state);

/* PatchModuleWithCoroutine.proto */
static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code);

/* PatchGeneratorABC.proto */
static int __Pyx_patch_abc(void);

/* Generator.proto */
#define __Pyx_Generator_USED
static PyTypeObject *__pyx_GeneratorType = 0;
#define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
#define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\
    __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name)
static PyObject *__Pyx_Generator_Next(PyObject *self);
static int __pyx_Generator_init(void);

/* CheckBinaryVersion.proto */
static int __Pyx_check_binary_version(void);

/* FunctionExport.proto */
static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig);

/* InitStrings.proto */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);

static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim__import_pandas(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, int __pyx_v_raise_); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim__check_import(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, struct __pyx_opt_args_7pyarrow_3lib_14_PandasAPIShim__check_import *__pyx_optional_args); /* proto*/
static CYTHON_INLINE int __pyx_f_7pyarrow_3lib_14_PandasAPIShim__have_pandas_internal(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim_infer_dtype(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim_pandas_dtype(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_dtype, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_array_like(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_categorical(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_datetimetz(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_sparse(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_data_frame(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_series(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_index(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim_get_values(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_7pyarrow_3lib_10MemoryPool_init(struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_self,  arrow::MemoryPool *__pyx_v_pool); /* proto*/
static void __pyx_f_7pyarrow_3lib_8DataType_init(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type); /* proto*/
static struct __pyx_obj_7pyarrow_3lib_Field *__pyx_f_7pyarrow_3lib_8DataType_child(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self, int __pyx_v_i); /* proto*/
static void __pyx_f_7pyarrow_3lib_14DictionaryType_init(struct __pyx_obj_7pyarrow_3lib_DictionaryType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type); /* proto*/
static void __pyx_f_7pyarrow_3lib_8ListType_init(struct __pyx_obj_7pyarrow_3lib_ListType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type); /* proto*/
static void __pyx_f_7pyarrow_3lib_13LargeListType_init(struct __pyx_obj_7pyarrow_3lib_LargeListType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type); /* proto*/
static void __pyx_f_7pyarrow_3lib_7MapType_init(struct __pyx_obj_7pyarrow_3lib_MapType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type); /* proto*/
static void __pyx_f_7pyarrow_3lib_17FixedSizeListType_init(struct __pyx_obj_7pyarrow_3lib_FixedSizeListType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type); /* proto*/
static void __pyx_f_7pyarrow_3lib_10StructType_init(struct __pyx_obj_7pyarrow_3lib_StructType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type); /* proto*/
static struct __pyx_obj_7pyarrow_3lib_Field *__pyx_f_7pyarrow_3lib_10StructType_field(struct __pyx_obj_7pyarrow_3lib_StructType *__pyx_v_self, int __pyx_v_i); /* proto*/
static struct __pyx_obj_7pyarrow_3lib_Field *__pyx_f_7pyarrow_3lib_10StructType_field_by_name(struct __pyx_obj_7pyarrow_3lib_StructType *__pyx_v_self, PyObject *__pyx_v_name); /* proto*/
static void __pyx_f_7pyarrow_3lib_9UnionType_init(struct __pyx_obj_7pyarrow_3lib_UnionType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type); /* proto*/
static void __pyx_f_7pyarrow_3lib_13TimestampType_init(struct __pyx_obj_7pyarrow_3lib_TimestampType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type); /* proto*/
static void __pyx_f_7pyarrow_3lib_10Time32Type_init(struct __pyx_obj_7pyarrow_3lib_Time32Type *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type); /* proto*/
static void __pyx_f_7pyarrow_3lib_10Time64Type_init(struct __pyx_obj_7pyarrow_3lib_Time64Type *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type); /* proto*/
static void __pyx_f_7pyarrow_3lib_12DurationType_init(struct __pyx_obj_7pyarrow_3lib_DurationType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type); /* proto*/
static void __pyx_f_7pyarrow_3lib_19FixedSizeBinaryType_init(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type); /* proto*/
static void __pyx_f_7pyarrow_3lib_14Decimal128Type_init(struct __pyx_obj_7pyarrow_3lib_Decimal128Type *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type); /* proto*/
static void __pyx_f_7pyarrow_3lib_17BaseExtensionType_init(struct __pyx_obj_7pyarrow_3lib_BaseExtensionType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type); /* proto*/
static void __pyx_f_7pyarrow_3lib_13ExtensionType_init(struct __pyx_obj_7pyarrow_3lib_ExtensionType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type); /* proto*/
static void __pyx_f_7pyarrow_3lib_5Field_init(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self, std::shared_ptr< arrow::Field>  const &__pyx_v_field); /* proto*/
static void __pyx_f_7pyarrow_3lib_6Schema_init(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, std::vector<std::shared_ptr< arrow::Field> >  const &__pyx_v_fields); /* proto*/
static void __pyx_f_7pyarrow_3lib_6Schema_init_schema(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, std::shared_ptr< arrow::Schema>  const &__pyx_v_schema); /* proto*/
static void __pyx_f_7pyarrow_3lib_10ArrayValue_init(struct __pyx_obj_7pyarrow_3lib_ArrayValue *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_type, std::shared_ptr< arrow::Array>  const &__pyx_v_sp_array, int64_t __pyx_v_index); /* proto*/
static void __pyx_f_7pyarrow_3lib_10ArrayValue__set_array(struct __pyx_obj_7pyarrow_3lib_ArrayValue *__pyx_v_self, std::shared_ptr< arrow::Array>  const &__pyx_v_sp_array); /* proto*/
static void __pyx_f_7pyarrow_3lib_9ListValue__set_array(struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self, std::shared_ptr< arrow::Array>  const &__pyx_v_sp_array); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_9ListValue_getitem(struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self, int64_t __pyx_v_i); /* proto*/
static int64_t __pyx_f_7pyarrow_3lib_9ListValue_length(struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self); /* proto*/
static void __pyx_f_7pyarrow_3lib_14LargeListValue__set_array(struct __pyx_obj_7pyarrow_3lib_LargeListValue *__pyx_v_self, std::shared_ptr< arrow::Array>  const &__pyx_v_sp_array); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_14LargeListValue_getitem(struct __pyx_obj_7pyarrow_3lib_LargeListValue *__pyx_v_self, int64_t __pyx_v_i); /* proto*/
static int64_t __pyx_f_7pyarrow_3lib_14LargeListValue_length(struct __pyx_obj_7pyarrow_3lib_LargeListValue *__pyx_v_self); /* proto*/
static void __pyx_f_7pyarrow_3lib_8MapValue__set_array(struct __pyx_obj_7pyarrow_3lib_MapValue *__pyx_v_self, std::shared_ptr< arrow::Array>  const &__pyx_v_sp_array); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_8MapValue_getitem(struct __pyx_obj_7pyarrow_3lib_MapValue *__pyx_v_self, int64_t __pyx_v_i); /* proto*/
static int64_t __pyx_f_7pyarrow_3lib_8MapValue_length(struct __pyx_obj_7pyarrow_3lib_MapValue *__pyx_v_self); /* proto*/
static void __pyx_f_7pyarrow_3lib_18FixedSizeListValue__set_array(struct __pyx_obj_7pyarrow_3lib_FixedSizeListValue *__pyx_v_self, std::shared_ptr< arrow::Array>  const &__pyx_v_sp_array); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_18FixedSizeListValue_getitem(struct __pyx_obj_7pyarrow_3lib_FixedSizeListValue *__pyx_v_self, int64_t __pyx_v_i); /* proto*/
static int64_t __pyx_f_7pyarrow_3lib_18FixedSizeListValue_length(struct __pyx_obj_7pyarrow_3lib_FixedSizeListValue *__pyx_v_self); /* proto*/
static void __pyx_f_7pyarrow_3lib_10UnionValue__set_array(struct __pyx_obj_7pyarrow_3lib_UnionValue *__pyx_v_self, std::shared_ptr< arrow::Array>  const &__pyx_v_sp_array); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_10UnionValue_getitem(struct __pyx_obj_7pyarrow_3lib_UnionValue *__pyx_v_self, int64_t __pyx_v_i); /* proto*/
static void __pyx_f_7pyarrow_3lib_11StructValue__set_array(struct __pyx_obj_7pyarrow_3lib_StructValue *__pyx_v_self, std::shared_ptr< arrow::Array>  const &__pyx_v_sp_array); /* proto*/
static void __pyx_f_7pyarrow_3lib_11ScalarValue_init(struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self, std::shared_ptr< arrow::Scalar>  const &__pyx_v_sp_scalar); /* proto*/
static void __pyx_f_7pyarrow_3lib_5Array_init(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, std::shared_ptr< arrow::Array>  const &__pyx_v_sp_array); /* proto*/
static int64_t __pyx_f_7pyarrow_3lib_5Array_length(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_5Array_getitem(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, int64_t __pyx_v_i); /* proto*/
static void __pyx_f_7pyarrow_3lib_12ChunkedArray_init(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, std::shared_ptr< arrow::ChunkedArray>  const &__pyx_v_chunked_array); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_12ChunkedArray_getitem(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, int64_t __pyx_v_i); /* proto*/
static void __pyx_f_7pyarrow_3lib_11RecordBatch_init(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self, std::shared_ptr< arrow::RecordBatch>  const &__pyx_v_batch); /* proto*/
static void __pyx_f_7pyarrow_3lib_5Table_init(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, std::shared_ptr< arrow::Table>  const &__pyx_v_table); /* proto*/
static void __pyx_f_7pyarrow_3lib_6Tensor_init(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self, std::shared_ptr< arrow::Tensor>  const &__pyx_v_sp_tensor); /* proto*/
static void __pyx_f_7pyarrow_3lib_15SparseCOOTensor_init(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *__pyx_v_self, std::shared_ptr< arrow::SparseCOOTensor>  const &__pyx_v_sp_sparse_tensor); /* proto*/
static void __pyx_f_7pyarrow_3lib_15SparseCSRMatrix_init(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *__pyx_v_self, std::shared_ptr< arrow::SparseCSRMatrix>  const &__pyx_v_sp_sparse_tensor); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_11CastOptions_wrap( arrow::compute::CastOptions __pyx_v_options); /* proto*/
static CYTHON_INLINE  arrow::compute::CastOptions __pyx_f_7pyarrow_3lib_11CastOptions_unwrap(struct __pyx_obj_7pyarrow_3lib_CastOptions *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_10NativeFile_set_random_access_file(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, std::shared_ptr< arrow::io::RandomAccessFile>  __pyx_v_handle); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_10NativeFile_set_input_stream(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, std::shared_ptr< arrow::io::InputStream>  __pyx_v_handle); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_10NativeFile_set_output_stream(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, std::shared_ptr< arrow::io::OutputStream>  __pyx_v_handle); /* proto*/
static std::shared_ptr< arrow::io::RandomAccessFile>  __pyx_f_7pyarrow_3lib_10NativeFile_get_random_access_file(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto*/
static std::shared_ptr< arrow::io::InputStream>  __pyx_f_7pyarrow_3lib_10NativeFile_get_input_stream(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto*/
static std::shared_ptr< arrow::io::OutputStream>  __pyx_f_7pyarrow_3lib_10NativeFile_get_output_stream(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_6OSFile__open_readable(struct __pyx_obj_7pyarrow_3lib_OSFile *__pyx_v_self, std::string __pyx_v_path,  arrow::MemoryPool *__pyx_v_pool); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_6OSFile__open_writable(struct __pyx_obj_7pyarrow_3lib_OSFile *__pyx_v_self, std::string __pyx_v_path); /* proto*/
static void __pyx_f_7pyarrow_3lib_6Buffer_init(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, std::shared_ptr< arrow::Buffer>  const &__pyx_v_buffer); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_6Buffer_getitem(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, int64_t __pyx_v_i); /* proto*/
static void __pyx_f_7pyarrow_3lib_15ResizableBuffer_init_rz(struct __pyx_obj_7pyarrow_3lib_ResizableBuffer *__pyx_v_self, std::shared_ptr< arrow::ResizableBuffer>  const &__pyx_v_buffer); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_16HadoopFileSystem__ensure_client(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_16HadoopFileSystem__path_info(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, arrow::io::HdfsPathInfo *__pyx_v_info); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_18SerializedPyObject__write_to(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self,  arrow::io::OutputStream *__pyx_v_stream); /* proto*/

/* Module declarations from 'cpython.version' */

/* Module declarations from '__builtin__' */

/* Module declarations from 'cpython.type' */
static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;

/* Module declarations from 'libc.string' */

/* Module declarations from 'libc.stdio' */

/* Module declarations from 'cpython.object' */

/* Module declarations from 'cpython.ref' */

/* Module declarations from 'cpython.exc' */

/* Module declarations from 'cpython.module' */

/* Module declarations from 'cpython.mem' */

/* Module declarations from 'cpython.tuple' */

/* Module declarations from 'cpython.list' */

/* Module declarations from 'cpython.sequence' */

/* Module declarations from 'cpython.mapping' */

/* Module declarations from 'cpython.iterator' */

/* Module declarations from 'cpython.number' */

/* Module declarations from 'cpython.int' */

/* Module declarations from '__builtin__' */

/* Module declarations from 'cpython.bool' */
static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;

/* Module declarations from 'cpython.long' */

/* Module declarations from 'cpython.float' */

/* Module declarations from '__builtin__' */

/* Module declarations from 'cpython.complex' */
static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0;

/* Module declarations from 'cpython.string' */

/* Module declarations from 'cpython.unicode' */

/* Module declarations from 'cpython.dict' */

/* Module declarations from 'cpython.instance' */

/* Module declarations from 'cpython.function' */

/* Module declarations from 'cpython.method' */

/* Module declarations from 'cpython.weakref' */

/* Module declarations from 'cpython.getargs' */

/* Module declarations from 'cpython.pythread' */

/* Module declarations from 'cpython.pystate' */

/* Module declarations from 'cpython.cobject' */

/* Module declarations from 'cpython.oldbuffer' */

/* Module declarations from 'cpython.set' */

/* Module declarations from 'cpython.buffer' */

/* Module declarations from 'cpython.bytes' */

/* Module declarations from 'cpython.pycapsule' */

/* Module declarations from 'cpython' */

/* Module declarations from 'libcpp' */

/* Module declarations from 'libcpp.cast' */

/* Module declarations from 'libc.stdint' */

/* Module declarations from 'libcpp.memory' */

/* Module declarations from 'libcpp.string' */

/* Module declarations from 'libcpp.utility' */

/* Module declarations from 'libcpp.vector' */

/* Module declarations from 'libcpp.unordered_map' */

/* Module declarations from 'libcpp.unordered_set' */

/* Module declarations from 'datetime' */

/* Module declarations from 'cpython.datetime' */
static PyTypeObject *__pyx_ptype_7cpython_8datetime_date = 0;
static PyTypeObject *__pyx_ptype_7cpython_8datetime_time = 0;
static PyTypeObject *__pyx_ptype_7cpython_8datetime_datetime = 0;
static PyTypeObject *__pyx_ptype_7cpython_8datetime_timedelta = 0;
static PyTypeObject *__pyx_ptype_7cpython_8datetime_tzinfo = 0;

/* Module declarations from 'pyarrow.includes.common' */
static CYTHON_INLINE PyObject *__pyx_f_7pyarrow_8includes_6common_PyObject_to_object(PyObject *); /*proto*/

/* Module declarations from 'pyarrow.includes.libarrow' */

/* Module declarations from 'libc.stdlib' */

/* Module declarations from 'pyarrow.lib' */
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Message = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_MemoryPool = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_DataType = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_ListType = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_LargeListType = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_MapType = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_FixedSizeListType = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_StructType = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_DictionaryMemo = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_DictionaryType = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_TimestampType = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Time32Type = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Time64Type = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_DurationType = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_FixedSizeBinaryType = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Decimal128Type = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_BaseExtensionType = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_ExtensionType = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_PyExtensionType = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Field = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Schema = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Scalar = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_NAType = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_ArrayValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_ScalarValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Int8Value = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Int64Value = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_ListValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_LargeListValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_MapValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_FixedSizeListValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_StructValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_UnionValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_StringValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_FixedSizeBinaryValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib__PandasConvertible = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Array = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Tensor = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_SparseCSRMatrix = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_SparseCOOTensor = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_NullArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_BooleanArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_NumericArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_IntegerArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_FloatingPointArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Int8Array = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_UInt8Array = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Int16Array = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_UInt16Array = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Int32Array = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_UInt32Array = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Int64Array = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_UInt64Array = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_HalfFloatArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_FloatArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_DoubleArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_FixedSizeBinaryArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Decimal128Array = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_StructArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_ListArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_LargeListArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_MapArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_FixedSizeListArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_UnionArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_StringArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_BinaryArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_DictionaryArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_ExtensionArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_ChunkedArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Table = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_RecordBatch = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Buffer = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_ResizableBuffer = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_NativeFile = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_BufferedInputStream = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_BufferedOutputStream = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_CompressedInputStream = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_CompressedOutputStream = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib__CRecordBatchWriter = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib__CRecordBatchReader = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_CastOptions = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib__PandasAPIShim = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_LoggingMemoryPool = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_ProxyMemoryPool = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_UnionType = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_UnknownExtensionType = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib__ExtensionRegistryNanny = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_NullType = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_BooleanValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_UInt8Value = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Int16Value = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_UInt16Value = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Int32Value = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_UInt32Value = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_UInt64Value = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Date32Value = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Date64Value = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Time32Value = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Time64Value = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_TimestampValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_DurationValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_HalfFloatValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_FloatValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_DoubleValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_DecimalValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_LargeStringValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_BinaryValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_LargeBinaryValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_DictionaryValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_UInt8Scalar = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Int8Scalar = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_UInt16Scalar = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Int16Scalar = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_UInt32Scalar = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Int32Scalar = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_UInt64Scalar = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Int64Scalar = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_FloatScalar = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_DoubleScalar = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib__FunctionContext = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Date32Array = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Date64Array = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_TimestampArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Time32Array = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Time64Array = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_DurationArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_LargeStringArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_LargeBinaryArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_StringBuilder = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_PythonFile = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_MemoryMappedFile = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_OSFile = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_FixedSizeBufferWriter = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_BufferOutputStream = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_MockOutputStream = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_BufferReader = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_HadoopFileSystem = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib__HdfsFileNanny = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_HdfsFile = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_MessageReader = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib__RecordBatchStreamWriter = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib__RecordBatchStreamReader = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib__RecordBatchFileWriter = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib__RecordBatchFileReader = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_FeatherWriter = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_FeatherReader = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_SerializationContext = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_SerializedPyObject = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct____iter__ = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_1___iter__ = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_2___iter__ = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_5___iter__ = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_6___iter__ = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_7___iter__ = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_8___iter__ = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_9___iter__ = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_10___iter__ = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_11_iterchunks = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_12_itercolumns = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_13___get__ = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_14_genexpr = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_15___get__ = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_16_genexpr = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_17_download = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_18_upload = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_19___iter__ = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_20___iter__ = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_22_genexpr = 0;
static struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_7pyarrow_3lib_pandas_api = 0;
static struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_7pyarrow_3lib__default_memory_pool = 0;
static struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *__pyx_v_7pyarrow_3lib__logging_memory_pool = 0;
static PyObject *__pyx_v_7pyarrow_3lib__pandas_type_map = 0;
static PyObject *__pyx_v_7pyarrow_3lib__pep3118_type_map = 0;
static PyObject *__pyx_v_7pyarrow_3lib__type_cache = 0;
static PyObject *__pyx_v_7pyarrow_3lib_PRIMITIVE_TYPES = 0;
static PyObject *__pyx_v_7pyarrow_3lib__timestamp_type_cache = 0;
static PyObject *__pyx_v_7pyarrow_3lib__time_type_cache = 0;
static PyObject *__pyx_v_7pyarrow_3lib__duration_type_cache = 0;
static PyObject *__pyx_v_7pyarrow_3lib__type_aliases = 0;
static PyObject *__pyx_v_7pyarrow_3lib__DATETIME_CONVERSION_FUNCTIONS = 0;
static bool __pyx_v_7pyarrow_3lib__datetime_conversion_initialized;
static PyObject *__pyx_v_7pyarrow_3lib__TIMEDELTA_CONVERSION_FUNCTIONS = 0;
static PyObject *__pyx_v_7pyarrow_3lib__array_value_classes = 0;
static PyObject *__pyx_v_7pyarrow_3lib__scalar_classes = 0;
static struct __pyx_obj_7pyarrow_3lib__FunctionContext *__pyx_v_7pyarrow_3lib__global_ctx = 0;
static PyObject *__pyx_v_7pyarrow_3lib__array_classes = 0;
static  arrow::compute::FunctionContext *__pyx_f_7pyarrow_3lib__context(void); /*proto*/
static int __pyx_f_7pyarrow_3lib_check_status(arrow::Status const &); /*proto*/
static  arrow::MemoryPool *__pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(struct __pyx_obj_7pyarrow_3lib_MemoryPool *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib_wrap_array_output(PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib_wrap_datum( arrow::compute::Datum const &); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib_box_scalar(struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::Array>  const &, int64_t); /*proto*/
static enum  arrow::Compression::type __pyx_f_7pyarrow_3lib__get_compression_type(PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib_get_input_stream(PyObject *, bool, std::shared_ptr< arrow::io::InputStream>  *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib_get_reader(PyObject *, bool, std::shared_ptr< arrow::io::RandomAccessFile>  *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib_get_writer(PyObject *, std::shared_ptr< arrow::io::OutputStream>  *); /*proto*/
static struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_f_7pyarrow_3lib_ensure_type(PyObject *, struct __pyx_opt_args_7pyarrow_3lib_ensure_type *__pyx_optional_args); /*proto*/
static std::shared_ptr< arrow::KeyValueMetadata>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_metadata(PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_metadata(std::shared_ptr< arrow::KeyValueMetadata const >  const &); /*proto*/
__PYX_EXTERN_C PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_scalar(std::shared_ptr< arrow::Scalar>  const &); /*proto*/
__PYX_EXTERN_C PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_array(std::shared_ptr< arrow::Array>  const &); /*proto*/
__PYX_EXTERN_C PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_chunked_array(std::shared_ptr< arrow::ChunkedArray>  const &); /*proto*/
__PYX_EXTERN_C PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_batch(std::shared_ptr< arrow::RecordBatch>  const &); /*proto*/
__PYX_EXTERN_C PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(std::shared_ptr< arrow::Buffer>  const &); /*proto*/
__PYX_EXTERN_C PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(std::shared_ptr< arrow::DataType>  const &); /*proto*/
__PYX_EXTERN_C PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_field(std::shared_ptr< arrow::Field>  const &); /*proto*/
__PYX_EXTERN_C PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_resizable_buffer(std::shared_ptr< arrow::ResizableBuffer>  const &); /*proto*/
__PYX_EXTERN_C PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(std::shared_ptr< arrow::Schema>  const &); /*proto*/
__PYX_EXTERN_C PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_table(std::shared_ptr< arrow::Table>  const &); /*proto*/
__PYX_EXTERN_C PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_tensor(std::shared_ptr< arrow::Tensor>  const &); /*proto*/
__PYX_EXTERN_C PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_sparse_coo_tensor(std::shared_ptr< arrow::SparseCOOTensor>  const &); /*proto*/
__PYX_EXTERN_C PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_sparse_csr_matrix(std::shared_ptr< arrow::SparseCSRMatrix>  const &); /*proto*/
__PYX_EXTERN_C std::shared_ptr< arrow::Scalar>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_scalar(PyObject *); /*proto*/
__PYX_EXTERN_C std::shared_ptr< arrow::Array>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_array(PyObject *); /*proto*/
__PYX_EXTERN_C std::shared_ptr< arrow::RecordBatch>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_batch(PyObject *); /*proto*/
__PYX_EXTERN_C std::shared_ptr< arrow::Buffer>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_buffer(PyObject *); /*proto*/
__PYX_EXTERN_C std::shared_ptr< arrow::DataType>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_data_type(PyObject *); /*proto*/
__PYX_EXTERN_C std::shared_ptr< arrow::Field>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_field(PyObject *); /*proto*/
__PYX_EXTERN_C std::shared_ptr< arrow::Schema>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_schema(PyObject *); /*proto*/
__PYX_EXTERN_C std::shared_ptr< arrow::Table>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_table(PyObject *); /*proto*/
__PYX_EXTERN_C std::shared_ptr< arrow::Tensor>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_tensor(PyObject *); /*proto*/
__PYX_EXTERN_C std::shared_ptr< arrow::SparseCOOTensor>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_sparse_coo_tensor(PyObject *); /*proto*/
__PYX_EXTERN_C std::shared_ptr< arrow::SparseCSRMatrix>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_sparse_csr_matrix(PyObject *); /*proto*/
static int __pyx_f_7pyarrow_3lib_pyarrow_internal_check_status(arrow::Status const &); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib__datatype_to_pep3118( arrow::DataType *); /*proto*/
static struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_f_7pyarrow_3lib_primitive_type(enum  arrow::Type::type); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib_timeunit_to_string(enum  arrow::TimeUnit::type); /*proto*/
static struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_f_7pyarrow_3lib_decimal128(int, int __pyx_skip_dispatch, struct __pyx_opt_args_7pyarrow_3lib_decimal128 *__pyx_optional_args); /*proto*/
static struct __pyx_obj_7pyarrow_3lib_LargeListType *__pyx_f_7pyarrow_3lib_large_list(PyObject *, int __pyx_skip_dispatch); /*proto*/
static struct __pyx_obj_7pyarrow_3lib_MapType *__pyx_f_7pyarrow_3lib_map_(PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7pyarrow_3lib_map_ *__pyx_optional_args); /*proto*/
static struct __pyx_obj_7pyarrow_3lib_DictionaryType *__pyx_f_7pyarrow_3lib_dictionary(PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7pyarrow_3lib_dictionary *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib__box_time_milli(int64_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib__box_time_micro(int64_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib__add_micros_maybe_localize(PyObject *, PyObject *, PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib__datetime_from_seconds(int64_t); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib__sequence_to_array(PyObject *, PyObject *, PyObject *, struct __pyx_obj_7pyarrow_3lib_DataType *,  arrow::MemoryPool *, bool); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_7pyarrow_3lib__is_array_like(PyObject *); /*proto*/
static std::shared_ptr< arrow::DataType>  __pyx_f_7pyarrow_3lib__ndarray_to_type(PyObject *, struct __pyx_obj_7pyarrow_3lib_DataType *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib__ndarray_to_array(PyObject *, PyObject *, struct __pyx_obj_7pyarrow_3lib_DataType *, bool, bool,  arrow::MemoryPool *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib__codes_to_indices(PyObject *, PyObject *, struct __pyx_obj_7pyarrow_3lib_DataType *, struct __pyx_obj_7pyarrow_3lib_MemoryPool *); /*proto*/
static Py_ssize_t __pyx_f_7pyarrow_3lib__normalize_index(Py_ssize_t, Py_ssize_t); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib__append_array_buffers( arrow::ArrayData const *, PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib__reduce_array_data( arrow::ArrayData const *); /*proto*/
static std::shared_ptr< arrow::ArrayData>  __pyx_f_7pyarrow_3lib__reconstruct_array_data(PyObject *); /*proto*/
static arrow::py::PandasOptions __pyx_f_7pyarrow_3lib__convert_pandas_options(PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib__array_like_to_pandas(PyObject *, PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib_get_values(PyObject *, int *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib__schema_from_arrays(PyObject *, PyObject *, PyObject *, std::shared_ptr< arrow::Schema>  *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib__sanitize_arrays(PyObject *, PyObject *, PyObject *, PyObject *, std::shared_ptr< arrow::Schema>  *); /*proto*/
static std::shared_ptr< arrow::ResizableBuffer>  __pyx_f_7pyarrow_3lib__allocate_buffer( arrow::MemoryPool *); /*proto*/
static std::shared_ptr< arrow::Buffer>  __pyx_f_7pyarrow_3lib_as_c_buffer(PyObject *); /*proto*/
static struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_f_7pyarrow_3lib__get_native_file(PyObject *, bool); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib__get_input_stream(PyObject *, std::shared_ptr< arrow::io::InputStream>  *); /*proto*/
static struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_f_7pyarrow_3lib_as_native_file(PyObject *); /*proto*/
static int __pyx_f_7pyarrow_3lib_pyarrow_is_buffer(PyObject *); /*proto*/
static int __pyx_f_7pyarrow_3lib_pyarrow_is_data_type(PyObject *); /*proto*/
static int __pyx_f_7pyarrow_3lib_pyarrow_is_field(PyObject *); /*proto*/
static int __pyx_f_7pyarrow_3lib_pyarrow_is_schema(PyObject *); /*proto*/
static int __pyx_f_7pyarrow_3lib_pyarrow_is_array(PyObject *); /*proto*/
static int __pyx_f_7pyarrow_3lib_pyarrow_is_scalar(PyObject *); /*proto*/
static int __pyx_f_7pyarrow_3lib_pyarrow_is_tensor(PyObject *); /*proto*/
static int __pyx_f_7pyarrow_3lib_pyarrow_is_sparse_coo_tensor(PyObject *); /*proto*/
static int __pyx_f_7pyarrow_3lib_pyarrow_is_sparse_csr_matrix(PyObject *); /*proto*/
static int __pyx_f_7pyarrow_3lib_pyarrow_is_table(PyObject *); /*proto*/
static int __pyx_f_7pyarrow_3lib_pyarrow_is_batch(PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib___pyx_unpickle__PandasAPIShim__set_state(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib___pyx_unpickle_Scalar__set_state(struct __pyx_obj_7pyarrow_3lib_Scalar *, PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib___pyx_unpickle__PandasConvertible__set_state(struct __pyx_obj_7pyarrow_3lib__PandasConvertible *, PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib___pyx_unpickle_SerializationContext__set_state(struct __pyx_obj_7pyarrow_3lib_SerializationContext *, PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_string(std::string const &); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_string(std::string const &); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(std::string const &); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string const &); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string const &); /*proto*/
static std::string __pyx_convert_string_from_py_std__in_string(PyObject *); /*proto*/
static PyObject *__pyx_convert_vector_to_py_int8_t(const std::vector<int8_t>  &); /*proto*/
static std::vector<int8_t>  __pyx_convert_vector_from_py_int8_t(PyObject *); /*proto*/
static std::unordered_set<std::string>  __pyx_convert_unordered_set_from_py_std_3a__3a_string(PyObject *); /*proto*/
static PyObject *__pyx_convert_vector_to_py_std_3a__3a_string(const std::vector<std::string>  &); /*proto*/
static PyObject *__pyx_convert_vector_to_py_int64_t(const std::vector<int64_t>  &); /*proto*/
static std::unordered_map<std::string,std::string>  __pyx_convert_unordered_map_from_py_std_3a__3a_string__and_std_3a__3a_string(PyObject *); /*proto*/
static std::vector<std::string>  __pyx_convert_vector_from_py_std_3a__3a_string(PyObject *); /*proto*/
#define __Pyx_MODULE_NAME "pyarrow.lib"
extern int __pyx_module_is_main_pyarrow__lib;
int __pyx_module_is_main_pyarrow__lib = 0;

/* Implementation of 'pyarrow.lib' */
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_MemoryError;
static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_NotImplementedError;
static PyObject *__pyx_builtin_IndexError;
static PyObject *__pyx_builtin_IOError;
static PyObject *__pyx_builtin_staticmethod;
static PyObject *__pyx_builtin_ImportError;
static PyObject *__pyx_builtin_AttributeError;
static PyObject *__pyx_builtin_NotImplemented;
static PyObject *__pyx_builtin_UserWarning;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_FutureWarning;
static PyObject *__pyx_builtin_super;
static PyObject *__pyx_builtin_zip;
static PyObject *__pyx_builtin_map;
static PyObject *__pyx_builtin_StopIteration;
static PyObject *__pyx_builtin_object;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_open;
static PyObject *__pyx_builtin_BufferError;
static PyObject *__pyx_builtin_SystemError;
static PyObject *__pyx_builtin_EOFError;
static const char __pyx_k_B[] = "B";
static const char __pyx_k_C[] = "C";
static const char __pyx_k_H[] = "H";
static const char __pyx_k_I[] = "I";
static const char __pyx_k_K[] = "K";
static const char __pyx_k_Q[] = "Q";
static const char __pyx_k_T[] = "T";
static const char __pyx_k_b[] = "b";
static const char __pyx_k_c[] = "c";
static const char __pyx_k_d[] = "d";
static const char __pyx_k_e[] = "e";
static const char __pyx_k_f[] = "f";
static const char __pyx_k_h[] = "h";
static const char __pyx_k_i[] = "i";
static const char __pyx_k_k[] = "k";
static const char __pyx_k_m[] = "m";
static const char __pyx_k_n[] = "n";
static const char __pyx_k_o[] = "o";
static const char __pyx_k_q[] = "q";
static const char __pyx_k_r[] = "r";
static const char __pyx_k_s[] = "s";
static const char __pyx_k_v[] = "v";
static const char __pyx_k_w[] = "w";
static const char __pyx_k_x[] = "x";
static const char __pyx_k_NA[] = "NA";
static const char __pyx_k__2[] = "*";
static const char __pyx_k__3[] = "_";
static const char __pyx_k_ab[] = "ab";
static const char __pyx_k_ad[] = "ad";
static const char __pyx_k_df[] = "df";
static const char __pyx_k_dt[] = "dt";
static const char __pyx_k_f2[] = "f2";
static const char __pyx_k_f4[] = "f4";
static const char __pyx_k_f8[] = "f8";
static const char __pyx_k_gz[] = ".gz";
static const char __pyx_k_i1[] = "i1";
static const char __pyx_k_i2[] = "i2";
static const char __pyx_k_i4[] = "i4";
static const char __pyx_k_i8[] = "i8";
static const char __pyx_k_id[] = "id";
static const char __pyx_k_io[] = "io";
static const char __pyx_k_ma[] = "ma";
static const char __pyx_k_ms[] = "ms";
static const char __pyx_k_nf[] = "nf";
static const char __pyx_k_np[] = "np";
static const char __pyx_k_ns[] = "ns";
static const char __pyx_k_os[] = "os";
static const char __pyx_k_pd[] = "pd";
static const char __pyx_k_rb[] = "rb+";
static const char __pyx_k_re[] = "re";
static const char __pyx_k_tb[] = "tb";
static const char __pyx_k_tz[] = "tz";
static const char __pyx_k_u1[] = "u1";
static const char __pyx_k_u2[] = "u2";
static const char __pyx_k_u4[] = "u4";
static const char __pyx_k_u8[] = "u8";
static const char __pyx_k_us[] = "us";
static const char __pyx_k_wb[] = "wb";
static const char __pyx_k_0_1[] = "{0}\n{1}";
static const char __pyx_k_COO[] = "COO";
static const char __pyx_k_PY3[] = "PY3";
static const char __pyx_k__10[] = "=";
static const char __pyx_k__27[] = "+";
static const char __pyx_k__28[] = "-";
static const char __pyx_k_add[] = "add";
static const char __pyx_k_api[] = "api";
static const char __pyx_k_arr[] = "arr";
static const char __pyx_k_buf[] = "buf";
static const char __pyx_k_bz2[] = "bz2";
static const char __pyx_k_cat[] = "cat";
static const char __pyx_k_cls[] = "cls";
static const char __pyx_k_col[] = "col";
static const char __pyx_k_coo[] = "coo";
static const char __pyx_k_csr[] = "csr";
static const char __pyx_k_doc[] = "__doc__";
static const char __pyx_k_get[] = "get";
static const char __pyx_k_key[] = "key";
static const char __pyx_k_lib[] = "lib";
static const char __pyx_k_lz4[] = "lz4";
static const char __pyx_k_map[] = "map";
static const char __pyx_k_mro[] = "__mro__";
static const char __pyx_k_nan[] = "nan";
static const char __pyx_k_new[] = "__new__";
static const char __pyx_k_obj[] = "obj";
static const char __pyx_k_out[] = "out";
static const char __pyx_k_pop[] = "pop";
static const char __pyx_k_pos[] = "pos";
static const char __pyx_k_r_2[] = "r+";
static const char __pyx_k_r_b[] = "r+b";
static const char __pyx_k_ref[] = "ref";
static const char __pyx_k_res[] = "res";
static const char __pyx_k_row[] = "row";
static const char __pyx_k_six[] = "six";
static const char __pyx_k_str[] = "__str__";
static const char __pyx_k_sys[] = "sys";
static const char __pyx_k_typ[] = "typ";
static const char __pyx_k_utc[] = "utc";
static const char __pyx_k_zip[] = "zip";
static const char __pyx_k_zst[] = ".zst";
static const char __pyx_k_0_24[] = "0.24";
static const char __pyx_k_0_25[] = "0.25";
static const char __pyx_k_Full[] = "Full";
static const char __pyx_k_NULL[] = "NULL";
static const char __pyx_k_None[] = "None";
static const char __pyx_k__169[] = ", ";
static const char __pyx_k__198[] = "";
static const char __pyx_k_args[] = "args";
static const char __pyx_k_base[] = "base";
static const char __pyx_k_body[] = "body";
static const char __pyx_k_bool[] = "bool_";
static const char __pyx_k_cast[] = "cast";
static const char __pyx_k_code[] = "code";
static const char __pyx_k_copy[] = "copy";
static const char __pyx_k_core[] = "core";
static const char __pyx_k_data[] = "data";
static const char __pyx_k_date[] = "date";
static const char __pyx_k_days[] = "days";
static const char __pyx_k_dest[] = "dest";
static const char __pyx_k_dict[] = "__dict__";
static const char __pyx_k_exit[] = "__exit__";
static const char __pyx_k_file[] = "file";
static const char __pyx_k_full[] = "full";
static const char __pyx_k_gzip[] = "gzip";
static const char __pyx_k_hint[] = "hint";
static const char __pyx_k_host[] = "host";
static const char __pyx_k_init[] = "__init__";
static const char __pyx_k_int8[] = "int8";
static const char __pyx_k_item[] = "item";
static const char __pyx_k_iter[] = "__iter__";
static const char __pyx_k_join[] = "join";
static const char __pyx_k_json[] = "json";
static const char __pyx_k_keys[] = "keys";
static const char __pyx_k_kind[] = "kind";
static const char __pyx_k_list[] = "list_";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_mask[] = "mask";
static const char __pyx_k_mmap[] = "mmap";
static const char __pyx_k_mode[] = "mode";
static const char __pyx_k_name[] = "name";
static const char __pyx_k_ndim[] = "ndim";
static const char __pyx_k_null[] = "null";
static const char __pyx_k_open[] = "open";
static const char __pyx_k_path[] = "path";
static const char __pyx_k_pool[] = "pool";
static const char __pyx_k_port[] = "port";
static const char __pyx_k_pytz[] = "pytz";
static const char __pyx_k_rb_2[] = "rb";
static const char __pyx_k_read[] = "read";
static const char __pyx_k_repr[] = "__repr__";
static const char __pyx_k_safe[] = "safe";
static const char __pyx_k_seek[] = "seek";
static const char __pyx_k_self[] = "self";
static const char __pyx_k_send[] = "send";
static const char __pyx_k_sign[] = "sign";
static const char __pyx_k_sink[] = "sink";
static const char __pyx_k_size[] = "size";
static const char __pyx_k_step[] = "step";
static const char __pyx_k_stop[] = "stop";
static const char __pyx_k_take[] = "take";
static const char __pyx_k_tell[] = "tell";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_time[] = "time";
static const char __pyx_k_type[] = "type";
static const char __pyx_k_unit[] = "unit";
static const char __pyx_k_user[] = "user";
static const char __pyx_k_utf8[] = "utf8";
static const char __pyx_k_util[] = "util";
static const char __pyx_k_warn[] = "warn";
static const char __pyx_k_zone[] = "zone";
static const char __pyx_k_zstd[] = "zstd";
static const char __pyx_k_Array[] = "Array";
static const char __pyx_k_Empty[] = "Empty";
static const char __pyx_k_Field[] = "Field";
static const char __pyx_k_Index[] = "Index";
static const char __pyx_k_Queue[] = "Queue";
static const char __pyx_k_Table[] = "Table";
static const char __pyx_k_alias[] = "alias";
static const char __pyx_k_array[] = "array";
static const char __pyx_k_as_py[] = "as_py";
static const char __pyx_k_bases[] = "__bases__";
static const char __pyx_k_batch[] = "batch";
static const char __pyx_k_bz2_2[] = ".bz2";
static const char __pyx_k_c_buf[] = "c_buf";
static const char __pyx_k_child[] = "child";
static const char __pyx_k_chunk[] = "chunk";
static const char __pyx_k_class[] = "__class__";
static const char __pyx_k_close[] = "close";
static const char __pyx_k_codec[] = "codec";
static const char __pyx_k_codes[] = "codes";
static const char __pyx_k_count[] = "count";
static const char __pyx_k_cpool[] = "cpool";
static const char __pyx_k_dense[] = "dense";
static const char __pyx_k_dtype[] = "dtype";
static const char __pyx_k_dumps[] = "dumps";
static const char __pyx_k_enter[] = "__enter__";
static const char __pyx_k_field[] = "field";
static const char __pyx_k_flags[] = "flags";
static const char __pyx_k_float[] = "float";
static const char __pyx_k_group[] = "group";
static const char __pyx_k_hours[] = "hours";
static const char __pyx_k_int16[] = "int16";
static const char __pyx_k_int32[] = "int32";
static const char __pyx_k_int64[] = "int64";
static const char __pyx_k_items[] = "items";
static const char __pyx_k_level[] = "level";
static const char __pyx_k_loads[] = "loads";
static const char __pyx_k_lower[] = "lower";
static const char __pyx_k_lz4_2[] = ".lz4";
static const char __pyx_k_map_2[] = "map_";
static const char __pyx_k_match[] = "match";
static const char __pyx_k_names[] = "names";
static const char __pyx_k_numpy[] = "numpy";
static const char __pyx_k_other[] = "other";
static const char __pyx_k_owner[] = "owner";
static const char __pyx_k_pybuf[] = "pybuf";
static const char __pyx_k_pyobj[] = "pyobj";
static const char __pyx_k_qsize[] = "qsize";
static const char __pyx_k_queue[] = "queue";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_scale[] = "scale";
static const char __pyx_k_scipy[] = "scipy";
static const char __pyx_k_shape[] = "shape";
static const char __pyx_k_sleep[] = "sleep";
static const char __pyx_k_slice[] = "slice";
static const char __pyx_k_slots[] = "__slots__";
static const char __pyx_k_start[] = "start";
static const char __pyx_k_str_2[] = "str";
static const char __pyx_k_super[] = "super";
static const char __pyx_k_table[] = "table";
static const char __pyx_k_throw[] = "throw";
static const char __pyx_k_types[] = "types";
static const char __pyx_k_uint8[] = "uint8";
static const char __pyx_k_union[] = "union";
static const char __pyx_k_value[] = "value";
static const char __pyx_k_write[] = "write";
static const char __pyx_k_0_19_0[] = "0.19.0";
static const char __pyx_k_0_20_0[] = "0.20.0";
static const char __pyx_k_0_23_0[] = "0.23.0";
static const char __pyx_k_Buffer[] = "Buffer";
static const char __pyx_k_Detail[] = ". Detail: ";
static const char __pyx_k_IOBase[] = "IOBase";
static const char __pyx_k_NAType[] = "NAType";
static const char __pyx_k_NULL_2[] = "_NULL";
static const char __pyx_k_OSFile[] = "OSFile";
static const char __pyx_k_Scalar[] = "Scalar";
static const char __pyx_k_Schema[] = "Schema";
static const char __pyx_k_Series[] = "Series";
static const char __pyx_k_Tensor[] = "Tensor";
static const char __pyx_k_Thread[] = "Thread";
static const char __pyx_k_append[] = "append";
static const char __pyx_k_arrays[] = "arrays";
static const char __pyx_k_astype[] = "astype";
static const char __pyx_k_atexit[] = "atexit";
static const char __pyx_k_binary[] = "binary";
static const char __pyx_k_bool_2[] = "bool";
static const char __pyx_k_brotli[] = "brotli";
static const char __pyx_k_buffer[] = "buffer";
static const char __pyx_k_c_addr[] = "c_addr";
static const char __pyx_k_c_meta[] = "c_meta";
static const char __pyx_k_c_path[] = "c_path";
static const char __pyx_k_c_size[] = "c_size";
static const char __pyx_k_c_type[] = "c_type";
static const char __pyx_k_chunks[] = "chunks";
static const char __pyx_k_client[] = "client";
static const char __pyx_k_closed[] = "closed";
static const char __pyx_k_column[] = "column";
static const char __pyx_k_common[] = "common";
static const char __pyx_k_compat[] = "compat";
static const char __pyx_k_coords[] = "coords";
static const char __pyx_k_create[] = "create";
static const char __pyx_k_date32[] = "date32";
static const char __pyx_k_date64[] = "date64";
static const char __pyx_k_decode[] = "decode";
static const char __pyx_k_detect[] = "detect";
static const char __pyx_k_double[] = "double";
static const char __pyx_k_driver[] = "driver";
static const char __pyx_k_enable[] = "enable";
static const char __pyx_k_equals[] = "equals";
static const char __pyx_k_exc_tb[] = "exc_tb";
static const char __pyx_k_fields[] = "fields";
static const char __pyx_k_format[] = "format";
static const char __pyx_k_handle[] = "handle";
static const char __pyx_k_hdfs_d[] = "hdfs://(.*):(\\d+)(.*)";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_indent[] = "indent";
static const char __pyx_k_indptr[] = "indptr";
static const char __pyx_k_insert[] = "insert";
static const char __pyx_k_keys_2[] = "_keys";
static const char __pyx_k_length[] = "length";
static const char __pyx_k_micros[] = "micros";
static const char __pyx_k_millis[] = "millis";
static const char __pyx_k_module[] = "__module__";
static const char __pyx_k_name_2[] = "__name__";
static const char __pyx_k_name_3[] = "_name";
static const char __pyx_k_nbytes[] = "nbytes";
static const char __pyx_k_object[] = "object";
static const char __pyx_k_offset[] = "offset";
static const char __pyx_k_open_2[] = "_open";
static const char __pyx_k_pandas[] = "pandas";
static const char __pyx_k_parent[] = "parent";
static const char __pyx_k_pickle[] = "pickle";
static const char __pyx_k_pprint[] = "pprint";
static const char __pyx_k_pytype[] = "_pytype_";
static const char __pyx_k_reader[] = "reader";
static const char __pyx_k_reduce[] = "__reduce__";
static const char __pyx_k_resize[] = "resize";
static const char __pyx_k_result[] = "result";
static const char __pyx_k_schema[] = "schema";
static const char __pyx_k_series[] = "series";
static const char __pyx_k_sizeof[] = "__sizeof__";
static const char __pyx_k_skipna[] = "skipna";
static const char __pyx_k_snappy[] = "snappy";
static const char __pyx_k_source[] = "source";
static const char __pyx_k_sparse[] = "sparse";
static const char __pyx_k_stream[] = "stream";
static const char __pyx_k_string[] = "string";
static const char __pyx_k_struct[] = "struct";
static const char __pyx_k_tables[] = "tables";
static const char __pyx_k_target[] = "target";
static const char __pyx_k_tensor[] = "tensor";
static const char __pyx_k_time32[] = "time32";
static const char __pyx_k_time64[] = "time64";
static const char __pyx_k_type_2[] = "type ";
static const char __pyx_k_type_3[] = "type_";
static const char __pyx_k_type_4[] = "_type";
static const char __pyx_k_tzinfo[] = "tzinfo";
static const char __pyx_k_uint16[] = "uint16";
static const char __pyx_k_uint32[] = "uint32";
static const char __pyx_k_uint64[] = "uint64";
static const char __pyx_k_unsafe[] = "unsafe";
static const char __pyx_k_update[] = "update";
static const char __pyx_k_upload[] = "upload";
static const char __pyx_k_values[] = "values";
static const char __pyx_k_vstack[] = "vstack";
static const char __pyx_k_whence[] = "whence";
static const char __pyx_k_window[] = "window";
static const char __pyx_k_02d_02d[] = "{}{:02d}:{:02d}";
static const char __pyx_k_Decimal[] = "Decimal";
static const char __pyx_k_IOError[] = "IOError";
static const char __pyx_k_MapType[] = "MapType";
static const char __pyx_k_Mapping[] = "Mapping";
static const char __pyx_k_Message[] = "Message";
static const char __pyx_k_Type_ID[] = "Type ID ";
static const char __pyx_k_Type_NA[] = "Type_NA";
static const char __pyx_k_address[] = "address";
static const char __pyx_k_array_2[] = "__array__";
static const char __pyx_k_asarray[] = "asarray";
static const char __pyx_k_asbytes[] = "asbytes";
static const char __pyx_k_batches[] = "batches";
static const char __pyx_k_boolean[] = "boolean";
static const char __pyx_k_buffers[] = "buffers";
static const char __pyx_k_c_array[] = "c_array";
static const char __pyx_k_c_codec[] = "c_codec";
static const char __pyx_k_c_names[] = "c_names";
static const char __pyx_k_c_shape[] = "c_shape";
static const char __pyx_k_c_table[] = "c_table";
static const char __pyx_k_cleanup[] = "cleanup";
static const char __pyx_k_columns[] = "columns";
static const char __pyx_k_compile[] = "compile";
static const char __pyx_k_connect[] = "connect";
static const char __pyx_k_context[] = "context";
static const char __pyx_k_ctensor[] = "ctensor";
static const char __pyx_k_decimal[] = "decimal";
static const char __pyx_k_exc_val[] = "exc_val";
static const char __pyx_k_field_2[] = "_field";
static const char __pyx_k_field_3[] = "field_";
static const char __pyx_k_flatten[] = "flatten";
static const char __pyx_k_float16[] = "float16";
static const char __pyx_k_float32[] = "float32";
static const char __pyx_k_float64[] = "float64";
static const char __pyx_k_fromutc[] = "fromutc";
static const char __pyx_k_genexpr[] = "genexpr";
static const char __pyx_k_indices[] = "indices";
static const char __pyx_k_items_2[] = "_items";
static const char __pyx_k_libhdfs[] = "libhdfs";
static const char __pyx_k_mapping[] = "mapping";
static const char __pyx_k_message[] = "message";
static const char __pyx_k_minutes[] = "minutes";
static const char __pyx_k_missing[] = "missing";
static const char __pyx_k_ndarray[] = "ndarray";
static const char __pyx_k_offsets[] = "offsets";
static const char __pyx_k_options[] = "options";
static const char __pyx_k_ordered[] = "ordered";
static const char __pyx_k_out_buf[] = "out_buf";
static const char __pyx_k_pformat[] = "pformat";
static const char __pyx_k_prepare[] = "__prepare__";
static const char __pyx_k_present[] = "present";
static const char __pyx_k_promote[] = "promote";
static const char __pyx_k_pyarrow[] = "pyarrow.{}\n{}";
static const char __pyx_k_replace[] = "replace";
static const char __pyx_k_require[] = "require";
static const char __pyx_k_seconds[] = "seconds";
static const char __pyx_k_storage[] = "storage";
static const char __pyx_k_testing[] = "testing";
static const char __pyx_k_timeout[] = "timeout";
static const char __pyx_k_tobytes[] = "tobytes";
static const char __pyx_k_type_id[] = "type_id";
static const char __pyx_k_version[] = "__version__";
static const char __pyx_k_weakref[] = "weakref";
static const char __pyx_k_DataType[] = "DataType";
static const char __pyx_k_EOFError[] = "EOFError";
static const char __pyx_k_HdfsFile[] = "HdfsFile";
static const char __pyx_k_KeyError[] = "KeyError";
static const char __pyx_k_ListType[] = "ListType";
static const char __pyx_k_MapArray[] = "MapArray";
static const char __pyx_k_MapValue[] = "MapValue";
static const char __pyx_k_NullType[] = "NullType";
static const char __pyx_k_Type_MAP[] = "Type_MAP";
static const char __pyx_k_bBhHiIqQ[] = "bBhHiIqQ";
static const char __pyx_k_bg_write[] = "bg_write";
static const char __pyx_k_c_arrays[] = "c_arrays";
static const char __pyx_k_c_fields[] = "c_fields";
static const char __pyx_k_c_result[] = "c_result";
static const char __pyx_k_c_schema[] = "c_schema";
static const char __pyx_k_c_stream[] = "c_stream";
static const char __pyx_k_c_tables[] = "c_tables";
static const char __pyx_k_children[] = "children";
static const char __pyx_k_column_2[] = "_column";
static const char __pyx_k_compress[] = "compress";
static const char __pyx_k_cpp_file[] = "cpp_file";
static const char __pyx_k_datetime[] = "datetime";
static const char __pyx_k_decay_ms[] = "decay_ms";
static const char __pyx_k_download[] = "download";
static const char __pyx_k_duration[] = "duration";
static const char __pyx_k_endswith[] = "endswith";
static const char __pyx_k_exc_info[] = "exc_info";
static const char __pyx_k_exc_type[] = "exc_type";
static const char __pyx_k_ext_type[] = "ext_type";
static const char __pyx_k_fastpath[] = "fastpath";
static const char __pyx_k_fields_2[] = "_fields";
static const char __pyx_k_getstate[] = "__getstate__";
static const char __pyx_k_getvalue[] = "getvalue";
static const char __pyx_k_is_alive[] = "is_alive";
static const char __pyx_k_is_index[] = "is_index";
static const char __pyx_k_key_type[] = "key_type";
static const char __pyx_k_libhdfs3[] = "libhdfs3";
static const char __pyx_k_metadata[] = "metadata";
static const char __pyx_k_new_path[] = "new_path";
static const char __pyx_k_new_size[] = "new_size";
static const char __pyx_k_nthreads[] = "nthreads";
static const char __pyx_k_nullable[] = "nullable";
static const char __pyx_k_num_rows[] = "num_rows";
static const char __pyx_k_object_2[] = "object_";
static const char __pyx_k_position[] = "position";
static const char __pyx_k_py_field[] = "py_field";
static const char __pyx_k_pyx_type[] = "__pyx_type";
static const char __pyx_k_qualname[] = "__qualname__";
static const char __pyx_k_readable[] = "readable";
static const char __pyx_k_readline[] = "readline";
static const char __pyx_k_register[] = "register";
static const char __pyx_k_setstate[] = "__setstate__";
static const char __pyx_k_time32_s[] = "time32[s]";
static const char __pyx_k_timezone[] = "timezone";
static const char __pyx_k_to_numpy[] = "to_numpy";
static const char __pyx_k_truncate[] = "truncate";
static const char __pyx_k_validate[] = "validate";
static const char __pyx_k_values_2[] = "_values";
static const char __pyx_k_warnings[] = "warnings";
static const char __pyx_k_writable[] = "writable";
static const char __pyx_k_write_to[] = "write_to";
static const char __pyx_k_DataFrame[] = "DataFrame";
static const char __pyx_k_Int8Array[] = "Int8Array";
static const char __pyx_k_Int8Value[] = "Int8Value";
static const char __pyx_k_ListArray[] = "ListArray";
static const char __pyx_k_ListValue[] = "ListValue";
static const char __pyx_k_NullArray[] = "NullArray";
static const char __pyx_k_QueueFull[] = "QueueFull";
static const char __pyx_k_Timedelta[] = "Timedelta";
static const char __pyx_k_Timestamp[] = "Timestamp";
static const char __pyx_k_TypeError[] = "TypeError";
static const char __pyx_k_Type_BOOL[] = "Type_BOOL";
static const char __pyx_k_Type_INT8[] = "Type_INT8";
static const char __pyx_k_Type_LIST[] = "Type_LIST";
static const char __pyx_k_UnionType[] = "UnionType";
static const char __pyx_k_alignment[] = "alignment";
static const char __pyx_k_arrow_obj[] = "arrow_obj";
static const char __pyx_k_as_buffer[] = "as_buffer";
static const char __pyx_k_bit_width[] = "bit_width";
static const char __pyx_k_c_batches[] = "c_batches";
static const char __pyx_k_c_buffers[] = "c_buffers";
static const char __pyx_k_c_options[] = "c_options";
static const char __pyx_k_c_ordered[] = "c_ordered";
static const char __pyx_k_chunksize[] = "chunksize";
static const char __pyx_k_cpu_count[] = "cpu_count";
static const char __pyx_k_date64_ms[] = "date64[ms]";
static const char __pyx_k_dim_names[] = "dim_names";
static const char __pyx_k_directory[] = "directory";
static const char __pyx_k_enumerate[] = "enumerate";
static const char __pyx_k_exc_value[] = "exc_value";
static const char __pyx_k_ext_array[] = "ext_array";
static const char __pyx_k_file_type[] = "file_type";
static const char __pyx_k_frombytes[] = "frombytes";
static const char __pyx_k_full_info[] = "full_info";
static const char __pyx_k_get_batch[] = "get_batch";
static const char __pyx_k_getsizeof[] = "getsizeof";
static const char __pyx_k_halffloat[] = "halffloat";
static const char __pyx_k_in_stream[] = "in_stream";
static const char __pyx_k_indices_2[] = "_indices";
static const char __pyx_k_is_series[] = "is_series";
static const char __pyx_k_is_sparse[] = "is_sparse";
static const char __pyx_k_item_type[] = "item_type";
static const char __pyx_k_iteritems[] = "iteritems";
static const char __pyx_k_large_str[] = "large_str";
static const char __pyx_k_list_size[] = "list_size";
static const char __pyx_k_list_type[] = "list_type";
static const char __pyx_k_metaclass[] = "__metaclass__";
static const char __pyx_k_offsets_2[] = "_offsets";
static const char __pyx_k_owned_buf[] = "owned_buf";
static const char __pyx_k_precision[] = "precision";
static const char __pyx_k_py_buffer[] = "py_buffer";
static const char __pyx_k_pyarrow_2[] = "pyarrow";
static const char __pyx_k_pydecimal[] = "_pydecimal";
static const char __pyx_k_pyx_state[] = "__pyx_state";
static const char __pyx_k_readlines[] = "readlines";
static const char __pyx_k_recursive[] = "recursive";
static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
static const char __pyx_k_resizable[] = "resizable";
static const char __pyx_k_rz_buffer[] = "rz_buffer";
static const char __pyx_k_serialize[] = "serialize";
static const char __pyx_k_sp_tensor[] = "sp_tensor";
static const char __pyx_k_temp_memo[] = "temp_memo";
static const char __pyx_k_threading[] = "threading";
static const char __pyx_k_time32_ms[] = "time32[ms]";
static const char __pyx_k_time64_ns[] = "time64[ns]";
static const char __pyx_k_time64_us[] = "time64[us]";
static const char __pyx_k_timedelta[] = "timedelta";
static const char __pyx_k_timestamp[] = "timestamp";
static const char __pyx_k_to_pandas[] = "_to_pandas";
static const char __pyx_k_to_pylist[] = "to_pylist";
static const char __pyx_k_traceback[] = "traceback";
static const char __pyx_k_type_name[] = "type_name";
static const char __pyx_k_unit_code[] = "unit_code";
static const char __pyx_k_utcoffset[] = "utcoffset";
static const char __pyx_k_writeable[] = "writeable";
static const char __pyx_k_ArrayValue[] = "ArrayValue";
static const char __pyx_k_BaseTzInfo[] = "BaseTzInfo";
static const char __pyx_k_FloatArray[] = "FloatArray";
static const char __pyx_k_FloatValue[] = "FloatValue";
static const char __pyx_k_IndexError[] = "IndexError";
static const char __pyx_k_Int16Array[] = "Int16Array";
static const char __pyx_k_Int16Value[] = "Int16Value";
static const char __pyx_k_Int32Array[] = "Int32Array";
static const char __pyx_k_Int32Value[] = "Int32Value";
static const char __pyx_k_Int64Array[] = "Int64Array";
static const char __pyx_k_Int64Value[] = "Int64Value";
static const char __pyx_k_Int8Scalar[] = "Int8Scalar";
static const char __pyx_k_MemoryPool[] = "MemoryPool";
static const char __pyx_k_NativeFile[] = "NativeFile";
static const char __pyx_k_PythonFile[] = "PythonFile";
static const char __pyx_k_QueueEmpty[] = "QueueEmpty";
static const char __pyx_k_StructType[] = "StructType";
static const char __pyx_k_TextIOBase[] = "TextIOBase";
static const char __pyx_k_Time32Type[] = "Time32Type";
static const char __pyx_k_Time64Type[] = "Time64Type";
static const char __pyx_k_Type_FLOAT[] = "Type_FLOAT";
static const char __pyx_k_Type_INT16[] = "Type_INT16";
static const char __pyx_k_Type_INT32[] = "Type_INT32";
static const char __pyx_k_Type_INT64[] = "Type_INT64";
static const char __pyx_k_Type_UINT8[] = "Type_UINT8";
static const char __pyx_k_Type_UNION[] = "Type_UNION";
static const char __pyx_k_UInt8Array[] = "UInt8Array";
static const char __pyx_k_UInt8Value[] = "UInt8Value";
static const char __pyx_k_UnionArray[] = "UnionArray";
static const char __pyx_k_UnionValue[] = "UnionValue";
static const char __pyx_k_ValueError[] = "ValueError";
static const char __pyx_k_add_column[] = "add_column";
static const char __pyx_k_array_data[] = "array_data";
static const char __pyx_k_block_size[] = "block_size";
static const char __pyx_k_byte_width[] = "byte_width";
static const char __pyx_k_c_timezone[] = "c_timezone";
static const char __pyx_k_categories[] = "categories";
static const char __pyx_k_components[] = "components";
static const char __pyx_k_coo_matrix[] = "coo_matrix";
static const char __pyx_k_csr_matrix[] = "csr_matrix";
static const char __pyx_k_data_frame[] = "data_frame";
static const char __pyx_k_date32_day[] = "date32[day]";
static const char __pyx_k_decimal128[] = "decimal128";
static const char __pyx_k_decompress[] = "decompress";
static const char __pyx_k_dictionary[] = "dictionary";
static const char __pyx_k_duration_s[] = "duration[s]";
static const char __pyx_k_extensions[] = "extensions";
static const char __pyx_k_extra_conf[] = "extra_conf";
static const char __pyx_k_from_dense[] = "from_dense";
static const char __pyx_k_from_numpy[] = "from_numpy";
static const char __pyx_k_from_scipy[] = "from_scipy";
static const char __pyx_k_get_values[] = "get_values";
static const char __pyx_k_getnewargs[] = "__getnewargs__";
static const char __pyx_k_index_type[] = "index_type";
static const char __pyx_k_infer_type[] = "infer_type";
static const char __pyx_k_iterchunks[] = "iterchunks";
static const char __pyx_k_large_list[] = "large_list";
static const char __pyx_k_large_utf8[] = "large_utf8";
static const char __pyx_k_memory_map[] = "memory_map";
static const char __pyx_k_memoryview[] = "memoryview";
static const char __pyx_k_metadata_2[] = "\nmetadata\n--------\n";
static const char __pyx_k_null_count[] = "null_count";
static const char __pyx_k_num_arrays[] = "num_arrays";
static const char __pyx_k_num_chunks[] = "num_chunks";
static const char __pyx_k_pandas_api[] = "_pandas_api";
static const char __pyx_k_put_nowait[] = "put_nowait";
static const char __pyx_k_pyx_result[] = "__pyx_result";
static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static const char __pyx_k_result_obj[] = "result_obj";
static const char __pyx_k_serialized[] = "serialized";
static const char __pyx_k_serializer[] = "serializer";
static const char __pyx_k_stacklevel[] = "stacklevel";
static const char __pyx_k_startswith[] = "startswith";
static const char __pyx_k_to_pybytes[] = "to_pybytes";
static const char __pyx_k_type_codes[] = "type_codes";
static const char __pyx_k_union_type[] = "union_type";
static const char __pyx_k_value_type[] = "value_type";
static const char __pyx_k_BinaryArray[] = "BinaryArray";
static const char __pyx_k_BinaryValue[] = "BinaryValue";
static const char __pyx_k_BufferError[] = "BufferError";
static const char __pyx_k_CastOptions[] = "CastOptions";
static const char __pyx_k_Categorical[] = "Categorical";
static const char __pyx_k_Date32Array[] = "Date32Array";
static const char __pyx_k_Date32Value[] = "Date32Value";
static const char __pyx_k_Date64Array[] = "Date64Array";
static const char __pyx_k_Date64Value[] = "Date64Value";
static const char __pyx_k_DoubleArray[] = "DoubleArray";
static const char __pyx_k_DoubleValue[] = "DoubleValue";
static const char __pyx_k_FixedOffset[] = "_FixedOffset";
static const char __pyx_k_FloatScalar[] = "FloatScalar";
static const char __pyx_k_ImportError[] = "ImportError";
static const char __pyx_k_Int16Scalar[] = "Int16Scalar";
static const char __pyx_k_Int32Scalar[] = "Int32Scalar";
static const char __pyx_k_Int64Scalar[] = "Int64Scalar";
static const char __pyx_k_MaskedArray[] = "MaskedArray";
static const char __pyx_k_MemoryError[] = "MemoryError";
static const char __pyx_k_PeriodDtype[] = "PeriodDtype";
static const char __pyx_k_PickleError[] = "PickleError";
static const char __pyx_k_RecordBatch[] = "RecordBatch";
static const char __pyx_k_ScalarValue[] = "ScalarValue";
static const char __pyx_k_StringArray[] = "StringArray";
static const char __pyx_k_StringValue[] = "StringValue";
static const char __pyx_k_StructArray[] = "StructArray";
static const char __pyx_k_StructValue[] = "StructValue";
static const char __pyx_k_SystemError[] = "SystemError";
static const char __pyx_k_Time32Array[] = "Time32Array";
static const char __pyx_k_Time32Value[] = "Time32Value";
static const char __pyx_k_Time64Array[] = "Time64Array";
static const char __pyx_k_Time64Value[] = "Time64Value";
static const char __pyx_k_Type_BINARY[] = "Type_BINARY";
static const char __pyx_k_Type_DATE32[] = "Type_DATE32";
static const char __pyx_k_Type_DATE64[] = "Type_DATE64";
static const char __pyx_k_Type_DOUBLE[] = "Type_DOUBLE";
static const char __pyx_k_Type_STRING[] = "Type_STRING";
static const char __pyx_k_Type_STRUCT[] = "Type_STRUCT";
static const char __pyx_k_Type_TIME32[] = "Type_TIME32";
static const char __pyx_k_Type_TIME64[] = "Type_TIME64";
static const char __pyx_k_Type_UINT16[] = "Type_UINT16";
static const char __pyx_k_Type_UINT32[] = "Type_UINT32";
static const char __pyx_k_Type_UINT64[] = "Type_UINT64";
static const char __pyx_k_UInt16Array[] = "UInt16Array";
static const char __pyx_k_UInt16Value[] = "UInt16Value";
static const char __pyx_k_UInt32Array[] = "UInt32Array";
static const char __pyx_k_UInt32Value[] = "UInt32Value";
static const char __pyx_k_UInt64Array[] = "UInt64Array";
static const char __pyx_k_UInt64Value[] = "UInt64Value";
static const char __pyx_k_UInt8Scalar[] = "UInt8Scalar";
static const char __pyx_k_UserWarning[] = "UserWarning";
static const char __pyx_k_arrow_array[] = "__arrow_array__";
static const char __pyx_k_assert_open[] = "_assert_open";
static const char __pyx_k_binary_type[] = "binary_type";
static const char __pyx_k_body_length[] = "body_length";
static const char __pyx_k_buffer_size[] = "buffer_size";
static const char __pyx_k_c_dim_names[] = "c_dim_names";
static const char __pyx_k_c_type_name[] = "c_type_name";
static const char __pyx_k_child_field[] = "child_field";
static const char __pyx_k_compression[] = "compression";
static const char __pyx_k_deserialize[] = "deserialize";
static const char __pyx_k_duration_ms[] = "duration[ms]";
static const char __pyx_k_duration_ns[] = "duration[ns]";
static const char __pyx_k_duration_us[] = "duration[us]";
static const char __pyx_k_field_names[] = "field_names";
static const char __pyx_k_file_handle[] = "file_handle";
static const char __pyx_k_from_arrays[] = "from_arrays";
static const char __pyx_k_from_pandas[] = "from_pandas";
static const char __pyx_k_from_pydict[] = "from_pydict";
static const char __pyx_k_from_sparse[] = "from_sparse";
static const char __pyx_k_from_tensor[] = "from_tensor";
static const char __pyx_k_have_pandas[] = "have_pandas";
static const char __pyx_k_index_value[] = "index_value";
static const char __pyx_k_infer_dtype[] = "infer_dtype";
static const char __pyx_k_itercolumns[] = "itercolumns";
static const char __pyx_k_kerb_ticket[] = "kerb_ticket";
static const char __pyx_k_keys_sorted[] = "keys_sorted";
static const char __pyx_k_memory_pool[] = "memory_pool";
static const char __pyx_k_microsecond[] = "microsecond";
static const char __pyx_k_null_bitmap[] = "null_bitmap";
static const char __pyx_k_num_buffers[] = "num_buffers";
static const char __pyx_k_num_columns[] = "num_columns";
static const char __pyx_k_num_tensors[] = "num_tensors";
static const char __pyx_k_open_stream[] = "open_stream";
static const char __pyx_k_output_size[] = "output_size";
static const char __pyx_k_permissions[] = "permissions";
static const char __pyx_k_pyarrow_lib[] = "pyarrow.lib";
static const char __pyx_k_read_schema[] = "read_schema";
static const char __pyx_k_read_tensor[] = "read_tensor";
static const char __pyx_k_replication[] = "replication";
static const char __pyx_k_source_path[] = "source_path";
static const char __pyx_k_struct_type[] = "struct_type";
static const char __pyx_k_target_type[] = "target_type";
static const char __pyx_k_timestamp_s[] = "timestamp[s]";
static const char __pyx_k_to_pandas_2[] = "to_pandas";
static const char __pyx_k_total_bytes[] = "total_bytes";
static const char __pyx_k_use_threads[] = "use_threads";
static const char __pyx_k_write_batch[] = "write_batch";
static const char __pyx_k_write_table[] = "write_table";
static const char __pyx_k_Array___iter[] = "Array.__iter__";
static const char __pyx_k_ArrowIOError[] = "ArrowIOError";
static const char __pyx_k_ArrowInvalid[] = "ArrowInvalid";
static const char __pyx_k_BooleanArray[] = "BooleanArray";
static const char __pyx_k_BooleanValue[] = "BooleanValue";
static const char __pyx_k_BufferReader[] = "BufferReader";
static const char __pyx_k_ChunkedArray[] = "ChunkedArray";
static const char __pyx_k_DecimalValue[] = "DecimalValue";
static const char __pyx_k_DoubleScalar[] = "DoubleScalar";
static const char __pyx_k_DurationType[] = "DurationType";
static const char __pyx_k_FeatherError[] = "FeatherError";
static const char __pyx_k_HDFS_PATH_RE[] = "_HDFS_PATH_RE";
static const char __pyx_k_IntegerArray[] = "IntegerArray";
static const char __pyx_k_LooseVersion[] = "LooseVersion";
static const char __pyx_k_NumericArray[] = "NumericArray";
static const char __pyx_k_PickleBuffer[] = "PickleBuffer";
static const char __pyx_k_Type_DECIMAL[] = "Type_DECIMAL";
static const char __pyx_k_UInt16Scalar[] = "UInt16Scalar";
static const char __pyx_k_UInt32Scalar[] = "UInt32Scalar";
static const char __pyx_k_UInt64Scalar[] = "UInt64Scalar";
static const char __pyx_k_c_child_data[] = "c_child_data";
static const char __pyx_k_c_type_codes[] = "c_type_codes";
static const char __pyx_k_cpy_ext_type[] = "cpy_ext_type";
static const char __pyx_k_deserializer[] = "deserializer";
static const char __pyx_k_dictionary_2[] = "_dictionary";
static const char __pyx_k_from_batches[] = "from_batches";
static const char __pyx_k_from_buffers[] = "from_buffers";
static const char __pyx_k_from_storage[] = "from_storage";
static const char __pyx_k_get_capacity[] = "get_capacity";
static const char __pyx_k_have_libhdfs[] = "have_libhdfs";
static const char __pyx_k_input_stream[] = "input_stream";
static const char __pyx_k_is_primitive[] = "_is_primitive";
static const char __pyx_k_large_binary[] = "large_binary";
static const char __pyx_k_large_string[] = "large_string";
static const char __pyx_k_microseconds[] = "microseconds";
static const char __pyx_k_milliseconds[] = "milliseconds";
static const char __pyx_k_num_children[] = "num_children";
static const char __pyx_k_num_ndarrays[] = "num_ndarrays";
static const char __pyx_k_ordered_dict[] = "ordered_dict";
static const char __pyx_k_pandas_dtype[] = "pandas_dtype";
static const char __pyx_k_pyarrow_util[] = "pyarrow.util";
static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
static const char __pyx_k_read_message[] = "read_message";
static const char __pyx_k_record_batch[] = "record_batch";
static const char __pyx_k_requirements[] = "requirements";
static const char __pyx_k_scipy_sparse[] = "scipy.sparse";
static const char __pyx_k_serialize_to[] = "serialize_to";
static const char __pyx_k_sp_data_type[] = "sp_data_type";
static const char __pyx_k_split_blocks[] = "split_blocks";
static const char __pyx_k_staticmethod[] = "staticmethod";
static const char __pyx_k_storage_type[] = "storage_type";
static const char __pyx_k_string_types[] = "string_types";
static const char __pyx_k_stringsource[] = "stringsource";
static const char __pyx_k_struct_array[] = "struct_array";
static const char __pyx_k_timestamp_ms[] = "timestamp[ms]";
static const char __pyx_k_timestamp_ns[] = "timestamp[ns]";
static const char __pyx_k_timestamp_us[] = "timestamp[us]";
static const char __pyx_k_types_mapper[] = "types_mapper";
static const char __pyx_k_uncompressed[] = "uncompressed";
static const char __pyx_k_write_tensor[] = "write_tensor";
static const char __pyx_k_ArrowKeyError[] = "ArrowKeyError";
static const char __pyx_k_DurationArray[] = "DurationArray";
static const char __pyx_k_DurationValue[] = "DurationValue";
static const char __pyx_k_ExtensionType[] = "ExtensionType";
static const char __pyx_k_FeatherReader[] = "FeatherReader";
static const char __pyx_k_FeatherWriter[] = "FeatherWriter";
static const char __pyx_k_FixedOffset_2[] = "FixedOffset";
static const char __pyx_k_FutureWarning[] = "FutureWarning";
static const char __pyx_k_HdfsFileNanny[] = "_HdfsFileNanny";
static const char __pyx_k_IntervalDtype[] = "IntervalDtype";
static const char __pyx_k_LargeListType[] = "LargeListType";
static const char __pyx_k_MessageReader[] = "MessageReader";
static const char __pyx_k_PandasAPIShim[] = "_PandasAPIShim";
static const char __pyx_k_Schema___iter[] = "Schema.__iter__";
static const char __pyx_k_StopIteration[] = "StopIteration";
static const char __pyx_k_StringBuilder[] = "StringBuilder";
static const char __pyx_k_TimestampType[] = "TimestampType";
static const char __pyx_k_Type_DURATION[] = "Type_DURATION";
static const char __pyx_k_arg_dict_memo[] = "arg_dict_memo";
static const char __pyx_k_c_field_names[] = "c_field_names";
static const char __pyx_k_c_from_pandas[] = "c_from_pandas";
static const char __pyx_k_chunked_array[] = "chunked_array";
static const char __pyx_k_concat_arrays[] = "concat_arrays";
static const char __pyx_k_concat_tables[] = "concat_tables";
static const char __pyx_k_datetime64_ns[] = "datetime64[ns]";
static const char __pyx_k_footer_offset[] = "footer_offset";
static const char __pyx_k_have_libhdfs3[] = "have_libhdfs3";
static const char __pyx_k_integer_types[] = "integer_types";
static const char __pyx_k_is_array_like[] = "is_array_like";
static const char __pyx_k_is_data_frame[] = "is_data_frame";
static const char __pyx_k_is_datetimetz[] = "is_datetimetz";
static const char __pyx_k_last_accessed[] = "last_accessed";
static const char __pyx_k_last_modified[] = "last_modified";
static const char __pyx_k_make_tz_aware[] = "make_tz_aware";
static const char __pyx_k_max_chunksize[] = "max_chunksize";
static const char __pyx_k_output_buffer[] = "output_buffer";
static const char __pyx_k_output_length[] = "output_length";
static const char __pyx_k_output_stream[] = "output_stream";
static const char __pyx_k_pa_getnewargs[] = "_pa_getnewargs_";
static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
static const char __pyx_k_remove_column[] = "remove_column";
static const char __pyx_k_restore_array[] = "_restore_array";
static const char __pyx_k_self_destruct[] = "self_destruct";
static const char __pyx_k_set_cpu_count[] = "set_cpu_count";
static const char __pyx_k_shrink_to_fit[] = "shrink_to_fit";
static const char __pyx_k_target_schema[] = "target_schema";
static const char __pyx_k_total_seconds[] = "total_seconds";
static const char __pyx_k_value_offsets[] = "value_offsets";
static const char __pyx_k_with_metadata[] = "with_metadata";
static const char __pyx_k_wrapped_value[] = "wrapped_value";
static const char __pyx_k_Array_was_NULL[] = "Array was NULL";
static const char __pyx_k_ArrowException[] = "ArrowException";
static const char __pyx_k_ArrowTypeError[] = "ArrowTypeError";
static const char __pyx_k_AttributeError[] = "AttributeError";
static const char __pyx_k_BufferedIOBase[] = "BufferedIOBase";
static const char __pyx_k_Decimal128Type[] = "Decimal128Type";
static const char __pyx_k_DictionaryMemo[] = "DictionaryMemo";
static const char __pyx_k_DictionaryType[] = "DictionaryType";
static const char __pyx_k_ExtensionArray[] = "ExtensionArray";
static const char __pyx_k_ExtensionDtype[] = "ExtensionDtype";
static const char __pyx_k_HalfFloatArray[] = "HalfFloatArray";
static const char __pyx_k_HalfFloatValue[] = "HalfFloatValue";
static const char __pyx_k_LargeListArray[] = "LargeListArray";
static const char __pyx_k_LargeListValue[] = "LargeListValue";
static const char __pyx_k_NotImplemented[] = "NotImplemented";
static const char __pyx_k_TimestampArray[] = "TimestampArray";
static const char __pyx_k_TimestampValue[] = "TimestampValue";
static const char __pyx_k_Type_TIMESTAMP[] = "Type_TIMESTAMP";
static const char __pyx_k_array_line_114[] = "array (line 114)";
static const char __pyx_k_builtin_pickle[] = "builtin_pickle";
static const char __pyx_k_c_record_batch[] = "c_record_batch";
static const char __pyx_k_c_result_table[] = "c_result_table";
static const char __pyx_k_check_metadata[] = "check_metadata";
static const char __pyx_k_csparse_tensor[] = "csparse_tensor";
static const char __pyx_k_date_as_object[] = "date_as_object";
static const char __pyx_k_example_object[] = "example_object";
static const char __pyx_k_extension_name[] = "extension_name";
static const char __pyx_k_foreign_buffer[] = "foreign_buffer";
static const char __pyx_k_get_space_used[] = "get_space_used";
static const char __pyx_k_is_categorical[] = "is_categorical";
static const char __pyx_k_is_float_value[] = "is_float_value";
static const char __pyx_k_is_named_tuple[] = "is_named_tuple";
static const char __pyx_k_preserve_index[] = "preserve_index";
static const char __pyx_k_pyarrow_compat[] = "pyarrow.compat";
static const char __pyx_k_pyarrow_io_pxi[] = "pyarrow\\io.pxi";
static const char __pyx_k_registry_nanny[] = "_registry_nanny";
static const char __pyx_k_stream_or_path[] = "stream_or_path";
static const char __pyx_k_stringify_path[] = "_stringify_path";
static const char __pyx_k_timedelta64_ns[] = "timedelta64[ns]";
static const char __pyx_k_type_for_alias[] = "type_for_alias";
static const char __pyx_k_use_memory_map[] = "use_memory_map";
static const char __pyx_k_zero_copy_only[] = "zero_copy_only";
static const char __pyx_k_ArrowIndexError[] = "ArrowIndexError";
static const char __pyx_k_DatetimeTZDtype[] = "DatetimeTZDtype";
static const char __pyx_k_Decimal128Array[] = "Decimal128Array";
static const char __pyx_k_DictionaryArray[] = "DictionaryArray";
static const char __pyx_k_DictionaryValue[] = "DictionaryValue";
static const char __pyx_k_FIXED_OFFSET_RE[] = "_FIXED_OFFSET_RE";
static const char __pyx_k_FunctionContext[] = "_FunctionContext";
static const char __pyx_k_MapValue___iter[] = "MapValue.__iter__";
static const char __pyx_k_ProxyMemoryPool[] = "ProxyMemoryPool";
static const char __pyx_k_PyExtensionType[] = "PyExtensionType";
static const char __pyx_k_ResizableBuffer[] = "ResizableBuffer";
static const char __pyx_k_Scalar_was_NULL[] = "Scalar was NULL";
static const char __pyx_k_SparseCOOTensor[] = "SparseCOOTensor";
static const char __pyx_k_SparseCSRMatrix[] = "SparseCSRMatrix";
static const char __pyx_k_Tensor_was_NULL[] = "Tensor was NULL";
static const char __pyx_k_Type_DICTIONARY[] = "Type_DICTIONARY";
static const char __pyx_k_Type_HALF_FLOAT[] = "Type_HALF_FLOAT";
static const char __pyx_k_Type_LARGE_LIST[] = "Type_LARGE_LIST";
static const char __pyx_k_UnionMode_DENSE[] = "UnionMode_DENSE";
static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
static const char __pyx_k_assert_readable[] = "_assert_readable";
static const char __pyx_k_assert_seekable[] = "_assert_seekable";
static const char __pyx_k_assert_writable[] = "_assert_writable";
static const char __pyx_k_children_fields[] = "children_fields";
static const char __pyx_k_dictionary_memo[] = "dictionary_memo";
static const char __pyx_k_file_descriptor[] = "file_descriptor";
static const char __pyx_k_from_components[] = "from_components";
static const char __pyx_k_get_field_index[] = "get_field_index";
static const char __pyx_k_get_tensor_size[] = "get_tensor_size";
static const char __pyx_k_got_null_buffer[] = "got null buffer";
static const char __pyx_k_ignore_metadata[] = "ignore_metadata";
static const char __pyx_k_make_datetimetz[] = "make_datetimetz";
static const char __pyx_k_max_output_size[] = "max_output_size";
static const char __pyx_k_metadata_length[] = "metadata_length";
static const char __pyx_k_normalize_slice[] = "_normalize_slice";
static const char __pyx_k_pyarrow_Field_0[] = "pyarrow.Field<{0}>";
static const char __pyx_k_pyarrow_ipc_pxi[] = "pyarrow\\ipc.pxi";
static const char __pyx_k_pyarrow_lib_pyx[] = "pyarrow\\lib.pyx";
static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
static const char __pyx_k_read_next_batch[] = "read_next_batch";
static const char __pyx_k_read_serialized[] = "read_serialized";
static const char __pyx_k_set_memory_pool[] = "set_memory_pool";
static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
static const char __pyx_k_table_to_blocks[] = "table_to_blocks";
static const char __pyx_k_ArrowMemoryError[] = "ArrowMemoryError";
static const char __pyx_k_HadoopFileSystem[] = "HadoopFileSystem";
static const char __pyx_k_LargeBinaryArray[] = "LargeBinaryArray";
static const char __pyx_k_LargeBinaryValue[] = "LargeBinaryValue";
static const char __pyx_k_LargeStringArray[] = "LargeStringArray";
static const char __pyx_k_LargeStringValue[] = "LargeStringValue";
static const char __pyx_k_ListValue___iter[] = "ListValue.__iter__";
static const char __pyx_k_MemoryMappedFile[] = "MemoryMappedFile";
static const char __pyx_k_MockOutputStream[] = "MockOutputStream";
static const char __pyx_k_UnionMode_SPARSE[] = "UnionMode_SPARSE";
static const char __pyx_k_UnionType___iter[] = "UnionType.__iter__";
static const char __pyx_k_c_extension_name[] = "c_extension_name";
static const char __pyx_k_categorical_type[] = "categorical_type";
static const char __pyx_k_compression_type[] = "compression_type";
static const char __pyx_k_converted_arrays[] = "converted_arrays";
static const char __pyx_k_deserialize_from[] = "deserialize_from";
static const char __pyx_k_dictionary_value[] = "dictionary_value";
static const char __pyx_k_encode_file_path[] = "encode_file_path";
static const char __pyx_k_from_dense_numpy[] = "from_dense_numpy";
static const char __pyx_k_from_numpy_dtype[] = "from_numpy_dtype";
static const char __pyx_k_get_record_batch[] = "get_record_batch";
static const char __pyx_k_is_boolean_value[] = "is_boolean_value";
static const char __pyx_k_is_integer_value[] = "is_integer_value";
static const char __pyx_k_is_pandas_object[] = "is_pandas_object";
static const char __pyx_k_last_access_time[] = "last_access_time";
static const char __pyx_k_pandas_api_types[] = "pandas.api.types";
static const char __pyx_k_release_registry[] = "release_registry";
static const char __pyx_k_sp_chunked_array[] = "sp_chunked_array";
static const char __pyx_k_string_to_tzinfo[] = "string_to_tzinfo";
static const char __pyx_k_tzinfo_to_string[] = "tzinfo_to_string";
static const char __pyx_k_unknown_driver_r[] = "unknown driver: %r";
static const char __pyx_k_BaseExtensionType[] = "BaseExtensionType";
static const char __pyx_k_FixedSizeListType[] = "FixedSizeListType";
static const char __pyx_k_LoggingMemoryPool[] = "LoggingMemoryPool";
static const char __pyx_k_PandasConvertible[] = "_PandasConvertible";
static const char __pyx_k_StructType___iter[] = "StructType.__iter__";
static const char __pyx_k_Table_itercolumns[] = "Table.itercolumns";
static const char __pyx_k_Type_LARGE_BINARY[] = "Type_LARGE_BINARY";
static const char __pyx_k_Type_LARGE_STRING[] = "Type_LARGE_STRING";
static const char __pyx_k_create_memory_map[] = "create_memory_map";
static const char __pyx_k_custom_serializer[] = "custom_serializer";
static const char __pyx_k_decompressed_size[] = "decompressed_size";
static const char __pyx_k_distutils_version[] = "distutils.version";
static const char __pyx_k_extension_columns[] = "extension_columns";
static const char __pyx_k_from_struct_array[] = "from_struct_array";
static const char __pyx_k_proxy_memory_pool[] = "proxy_memory_pool";
static const char __pyx_k_pyarrow_array_pxi[] = "pyarrow\\array.pxi";
static const char __pyx_k_pyarrow_error_pxi[] = "pyarrow\\error.pxi";
static const char __pyx_k_pyarrow_table_pxi[] = "pyarrow\\table.pxi";
static const char __pyx_k_pyarrow_types_pxi[] = "pyarrow\\types.pxi";
static const char __pyx_k_read_next_message[] = "read_next_message";
static const char __pyx_k_read_record_batch[] = "read_record_batch";
static const char __pyx_k_reconstruct_table[] = "_reconstruct_table";
static const char __pyx_k_use_legacy_format[] = "use_legacy_format";
static const char __pyx_k_ArrowCapacityError[] = "ArrowCapacityError";
static const char __pyx_k_BufferOutputStream[] = "BufferOutputStream";
static const char __pyx_k_CRecordBatchReader[] = "_CRecordBatchReader";
static const char __pyx_k_CRecordBatchWriter[] = "_CRecordBatchWriter";
static const char __pyx_k_Column_r_not_found[] = "Column {!r} not found";
static const char __pyx_k_FixedSizeListArray[] = "FixedSizeListArray";
static const char __pyx_k_FixedSizeListValue[] = "FixedSizeListValue";
static const char __pyx_k_FloatingPointArray[] = "FloatingPointArray";
static const char __pyx_k_SerializedPyObject[] = "SerializedPyObject";
static const char __pyx_k_allow_int_overflow[] = "allow_int_overflow";
static const char __pyx_k_allow_invalid_utf8[] = "allow_invalid_utf8";
static const char __pyx_k_assert_frame_equal[] = "assert_frame_equal";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_dataframe_to_types[] = "dataframe_to_types";
static const char __pyx_k_default_block_size[] = "default_block_size";
static const char __pyx_k_detect_compression[] = "_detect_compression";
static const char __pyx_k_from_pydata_sparse[] = "from_pydata_sparse";
static const char __pyx_k_last_modified_time[] = "last_modified_time";
static const char __pyx_k_millis_to_datetime[] = "_millis_to_datetime";
static const char __pyx_k_num_record_batches[] = "num_record_batches";
static const char __pyx_k_num_sparse_tensors[] = "num_sparse_tensors";
static const char __pyx_k_pyarrow_memory_pxi[] = "pyarrow\\memory.pxi";
static const char __pyx_k_pyarrow_scalar_pxi[] = "pyarrow\\scalar.pxi";
static const char __pyx_k_pyarrow_tensor_pxi[] = "pyarrow\\tensor.pxi";
static const char __pyx_k_strip_hdfs_abspath[] = "strip_hdfs_abspath";
static const char __pyx_k_Array_cast_line_611[] = "Array.cast (line 611)";
static const char __pyx_k_Array_take_line_923[] = "Array.take (line 923)";
static const char __pyx_k_ArrowKeyError___str[] = "ArrowKeyError.__str__";
static const char __pyx_k_BufferedInputStream[] = "BufferedInputStream";
static const char __pyx_k_ChunkedArray___iter[] = "ChunkedArray.__iter__";
static const char __pyx_k_DEFAULT_BUFFER_SIZE[] = "DEFAULT_BUFFER_SIZE";
static const char __pyx_k_End_of_Arrow_stream[] = "End of Arrow stream";
static const char __pyx_k_FixedSizeBinaryType[] = "FixedSizeBinaryType";
static const char __pyx_k_Invalid_file_mode_0[] = "Invalid file mode: {0}";
static const char __pyx_k_No_type_alias_for_0[] = "No type alias for {0}";
static const char __pyx_k_NotImplementedError[] = "NotImplementedError";
static const char __pyx_k_allow_time_overflow[] = "allow_time_overflow";
static const char __pyx_k_allow_time_truncate[] = "allow_time_truncate";
static const char __pyx_k_custom_deserializer[] = "custom_deserializer";
static const char __pyx_k_dataframe_to_arrays[] = "dataframe_to_arrays";
static const char __pyx_k_deduplicate_objects[] = "deduplicate_objects";
static const char __pyx_k_default_memory_pool[] = "default_memory_pool";
static const char __pyx_k_get_datetimetz_type[] = "get_datetimetz_type";
static const char __pyx_k_get_default_context[] = "_get_default_context";
static const char __pyx_k_index_out_of_bounds[] = "index out of bounds";
static const char __pyx_k_logging_memory_pool[] = "logging_memory_pool";
static const char __pyx_k_pandas_types_dtypes[] = "pandas.types.dtypes";
static const char __pyx_k_pyarrow_compute_pxi[] = "pyarrow\\compute.pxi";
static const char __pyx_k_pyarrow_io_hdfs_pxi[] = "pyarrow\\io-hdfs.pxi";
static const char __pyx_k_pyx_unpickle_Scalar[] = "__pyx_unpickle_Scalar";
static const char __pyx_k_seconds_to_datetime[] = "_seconds_to_datetime";
static const char __pyx_k_set_memcopy_threads[] = "set_memcopy_threads";
static const char __pyx_k_BufferedOutputStream[] = "BufferedOutputStream";
static const char __pyx_k_FixedSizeBinaryArray[] = "FixedSizeBinaryArray";
static const char __pyx_k_FixedSizeBinaryValue[] = "FixedSizeBinaryValue";
static const char __pyx_k_MessageReader___iter[] = "MessageReader.__iter__";
static const char __pyx_k_Non_fixed_width_type[] = "Non-fixed width type";
static const char __pyx_k_SerializationContext[] = "SerializationContext";
static const char __pyx_k_Type_FIXED_SIZE_LIST[] = "Type_FIXED_SIZE_LIST";
static const char __pyx_k_UnknownExtensionType[] = "UnknownExtensionType";
static const char __pyx_k_UnsupportedOperation[] = "UnsupportedOperation";
static const char __pyx_k_allow_float_truncate[] = "allow_float_truncate";
static const char __pyx_k_integer_object_nulls[] = "integer_object_nulls";
static const char __pyx_k_use_pandas_sentinels[] = "use_pandas_sentinels";
static const char __pyx_k_Array_filter_line_966[] = "Array.filter (line 966)";
static const char __pyx_k_ChunkedArray_was_NULL[] = "ChunkedArray was NULL";
static const char __pyx_k_CompressedInputStream[] = "CompressedInputStream";
static const char __pyx_k_FixedSizeBufferWriter[] = "FixedSizeBufferWriter";
static const char __pyx_k_HDFS_client_is_closed[] = "HDFS client is closed";
static const char __pyx_k_LargeListValue___iter[] = "LargeListValue.__iter__";
static const char __pyx_k_RecordBatchFileReader[] = "_RecordBatchFileReader";
static const char __pyx_k_RecordBatchFileWriter[] = "_RecordBatchFileWriter";
static const char __pyx_k_arrow_ext_deserialize[] = "__arrow_ext_deserialize__";
static const char __pyx_k_get_record_batch_size[] = "get_record_batch_size";
static const char __pyx_k_jemalloc_set_decay_ms[] = "jemalloc_set_decay_ms";
static const char __pyx_k_ndarray_to_arrow_type[] = "_ndarray_to_arrow_type";
static const char __pyx_k_pyarrow_benchmark_pxi[] = "pyarrow\\benchmark.pxi";
static const char __pyx_k_pyarrow_pandas_compat[] = "pyarrow.pandas_compat";
static const char __pyx_k_pyarrow_serialization[] = "pyarrow.serialization";
static const char __pyx_k_table_to_blockmanager[] = "table_to_blockmanager";
static const char __pyx_k_total_allocated_bytes[] = "total_allocated_bytes";
static const char __pyx_k_0___class_____name___0[] = "{0.__class__.__name__}({0})";
static const char __pyx_k_CompressedOutputStream[] = "CompressedOutputStream";
static const char __pyx_k_ExtensionRegistryNanny[] = "_ExtensionRegistryNanny";
static const char __pyx_k_Invalid_union_mode_0_r[] = "Invalid union mode {0!r}";
static const char __pyx_k_Type_FIXED_SIZE_BINARY[] = "Type_FIXED_SIZE_BINARY";
static const char __pyx_k_deserialize_components[] = "deserialize_components";
static const char __pyx_k_fixed_offset_to_string[] = "fixed_offset_to_string";
static const char __pyx_k_fixed_size_binary_type[] = "fixed_size_binary_type";
static const char __pyx_k_log_memory_allocations[] = "log_memory_allocations";
static const char __pyx_k_readable_file_expected[] = "readable file expected";
static const char __pyx_k_strings_to_categorical[] = "strings_to_categorical";
static const char __pyx_k_upload_locals_bg_write[] = "upload.<locals>.bg_write";
static const char __pyx_k_writable_file_expected[] = "writable file expected";
static const char __pyx_k_ArrowSerializationError[] = "ArrowSerializationError";
static const char __pyx_k_ChunkedArray_iterchunks[] = "ChunkedArray.iterchunks";
static const char __pyx_k_DataType_expected_got_r[] = "DataType expected, got {!r}";
static const char __pyx_k_Expected_sparse_COO_got[] = "Expected sparse.COO, got {}";
static const char __pyx_k_Invalid_TimeUnit_string[] = "Invalid TimeUnit string";
static const char __pyx_k_RecordBatchStreamReader[] = "_RecordBatchStreamReader";
static const char __pyx_k_RecordBatchStreamWriter[] = "_RecordBatchStreamWriter";
static const char __pyx_k_arrow_py_extension_type[] = "arrow.py_extension_type";
static const char __pyx_k_download_locals_cleanup[] = "download.<locals>.cleanup";
static const char __pyx_k_register_extension_type[] = "register_extension_type";
static const char __pyx_k_Array_data_type_was_NULL[] = "Array data type was NULL";
static const char __pyx_k_ArrowNotImplementedError[] = "ArrowNotImplementedError";
static const char __pyx_k_Chunk_index_out_of_range[] = "Chunk index out of range.";
static const char __pyx_k_SparseCOOTensor_was_NULL[] = "SparseCOOTensor was NULL";
static const char __pyx_k_SparseCSRMatrix_was_NULL[] = "SparseCSRMatrix was NULL";
static const char __pyx_k_download_locals_bg_write[] = "download.<locals>.bg_write";
static const char __pyx_k_microseconds_to_datetime[] = "_microseconds_to_datetime";
static const char __pyx_k_reconstruct_record_batch[] = "_reconstruct_record_batch";
static const char __pyx_k_0_0_9_1_0_9_2_0_3_0_5_0_9[] = "([+-])(0[0-9]|1[0-9]|2[0-3]):([0-5][0-9])$";
static const char __pyx_k_CRecordBatchReader___iter[] = "_CRecordBatchReader.__iter__";
static const char __pyx_k_FixedSizeListValue___iter[] = "FixedSizeListValue.__iter__";
static const char __pyx_k_Invalid_value_of_whence_0[] = "Invalid value of whence: {0}";
static const char __pyx_k_Scalar_data_type_was_NULL[] = "Scalar data type was NULL";
static const char __pyx_k_please_pass_it_explicitly[] = ", please pass it explicitly";
static const char __pyx_k_pyarrow_serialization_pxi[] = "pyarrow\\serialization.pxi";
static const char __pyx_k_unregister_extension_type[] = "unregister_extension_type";
static const char __pyx_k_Failed_to_allocate_0_bytes[] = "Failed to allocate {0} bytes";
static const char __pyx_k_SerializationCallbackError[] = "SerializationCallbackError";
static const char __pyx_k_register_py_extension_type[] = "_register_py_extension_type";
static const char __pyx_k_Batch_number_0_out_of_range[] = "Batch number {0} out of range";
static const char __pyx_k_Invalid_TimeUnit_for_time32[] = "Invalid TimeUnit for time32: {}";
static const char __pyx_k_Invalid_TimeUnit_for_time64[] = "Invalid TimeUnit for time64: {}";
static const char __pyx_k_Offset_must_be_non_negative[] = "Offset must be non-negative";
static const char __pyx_k_Please_implement_0___reduce[] = "Please implement {0}.__reduce__";
static const char __pyx_k_Table_from_pandas_line_1118[] = "Table.from_pandas (line 1118)";
static const char __pyx_k_default_context_initialized[] = "_default_context_initialized";
static const char __pyx_k_handle_arrow_array_protocol[] = "_handle_arrow_array_protocol";
static const char __pyx_k_pyarrow_Message_unitialized[] = "pyarrow.Message(unitialized)";
static const char __pyx_k_pyx_unpickle__PandasAPIShim[] = "__pyx_unpickle__PandasAPIShim";
static const char __pyx_k_DeserializationCallbackError[] = "DeserializationCallbackError";
static const char __pyx_k_I_O_operation_on_closed_file[] = "I/O operation on closed file";
static const char __pyx_k_Indices_must_be_integer_type[] = "Indices must be integer type";
static const char __pyx_k_Schema_from_pandas_line_1045[] = "Schema.from_pandas (line 1045)";
static const char __pyx_k_benchmark_PandasObjectIsNull[] = "benchmark_PandasObjectIsNull";
static const char __pyx_k_nanoseconds_to_datetime_safe[] = "_nanoseconds_to_datetime_safe";
static const char __pyx_k_only_valid_on_readonly_files[] = "only valid on readonly files";
static const char __pyx_k_only_valid_on_seekable_files[] = "only valid on seekable files";
static const char __pyx_k_only_valid_on_writable_files[] = "only valid on writable files";
static const char __pyx_k_Unrecognized_compression_type[] = "Unrecognized compression type: {}";
static const char __pyx_k_datetime_conversion_functions[] = "_datetime_conversion_functions";
static const char __pyx_k_default_serialization_context[] = "_default_serialization_context";
static const char __pyx_k_is_named_tuple_locals_genexpr[] = "is_named_tuple.<locals>.genexpr";
static const char __pyx_k_nanoseconds_to_timedelta_safe[] = "_nanoseconds_to_timedelta_safe";
static const char __pyx_k_unregister_py_extension_types[] = "_unregister_py_extension_types";
static const char __pyx_k_Column_does_not_exist_in_table[] = "Column {} does not exist in table";
static const char __pyx_k_Convert_pandas_DataFrame_to_an[] = "\n        Convert pandas.DataFrame to an Arrow Table.\n\n        The column types in the resulting Arrow Table are inferred from the\n        dtypes of the pandas.Series in the DataFrame. In the case of non-object\n        Series, the NumPy dtype is translated to its Arrow equivalent. In the\n        case of `object`, we need to guess the datatype by looking at the\n        Python objects in this Series.\n\n        Be aware that Series of the `object` dtype don't carry enough\n        information to always lead to a meaningful Arrow type. In the case that\n        we cannot infer a type, e.g. because the DataFrame is of length 0 or\n        the Series only contains None/nan objects, the type is set to\n        null. This behavior can be avoided by constructing an explicit schema\n        and passing it to this function.\n\n        Parameters\n        ----------\n        df : pandas.DataFrame\n        schema : pyarrow.Schema, optional\n            The expected schema of the Arrow Table. This can be used to\n            indicate the type of columns if we cannot infer it automatically.\n            If passed, the output will have exactly this schema. Columns\n            specified in the schema that are not found in the DataFrame columns\n            or its index will raise an error. Additional columns or index\n            levels in the DataFrame which are not specified in the schema will\n            be ignored.\n        preserve_index : bool, optional\n            Whether to store the index as an additional column in the resulting\n            ``Table``. The default of None will store the index as a column,\n            except for RangeIndex which is stored as metadata only. Use\n            ``preserve_index=True`` to force it to be stored as a column.\n        nthreads : int, default None (may use up to system CPU count threads)\n            If greater than 1, convert columns to Arrow in parallel using\n            indicated number of threads\n        columns : lis""t, optional\n           List of column to be converted. If None, use all columns.\n        safe : boolean, default True\n           Check for overflows or other unsafe conversions\n\n        Returns\n        -------\n        pyarrow.Table\n\n        Examples\n        --------\n\n        >>> import pandas as pd\n        >>> import pyarrow as pa\n        >>> df = pd.DataFrame({\n            ...     'int': [1, 2],\n            ...     'str': ['a', 'b']\n            ... })\n        >>> pa.Table.from_pandas(df)\n        <pyarrow.lib.Table object at 0x7f05d1fb1b40>\n        ";
static const char __pyx_k_pyarrow_SparseCOOTensor_type_0[] = "<pyarrow.SparseCOOTensor>\ntype: {0.type}\nshape: {0.shape}";
static const char __pyx_k_pyarrow_SparseCSRMatrix_type_0[] = "<pyarrow.SparseCSRMatrix>\ntype: {0.type}\nshape: {0.shape}";
static const char __pyx_k_pyx_unpickle_SerializationCont[] = "__pyx_unpickle_SerializationContext";
static const char __pyx_k_pyx_unpickle__PandasConvertibl[] = "__pyx_unpickle__PandasConvertible";
static const char __pyx_k_timedelta_conversion_functions[] = "_timedelta_conversion_functions.<locals>.<lambda>";
static const char __pyx_k_Buffer_size_must_be_larger_than[] = "Buffer size must be larger than zero";
static const char __pyx_k_Calling_data_on_ChunkedArray_is[] = "Calling .data on ChunkedArray is provided for compatibility after Column was removed, simply drop this attribute";
static const char __pyx_k_Can_only_instantiate_subclasses[] = "Can only instantiate subclasses of ExtensionType";
static const char __pyx_k_Cannot_compare_scalars_that_don[] = "Cannot compare scalars that don't support as_py()";
static const char __pyx_k_Cannot_specify_a_mask_or_a_size[] = "Cannot specify a mask or a size when passing an object that is converted with the __arrow_array__ protocol.";
static const char __pyx_k_Cast_array_values_to_another_da[] = "\n        Cast array values to another data type.\n\n        Example\n        -------\n\n        >>> from datetime import datetime\n        >>> import pyarrow as pa\n        >>> arr = pa.array([datetime(2010, 1, 1), datetime(2015, 1, 1)])\n        >>> arr.type\n        TimestampType(timestamp[us])\n\n        You can use ``pyarrow.DataType`` objects to specify the target type:\n\n        >>> arr.cast(pa.timestamp('ms'))\n        <pyarrow.lib.TimestampArray object at 0x10420eb88>\n        [\n          1262304000000,\n          1420070400000\n        ]\n        >>> arr.cast(pa.timestamp('ms')).type\n        TimestampType(timestamp[ms])\n\n        Alternatively, it is also supported to use the string aliases for these\n        types:\n\n        >>> arr.cast('timestamp[ms]')\n        <pyarrow.lib.TimestampArray object at 0x10420eb88>\n        [\n          1262304000000,\n          1420070400000\n        ]\n        >>> arr.cast('timestamp[ms]').type\n        TimestampType(timestamp[ms])\n\n        Parameters\n        ----------\n        target_type : DataType\n            Type to cast to\n        safe : boolean, default True\n            Check for overflows or other unsafe conversions\n\n        Returns\n        -------\n        casted : Array\n        ";
static const char __pyx_k_ChunkedArray_data_type_was_NULL[] = "ChunkedArray data type was NULL";
static const char __pyx_k_Column_does_not_exist_in_schema[] = "Column {} does not exist in schema";
static const char __pyx_k_Create_pyarrow_Array_instance_f[] = "\n    Create pyarrow.Array instance from a Python object\n\n    Parameters\n    ----------\n    obj : sequence, iterable, ndarray or Series\n        If both type and size are specified may be a single use iterable. If\n        not strongly-typed, Arrow type will be inferred for resulting array\n    type : pyarrow.DataType\n        Explicit type to attempt to coerce to, otherwise will be inferred from\n        the data\n    mask : array (boolean), optional\n        Indicate which values are null (True) or not null (False).\n    size : int64, optional\n        Size of the elements. If the imput is larger than size bail at this\n        length. For iterators, if size is larger than the input iterator this\n        will be treated as a \"max size\", but will involve an initial allocation\n        of size followed by a resize to the actual size (so if you know the\n        exact size specifying it correctly will give you better performance).\n    from_pandas : boolean, default None\n        Use pandas's semantics for inferring nulls from values in\n        ndarray-like data. If passed, the mask tasks precendence, but\n        if a value is unmasked (not-null), but still null according to\n        pandas semantics, then it is null. Defaults to False if not\n        passed explicitly by user, or True if a pandas object is\n        passed in\n    safe : boolean, default True\n        Check for overflows or other unsafe conversions\n    memory_pool : pyarrow.MemoryPool, optional\n        If not passed, will allocate memory from the currently-set default\n        memory pool\n\n    Notes\n    -----\n    Localized timestamps will currently be returned as UTC (pandas's native\n    representation).  Timezone-naive data will be implicitly interpreted as\n    UTC.\n\n    Examples\n    --------\n    >>> import pandas as pd\n    >>> import pyarrow as pa\n    >>> pa.array(pd.Series([1, 2]))\n    <pyarrow.array.Int64Array object at 0x7f674e4c0e10>\n    [\n      1,\n      2\n    ]\n""\n    >>> import numpy as np\n    >>> pa.array(pd.Series([1, 2]), np.array([0, 1],\n    ... dtype=bool))\n    <pyarrow.array.Int64Array object at 0x7f9019e11208>\n    [\n      1,\n      null\n    ]\n\n    Returns\n    -------\n    array : pyarrow.Array or pyarrow.ChunkedArray\n        A ChunkedArray instead of an Array is returned if:\n\n        - the object data overflowed binary storage.\n        - the object's ``__arrow_array__`` protocol method returned a chunked\n          array.\n    ";
static const char __pyx_k_Do_not_call_Field_s_constructor[] = "Do not call Field's constructor directly, use `pyarrow.field` instead.";
static const char __pyx_k_Do_not_call_Table_s_constructor[] = "Do not call Table's constructor directly, use one of the `Table.from_*` functions instead.";
static const char __pyx_k_Expected_storage_type_0_but_got[] = "Expected storage type {0} but got {1}";
static const char __pyx_k_File_object_is_malformed_has_no[] = "File object is malformed, has no mode";
static const char __pyx_k_Filter_the_array_with_a_boolean[] = "\n        Filter the array with a boolean mask.\n\n        Parameters\n        ----------\n        mask : Array\n            The boolean mask indicating which values to extract.\n\n        Returns\n        -------\n        Array\n\n        Examples\n        --------\n\n        >>> import pyarrow as pa\n        >>> arr = pa.array([\"a\", \"b\", \"c\", None, \"e\"])\n        >>> mask = pa.array([True, False, None, False, True])\n        >>> arr.filter(mask)\n        <pyarrow.lib.StringArray object at 0x7fa826df9200>\n        [\n          \"a\",\n          null,\n          \"e\"\n        ]\n        ";
static const char __pyx_k_Incompatible_storage_type_0_for[] = "Incompatible storage type {0} for extension type {1}";
static const char __pyx_k_Invalid_value_for_compression_r[] = "Invalid value for compression: {!r}";
static const char __pyx_k_List_requires_DataType_or_Field[] = "List requires DataType or Field";
static const char __pyx_k_Metadata_must_be_an_instance_of[] = "Metadata must be an instance of dict";
static const char __pyx_k_Must_be_an_instance_of_datetime[] = "Must be an instance of `datetime.tzinfo`";
static const char __pyx_k_Must_pass_decompressed_size_for[] = "Must pass decompressed_size for {0} codec";
static const char __pyx_k_Returns_implied_schema_from_dat[] = "\n        Returns implied schema from dataframe\n\n        Parameters\n        ----------\n        df : pandas.DataFrame\n        preserve_index : bool, default True\n            Whether to store the index as an additional column (or columns, for\n            MultiIndex) in the resulting `Table`.\n            The default of None will store the index as a column, except for\n            RangeIndex which is stored as metadata only. Use\n            ``preserve_index=True`` to force it to be stored as a column.\n\n        Returns\n        -------\n        pyarrow.Schema\n\n        Examples\n        --------\n\n        >>> import pandas as pd\n        >>> import pyarrow as pa\n        >>> df = pd.DataFrame({\n            ...     'int': [1, 2],\n            ...     'str': ['a', 'b']\n            ... })\n        >>> pa.Schema.from_pandas(df)\n        int: int64\n        str: string\n        __index_level_0__: int64\n        ";
static const char __pyx_k_Take_elements_from_an_array_The[] = "\n        Take elements from an array.\n\n        The resulting array will be of the same type as the input array, with\n        elements taken from the input array at the given indices. If an index\n        is null then the taken element will be null.\n\n        Parameters\n        ----------\n        indices : Array\n            The indices of the values to extract. Array needs to be of\n            integer type.\n\n        Returns\n        -------\n        Array\n\n        Examples\n        --------\n\n        >>> import pyarrow as pa\n        >>> arr = pa.array([\"a\", \"b\", \"c\", None, \"e\", \"f\"])\n        >>> indices = pa.array([0, None, 4, 3])\n        >>> arr.take(indices)\n        <pyarrow.lib.StringArray object at 0x7ffa4fc7d368>\n        [\n          \"a\",\n          null,\n          \"e\",\n          null\n        ]\n        ";
static const char __pyx_k_Target_schema_s_field_names_are[] = "Target schema's field names are not matching the table's field names: {!r}, {!r}";
static const char __pyx_k_The_names_argument_is_not_valid[] = "The 'names' argument is not valid when passing a dictionary";
static const char __pyx_k_We_do_not_know_how_to_serialize[] = "We do not know how to serialize the object '{}'";
static const char __pyx_k_datetime_conversion_functions_l[] = "_datetime_conversion_functions.<locals>.<lambda>";
static const char __pyx_k_mask_not_implemented_with_Arrow[] = "mask not implemented with Arrow array inputs yet";
static const char __pyx_k_not_registered_in_deserializati[] = " not registered in deserialization callback";
static const char __pyx_k_not_supported_for_buffer_protoc[] = " not supported for buffer protocol";
static const char __pyx_k_pyarrow_Message_type_0_metadata[] = "pyarrow.Message\ntype: {0}\nmetadata length: {1}\nbody length: {2}";
static const char __pyx_k_pyarrow_Tensor_type_0_type_shap[] = "<pyarrow.Tensor>\ntype: {0.type}\nshape: {0.shape}\nstrides: {0.strides}";
static const char __pyx_k_python_extension_types_registry[] = "_python_extension_types_registry";
static const char __pyx_k_self_ap_self_sp_array_cannot_be[] = "self.ap,self.sp_array cannot be converted to a Python object for pickling";
static const char __pyx_k_self_client_cannot_be_converted[] = "self.client cannot be converted to a Python object for pickling";
static const char __pyx_k_self_reader_cannot_be_converted[] = "self.reader cannot be converted to a Python object for pickling";
static const char __pyx_k_self_writer_cannot_be_converted[] = "self.writer cannot be converted to a Python object for pickling";
static const char __pyx_k_type_codes_should_have_the_same[] = "type_codes should have the same length as fields";
static const char __pyx_k_Arrays_were_not_all_the_same_len[] = "Arrays were not all the same length: {0} vs {1}";
static const char __pyx_k_CPU_count_must_be_strictly_posit[] = "CPU count must be strictly positive";
static const char __pyx_k_Cannot_compare_Arrow_values_that[] = "Cannot compare Arrow values that don't support as_py()";
static const char __pyx_k_Cannot_construct_a_chunked_array[] = "Cannot construct a chunked array with neither arrays nor type";
static const char __pyx_k_Cannot_convert_nanosecond_timest[] = "Cannot convert nanosecond timestamps without pandas";
static const char __pyx_k_Cannot_create_multiple_NAType_in[] = "Cannot create multiple NAType instances";
static const char __pyx_k_Cannot_pass_a_numpy_masked_array[] = "Cannot pass a numpy masked array and specify a mask at the same time";
static const char __pyx_k_Cannot_pass_both_schema_and_meta[] = "Cannot pass both schema and metadata";
static const char __pyx_k_Cannot_pass_both_schema_and_name[] = "Cannot pass both schema and names";
static const char __pyx_k_Cannot_return_a_writable_array_i[] = "Cannot return a writable array if asking for zero-copy";
static const char __pyx_k_Comparisons_with_pyarrow_Array_a[] = "Comparisons with pyarrow.Array are not implemented";
static const char __pyx_k_DeserializationCallbackError___i[] = "DeserializationCallbackError.__init__";
static const char __pyx_k_Do_not_call_Buffer_s_constructor[] = "Do not call Buffer's constructor directly, use `pyarrow.py_buffer` function instead.";
static const char __pyx_k_Do_not_call_ChunkedArray_s_const[] = "Do not call ChunkedArray's constructor directly, use `chunked_array` function instead.";
static const char __pyx_k_Do_not_call_RecordBatch_s_constr[] = "Do not call RecordBatch's constructor directly, use one of the `RecordBatch.from_*` functions instead.";
static const char __pyx_k_Do_not_call_Schema_s_constructor[] = "Do not call Schema's constructor directly, use `pyarrow.schema` instead.";
static const char __pyx_k_Do_not_call_SparseCOOTensor_s_co[] = "Do not call SparseCOOTensor's constructor directly, use one of the `pyarrow.SparseCOOTensor.from_*` functions instead.";
static const char __pyx_k_Do_not_call_SparseCSRMatrix_s_co[] = "Do not call SparseCSRMatrix's constructor directly, use one of the `pyarrow.SparseCSRMatrix.from_*` functions instead.";
static const char __pyx_k_Do_not_call_Tensor_s_constructor[] = "Do not call Tensor's constructor directly, use one of the `pyarrow.Tensor.from_*` functions instead.";
static const char __pyx_k_Do_not_call_s_constructor_direct[] = "Do not call {}'s constructor directly, use pyarrow.*_memory_pool instead.";
static const char __pyx_k_Expected_1_dimensional_array_for[] = "Expected 1-dimensional array for SparseCSRMatrix indptr";
static const char __pyx_k_Expected_2_dimensional_array_for[] = "Expected 2-dimensional array for SparseCOOTensor indices";
static const char __pyx_k_Expected_integer_or_string_index[] = "Expected integer or string index";
static const char __pyx_k_Expected_pandas_DataFrame_or_lis[] = "Expected pandas DataFrame or list of arrays";
static const char __pyx_k_Expected_pandas_DataFrame_python[] = "Expected pandas DataFrame, python dictionary or list of arrays";
static const char __pyx_k_Expected_scipy_sparse_coo_matrix[] = "Expected scipy.sparse.coo_matrix, got {}";
static const char __pyx_k_Expected_scipy_sparse_csr_matrix[] = "Expected scipy.sparse.csr_matrix, got {}";
static const char __pyx_k_HDFS_client_improperly_initializ[] = "HDFS client improperly initialized";
static const char __pyx_k_Incompatible_checksums_s_vs_0x3f[] = "Incompatible checksums (%s vs 0x3f5738b = (_array_like_types, _categorical_type, _compat_module, _data_frame, _datetimetz_type, _extension_array, _extension_dtype, _have_pandas, _index, _loose_version, _pd, _pd024, _series, _tried_importing_pandas, _types_api, _version, has_sparse))";
static const char __pyx_k_Incompatible_checksums_s_vs_0x59[] = "Incompatible checksums (%s vs 0x599dcce = (type))";
static const char __pyx_k_Incompatible_checksums_s_vs_0x9a[] = "Incompatible checksums (%s vs 0x9aeed6f = (custom_deserializers, custom_serializers, pickle_deserializer, pickle_serializer, type_to_type_id, types_to_pickle, whitelisted_types))";
static const char __pyx_k_Incompatible_checksums_s_vs_0xd4[] = "Incompatible checksums (%s vs 0xd41d8cd = ())";
static const char __pyx_k_Index_must_either_be_string_or_i[] = "Index must either be string or integer";
static const char __pyx_k_Length_of_names_does_not_match_l[] = "Length of names ({}) does not match length of arrays ({})";
static const char __pyx_k_Mode_must_be_rb_read_wb_write_ne[] = "Mode must be 'rb' (read), 'wb' (write, new file), or 'ab' (append)";
static const char __pyx_k_Must_pass_either_names_or_fields[] = "Must pass either names or fields";
static const char __pyx_k_Must_pass_names_or_schema_to_Tab[] = "Must pass names or schema to Table.from_arrays";
static const char __pyx_k_Must_pass_schema_or_at_least_one[] = "Must pass schema, or at least one RecordBatch";
static const char __pyx_k_Nanosecond_duration_is_not_safel[] = "Nanosecond duration {} is not safely convertible to microseconds to convert to datetime.timedelta. Install pandas to return as Timedelta with nanosecond support or access the .value attribute.";
static const char __pyx_k_Nanosecond_timestamp_is_not_safe[] = "Nanosecond timestamp {} is not safely convertible  to microseconds to convert to datetime.datetime. Install pandas to return as Timestamp with  nanosecond support or access the .value attribute.";
static const char __pyx_k_Offset_must_represent_whole_numb[] = "Offset must represent whole number of minutes";
static const char __pyx_k_Only_extension_types_can_be_regi[] = "Only extension types can be registered";
static const char __pyx_k_Please_use_read_next_batch_inste[] = "Please use read_next_batch instead of get_next_batch";
static const char __pyx_k_Schema_and_number_of_arrays_uneq[] = "Schema and number of arrays unequal";
static const char __pyx_k_Schema_field_name_corresponds_to[] = "Schema field name corresponds to more than one field";
static const char __pyx_k_Schema_must_be_an_instance_of_py[] = "Schema must be an instance of pyarrow.Schema";
static const char __pyx_k_Schema_passed_to_names_option_pl[] = "Schema passed to names= option, please pass schema= explicitly. Will raise exception in future";
static const char __pyx_k_SerializationCallbackError___ini[] = "SerializationCallbackError.__init__";
static const char __pyx_k_SparseCOOTensor___get___locals_g[] = "SparseCOOTensor.__get__.<locals>.genexpr";
static const char __pyx_k_SparseCSRMatrix___get___locals_g[] = "SparseCSRMatrix.__get__.<locals>.genexpr";
static const char __pyx_k_StringBuilder_only_accepts_strin[] = "StringBuilder only accepts string objects";
static const char __pyx_k_Struct_field_name_corresponds_to[] = "Struct field name corresponds to more than one field";
static const char __pyx_k_Table_s_internal_pointer_is_NULL[] = "Table's internal pointer is NULL, do not use any methods or attributes on this object";
static const char __pyx_k_The_add_metadata_method_is_depre[] = "The 'add_metadata' method is deprecated, use 'with_metadata' instead";
static const char __pyx_k_The_dictionary_index_type_should[] = "The dictionary index type should be signed integer.";
static const char __pyx_k_The_dtype_of_the_categories_of_t[] = "The dtype of the 'categories' of the passed categorical values ({0}) does not match the specified type ({1}). For now ignoring the specified type, but in the future this mismatch will raise a TypeError";
static const char __pyx_k_The_field_by_name_method_is_depr[] = "The 'field_by_name' method is deprecated, use 'field' instead";
static const char __pyx_k_The_names_and_metadata_arguments[] = "The 'names' and 'metadata' arguments are not valid when passing a pandas DataFrame";
static const char __pyx_k_The_object_s___arrow_array___met[] = "The object's __arrow_array__ method does not return a pyarrow Array or ChunkedArray.";
static const char __pyx_k_The_ordered_flag_of_the_passed_c[] = "The 'ordered' flag of the passed categorical values does not match the 'ordered' of the specified type. Using the flag of the values, but in the future this mismatch will raise a ValueError.";
static const char __pyx_k_The_parameter_chunksize_is_depre[] = "The parameter chunksize is deprecated for pyarrow.Table.to_batches as of 0.15, please use the parameter max_chunksize instead";
static const char __pyx_k_The_passed_mapping_doesn_t_conta[] = "The passed mapping doesn't contain the following field(s) of the schema: {}";
static const char __pyx_k_The_type_id_argument_must_be_a_s[] = "The type_id argument must be a string. The value passed in has type {}.";
static const char __pyx_k_Type_s_expected_number_of_buffer[] = "Type's expected number of buffers ({0}) did not match the passed number ({1}).";
static const char __pyx_k_Type_s_expected_number_of_childr[] = "Type's expected number of children ({0}) did not match the passed number ({1}).";
static const char __pyx_k_Unable_to_convert_timezone_to_st[] = "Unable to convert timezone `{}` to string";
static const char __pyx_k_Unable_to_read_from_object_of_ty[] = "Unable to read from object of type: {0}";
static const char __pyx_k_Unable_to_read_message_from_obje[] = "Unable to read message from object with type: {0}";
static const char __pyx_k_Unable_to_wrap_Datum_in_a_Python[] = "Unable to wrap Datum in a Python object";
static const char __pyx_k_Writable_buffer_requested_but_Ar[] = "Writable buffer requested but Arrow buffer was not mutable";
static const char __pyx_k_accessing_non_existent_buffer_se[] = "accessing non-existent buffer segment";
static const char __pyx_k_binary_file_expected_got_text_fi[] = "binary file expected, got text file";
static const char __pyx_k_could_not_infer_open_mode_for_fi[] = "could not infer open mode for file-like object ";
static const char __pyx_k_field_or_tuple_expected_got_None[] = "field or tuple expected, got None";
static const char __pyx_k_key_must_either_be_a_slice_or_in[] = "key must either be a slice or integer";
static const char __pyx_k_list_size_should_be_a_positive_i[] = "list_size should be a positive integer";
static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
static const char __pyx_k_only_slices_with_step_1_supporte[] = "only slices with step 1 supported";
static const char __pyx_k_pa_input_stream_called_with_inst[] = "pa.input_stream() called with instance of '{}'";
static const char __pyx_k_pa_output_stream_called_with_ins[] = "pa.output_stream() called with instance of '{}'";
static const char __pyx_k_precision_should_be_between_1_an[] = "precision should be between 1 and 38";
static const char __pyx_k_prior_column_had_a_different_num[] = "prior column had a different number of rows";
static const char __pyx_k_pyarrow_does_not_know_how_to_ser[] = "pyarrow does not know how to serialize objects of type {}.";
static const char __pyx_k_register_default_serialization_h[] = "register_default_serialization_handlers";
static const char __pyx_k_self_data_cannot_be_converted_to[] = "self.data cannot be converted to a Python object for pickling";
static const char __pyx_k_self_logging_pool_self_pool_cann[] = "self.logging_pool,self.pool cannot be converted to a Python object for pickling";
static const char __pyx_k_self_options_cannot_be_converted[] = "self.options cannot be converted to a Python object for pickling";
static const char __pyx_k_self_pool_cannot_be_converted_to[] = "self.pool cannot be converted to a Python object for pickling";
static const char __pyx_k_self_pool_self_proxy_pool_cannot[] = "self.pool,self.proxy_pool cannot be converted to a Python object for pickling";
static const char __pyx_k_self_sp_array_cannot_be_converte[] = "self.sp_array cannot be converted to a Python object for pickling";
static const char __pyx_k_self_sp_scalar_cannot_be_convert[] = "self.sp_scalar cannot be converted to a Python object for pickling";
static const char __pyx_k_self_sp_sparse_tensor_self_stp_c[] = "self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling";
static const char __pyx_k_self_sp_tensor_self_tp_cannot_be[] = "self.sp_tensor,self.tp cannot be converted to a Python object for pickling";
static const char __pyx_k_timedelta_conversion_functions_2[] = "_timedelta_conversion_functions";
static const char __pyx_k_trying_to_write_an_immutable_buf[] = "trying to write an immutable buffer";
static const char __pyx_k_tzinfo_to_string_locals_fixed_of[] = "tzinfo_to_string.<locals>.fixed_offset_to_string";
static const char __pyx_k_Can_only_instantiate_subclasses_2[] = "Can only instantiate subclasses of PyExtensionType";
static const char __pyx_k_Do_not_call_s_constructor_direct_2[] = "Do not call {}'s constructor directly, use pyarrow.logging_memory_pool instead.";
static const char __pyx_k_Do_not_call_s_constructor_direct_3[] = "Do not call {}'s constructor directly, use pyarrow.proxy_memory_pool instead.";
static const char __pyx_k_Do_not_call_s_constructor_direct_4[] = "Do not call {}'s constructor directly, use public functions like pyarrow.int64, pyarrow.list_, etc. instead.";
static const char __pyx_k_Do_not_call_s_constructor_direct_5[] = "Do not call {}'s constructor directly, use array subscription instead.";
static const char __pyx_k_Do_not_call_s_constructor_direct_6[] = "Do not call {}'s constructor directly.";
static const char __pyx_k_Do_not_call_s_constructor_direct_7[] = "Do not call {}'s constructor directly, use one of the `pyarrow.Array.from_*` functions instead.";
static const char __pyx_k_Do_not_call_s_constructor_direct_8[] = "Do not call {}'s constructor directly, use `pyarrow.ipc.read_message` function instead.";
static const char __pyx_k_Do_not_call_s_constructor_direct_9[] = "Do not call {}'s constructor directly, use `pyarrow.ipc.MessageReader.open_stream` function instead.";
static const char __pyx_k_Expected_1_dimensional_array_for_2[] = "Expected 1-dimensional array for SparseCSRMatrix indices";
static const char __pyx_k_Must_pass_either_names_or_fields_2[] = "Must pass either names or fields, not both";
static const char __pyx_k_The_parameter_chunksize_is_depre_2[] = "The parameter chunksize is deprecated for the write_table methods as of 0.15, please use parameter max_chunksize instead";
static PyObject *__pyx_kp_u_02d_02d;
static PyObject *__pyx_kp_u_0_0_9_1_0_9_2_0_3_0_5_0_9;
static PyObject *__pyx_kp_u_0_1;
static PyObject *__pyx_kp_u_0_19_0;
static PyObject *__pyx_kp_u_0_20_0;
static PyObject *__pyx_kp_u_0_23_0;
static PyObject *__pyx_kp_u_0_24;
static PyObject *__pyx_kp_u_0_25;
static PyObject *__pyx_kp_u_0___class_____name___0;
static PyObject *__pyx_n_s_Array;
static PyObject *__pyx_n_s_ArrayValue;
static PyObject *__pyx_n_s_Array___iter;
static PyObject *__pyx_kp_u_Array_cast_line_611;
static PyObject *__pyx_kp_u_Array_data_type_was_NULL;
static PyObject *__pyx_kp_u_Array_filter_line_966;
static PyObject *__pyx_kp_u_Array_take_line_923;
static PyObject *__pyx_kp_u_Array_was_NULL;
static PyObject *__pyx_kp_u_Arrays_were_not_all_the_same_len;
static PyObject *__pyx_n_s_ArrowCapacityError;
static PyObject *__pyx_n_s_ArrowException;
static PyObject *__pyx_n_s_ArrowIOError;
static PyObject *__pyx_n_s_ArrowIndexError;
static PyObject *__pyx_n_s_ArrowInvalid;
static PyObject *__pyx_n_s_ArrowKeyError;
static PyObject *__pyx_n_s_ArrowKeyError___str;
static PyObject *__pyx_n_s_ArrowMemoryError;
static PyObject *__pyx_n_s_ArrowNotImplementedError;
static PyObject *__pyx_n_s_ArrowSerializationError;
static PyObject *__pyx_n_s_ArrowTypeError;
static PyObject *__pyx_n_s_AttributeError;
static PyObject *__pyx_n_b_B;
static PyObject *__pyx_n_s_BaseExtensionType;
static PyObject *__pyx_n_s_BaseTzInfo;
static PyObject *__pyx_kp_u_Batch_number_0_out_of_range;
static PyObject *__pyx_n_s_BinaryArray;
static PyObject *__pyx_n_s_BinaryValue;
static PyObject *__pyx_n_s_BooleanArray;
static PyObject *__pyx_n_s_BooleanValue;
static PyObject *__pyx_n_s_Buffer;
static PyObject *__pyx_n_s_BufferError;
static PyObject *__pyx_n_s_BufferOutputStream;
static PyObject *__pyx_n_s_BufferReader;
static PyObject *__pyx_kp_u_Buffer_size_must_be_larger_than;
static PyObject *__pyx_n_s_BufferedIOBase;
static PyObject *__pyx_n_s_BufferedInputStream;
static PyObject *__pyx_n_s_BufferedOutputStream;
static PyObject *__pyx_n_u_C;
static PyObject *__pyx_n_s_COO;
static PyObject *__pyx_kp_u_CPU_count_must_be_strictly_posit;
static PyObject *__pyx_n_s_CRecordBatchReader;
static PyObject *__pyx_n_s_CRecordBatchReader___iter;
static PyObject *__pyx_n_s_CRecordBatchWriter;
static PyObject *__pyx_kp_u_Calling_data_on_ChunkedArray_is;
static PyObject *__pyx_kp_u_Can_only_instantiate_subclasses;
static PyObject *__pyx_kp_u_Can_only_instantiate_subclasses_2;
static PyObject *__pyx_kp_u_Cannot_compare_Arrow_values_that;
static PyObject *__pyx_kp_u_Cannot_compare_scalars_that_don;
static PyObject *__pyx_kp_u_Cannot_construct_a_chunked_array;
static PyObject *__pyx_kp_u_Cannot_convert_nanosecond_timest;
static PyObject *__pyx_kp_u_Cannot_create_multiple_NAType_in;
static PyObject *__pyx_kp_u_Cannot_pass_a_numpy_masked_array;
static PyObject *__pyx_kp_u_Cannot_pass_both_schema_and_meta;
static PyObject *__pyx_kp_u_Cannot_pass_both_schema_and_name;
static PyObject *__pyx_kp_u_Cannot_return_a_writable_array_i;
static PyObject *__pyx_kp_u_Cannot_specify_a_mask_or_a_size;
static PyObject *__pyx_n_s_CastOptions;
static PyObject *__pyx_kp_u_Cast_array_values_to_another_da;
static PyObject *__pyx_n_s_Categorical;
static PyObject *__pyx_kp_u_Chunk_index_out_of_range;
static PyObject *__pyx_n_s_ChunkedArray;
static PyObject *__pyx_n_s_ChunkedArray___iter;
static PyObject *__pyx_kp_u_ChunkedArray_data_type_was_NULL;
static PyObject *__pyx_n_s_ChunkedArray_iterchunks;
static PyObject *__pyx_kp_u_ChunkedArray_was_NULL;
static PyObject *__pyx_kp_u_Column_does_not_exist_in_schema;
static PyObject *__pyx_kp_u_Column_does_not_exist_in_table;
static PyObject *__pyx_kp_u_Column_r_not_found;
static PyObject *__pyx_kp_u_Comparisons_with_pyarrow_Array_a;
static PyObject *__pyx_n_s_CompressedInputStream;
static PyObject *__pyx_n_s_CompressedOutputStream;
static PyObject *__pyx_kp_u_Convert_pandas_DataFrame_to_an;
static PyObject *__pyx_kp_u_Create_pyarrow_Array_instance_f;
static PyObject *__pyx_n_s_DEFAULT_BUFFER_SIZE;
static PyObject *__pyx_n_s_DataFrame;
static PyObject *__pyx_n_s_DataType;
static PyObject *__pyx_kp_u_DataType_expected_got_r;
static PyObject *__pyx_n_s_Date32Array;
static PyObject *__pyx_n_s_Date32Value;
static PyObject *__pyx_n_s_Date64Array;
static PyObject *__pyx_n_s_Date64Value;
static PyObject *__pyx_n_s_DatetimeTZDtype;
static PyObject *__pyx_n_s_Decimal;
static PyObject *__pyx_n_s_Decimal128Array;
static PyObject *__pyx_n_s_Decimal128Type;
static PyObject *__pyx_n_s_DecimalValue;
static PyObject *__pyx_n_s_DeserializationCallbackError;
static PyObject *__pyx_n_s_DeserializationCallbackError___i;
static PyObject *__pyx_kp_u_Detail;
static PyObject *__pyx_n_s_DictionaryArray;
static PyObject *__pyx_n_s_DictionaryMemo;
static PyObject *__pyx_n_s_DictionaryType;
static PyObject *__pyx_n_s_DictionaryValue;
static PyObject *__pyx_kp_u_Do_not_call_Buffer_s_constructor;
static PyObject *__pyx_kp_u_Do_not_call_ChunkedArray_s_const;
static PyObject *__pyx_kp_u_Do_not_call_Field_s_constructor;
static PyObject *__pyx_kp_u_Do_not_call_RecordBatch_s_constr;
static PyObject *__pyx_kp_u_Do_not_call_Schema_s_constructor;
static PyObject *__pyx_kp_u_Do_not_call_SparseCOOTensor_s_co;
static PyObject *__pyx_kp_u_Do_not_call_SparseCSRMatrix_s_co;
static PyObject *__pyx_kp_u_Do_not_call_Table_s_constructor;
static PyObject *__pyx_kp_u_Do_not_call_Tensor_s_constructor;
static PyObject *__pyx_kp_u_Do_not_call_s_constructor_direct;
static PyObject *__pyx_kp_u_Do_not_call_s_constructor_direct_2;
static PyObject *__pyx_kp_u_Do_not_call_s_constructor_direct_3;
static PyObject *__pyx_kp_u_Do_not_call_s_constructor_direct_4;
static PyObject *__pyx_kp_u_Do_not_call_s_constructor_direct_5;
static PyObject *__pyx_kp_u_Do_not_call_s_constructor_direct_6;
static PyObject *__pyx_kp_u_Do_not_call_s_constructor_direct_7;
static PyObject *__pyx_kp_u_Do_not_call_s_constructor_direct_8;
static PyObject *__pyx_kp_u_Do_not_call_s_constructor_direct_9;
static PyObject *__pyx_n_s_DoubleArray;
static PyObject *__pyx_n_s_DoubleScalar;
static PyObject *__pyx_n_s_DoubleValue;
static PyObject *__pyx_n_s_DurationArray;
static PyObject *__pyx_n_s_DurationType;
static PyObject *__pyx_n_s_DurationValue;
static PyObject *__pyx_n_s_EOFError;
static PyObject *__pyx_n_s_Empty;
static PyObject *__pyx_kp_u_End_of_Arrow_stream;
static PyObject *__pyx_kp_u_Expected_1_dimensional_array_for;
static PyObject *__pyx_kp_u_Expected_1_dimensional_array_for_2;
static PyObject *__pyx_kp_u_Expected_2_dimensional_array_for;
static PyObject *__pyx_kp_u_Expected_integer_or_string_index;
static PyObject *__pyx_kp_u_Expected_pandas_DataFrame_or_lis;
static PyObject *__pyx_kp_u_Expected_pandas_DataFrame_python;
static PyObject *__pyx_kp_u_Expected_scipy_sparse_coo_matrix;
static PyObject *__pyx_kp_u_Expected_scipy_sparse_csr_matrix;
static PyObject *__pyx_kp_u_Expected_sparse_COO_got;
static PyObject *__pyx_kp_u_Expected_storage_type_0_but_got;
static PyObject *__pyx_n_s_ExtensionArray;
static PyObject *__pyx_n_s_ExtensionDtype;
static PyObject *__pyx_n_s_ExtensionRegistryNanny;
static PyObject *__pyx_n_s_ExtensionType;
static PyObject *__pyx_n_s_FIXED_OFFSET_RE;
static PyObject *__pyx_kp_u_Failed_to_allocate_0_bytes;
static PyObject *__pyx_n_s_FeatherError;
static PyObject *__pyx_n_s_FeatherReader;
static PyObject *__pyx_n_s_FeatherWriter;
static PyObject *__pyx_n_s_Field;
static PyObject *__pyx_kp_u_File_object_is_malformed_has_no;
static PyObject *__pyx_kp_u_Filter_the_array_with_a_boolean;
static PyObject *__pyx_n_s_FixedOffset;
static PyObject *__pyx_n_s_FixedOffset_2;
static PyObject *__pyx_n_s_FixedSizeBinaryArray;
static PyObject *__pyx_n_s_FixedSizeBinaryType;
static PyObject *__pyx_n_s_FixedSizeBinaryValue;
static PyObject *__pyx_n_s_FixedSizeBufferWriter;
static PyObject *__pyx_n_s_FixedSizeListArray;
static PyObject *__pyx_n_s_FixedSizeListType;
static PyObject *__pyx_n_s_FixedSizeListValue;
static PyObject *__pyx_n_s_FixedSizeListValue___iter;
static PyObject *__pyx_n_s_FloatArray;
static PyObject *__pyx_n_s_FloatScalar;
static PyObject *__pyx_n_s_FloatValue;
static PyObject *__pyx_n_s_FloatingPointArray;
static PyObject *__pyx_n_s_Full;
static PyObject *__pyx_n_s_FunctionContext;
static PyObject *__pyx_n_s_FutureWarning;
static PyObject *__pyx_n_b_H;
static PyObject *__pyx_n_s_HDFS_PATH_RE;
static PyObject *__pyx_kp_u_HDFS_client_improperly_initializ;
static PyObject *__pyx_kp_u_HDFS_client_is_closed;
static PyObject *__pyx_n_s_HadoopFileSystem;
static PyObject *__pyx_n_s_HalfFloatArray;
static PyObject *__pyx_n_s_HalfFloatValue;
static PyObject *__pyx_n_s_HdfsFile;
static PyObject *__pyx_n_s_HdfsFileNanny;
static PyObject *__pyx_n_b_I;
static PyObject *__pyx_n_s_IOBase;
static PyObject *__pyx_n_s_IOError;
static PyObject *__pyx_kp_u_I_O_operation_on_closed_file;
static PyObject *__pyx_n_s_ImportError;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x3f;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x59;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x9a;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xd4;
static PyObject *__pyx_kp_u_Incompatible_storage_type_0_for;
static PyObject *__pyx_n_s_Index;
static PyObject *__pyx_n_s_IndexError;
static PyObject *__pyx_kp_u_Index_must_either_be_string_or_i;
static PyObject *__pyx_kp_u_Indices_must_be_integer_type;
static PyObject *__pyx_n_s_Int16Array;
static PyObject *__pyx_n_s_Int16Scalar;
static PyObject *__pyx_n_s_Int16Value;
static PyObject *__pyx_n_s_Int32Array;
static PyObject *__pyx_n_s_Int32Scalar;
static PyObject *__pyx_n_s_Int32Value;
static PyObject *__pyx_n_s_Int64Array;
static PyObject *__pyx_n_s_Int64Scalar;
static PyObject *__pyx_n_s_Int64Value;
static PyObject *__pyx_n_s_Int8Array;
static PyObject *__pyx_n_s_Int8Scalar;
static PyObject *__pyx_n_s_Int8Value;
static PyObject *__pyx_n_s_IntegerArray;
static PyObject *__pyx_n_s_IntervalDtype;
static PyObject *__pyx_kp_u_Invalid_TimeUnit_for_time32;
static PyObject *__pyx_kp_u_Invalid_TimeUnit_for_time64;
static PyObject *__pyx_kp_u_Invalid_TimeUnit_string;
static PyObject *__pyx_kp_u_Invalid_file_mode_0;
static PyObject *__pyx_kp_u_Invalid_union_mode_0_r;
static PyObject *__pyx_kp_u_Invalid_value_for_compression_r;
static PyObject *__pyx_kp_u_Invalid_value_of_whence_0;
static PyObject *__pyx_n_s_K;
static PyObject *__pyx_n_s_KeyError;
static PyObject *__pyx_n_s_LargeBinaryArray;
static PyObject *__pyx_n_s_LargeBinaryValue;
static PyObject *__pyx_n_s_LargeListArray;
static PyObject *__pyx_n_s_LargeListType;
static PyObject *__pyx_n_s_LargeListValue;
static PyObject *__pyx_n_s_LargeListValue___iter;
static PyObject *__pyx_n_s_LargeStringArray;
static PyObject *__pyx_n_s_LargeStringValue;
static PyObject *__pyx_kp_u_Length_of_names_does_not_match_l;
static PyObject *__pyx_n_s_ListArray;
static PyObject *__pyx_n_s_ListType;
static PyObject *__pyx_n_s_ListValue;
static PyObject *__pyx_n_s_ListValue___iter;
static PyObject *__pyx_kp_u_List_requires_DataType_or_Field;
static PyObject *__pyx_n_s_LoggingMemoryPool;
static PyObject *__pyx_n_s_LooseVersion;
static PyObject *__pyx_n_s_MapArray;
static PyObject *__pyx_n_s_MapType;
static PyObject *__pyx_n_s_MapValue;
static PyObject *__pyx_n_s_MapValue___iter;
static PyObject *__pyx_n_s_Mapping;
static PyObject *__pyx_n_s_MaskedArray;
static PyObject *__pyx_n_s_MemoryError;
static PyObject *__pyx_n_s_MemoryMappedFile;
static PyObject *__pyx_n_s_MemoryPool;
static PyObject *__pyx_n_s_Message;
static PyObject *__pyx_n_s_MessageReader;
static PyObject *__pyx_n_s_MessageReader___iter;
static PyObject *__pyx_kp_u_Metadata_must_be_an_instance_of;
static PyObject *__pyx_n_s_MockOutputStream;
static PyObject *__pyx_kp_u_Mode_must_be_rb_read_wb_write_ne;
static PyObject *__pyx_kp_u_Must_be_an_instance_of_datetime;
static PyObject *__pyx_kp_u_Must_pass_decompressed_size_for;
static PyObject *__pyx_kp_u_Must_pass_either_names_or_fields;
static PyObject *__pyx_kp_u_Must_pass_either_names_or_fields_2;
static PyObject *__pyx_kp_u_Must_pass_names_or_schema_to_Tab;
static PyObject *__pyx_kp_u_Must_pass_schema_or_at_least_one;
static PyObject *__pyx_n_s_NA;
static PyObject *__pyx_n_s_NAType;
static PyObject *__pyx_n_u_NULL;
static PyObject *__pyx_n_s_NULL_2;
static PyObject *__pyx_kp_u_Nanosecond_duration_is_not_safel;
static PyObject *__pyx_kp_u_Nanosecond_timestamp_is_not_safe;
static PyObject *__pyx_n_s_NativeFile;
static PyObject *__pyx_kp_u_No_type_alias_for_0;
static PyObject *__pyx_kp_u_Non_fixed_width_type;
static PyObject *__pyx_n_u_None;
static PyObject *__pyx_n_s_NotImplemented;
static PyObject *__pyx_n_s_NotImplementedError;
static PyObject *__pyx_n_s_NullArray;
static PyObject *__pyx_n_s_NullType;
static PyObject *__pyx_n_s_NumericArray;
static PyObject *__pyx_n_s_OSFile;
static PyObject *__pyx_kp_u_Offset_must_be_non_negative;
static PyObject *__pyx_kp_u_Offset_must_represent_whole_numb;
static PyObject *__pyx_kp_u_Only_extension_types_can_be_regi;
static PyObject *__pyx_n_s_PY3;
static PyObject *__pyx_n_s_PandasAPIShim;
static PyObject *__pyx_n_s_PandasConvertible;
static PyObject *__pyx_n_s_PeriodDtype;
static PyObject *__pyx_n_s_PickleBuffer;
static PyObject *__pyx_n_s_PickleError;
static PyObject *__pyx_kp_u_Please_implement_0___reduce;
static PyObject *__pyx_kp_u_Please_use_read_next_batch_inste;
static PyObject *__pyx_n_s_ProxyMemoryPool;
static PyObject *__pyx_n_s_PyExtensionType;
static PyObject *__pyx_n_s_PythonFile;
static PyObject *__pyx_n_b_Q;
static PyObject *__pyx_n_s_Queue;
static PyObject *__pyx_n_s_QueueEmpty;
static PyObject *__pyx_n_s_QueueFull;
static PyObject *__pyx_n_s_RecordBatch;
static PyObject *__pyx_n_s_RecordBatchFileReader;
static PyObject *__pyx_n_s_RecordBatchFileWriter;
static PyObject *__pyx_n_s_RecordBatchStreamReader;
static PyObject *__pyx_n_s_RecordBatchStreamWriter;
static PyObject *__pyx_n_s_ResizableBuffer;
static PyObject *__pyx_kp_u_Returns_implied_schema_from_dat;
static PyObject *__pyx_n_s_Scalar;
static PyObject *__pyx_n_s_ScalarValue;
static PyObject *__pyx_kp_u_Scalar_data_type_was_NULL;
static PyObject *__pyx_kp_u_Scalar_was_NULL;
static PyObject *__pyx_n_s_Schema;
static PyObject *__pyx_n_s_Schema___iter;
static PyObject *__pyx_kp_u_Schema_and_number_of_arrays_uneq;
static PyObject *__pyx_kp_u_Schema_field_name_corresponds_to;
static PyObject *__pyx_kp_u_Schema_from_pandas_line_1045;
static PyObject *__pyx_kp_u_Schema_must_be_an_instance_of_py;
static PyObject *__pyx_kp_u_Schema_passed_to_names_option_pl;
static PyObject *__pyx_n_s_SerializationCallbackError;
static PyObject *__pyx_n_s_SerializationCallbackError___ini;
static PyObject *__pyx_n_s_SerializationContext;
static PyObject *__pyx_n_s_SerializedPyObject;
static PyObject *__pyx_n_s_Series;
static PyObject *__pyx_n_s_SparseCOOTensor;
static PyObject *__pyx_n_s_SparseCOOTensor___get___locals_g;
static PyObject *__pyx_kp_u_SparseCOOTensor_was_NULL;
static PyObject *__pyx_n_s_SparseCSRMatrix;
static PyObject *__pyx_n_s_SparseCSRMatrix___get___locals_g;
static PyObject *__pyx_kp_u_SparseCSRMatrix_was_NULL;
static PyObject *__pyx_n_s_StopIteration;
static PyObject *__pyx_n_s_StringArray;
static PyObject *__pyx_n_s_StringBuilder;
static PyObject *__pyx_kp_u_StringBuilder_only_accepts_strin;
static PyObject *__pyx_n_s_StringValue;
static PyObject *__pyx_n_s_StructArray;
static PyObject *__pyx_n_s_StructType;
static PyObject *__pyx_n_s_StructType___iter;
static PyObject *__pyx_n_s_StructValue;
static PyObject *__pyx_kp_u_Struct_field_name_corresponds_to;
static PyObject *__pyx_n_s_SystemError;
static PyObject *__pyx_n_s_T;
static PyObject *__pyx_n_s_Table;
static PyObject *__pyx_kp_u_Table_from_pandas_line_1118;
static PyObject *__pyx_n_s_Table_itercolumns;
static PyObject *__pyx_kp_u_Table_s_internal_pointer_is_NULL;
static PyObject *__pyx_kp_u_Take_elements_from_an_array_The;
static PyObject *__pyx_kp_u_Target_schema_s_field_names_are;
static PyObject *__pyx_n_s_Tensor;
static PyObject *__pyx_kp_u_Tensor_was_NULL;
static PyObject *__pyx_n_s_TextIOBase;
static PyObject *__pyx_kp_u_The_add_metadata_method_is_depre;
static PyObject *__pyx_kp_u_The_dictionary_index_type_should;
static PyObject *__pyx_kp_u_The_dtype_of_the_categories_of_t;
static PyObject *__pyx_kp_u_The_field_by_name_method_is_depr;
static PyObject *__pyx_kp_u_The_names_and_metadata_arguments;
static PyObject *__pyx_kp_u_The_names_argument_is_not_valid;
static PyObject *__pyx_kp_u_The_object_s___arrow_array___met;
static PyObject *__pyx_kp_u_The_ordered_flag_of_the_passed_c;
static PyObject *__pyx_kp_u_The_parameter_chunksize_is_depre;
static PyObject *__pyx_kp_u_The_parameter_chunksize_is_depre_2;
static PyObject *__pyx_kp_u_The_passed_mapping_doesn_t_conta;
static PyObject *__pyx_kp_u_The_type_id_argument_must_be_a_s;
static PyObject *__pyx_n_s_Thread;
static PyObject *__pyx_n_s_Time32Array;
static PyObject *__pyx_n_s_Time32Type;
static PyObject *__pyx_n_s_Time32Value;
static PyObject *__pyx_n_s_Time64Array;
static PyObject *__pyx_n_s_Time64Type;
static PyObject *__pyx_n_s_Time64Value;
static PyObject *__pyx_n_s_Timedelta;
static PyObject *__pyx_n_s_Timestamp;
static PyObject *__pyx_n_s_TimestampArray;
static PyObject *__pyx_n_s_TimestampType;
static PyObject *__pyx_n_s_TimestampValue;
static PyObject *__pyx_n_s_TypeError;
static PyObject *__pyx_n_s_Type_BINARY;
static PyObject *__pyx_n_s_Type_BOOL;
static PyObject *__pyx_n_s_Type_DATE32;
static PyObject *__pyx_n_s_Type_DATE64;
static PyObject *__pyx_n_s_Type_DECIMAL;
static PyObject *__pyx_n_s_Type_DICTIONARY;
static PyObject *__pyx_n_s_Type_DOUBLE;
static PyObject *__pyx_n_s_Type_DURATION;
static PyObject *__pyx_n_s_Type_FIXED_SIZE_BINARY;
static PyObject *__pyx_n_s_Type_FIXED_SIZE_LIST;
static PyObject *__pyx_n_s_Type_FLOAT;
static PyObject *__pyx_n_s_Type_HALF_FLOAT;
static PyObject *__pyx_kp_u_Type_ID;
static PyObject *__pyx_n_s_Type_INT16;
static PyObject *__pyx_n_s_Type_INT32;
static PyObject *__pyx_n_s_Type_INT64;
static PyObject *__pyx_n_s_Type_INT8;
static PyObject *__pyx_n_s_Type_LARGE_BINARY;
static PyObject *__pyx_n_s_Type_LARGE_LIST;
static PyObject *__pyx_n_s_Type_LARGE_STRING;
static PyObject *__pyx_n_s_Type_LIST;
static PyObject *__pyx_n_s_Type_MAP;
static PyObject *__pyx_n_s_Type_NA;
static PyObject *__pyx_n_s_Type_STRING;
static PyObject *__pyx_n_s_Type_STRUCT;
static PyObject *__pyx_n_s_Type_TIME32;
static PyObject *__pyx_n_s_Type_TIME64;
static PyObject *__pyx_n_s_Type_TIMESTAMP;
static PyObject *__pyx_n_s_Type_UINT16;
static PyObject *__pyx_n_s_Type_UINT32;
static PyObject *__pyx_n_s_Type_UINT64;
static PyObject *__pyx_n_s_Type_UINT8;
static PyObject *__pyx_n_s_Type_UNION;
static PyObject *__pyx_kp_u_Type_s_expected_number_of_buffer;
static PyObject *__pyx_kp_u_Type_s_expected_number_of_childr;
static PyObject *__pyx_n_s_UInt16Array;
static PyObject *__pyx_n_s_UInt16Scalar;
static PyObject *__pyx_n_s_UInt16Value;
static PyObject *__pyx_n_s_UInt32Array;
static PyObject *__pyx_n_s_UInt32Scalar;
static PyObject *__pyx_n_s_UInt32Value;
static PyObject *__pyx_n_s_UInt64Array;
static PyObject *__pyx_n_s_UInt64Scalar;
static PyObject *__pyx_n_s_UInt64Value;
static PyObject *__pyx_n_s_UInt8Array;
static PyObject *__pyx_n_s_UInt8Scalar;
static PyObject *__pyx_n_s_UInt8Value;
static PyObject *__pyx_kp_u_Unable_to_convert_timezone_to_st;
static PyObject *__pyx_kp_u_Unable_to_read_from_object_of_ty;
static PyObject *__pyx_kp_u_Unable_to_read_message_from_obje;
static PyObject *__pyx_kp_u_Unable_to_wrap_Datum_in_a_Python;
static PyObject *__pyx_n_s_UnionArray;
static PyObject *__pyx_n_s_UnionMode_DENSE;
static PyObject *__pyx_n_s_UnionMode_SPARSE;
static PyObject *__pyx_n_s_UnionType;
static PyObject *__pyx_n_s_UnionType___iter;
static PyObject *__pyx_n_s_UnionValue;
static PyObject *__pyx_n_s_UnknownExtensionType;
static PyObject *__pyx_kp_u_Unrecognized_compression_type;
static PyObject *__pyx_n_s_UnsupportedOperation;
static PyObject *__pyx_n_s_UserWarning;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_kp_u_We_do_not_know_how_to_serialize;
static PyObject *__pyx_kp_u_Writable_buffer_requested_but_Ar;
static PyObject *__pyx_kp_b__10;
static PyObject *__pyx_kp_u__169;
static PyObject *__pyx_kp_b__198;
static PyObject *__pyx_n_s__2;
static PyObject *__pyx_kp_u__27;
static PyObject *__pyx_kp_u__28;
static PyObject *__pyx_n_u__3;
static PyObject *__pyx_n_u_ab;
static PyObject *__pyx_kp_u_accessing_non_existent_buffer_se;
static PyObject *__pyx_n_s_ad;
static PyObject *__pyx_n_s_add;
static PyObject *__pyx_n_s_add_column;
static PyObject *__pyx_n_s_address;
static PyObject *__pyx_n_s_alias;
static PyObject *__pyx_n_s_alignment;
static PyObject *__pyx_n_s_allocate_buffer;
static PyObject *__pyx_n_s_allow_float_truncate;
static PyObject *__pyx_n_s_allow_int_overflow;
static PyObject *__pyx_n_s_allow_invalid_utf8;
static PyObject *__pyx_n_s_allow_time_overflow;
static PyObject *__pyx_n_s_allow_time_truncate;
static PyObject *__pyx_n_s_api;
static PyObject *__pyx_n_s_append;
static PyObject *__pyx_n_s_arg_dict_memo;
static PyObject *__pyx_n_s_args;
static PyObject *__pyx_n_s_arr;
static PyObject *__pyx_n_s_array;
static PyObject *__pyx_n_s_array_2;
static PyObject *__pyx_n_s_array_data;
static PyObject *__pyx_kp_u_array_line_114;
static PyObject *__pyx_n_s_arrays;
static PyObject *__pyx_n_s_arrow_array;
static PyObject *__pyx_n_u_arrow_array;
static PyObject *__pyx_n_s_arrow_ext_deserialize;
static PyObject *__pyx_n_s_arrow_obj;
static PyObject *__pyx_kp_u_arrow_py_extension_type;
static PyObject *__pyx_n_s_as_buffer;
static PyObject *__pyx_n_s_as_py;
static PyObject *__pyx_n_u_as_py;
static PyObject *__pyx_n_s_asarray;
static PyObject *__pyx_n_s_asbytes;
static PyObject *__pyx_n_s_assert_frame_equal;
static PyObject *__pyx_n_s_assert_open;
static PyObject *__pyx_n_s_assert_readable;
static PyObject *__pyx_n_s_assert_seekable;
static PyObject *__pyx_n_s_assert_writable;
static PyObject *__pyx_n_s_astype;
static PyObject *__pyx_n_s_atexit;
static PyObject *__pyx_n_b_b;
static PyObject *__pyx_n_s_b;
static PyObject *__pyx_n_b_bBhHiIqQ;
static PyObject *__pyx_n_s_base;
static PyObject *__pyx_n_s_bases;
static PyObject *__pyx_n_s_batch;
static PyObject *__pyx_n_s_batches;
static PyObject *__pyx_n_s_benchmark_PandasObjectIsNull;
static PyObject *__pyx_n_s_bg_write;
static PyObject *__pyx_n_s_binary;
static PyObject *__pyx_n_u_binary;
static PyObject *__pyx_kp_u_binary_file_expected_got_text_fi;
static PyObject *__pyx_n_s_binary_type;
static PyObject *__pyx_n_s_bit_width;
static PyObject *__pyx_n_u_block_size;
static PyObject *__pyx_n_s_body;
static PyObject *__pyx_n_s_body_length;
static PyObject *__pyx_n_s_bool;
static PyObject *__pyx_n_u_bool_2;
static PyObject *__pyx_n_u_boolean;
static PyObject *__pyx_n_u_brotli;
static PyObject *__pyx_n_s_buf;
static PyObject *__pyx_n_s_buffer;
static PyObject *__pyx_n_s_buffer_size;
static PyObject *__pyx_n_s_buffers;
static PyObject *__pyx_n_s_builtin_pickle;
static PyObject *__pyx_n_s_byte_width;
static PyObject *__pyx_n_u_bz2;
static PyObject *__pyx_kp_u_bz2_2;
static PyObject *__pyx_n_s_c;
static PyObject *__pyx_n_s_c_addr;
static PyObject *__pyx_n_s_c_array;
static PyObject *__pyx_n_s_c_arrays;
static PyObject *__pyx_n_s_c_batches;
static PyObject *__pyx_n_s_c_buf;
static PyObject *__pyx_n_s_c_buffers;
static PyObject *__pyx_n_s_c_child_data;
static PyObject *__pyx_n_s_c_codec;
static PyObject *__pyx_n_s_c_dim_names;
static PyObject *__pyx_n_s_c_extension_name;
static PyObject *__pyx_n_s_c_field_names;
static PyObject *__pyx_n_s_c_fields;
static PyObject *__pyx_n_s_c_from_pandas;
static PyObject *__pyx_n_s_c_meta;
static PyObject *__pyx_n_s_c_names;
static PyObject *__pyx_n_s_c_options;
static PyObject *__pyx_n_s_c_ordered;
static PyObject *__pyx_n_s_c_path;
static PyObject *__pyx_n_s_c_record_batch;
static PyObject *__pyx_n_s_c_result;
static PyObject *__pyx_n_s_c_result_table;
static PyObject *__pyx_n_s_c_schema;
static PyObject *__pyx_n_s_c_shape;
static PyObject *__pyx_n_s_c_size;
static PyObject *__pyx_n_s_c_stream;
static PyObject *__pyx_n_s_c_table;
static PyObject *__pyx_n_s_c_tables;
static PyObject *__pyx_n_s_c_timezone;
static PyObject *__pyx_n_s_c_type;
static PyObject *__pyx_n_s_c_type_codes;
static PyObject *__pyx_n_s_c_type_name;
static PyObject *__pyx_n_s_cast;
static PyObject *__pyx_n_s_cat;
static PyObject *__pyx_n_s_categorical_type;
static PyObject *__pyx_n_s_categories;
static PyObject *__pyx_n_s_check_metadata;
static PyObject *__pyx_n_s_child;
static PyObject *__pyx_n_s_child_field;
static PyObject *__pyx_n_s_children;
static PyObject *__pyx_n_s_children_fields;
static PyObject *__pyx_n_s_chunk;
static PyObject *__pyx_n_s_chunked_array;
static PyObject *__pyx_n_s_chunks;
static PyObject *__pyx_n_u_chunksize;
static PyObject *__pyx_n_s_class;
static PyObject *__pyx_n_s_cleanup;
static PyObject *__pyx_n_s_client;
static PyObject *__pyx_n_s_cline_in_traceback;
static PyObject *__pyx_n_s_close;
static PyObject *__pyx_n_u_close;
static PyObject *__pyx_n_s_closed;
static PyObject *__pyx_n_u_closed;
static PyObject *__pyx_n_s_cls;
static PyObject *__pyx_n_s_code;
static PyObject *__pyx_n_s_codec;
static PyObject *__pyx_n_s_codes;
static PyObject *__pyx_n_s_col;
static PyObject *__pyx_n_s_column;
static PyObject *__pyx_n_s_column_2;
static PyObject *__pyx_n_s_columns;
static PyObject *__pyx_n_s_common;
static PyObject *__pyx_n_s_compat;
static PyObject *__pyx_n_s_compile;
static PyObject *__pyx_n_s_components;
static PyObject *__pyx_n_s_compress;
static PyObject *__pyx_n_s_compression;
static PyObject *__pyx_n_s_compression_type;
static PyObject *__pyx_n_s_concat_arrays;
static PyObject *__pyx_n_s_concat_tables;
static PyObject *__pyx_n_s_connect;
static PyObject *__pyx_n_s_context;
static PyObject *__pyx_n_s_converted_arrays;
static PyObject *__pyx_n_u_coo;
static PyObject *__pyx_n_s_coo_matrix;
static PyObject *__pyx_n_s_coords;
static PyObject *__pyx_n_s_copy;
static PyObject *__pyx_n_s_core;
static PyObject *__pyx_kp_u_could_not_infer_open_mode_for_fi;
static PyObject *__pyx_n_s_count;
static PyObject *__pyx_n_s_cpool;
static PyObject *__pyx_n_s_cpp_file;
static PyObject *__pyx_n_s_cpu_count;
static PyObject *__pyx_n_s_cpy_ext_type;
static PyObject *__pyx_n_s_create;
static PyObject *__pyx_n_s_create_memory_map;
static PyObject *__pyx_n_s_csparse_tensor;
static PyObject *__pyx_n_u_csr;
static PyObject *__pyx_n_s_csr_matrix;
static PyObject *__pyx_n_s_ctensor;
static PyObject *__pyx_n_s_custom_deserializer;
static PyObject *__pyx_n_s_custom_serializer;
static PyObject *__pyx_n_b_d;
static PyObject *__pyx_n_s_data;
static PyObject *__pyx_n_u_data;
static PyObject *__pyx_n_s_data_frame;
static PyObject *__pyx_n_s_dataframe_to_arrays;
static PyObject *__pyx_n_s_dataframe_to_types;
static PyObject *__pyx_n_s_date;
static PyObject *__pyx_n_s_date32;
static PyObject *__pyx_n_u_date32;
static PyObject *__pyx_kp_u_date32_day;
static PyObject *__pyx_n_s_date64;
static PyObject *__pyx_n_u_date64;
static PyObject *__pyx_kp_u_date64_ms;
static PyObject *__pyx_n_s_date_as_object;
static PyObject *__pyx_n_u_date_as_object;
static PyObject *__pyx_n_s_datetime;
static PyObject *__pyx_kp_u_datetime64_ns;
static PyObject *__pyx_n_s_datetime_conversion_functions;
static PyObject *__pyx_n_s_datetime_conversion_functions_l;
static PyObject *__pyx_n_s_days;
static PyObject *__pyx_n_s_decay_ms;
static PyObject *__pyx_n_s_decimal;
static PyObject *__pyx_n_s_decimal128;
static PyObject *__pyx_n_s_decode;
static PyObject *__pyx_n_s_decompress;
static PyObject *__pyx_n_s_decompressed_size;
static PyObject *__pyx_n_s_deduplicate_objects;
static PyObject *__pyx_n_u_deduplicate_objects;
static PyObject *__pyx_n_s_default_block_size;
static PyObject *__pyx_n_s_default_context_initialized;
static PyObject *__pyx_n_s_default_memory_pool;
static PyObject *__pyx_n_s_default_serialization_context;
static PyObject *__pyx_n_u_dense;
static PyObject *__pyx_n_s_deserialize;
static PyObject *__pyx_n_s_deserialize_components;
static PyObject *__pyx_n_s_deserialize_from;
static PyObject *__pyx_n_s_deserializer;
static PyObject *__pyx_n_s_dest;
static PyObject *__pyx_n_u_detect;
static PyObject *__pyx_n_s_detect_compression;
static PyObject *__pyx_n_s_df;
static PyObject *__pyx_n_s_dict;
static PyObject *__pyx_n_u_dict;
static PyObject *__pyx_n_s_dictionary;
static PyObject *__pyx_n_u_dictionary;
static PyObject *__pyx_n_s_dictionary_2;
static PyObject *__pyx_n_s_dictionary_memo;
static PyObject *__pyx_n_s_dictionary_value;
static PyObject *__pyx_n_s_dim_names;
static PyObject *__pyx_n_u_directory;
static PyObject *__pyx_n_s_distutils_version;
static PyObject *__pyx_n_s_doc;
static PyObject *__pyx_n_u_double;
static PyObject *__pyx_n_s_download;
static PyObject *__pyx_n_s_download_locals_bg_write;
static PyObject *__pyx_n_s_download_locals_cleanup;
static PyObject *__pyx_n_s_driver;
static PyObject *__pyx_n_s_dt;
static PyObject *__pyx_n_s_dtype;
static PyObject *__pyx_n_s_dumps;
static PyObject *__pyx_n_s_duration;
static PyObject *__pyx_kp_u_duration_ms;
static PyObject *__pyx_kp_u_duration_ns;
static PyObject *__pyx_kp_u_duration_s;
static PyObject *__pyx_kp_u_duration_us;
static PyObject *__pyx_n_b_e;
static PyObject *__pyx_n_s_e;
static PyObject *__pyx_n_s_enable;
static PyObject *__pyx_n_s_encode_file_path;
static PyObject *__pyx_n_s_endswith;
static PyObject *__pyx_n_s_enter;
static PyObject *__pyx_n_s_enumerate;
static PyObject *__pyx_n_s_equals;
static PyObject *__pyx_n_s_example_object;
static PyObject *__pyx_n_s_exc_info;
static PyObject *__pyx_n_s_exc_tb;
static PyObject *__pyx_n_s_exc_type;
static PyObject *__pyx_n_s_exc_val;
static PyObject *__pyx_n_s_exc_value;
static PyObject *__pyx_n_s_exit;
static PyObject *__pyx_n_s_ext_array;
static PyObject *__pyx_n_s_ext_type;
static PyObject *__pyx_n_s_extension_columns;
static PyObject *__pyx_n_s_extension_name;
static PyObject *__pyx_n_s_extensions;
static PyObject *__pyx_n_s_extra_conf;
static PyObject *__pyx_n_b_f;
static PyObject *__pyx_n_s_f;
static PyObject *__pyx_n_u_f2;
static PyObject *__pyx_n_u_f4;
static PyObject *__pyx_n_u_f8;
static PyObject *__pyx_n_s_fastpath;
static PyObject *__pyx_n_s_field;
static PyObject *__pyx_n_s_field_2;
static PyObject *__pyx_n_s_field_3;
static PyObject *__pyx_n_s_field_names;
static PyObject *__pyx_kp_u_field_or_tuple_expected_got_None;
static PyObject *__pyx_n_s_fields;
static PyObject *__pyx_n_u_fields_2;
static PyObject *__pyx_n_u_file;
static PyObject *__pyx_n_s_file_descriptor;
static PyObject *__pyx_n_s_file_handle;
static PyObject *__pyx_n_s_file_type;
static PyObject *__pyx_n_s_fixed_offset_to_string;
static PyObject *__pyx_n_s_fixed_size_binary_type;
static PyObject *__pyx_n_s_flags;
static PyObject *__pyx_n_s_flatten;
static PyObject *__pyx_n_u_float;
static PyObject *__pyx_n_s_float16;
static PyObject *__pyx_n_u_float16;
static PyObject *__pyx_n_s_float32;
static PyObject *__pyx_n_u_float32;
static PyObject *__pyx_n_s_float64;
static PyObject *__pyx_n_u_float64;
static PyObject *__pyx_n_s_footer_offset;
static PyObject *__pyx_n_s_foreign_buffer;
static PyObject *__pyx_n_s_format;
static PyObject *__pyx_n_s_from_arrays;
static PyObject *__pyx_n_s_from_batches;
static PyObject *__pyx_n_s_from_buffers;
static PyObject *__pyx_n_s_from_components;
static PyObject *__pyx_n_s_from_dense;
static PyObject *__pyx_n_s_from_dense_numpy;
static PyObject *__pyx_n_s_from_numpy;
static PyObject *__pyx_n_s_from_numpy_dtype;
static PyObject *__pyx_n_s_from_pandas;
static PyObject *__pyx_n_s_from_pydata_sparse;
static PyObject *__pyx_n_s_from_pydict;
static PyObject *__pyx_n_s_from_scipy;
static PyObject *__pyx_n_s_from_sparse;
static PyObject *__pyx_n_s_from_storage;
static PyObject *__pyx_n_s_from_struct_array;
static PyObject *__pyx_n_s_from_tensor;
static PyObject *__pyx_n_s_frombytes;
static PyObject *__pyx_n_s_fromutc;
static PyObject *__pyx_n_s_full;
static PyObject *__pyx_n_s_full_info;
static PyObject *__pyx_n_s_genexpr;
static PyObject *__pyx_n_s_get;
static PyObject *__pyx_n_s_get_batch;
static PyObject *__pyx_n_s_get_capacity;
static PyObject *__pyx_n_s_get_datetimetz_type;
static PyObject *__pyx_n_s_get_default_context;
static PyObject *__pyx_n_s_get_field_index;
static PyObject *__pyx_n_s_get_record_batch;
static PyObject *__pyx_n_s_get_record_batch_size;
static PyObject *__pyx_n_s_get_space_used;
static PyObject *__pyx_n_s_get_tensor_size;
static PyObject *__pyx_n_s_get_values;
static PyObject *__pyx_n_s_getnewargs;
static PyObject *__pyx_n_s_getsizeof;
static PyObject *__pyx_n_s_getstate;
static PyObject *__pyx_n_s_getvalue;
static PyObject *__pyx_kp_u_got_null_buffer;
static PyObject *__pyx_n_s_group;
static PyObject *__pyx_n_u_group;
static PyObject *__pyx_kp_u_gz;
static PyObject *__pyx_n_u_gzip;
static PyObject *__pyx_n_b_h;
static PyObject *__pyx_n_u_halffloat;
static PyObject *__pyx_n_s_handle;
static PyObject *__pyx_n_s_handle_arrow_array_protocol;
static PyObject *__pyx_n_s_have_libhdfs;
static PyObject *__pyx_n_s_have_libhdfs3;
static PyObject *__pyx_n_s_have_pandas;
static PyObject *__pyx_kp_u_hdfs_d;
static PyObject *__pyx_n_s_hint;
static PyObject *__pyx_n_s_host;
static PyObject *__pyx_n_s_hours;
static PyObject *__pyx_n_b_i;
static PyObject *__pyx_n_s_i;
static PyObject *__pyx_n_u_i1;
static PyObject *__pyx_n_u_i2;
static PyObject *__pyx_n_u_i4;
static PyObject *__pyx_n_u_i8;
static PyObject *__pyx_n_s_id;
static PyObject *__pyx_n_s_ignore_metadata;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_in_stream;
static PyObject *__pyx_n_s_indent;
static PyObject *__pyx_kp_u_index_out_of_bounds;
static PyObject *__pyx_n_s_index_type;
static PyObject *__pyx_n_s_index_value;
static PyObject *__pyx_n_s_indices;
static PyObject *__pyx_n_u_indices;
static PyObject *__pyx_n_s_indices_2;
static PyObject *__pyx_n_s_indptr;
static PyObject *__pyx_n_s_infer_dtype;
static PyObject *__pyx_n_s_infer_type;
static PyObject *__pyx_n_s_init;
static PyObject *__pyx_n_s_input_stream;
static PyObject *__pyx_n_s_insert;
static PyObject *__pyx_n_s_int16;
static PyObject *__pyx_n_u_int16;
static PyObject *__pyx_n_s_int32;
static PyObject *__pyx_n_u_int32;
static PyObject *__pyx_n_s_int64;
static PyObject *__pyx_n_u_int64;
static PyObject *__pyx_n_s_int8;
static PyObject *__pyx_n_u_int8;
static PyObject *__pyx_n_s_integer_object_nulls;
static PyObject *__pyx_n_u_integer_object_nulls;
static PyObject *__pyx_n_s_integer_types;
static PyObject *__pyx_n_s_io;
static PyObject *__pyx_n_s_is_alive;
static PyObject *__pyx_n_s_is_array_like;
static PyObject *__pyx_n_s_is_boolean_value;
static PyObject *__pyx_n_s_is_categorical;
static PyObject *__pyx_n_s_is_data_frame;
static PyObject *__pyx_n_s_is_datetimetz;
static PyObject *__pyx_n_s_is_float_value;
static PyObject *__pyx_n_s_is_index;
static PyObject *__pyx_n_s_is_integer_value;
static PyObject *__pyx_n_s_is_named_tuple;
static PyObject *__pyx_n_s_is_named_tuple_locals_genexpr;
static PyObject *__pyx_n_s_is_pandas_object;
static PyObject *__pyx_n_s_is_primitive;
static PyObject *__pyx_n_s_is_series;
static PyObject *__pyx_n_s_is_sparse;
static PyObject *__pyx_n_s_item;
static PyObject *__pyx_n_u_item;
static PyObject *__pyx_n_s_item_type;
static PyObject *__pyx_n_s_items;
static PyObject *__pyx_n_s_items_2;
static PyObject *__pyx_n_s_iter;
static PyObject *__pyx_n_s_iterchunks;
static PyObject *__pyx_n_s_itercolumns;
static PyObject *__pyx_n_s_iteritems;
static PyObject *__pyx_n_s_jemalloc_set_decay_ms;
static PyObject *__pyx_n_s_join;
static PyObject *__pyx_n_s_json;
static PyObject *__pyx_n_s_k;
static PyObject *__pyx_n_s_kerb_ticket;
static PyObject *__pyx_n_s_key;
static PyObject *__pyx_kp_u_key_must_either_be_a_slice_or_in;
static PyObject *__pyx_n_s_key_type;
static PyObject *__pyx_n_s_keys;
static PyObject *__pyx_n_s_keys_2;
static PyObject *__pyx_n_s_keys_sorted;
static PyObject *__pyx_n_u_kind;
static PyObject *__pyx_n_s_large_binary;
static PyObject *__pyx_n_u_large_binary;
static PyObject *__pyx_n_s_large_list;
static PyObject *__pyx_n_u_large_str;
static PyObject *__pyx_n_s_large_string;
static PyObject *__pyx_n_u_large_string;
static PyObject *__pyx_n_s_large_utf8;
static PyObject *__pyx_n_u_large_utf8;
static PyObject *__pyx_n_u_last_access_time;
static PyObject *__pyx_n_u_last_accessed;
static PyObject *__pyx_n_u_last_modified;
static PyObject *__pyx_n_u_last_modified_time;
static PyObject *__pyx_n_s_length;
static PyObject *__pyx_n_s_level;
static PyObject *__pyx_n_s_lib;
static PyObject *__pyx_n_u_libhdfs;
static PyObject *__pyx_n_u_libhdfs3;
static PyObject *__pyx_n_s_list;
static PyObject *__pyx_n_s_list_size;
static PyObject *__pyx_kp_u_list_size_should_be_a_positive_i;
static PyObject *__pyx_n_s_list_type;
static PyObject *__pyx_n_s_loads;
static PyObject *__pyx_n_s_log_memory_allocations;
static PyObject *__pyx_n_s_logging_memory_pool;
static PyObject *__pyx_n_s_lower;
static PyObject *__pyx_n_u_lz4;
static PyObject *__pyx_kp_u_lz4_2;
static PyObject *__pyx_n_s_m;
static PyObject *__pyx_n_s_ma;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_make_datetimetz;
static PyObject *__pyx_n_s_make_tz_aware;
static PyObject *__pyx_n_s_map;
static PyObject *__pyx_n_s_map_2;
static PyObject *__pyx_n_s_mapping;
static PyObject *__pyx_n_s_mask;
static PyObject *__pyx_kp_u_mask_not_implemented_with_Arrow;
static PyObject *__pyx_n_s_match;
static PyObject *__pyx_n_s_max_chunksize;
static PyObject *__pyx_n_s_max_output_size;
static PyObject *__pyx_n_s_memory_map;
static PyObject *__pyx_n_s_memory_pool;
static PyObject *__pyx_n_s_memoryview;
static PyObject *__pyx_n_s_message;
static PyObject *__pyx_n_s_metaclass;
static PyObject *__pyx_n_s_metadata;
static PyObject *__pyx_kp_u_metadata_2;
static PyObject *__pyx_n_s_metadata_length;
static PyObject *__pyx_n_s_micros;
static PyObject *__pyx_n_s_microsecond;
static PyObject *__pyx_n_s_microseconds;
static PyObject *__pyx_n_s_microseconds_to_datetime;
static PyObject *__pyx_n_s_millis;
static PyObject *__pyx_n_s_millis_to_datetime;
static PyObject *__pyx_n_s_milliseconds;
static PyObject *__pyx_n_s_minutes;
static PyObject *__pyx_n_s_missing;
static PyObject *__pyx_n_s_mmap;
static PyObject *__pyx_n_s_mode;
static PyObject *__pyx_n_s_module;
static PyObject *__pyx_n_s_mro;
static PyObject *__pyx_n_u_ms;
static PyObject *__pyx_n_s_n;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_u_name;
static PyObject *__pyx_n_s_name_2;
static PyObject *__pyx_n_s_name_3;
static PyObject *__pyx_n_s_names;
static PyObject *__pyx_n_s_nan;
static PyObject *__pyx_n_s_nanoseconds_to_datetime_safe;
static PyObject *__pyx_n_s_nanoseconds_to_timedelta_safe;
static PyObject *__pyx_n_s_nbytes;
static PyObject *__pyx_n_s_ndarray;
static PyObject *__pyx_n_s_ndarray_to_arrow_type;
static PyObject *__pyx_n_s_ndim;
static PyObject *__pyx_n_s_new;
static PyObject *__pyx_n_s_new_path;
static PyObject *__pyx_n_s_new_size;
static PyObject *__pyx_n_s_nf;
static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
static PyObject *__pyx_n_s_normalize_slice;
static PyObject *__pyx_kp_u_not_registered_in_deserializati;
static PyObject *__pyx_kp_u_not_supported_for_buffer_protoc;
static PyObject *__pyx_n_s_np;
static PyObject *__pyx_n_u_ns;
static PyObject *__pyx_n_s_nthreads;
static PyObject *__pyx_n_s_null;
static PyObject *__pyx_n_u_null;
static PyObject *__pyx_n_s_null_bitmap;
static PyObject *__pyx_n_s_null_count;
static PyObject *__pyx_n_s_nullable;
static PyObject *__pyx_n_s_num_arrays;
static PyObject *__pyx_n_s_num_buffers;
static PyObject *__pyx_n_u_num_buffers;
static PyObject *__pyx_n_s_num_children;
static PyObject *__pyx_n_s_num_chunks;
static PyObject *__pyx_n_s_num_columns;
static PyObject *__pyx_n_s_num_ndarrays;
static PyObject *__pyx_n_u_num_ndarrays;
static PyObject *__pyx_n_s_num_record_batches;
static PyObject *__pyx_n_s_num_rows;
static PyObject *__pyx_n_s_num_sparse_tensors;
static PyObject *__pyx_n_u_num_sparse_tensors;
static PyObject *__pyx_n_s_num_tensors;
static PyObject *__pyx_n_u_num_tensors;
static PyObject *__pyx_n_s_numpy;
static PyObject *__pyx_n_s_o;
static PyObject *__pyx_n_s_obj;
static PyObject *__pyx_n_s_object;
static PyObject *__pyx_n_s_object_2;
static PyObject *__pyx_n_s_offset;
static PyObject *__pyx_n_s_offsets;
static PyObject *__pyx_n_s_offsets_2;
static PyObject *__pyx_kp_u_only_slices_with_step_1_supporte;
static PyObject *__pyx_kp_u_only_valid_on_readonly_files;
static PyObject *__pyx_kp_u_only_valid_on_seekable_files;
static PyObject *__pyx_kp_u_only_valid_on_writable_files;
static PyObject *__pyx_n_s_open;
static PyObject *__pyx_n_s_open_2;
static PyObject *__pyx_n_s_open_stream;
static PyObject *__pyx_n_s_options;
static PyObject *__pyx_n_s_ordered;
static PyObject *__pyx_n_u_ordered;
static PyObject *__pyx_n_s_ordered_dict;
static PyObject *__pyx_n_s_os;
static PyObject *__pyx_n_s_other;
static PyObject *__pyx_n_s_out;
static PyObject *__pyx_n_s_out_buf;
static PyObject *__pyx_n_s_output_buffer;
static PyObject *__pyx_n_s_output_length;
static PyObject *__pyx_n_s_output_size;
static PyObject *__pyx_n_s_output_stream;
static PyObject *__pyx_n_s_owned_buf;
static PyObject *__pyx_n_s_owner;
static PyObject *__pyx_n_u_owner;
static PyObject *__pyx_n_u_pa_getnewargs;
static PyObject *__pyx_kp_u_pa_input_stream_called_with_inst;
static PyObject *__pyx_kp_u_pa_output_stream_called_with_ins;
static PyObject *__pyx_n_b_pandas;
static PyObject *__pyx_n_s_pandas;
static PyObject *__pyx_n_s_pandas_api;
static PyObject *__pyx_n_s_pandas_api_types;
static PyObject *__pyx_n_s_pandas_dtype;
static PyObject *__pyx_n_s_pandas_types_dtypes;
static PyObject *__pyx_n_s_parent;
static PyObject *__pyx_n_s_path;
static PyObject *__pyx_n_u_path;
static PyObject *__pyx_n_s_pd;
static PyObject *__pyx_n_u_permissions;
static PyObject *__pyx_n_s_pformat;
static PyObject *__pyx_n_s_pickle;
static PyObject *__pyx_n_u_pickle;
static PyObject *__pyx_kp_u_please_pass_it_explicitly;
static PyObject *__pyx_n_s_pool;
static PyObject *__pyx_n_u_pool;
static PyObject *__pyx_n_s_pop;
static PyObject *__pyx_n_s_port;
static PyObject *__pyx_n_s_pos;
static PyObject *__pyx_n_s_position;
static PyObject *__pyx_n_s_pprint;
static PyObject *__pyx_n_s_precision;
static PyObject *__pyx_kp_u_precision_should_be_between_1_an;
static PyObject *__pyx_n_s_prepare;
static PyObject *__pyx_n_s_present;
static PyObject *__pyx_n_s_preserve_index;
static PyObject *__pyx_kp_u_prior_column_had_a_different_num;
static PyObject *__pyx_n_s_promote;
static PyObject *__pyx_n_s_proxy_memory_pool;
static PyObject *__pyx_n_s_put_nowait;
static PyObject *__pyx_n_s_py_buffer;
static PyObject *__pyx_n_s_py_field;
static PyObject *__pyx_kp_u_pyarrow;
static PyObject *__pyx_n_s_pyarrow_2;
static PyObject *__pyx_kp_u_pyarrow_Field_0;
static PyObject *__pyx_kp_u_pyarrow_Message_type_0_metadata;
static PyObject *__pyx_kp_u_pyarrow_Message_unitialized;
static PyObject *__pyx_kp_u_pyarrow_SparseCOOTensor_type_0;
static PyObject *__pyx_kp_u_pyarrow_SparseCSRMatrix_type_0;
static PyObject *__pyx_kp_u_pyarrow_Tensor_type_0_type_shap;
static PyObject *__pyx_kp_s_pyarrow_array_pxi;
static PyObject *__pyx_kp_s_pyarrow_benchmark_pxi;
static PyObject *__pyx_n_s_pyarrow_compat;
static PyObject *__pyx_kp_s_pyarrow_compute_pxi;
static PyObject *__pyx_kp_u_pyarrow_does_not_know_how_to_ser;
static PyObject *__pyx_kp_s_pyarrow_error_pxi;
static PyObject *__pyx_kp_s_pyarrow_io_hdfs_pxi;
static PyObject *__pyx_kp_s_pyarrow_io_pxi;
static PyObject *__pyx_kp_s_pyarrow_ipc_pxi;
static PyObject *__pyx_n_s_pyarrow_lib;
static PyObject *__pyx_kp_s_pyarrow_lib_pyx;
static PyObject *__pyx_kp_s_pyarrow_memory_pxi;
static PyObject *__pyx_n_s_pyarrow_pandas_compat;
static PyObject *__pyx_kp_s_pyarrow_scalar_pxi;
static PyObject *__pyx_n_s_pyarrow_serialization;
static PyObject *__pyx_kp_s_pyarrow_serialization_pxi;
static PyObject *__pyx_kp_s_pyarrow_table_pxi;
static PyObject *__pyx_kp_s_pyarrow_tensor_pxi;
static PyObject *__pyx_kp_s_pyarrow_types_pxi;
static PyObject *__pyx_n_s_pyarrow_util;
static PyObject *__pyx_n_s_pybuf;
static PyObject *__pyx_n_s_pydecimal;
static PyObject *__pyx_n_s_pyobj;
static PyObject *__pyx_n_s_python_extension_types_registry;
static PyObject *__pyx_n_u_pytype;
static PyObject *__pyx_n_s_pytz;
static PyObject *__pyx_n_s_pyx_PickleError;
static PyObject *__pyx_n_s_pyx_checksum;
static PyObject *__pyx_n_s_pyx_result;
static PyObject *__pyx_n_s_pyx_state;
static PyObject *__pyx_n_s_pyx_type;
static PyObject *__pyx_n_s_pyx_unpickle_Scalar;
static PyObject *__pyx_n_s_pyx_unpickle_SerializationCont;
static PyObject *__pyx_n_s_pyx_unpickle__PandasAPIShim;
static PyObject *__pyx_n_s_pyx_unpickle__PandasConvertibl;
static PyObject *__pyx_n_s_pyx_vtable;
static PyObject *__pyx_n_b_q;
static PyObject *__pyx_n_s_qsize;
static PyObject *__pyx_n_s_qualname;
static PyObject *__pyx_n_s_queue;
static PyObject *__pyx_n_u_r;
static PyObject *__pyx_kp_u_r_2;
static PyObject *__pyx_kp_u_r_b;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_kp_u_rb;
static PyObject *__pyx_n_u_rb_2;
static PyObject *__pyx_n_s_re;
static PyObject *__pyx_n_s_read;
static PyObject *__pyx_n_u_read;
static PyObject *__pyx_n_s_read_message;
static PyObject *__pyx_n_s_read_next_batch;
static PyObject *__pyx_n_s_read_next_message;
static PyObject *__pyx_n_s_read_record_batch;
static PyObject *__pyx_n_s_read_schema;
static PyObject *__pyx_n_s_read_serialized;
static PyObject *__pyx_n_s_read_tensor;
static PyObject *__pyx_n_s_readable;
static PyObject *__pyx_kp_u_readable_file_expected;
static PyObject *__pyx_n_s_reader;
static PyObject *__pyx_n_s_readline;
static PyObject *__pyx_n_s_readlines;
static PyObject *__pyx_n_s_reconstruct_record_batch;
static PyObject *__pyx_n_s_reconstruct_table;
static PyObject *__pyx_n_s_record_batch;
static PyObject *__pyx_n_s_recursive;
static PyObject *__pyx_n_s_reduce;
static PyObject *__pyx_n_s_reduce_cython;
static PyObject *__pyx_n_s_reduce_ex;
static PyObject *__pyx_n_s_ref;
static PyObject *__pyx_n_s_register;
static PyObject *__pyx_n_s_register_default_serialization_h;
static PyObject *__pyx_n_s_register_extension_type;
static PyObject *__pyx_n_s_register_py_extension_type;
static PyObject *__pyx_n_s_registry_nanny;
static PyObject *__pyx_n_s_release_registry;
static PyObject *__pyx_n_s_remove_column;
static PyObject *__pyx_n_s_replace;
static PyObject *__pyx_n_s_replication;
static PyObject *__pyx_n_u_replication;
static PyObject *__pyx_n_s_repr;
static PyObject *__pyx_n_s_require;
static PyObject *__pyx_n_s_requirements;
static PyObject *__pyx_n_s_res;
static PyObject *__pyx_n_s_resizable;
static PyObject *__pyx_n_s_resize;
static PyObject *__pyx_n_s_restore_array;
static PyObject *__pyx_n_s_result;
static PyObject *__pyx_n_s_result_obj;
static PyObject *__pyx_n_s_row;
static PyObject *__pyx_n_s_rz_buffer;
static PyObject *__pyx_n_u_s;
static PyObject *__pyx_n_s_safe;
static PyObject *__pyx_n_s_scale;
static PyObject *__pyx_n_s_schema;
static PyObject *__pyx_n_s_scipy;
static PyObject *__pyx_n_s_scipy_sparse;
static PyObject *__pyx_n_s_seconds;
static PyObject *__pyx_n_s_seconds_to_datetime;
static PyObject *__pyx_n_s_seek;
static PyObject *__pyx_n_s_self;
static PyObject *__pyx_kp_s_self_ap_self_sp_array_cannot_be;
static PyObject *__pyx_kp_s_self_client_cannot_be_converted;
static PyObject *__pyx_kp_s_self_data_cannot_be_converted_to;
static PyObject *__pyx_n_s_self_destruct;
static PyObject *__pyx_n_u_self_destruct;
static PyObject *__pyx_kp_s_self_logging_pool_self_pool_cann;
static PyObject *__pyx_kp_s_self_options_cannot_be_converted;
static PyObject *__pyx_kp_s_self_pool_cannot_be_converted_to;
static PyObject *__pyx_kp_s_self_pool_self_proxy_pool_cannot;
static PyObject *__pyx_kp_s_self_reader_cannot_be_converted;
static PyObject *__pyx_kp_s_self_sp_array_cannot_be_converte;
static PyObject *__pyx_kp_s_self_sp_scalar_cannot_be_convert;
static PyObject *__pyx_kp_s_self_sp_sparse_tensor_self_stp_c;
static PyObject *__pyx_kp_s_self_sp_tensor_self_tp_cannot_be;
static PyObject *__pyx_kp_s_self_writer_cannot_be_converted;
static PyObject *__pyx_n_s_send;
static PyObject *__pyx_n_s_serialize;
static PyObject *__pyx_n_s_serialize_to;
static PyObject *__pyx_n_s_serialized;
static PyObject *__pyx_n_s_serializer;
static PyObject *__pyx_n_s_series;
static PyObject *__pyx_n_s_set_cpu_count;
static PyObject *__pyx_n_s_set_memcopy_threads;
static PyObject *__pyx_n_s_set_memory_pool;
static PyObject *__pyx_n_s_setstate;
static PyObject *__pyx_n_s_setstate_cython;
static PyObject *__pyx_n_s_shape;
static PyObject *__pyx_n_s_shrink_to_fit;
static PyObject *__pyx_n_s_sign;
static PyObject *__pyx_n_s_sink;
static PyObject *__pyx_n_s_six;
static PyObject *__pyx_n_s_size;
static PyObject *__pyx_n_u_size;
static PyObject *__pyx_n_s_sizeof;
static PyObject *__pyx_n_s_skipna;
static PyObject *__pyx_n_s_sleep;
static PyObject *__pyx_n_s_slice;
static PyObject *__pyx_n_s_slots;
static PyObject *__pyx_n_u_snappy;
static PyObject *__pyx_n_s_source;
static PyObject *__pyx_n_s_source_path;
static PyObject *__pyx_n_s_sp_chunked_array;
static PyObject *__pyx_n_s_sp_data_type;
static PyObject *__pyx_n_s_sp_tensor;
static PyObject *__pyx_n_s_sparse;
static PyObject *__pyx_n_u_sparse;
static PyObject *__pyx_n_s_split_blocks;
static PyObject *__pyx_n_u_split_blocks;
static PyObject *__pyx_n_s_stacklevel;
static PyObject *__pyx_n_s_start;
static PyObject *__pyx_n_s_startswith;
static PyObject *__pyx_n_s_staticmethod;
static PyObject *__pyx_n_s_step;
static PyObject *__pyx_n_s_stop;
static PyObject *__pyx_n_s_storage;
static PyObject *__pyx_n_s_storage_type;
static PyObject *__pyx_n_s_str;
static PyObject *__pyx_n_u_str_2;
static PyObject *__pyx_n_s_stream;
static PyObject *__pyx_n_s_stream_or_path;
static PyObject *__pyx_n_s_string;
static PyObject *__pyx_n_u_string;
static PyObject *__pyx_n_s_string_to_tzinfo;
static PyObject *__pyx_n_s_string_types;
static PyObject *__pyx_n_s_stringify_path;
static PyObject *__pyx_n_s_strings_to_categorical;
static PyObject *__pyx_n_u_strings_to_categorical;
static PyObject *__pyx_kp_s_stringsource;
static PyObject *__pyx_n_s_strip_hdfs_abspath;
static PyObject *__pyx_n_s_struct;
static PyObject *__pyx_n_s_struct_array;
static PyObject *__pyx_n_s_struct_type;
static PyObject *__pyx_n_s_super;
static PyObject *__pyx_n_s_sys;
static PyObject *__pyx_n_s_table;
static PyObject *__pyx_n_s_table_to_blockmanager;
static PyObject *__pyx_n_s_table_to_blocks;
static PyObject *__pyx_n_s_tables;
static PyObject *__pyx_n_s_take;
static PyObject *__pyx_n_s_target;
static PyObject *__pyx_n_s_target_schema;
static PyObject *__pyx_n_s_target_type;
static PyObject *__pyx_n_s_tb;
static PyObject *__pyx_n_s_tell;
static PyObject *__pyx_n_s_temp_memo;
static PyObject *__pyx_n_s_tensor;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_testing;
static PyObject *__pyx_n_s_threading;
static PyObject *__pyx_n_s_throw;
static PyObject *__pyx_n_s_time;
static PyObject *__pyx_n_s_time32;
static PyObject *__pyx_kp_u_time32_ms;
static PyObject *__pyx_kp_u_time32_s;
static PyObject *__pyx_n_s_time64;
static PyObject *__pyx_kp_u_time64_ns;
static PyObject *__pyx_kp_u_time64_us;
static PyObject *__pyx_n_s_timedelta;
static PyObject *__pyx_kp_u_timedelta64_ns;
static PyObject *__pyx_n_s_timedelta_conversion_functions;
static PyObject *__pyx_n_s_timedelta_conversion_functions_2;
static PyObject *__pyx_n_s_timeout;
static PyObject *__pyx_n_s_timestamp;
static PyObject *__pyx_kp_u_timestamp_ms;
static PyObject *__pyx_kp_u_timestamp_ns;
static PyObject *__pyx_kp_u_timestamp_s;
static PyObject *__pyx_kp_u_timestamp_us;
static PyObject *__pyx_n_s_timezone;
static PyObject *__pyx_n_s_to_numpy;
static PyObject *__pyx_n_s_to_pandas;
static PyObject *__pyx_n_s_to_pandas_2;
static PyObject *__pyx_n_s_to_pybytes;
static PyObject *__pyx_n_s_to_pylist;
static PyObject *__pyx_n_s_tobytes;
static PyObject *__pyx_n_s_total_allocated_bytes;
static PyObject *__pyx_n_s_total_bytes;
static PyObject *__pyx_n_s_total_seconds;
static PyObject *__pyx_n_s_traceback;
static PyObject *__pyx_n_s_truncate;
static PyObject *__pyx_kp_u_trying_to_write_an_immutable_buf;
static PyObject *__pyx_n_s_typ;
static PyObject *__pyx_n_s_type;
static PyObject *__pyx_kp_u_type_2;
static PyObject *__pyx_n_s_type_3;
static PyObject *__pyx_n_s_type_4;
static PyObject *__pyx_n_s_type_codes;
static PyObject *__pyx_kp_u_type_codes_should_have_the_same;
static PyObject *__pyx_n_s_type_for_alias;
static PyObject *__pyx_n_s_type_id;
static PyObject *__pyx_n_s_type_name;
static PyObject *__pyx_n_s_types;
static PyObject *__pyx_n_s_types_mapper;
static PyObject *__pyx_n_s_tz;
static PyObject *__pyx_n_s_tzinfo;
static PyObject *__pyx_n_s_tzinfo_to_string;
static PyObject *__pyx_n_s_tzinfo_to_string_locals_fixed_of;
static PyObject *__pyx_n_u_u1;
static PyObject *__pyx_n_u_u2;
static PyObject *__pyx_n_u_u4;
static PyObject *__pyx_n_u_u8;
static PyObject *__pyx_n_s_uint16;
static PyObject *__pyx_n_u_uint16;
static PyObject *__pyx_n_s_uint32;
static PyObject *__pyx_n_u_uint32;
static PyObject *__pyx_n_s_uint64;
static PyObject *__pyx_n_u_uint64;
static PyObject *__pyx_n_s_uint8;
static PyObject *__pyx_n_u_uint8;
static PyObject *__pyx_n_u_uncompressed;
static PyObject *__pyx_n_s_union;
static PyObject *__pyx_n_s_union_type;
static PyObject *__pyx_n_s_unit;
static PyObject *__pyx_n_s_unit_code;
static PyObject *__pyx_kp_u_unknown_driver_r;
static PyObject *__pyx_n_s_unregister_extension_type;
static PyObject *__pyx_n_s_unregister_py_extension_types;
static PyObject *__pyx_n_s_unsafe;
static PyObject *__pyx_n_s_update;
static PyObject *__pyx_n_s_upload;
static PyObject *__pyx_n_s_upload_locals_bg_write;
static PyObject *__pyx_n_u_us;
static PyObject *__pyx_n_s_use_legacy_format;
static PyObject *__pyx_n_s_use_memory_map;
static PyObject *__pyx_n_s_use_pandas_sentinels;
static PyObject *__pyx_n_s_use_threads;
static PyObject *__pyx_n_u_use_threads;
static PyObject *__pyx_n_s_user;
static PyObject *__pyx_n_s_utc;
static PyObject *__pyx_n_s_utcoffset;
static PyObject *__pyx_n_s_utf8;
static PyObject *__pyx_n_u_utf8;
static PyObject *__pyx_n_s_util;
static PyObject *__pyx_n_s_v;
static PyObject *__pyx_n_s_validate;
static PyObject *__pyx_n_s_value;
static PyObject *__pyx_n_s_value_offsets;
static PyObject *__pyx_n_s_value_type;
static PyObject *__pyx_n_s_values;
static PyObject *__pyx_n_s_values_2;
static PyObject *__pyx_n_s_version;
static PyObject *__pyx_n_s_vstack;
static PyObject *__pyx_n_u_w;
static PyObject *__pyx_n_s_warn;
static PyObject *__pyx_n_s_warnings;
static PyObject *__pyx_n_u_wb;
static PyObject *__pyx_n_s_weakref;
static PyObject *__pyx_n_s_whence;
static PyObject *__pyx_n_s_window;
static PyObject *__pyx_n_s_with_metadata;
static PyObject *__pyx_n_s_wrapped_value;
static PyObject *__pyx_n_s_writable;
static PyObject *__pyx_kp_u_writable_file_expected;
static PyObject *__pyx_n_s_write;
static PyObject *__pyx_n_u_write;
static PyObject *__pyx_n_s_write_batch;
static PyObject *__pyx_n_s_write_table;
static PyObject *__pyx_n_s_write_tensor;
static PyObject *__pyx_n_s_write_to;
static PyObject *__pyx_n_s_writeable;
static PyObject *__pyx_n_s_x;
static PyObject *__pyx_n_s_zero_copy_only;
static PyObject *__pyx_n_u_zero_copy_only;
static PyObject *__pyx_n_s_zip;
static PyObject *__pyx_n_s_zone;
static PyObject *__pyx_kp_u_zst;
static PyObject *__pyx_n_u_zstd;
static PyObject *__pyx_pf_7pyarrow_3lib_cpu_count(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_2set_cpu_count(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_count); /* proto */
static int __pyx_pf_7pyarrow_3lib_14_PandasAPIShim___init__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_2series(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_4data_frame(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_11have_pandas___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_6compat___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_2pd___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_6infer_dtype(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_8pandas_dtype(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_dtype); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_13loose_version___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_7version___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_16categorical_type___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_15datetimetz_type___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_15extension_dtype___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_10is_array_like(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_12is_categorical(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_14is_datetimetz(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_16is_sparse(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_18is_data_frame(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_20is_series(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_22is_index(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_24get_values(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_26assert_frame_equal(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_28get_rangeindex_attribute(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_level, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_14_loose_version___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_8_version___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_3_pd___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_10_types_api___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_14_compat_module___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_11_data_frame___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_6_index___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_7_series___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_17_categorical_type___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_16_datetimetz_type___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_16_extension_array___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_16_extension_dtype___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_17_array_like_types___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_10has_sparse___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_6_pd024___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_30__reduce_cython__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_32__setstate_cython__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13ArrowKeyError___str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_3lib_10MemoryPool___init__(struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10MemoryPool_2bytes_allocated(struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10MemoryPool_4max_memory(struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10MemoryPool_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10MemoryPool_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_17LoggingMemoryPool___init__(struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_17LoggingMemoryPool_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_17LoggingMemoryPool_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_15ProxyMemoryPool___init__(struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15ProxyMemoryPool_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15ProxyMemoryPool_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_4default_memory_pool(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6proxy_memory_pool(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_parent); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8logging_memory_pool(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_parent); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10set_memory_pool(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12log_memory_allocations(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_enable); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14total_allocated_bytes(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16jemalloc_set_decay_ms(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_decay_ms); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18_is_primitive(CYTHON_UNUSED PyObject *__pyx_self, enum  arrow::Type::type __pyx_v_type); /* proto */
static int __pyx_pf_7pyarrow_3lib_8DataType___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_3lib_8DataType_2__init__(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8DataType_2id___get__(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8DataType_9bit_width___get__(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8DataType_12num_children___get__(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8DataType_11num_buffers___get__(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8DataType_4__str__(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self); /* proto */
static Py_hash_t __pyx_pf_7pyarrow_3lib_8DataType_6__hash__(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8DataType_8__reduce__(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8DataType_10__repr__(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8DataType_12__eq__(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8DataType_14equals(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8DataType_16to_pandas_dtype(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_3lib_14DictionaryMemo___cinit__(struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14DictionaryMemo_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14DictionaryMemo_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14DictionaryType___reduce__(struct __pyx_obj_7pyarrow_3lib_DictionaryType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14DictionaryType_7ordered___get__(struct __pyx_obj_7pyarrow_3lib_DictionaryType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14DictionaryType_10index_type___get__(struct __pyx_obj_7pyarrow_3lib_DictionaryType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14DictionaryType_10value_type___get__(struct __pyx_obj_7pyarrow_3lib_DictionaryType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8ListType___reduce__(struct __pyx_obj_7pyarrow_3lib_ListType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8ListType_10value_type___get__(struct __pyx_obj_7pyarrow_3lib_ListType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13LargeListType___reduce__(struct __pyx_obj_7pyarrow_3lib_LargeListType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13LargeListType_10value_type___get__(struct __pyx_obj_7pyarrow_3lib_LargeListType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_7MapType___reduce__(struct __pyx_obj_7pyarrow_3lib_MapType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_7MapType_8key_type___get__(struct __pyx_obj_7pyarrow_3lib_MapType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_7MapType_9item_type___get__(struct __pyx_obj_7pyarrow_3lib_MapType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_17FixedSizeListType___reduce__(struct __pyx_obj_7pyarrow_3lib_FixedSizeListType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_17FixedSizeListType_10value_type___get__(struct __pyx_obj_7pyarrow_3lib_FixedSizeListType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_17FixedSizeListType_9list_size___get__(struct __pyx_obj_7pyarrow_3lib_FixedSizeListType *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_pf_7pyarrow_3lib_10StructType___len__(struct __pyx_obj_7pyarrow_3lib_StructType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10StructType_2__iter__(struct __pyx_obj_7pyarrow_3lib_StructType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10StructType_5__getitem__(struct __pyx_obj_7pyarrow_3lib_StructType *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10StructType_7__reduce__(struct __pyx_obj_7pyarrow_3lib_StructType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_9UnionType_4mode___get__(struct __pyx_obj_7pyarrow_3lib_UnionType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_9UnionType_10type_codes___get__(struct __pyx_obj_7pyarrow_3lib_UnionType *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_pf_7pyarrow_3lib_9UnionType___len__(struct __pyx_obj_7pyarrow_3lib_UnionType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_9UnionType_2__iter__(struct __pyx_obj_7pyarrow_3lib_UnionType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_9UnionType_5__getitem__(struct __pyx_obj_7pyarrow_3lib_UnionType *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_9UnionType_7__reduce__(struct __pyx_obj_7pyarrow_3lib_UnionType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13TimestampType_4unit___get__(struct __pyx_obj_7pyarrow_3lib_TimestampType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13TimestampType_2tz___get__(struct __pyx_obj_7pyarrow_3lib_TimestampType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13TimestampType_to_pandas_dtype(struct __pyx_obj_7pyarrow_3lib_TimestampType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13TimestampType_2__reduce__(struct __pyx_obj_7pyarrow_3lib_TimestampType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10Time32Type_4unit___get__(struct __pyx_obj_7pyarrow_3lib_Time32Type *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10Time64Type_4unit___get__(struct __pyx_obj_7pyarrow_3lib_Time64Type *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12DurationType_4unit___get__(struct __pyx_obj_7pyarrow_3lib_DurationType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19FixedSizeBinaryType___reduce__(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19FixedSizeBinaryType_10byte_width___get__(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14Decimal128Type___reduce__(struct __pyx_obj_7pyarrow_3lib_Decimal128Type *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14Decimal128Type_9precision___get__(struct __pyx_obj_7pyarrow_3lib_Decimal128Type *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14Decimal128Type_5scale___get__(struct __pyx_obj_7pyarrow_3lib_Decimal128Type *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_17BaseExtensionType_14extension_name___get__(struct __pyx_obj_7pyarrow_3lib_BaseExtensionType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_17BaseExtensionType_12storage_type___get__(struct __pyx_obj_7pyarrow_3lib_BaseExtensionType *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_3lib_13ExtensionType___cinit__(struct __pyx_obj_7pyarrow_3lib_ExtensionType *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_3lib_13ExtensionType_2__init__(struct __pyx_obj_7pyarrow_3lib_ExtensionType *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_storage_type, PyObject *__pyx_v_extension_name); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13ExtensionType_4__eq__(struct __pyx_obj_7pyarrow_3lib_ExtensionType *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13ExtensionType_6__arrow_ext_serialize__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_ExtensionType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13ExtensionType_8__arrow_ext_deserialize__(CYTHON_UNUSED PyTypeObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_storage_type, CYTHON_UNUSED PyObject *__pyx_v_serialized); /* proto */
static int __pyx_pf_7pyarrow_3lib_15PyExtensionType___cinit__(struct __pyx_obj_7pyarrow_3lib_PyExtensionType *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_3lib_15PyExtensionType_2__init__(struct __pyx_obj_7pyarrow_3lib_PyExtensionType *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_storage_type); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15PyExtensionType_4__reduce__(struct __pyx_obj_7pyarrow_3lib_PyExtensionType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15PyExtensionType_6__arrow_ext_serialize__(struct __pyx_obj_7pyarrow_3lib_PyExtensionType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15PyExtensionType_8__arrow_ext_deserialize__(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_storage_type, PyObject *__pyx_v_serialized); /* proto */
static int __pyx_pf_7pyarrow_3lib_20UnknownExtensionType___init__(struct __pyx_obj_7pyarrow_3lib_UnknownExtensionType *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_storage_type, PyObject *__pyx_v_serialized); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_20UnknownExtensionType_2__arrow_ext_serialize__(struct __pyx_obj_7pyarrow_3lib_UnknownExtensionType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_20register_extension_type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ext_type); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_22unregister_extension_type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_type_name); /* proto */
static int __pyx_pf_7pyarrow_3lib_5Field___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_3lib_5Field_2__init__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Field_4equals(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Field_6__eq__(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Field_8__reduce__(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Field_10__str__(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Field_12__repr__(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self); /* proto */
static Py_hash_t __pyx_pf_7pyarrow_3lib_5Field_14__hash__(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Field_8nullable___get__(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Field_4name___get__(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Field_8metadata___get__(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Field_16add_metadata(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self, PyObject *__pyx_v_metadata); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Field_18with_metadata(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self, PyObject *__pyx_v_metadata); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Field_20remove_metadata(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Field_22flatten(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Field_4type___get__(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_3lib_6Schema___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_3lib_6Schema_2__init__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_pf_7pyarrow_3lib_6Schema_4__len__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_6__getitem__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_8__iter__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_11__reduce__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self); /* proto */
static Py_hash_t __pyx_pf_7pyarrow_3lib_6Schema_13__hash__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_15__sizeof__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_15pandas_metadata___get__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_5names___get__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_5types___get__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_8metadata___get__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_17__eq__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_19empty_table(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_21equals(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_other, int __pyx_v_check_metadata); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_23from_pandas(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_df, PyObject *__pyx_v_preserve_index); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_25field(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_27_field(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, int __pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_29field_by_name(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_31get_field_index(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_33append(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_field); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_35insert(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, int __pyx_v_i, struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_field); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_37remove(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, int __pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_39set(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, int __pyx_v_i, struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_field); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_41add_metadata(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, PyObject *__pyx_v_metadata); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_43with_metadata(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, PyObject *__pyx_v_metadata); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_45serialize(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *__pyx_v_dictionary_memo, PyObject *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_47remove_metadata(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_49__str__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_51__repr__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_24field(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name, PyObject *__pyx_v_type, int __pyx_v_nullable, PyObject *__pyx_v_metadata); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_26null(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_28bool_(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_30uint8(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_32int8(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_34uint16(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_36int16(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_38uint32(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_40int32(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_42uint64(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_44int64(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16tzinfo_to_string_fixed_offset_to_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_offset); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_46tzinfo_to_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_tz); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_48string_to_tzinfo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_50timestamp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_unit, PyObject *__pyx_v_tz); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_52time32(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_unit); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_54time64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_unit); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_56duration(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_unit); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_58date32(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_60date64(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_62float16(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_64float32(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_66float64(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_68decimal128(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_precision, int __pyx_v_scale); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_70string(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_72utf8(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_74binary(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_length); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_76large_binary(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_78large_string(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_80large_utf8(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_82list_(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value_type, int __pyx_v_list_size); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_84large_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value_type); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_86map_(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_key_type, PyObject *__pyx_v_item_type, PyObject *__pyx_v_keys_sorted); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_88dictionary(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_index_type, PyObject *__pyx_v_value_type, int __pyx_v_ordered); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_90struct(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fields); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_92union(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_children_fields, PyObject *__pyx_v_mode, PyObject *__pyx_v_type_codes); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_94type_for_alias(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_96schema(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fields, PyObject *__pyx_v_metadata); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_98from_numpy_dtype(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dtype); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_100is_boolean_value(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_102is_integer_value(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_104is_float_value(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */
static int __pyx_pf_7pyarrow_3lib_23_ExtensionRegistryNanny___cinit__(struct __pyx_obj_7pyarrow_3lib__ExtensionRegistryNanny *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_23_ExtensionRegistryNanny_2release_registry(struct __pyx_obj_7pyarrow_3lib__ExtensionRegistryNanny *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_23_ExtensionRegistryNanny_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__ExtensionRegistryNanny *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_23_ExtensionRegistryNanny_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__ExtensionRegistryNanny *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_106_register_py_extension_type(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_108_unregister_py_extension_types(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Scalar_4type___get__(struct __pyx_obj_7pyarrow_3lib_Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Scalar___reduce_cython__(struct __pyx_obj_7pyarrow_3lib_Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Scalar_2__setstate_cython__(struct __pyx_obj_7pyarrow_3lib_Scalar *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_8NullType___cinit__(struct __pyx_obj_7pyarrow_3lib_NullType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8NullType_2__repr__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NullType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8NullType_4as_py(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NullType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8NullType_6__eq__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NullType *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8NullType_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NullType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8NullType_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NullType *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_10ArrayValue___init__(struct __pyx_obj_7pyarrow_3lib_ArrayValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10ArrayValue_2__repr__(struct __pyx_obj_7pyarrow_3lib_ArrayValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10ArrayValue_4__str__(struct __pyx_obj_7pyarrow_3lib_ArrayValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10ArrayValue_6__eq__(struct __pyx_obj_7pyarrow_3lib_ArrayValue *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static Py_hash_t __pyx_pf_7pyarrow_3lib_10ArrayValue_8__hash__(struct __pyx_obj_7pyarrow_3lib_ArrayValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10ArrayValue_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_ArrayValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10ArrayValue_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_ArrayValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12BooleanValue_as_py(struct __pyx_obj_7pyarrow_3lib_BooleanValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12BooleanValue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BooleanValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12BooleanValue_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BooleanValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_9Int8Value_as_py(struct __pyx_obj_7pyarrow_3lib_Int8Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_9Int8Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int8Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_9Int8Value_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int8Value *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10UInt8Value_as_py(struct __pyx_obj_7pyarrow_3lib_UInt8Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10UInt8Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt8Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10UInt8Value_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt8Value *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10Int16Value_as_py(struct __pyx_obj_7pyarrow_3lib_Int16Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10Int16Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int16Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10Int16Value_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int16Value *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11UInt16Value_as_py(struct __pyx_obj_7pyarrow_3lib_UInt16Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11UInt16Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt16Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11UInt16Value_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt16Value *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10Int32Value_as_py(struct __pyx_obj_7pyarrow_3lib_Int32Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10Int32Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int32Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10Int32Value_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int32Value *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11UInt32Value_as_py(struct __pyx_obj_7pyarrow_3lib_UInt32Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11UInt32Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt32Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11UInt32Value_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt32Value *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10Int64Value_as_py(struct __pyx_obj_7pyarrow_3lib_Int64Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10Int64Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int64Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10Int64Value_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int64Value *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11UInt64Value_as_py(struct __pyx_obj_7pyarrow_3lib_UInt64Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11UInt64Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt64Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11UInt64Value_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt64Value *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Date32Value_as_py(struct __pyx_obj_7pyarrow_3lib_Date32Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Date32Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Date32Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Date32Value_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Date32Value *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Date64Value_as_py(struct __pyx_obj_7pyarrow_3lib_Date64Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Date64Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Date64Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Date64Value_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Date64Value *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Time32Value_as_py(struct __pyx_obj_7pyarrow_3lib_Time32Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Time32Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Time32Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Time32Value_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Time32Value *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Time64Value_as_py(struct __pyx_obj_7pyarrow_3lib_Time64Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Time64Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Time64Value *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Time64Value_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Time64Value *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_110_box_time_milli(CYTHON_UNUSED PyObject *__pyx_self, int64_t __pyx_v_val); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_112_box_time_micro(CYTHON_UNUSED PyObject *__pyx_self, int64_t __pyx_v_val); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_114_nanoseconds_to_datetime_safe(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_v, PyObject *__pyx_v_tzinfo); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_116_microseconds_to_datetime(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_v, PyObject *__pyx_v_tzinfo); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_118_millis_to_datetime(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_v, PyObject *__pyx_v_tzinfo); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_120_seconds_to_datetime(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_v, PyObject *__pyx_v_tzinfo); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_tzinfo); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_122_datetime_conversion_functions(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14TimestampValue_5value___get__(struct __pyx_obj_7pyarrow_3lib_TimestampValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14TimestampValue_as_py(struct __pyx_obj_7pyarrow_3lib_TimestampValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14TimestampValue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_TimestampValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14TimestampValue_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_TimestampValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_124_nanoseconds_to_timedelta_safe(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_v); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda1(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_v); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda2(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_v); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_v); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda4(PyObject *__pyx_self, PyObject *__pyx_v_v); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_126_timedelta_conversion_functions(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13DurationValue_5value___get__(struct __pyx_obj_7pyarrow_3lib_DurationValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13DurationValue_as_py(struct __pyx_obj_7pyarrow_3lib_DurationValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13DurationValue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DurationValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13DurationValue_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DurationValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14HalfFloatValue_as_py(struct __pyx_obj_7pyarrow_3lib_HalfFloatValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14HalfFloatValue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_HalfFloatValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14HalfFloatValue_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_HalfFloatValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10FloatValue_as_py(struct __pyx_obj_7pyarrow_3lib_FloatValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10FloatValue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FloatValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10FloatValue_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FloatValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11DoubleValue_as_py(struct __pyx_obj_7pyarrow_3lib_DoubleValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11DoubleValue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DoubleValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11DoubleValue_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DoubleValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12DecimalValue_as_py(struct __pyx_obj_7pyarrow_3lib_DecimalValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12DecimalValue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DecimalValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12DecimalValue_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DecimalValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11StringValue_as_py(struct __pyx_obj_7pyarrow_3lib_StringValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11StringValue_2as_buffer(struct __pyx_obj_7pyarrow_3lib_StringValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11StringValue_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_StringValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11StringValue_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_StringValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16LargeStringValue_as_py(struct __pyx_obj_7pyarrow_3lib_LargeStringValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16LargeStringValue_2as_buffer(struct __pyx_obj_7pyarrow_3lib_LargeStringValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16LargeStringValue_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_LargeStringValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16LargeStringValue_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_LargeStringValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11BinaryValue_as_py(struct __pyx_obj_7pyarrow_3lib_BinaryValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11BinaryValue_2as_buffer(struct __pyx_obj_7pyarrow_3lib_BinaryValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11BinaryValue_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BinaryValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11BinaryValue_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BinaryValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16LargeBinaryValue_as_py(struct __pyx_obj_7pyarrow_3lib_LargeBinaryValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16LargeBinaryValue_2as_buffer(struct __pyx_obj_7pyarrow_3lib_LargeBinaryValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16LargeBinaryValue_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_LargeBinaryValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16LargeBinaryValue_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_LargeBinaryValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static Py_ssize_t __pyx_pf_7pyarrow_3lib_9ListValue___len__(struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_9ListValue_2__getitem__(struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_9ListValue_4__iter__(struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_9ListValue_7as_py(struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_9ListValue_10value_type___get__(struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_9ListValue_9__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_9ListValue_11__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static Py_ssize_t __pyx_pf_7pyarrow_3lib_14LargeListValue___len__(struct __pyx_obj_7pyarrow_3lib_LargeListValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14LargeListValue_2__getitem__(struct __pyx_obj_7pyarrow_3lib_LargeListValue *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14LargeListValue_4__iter__(struct __pyx_obj_7pyarrow_3lib_LargeListValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14LargeListValue_7as_py(struct __pyx_obj_7pyarrow_3lib_LargeListValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14LargeListValue_10value_type___get__(struct __pyx_obj_7pyarrow_3lib_LargeListValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14LargeListValue_9__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_LargeListValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14LargeListValue_11__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_LargeListValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static Py_ssize_t __pyx_pf_7pyarrow_3lib_8MapValue___len__(struct __pyx_obj_7pyarrow_3lib_MapValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8MapValue_2__getitem__(struct __pyx_obj_7pyarrow_3lib_MapValue *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8MapValue_4__iter__(struct __pyx_obj_7pyarrow_3lib_MapValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8MapValue_7as_py(struct __pyx_obj_7pyarrow_3lib_MapValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8MapValue_8key_type___get__(struct __pyx_obj_7pyarrow_3lib_MapValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8MapValue_9item_type___get__(struct __pyx_obj_7pyarrow_3lib_MapValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8MapValue_9__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MapValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8MapValue_11__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MapValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static Py_ssize_t __pyx_pf_7pyarrow_3lib_18FixedSizeListValue___len__(struct __pyx_obj_7pyarrow_3lib_FixedSizeListValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18FixedSizeListValue_2__getitem__(struct __pyx_obj_7pyarrow_3lib_FixedSizeListValue *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18FixedSizeListValue_4__iter__(struct __pyx_obj_7pyarrow_3lib_FixedSizeListValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18FixedSizeListValue_7as_py(struct __pyx_obj_7pyarrow_3lib_FixedSizeListValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18FixedSizeListValue_10value_type___get__(struct __pyx_obj_7pyarrow_3lib_FixedSizeListValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18FixedSizeListValue_9__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FixedSizeListValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18FixedSizeListValue_11__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FixedSizeListValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10UnionValue_as_py(struct __pyx_obj_7pyarrow_3lib_UnionValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10UnionValue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UnionValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10UnionValue_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UnionValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_20FixedSizeBinaryValue_as_py(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_20FixedSizeBinaryValue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_20FixedSizeBinaryValue_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11StructValue___getitem__(struct __pyx_obj_7pyarrow_3lib_StructValue *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11StructValue_2as_py(struct __pyx_obj_7pyarrow_3lib_StructValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11StructValue_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_StructValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11StructValue_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_StructValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15DictionaryValue_as_py(struct __pyx_obj_7pyarrow_3lib_DictionaryValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15DictionaryValue_11index_value___get__(struct __pyx_obj_7pyarrow_3lib_DictionaryValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15DictionaryValue_16dictionary_value___get__(struct __pyx_obj_7pyarrow_3lib_DictionaryValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15DictionaryValue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DictionaryValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15DictionaryValue_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DictionaryValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_11ScalarValue___init__(struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11ScalarValue_2__repr__(struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11ScalarValue_4__str__(struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11ScalarValue_6__eq__(struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static Py_hash_t __pyx_pf_7pyarrow_3lib_11ScalarValue_8__hash__(struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11ScalarValue_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11ScalarValue_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11UInt8Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_UInt8Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11UInt8Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt8Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11UInt8Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt8Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10Int8Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_Int8Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10Int8Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int8Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10Int8Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int8Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12UInt16Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_UInt16Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12UInt16Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt16Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12UInt16Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt16Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Int16Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_Int16Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Int16Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int16Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Int16Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int16Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12UInt32Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_UInt32Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12UInt32Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt32Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12UInt32Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt32Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Int32Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_Int32Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Int32Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int32Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Int32Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int32Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12UInt64Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_UInt64Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12UInt64Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt64Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12UInt64Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt64Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Int64Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_Int64Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Int64Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int64Scalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11Int64Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int64Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11FloatScalar_as_py(struct __pyx_obj_7pyarrow_3lib_FloatScalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11FloatScalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FloatScalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11FloatScalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FloatScalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12DoubleScalar_as_py(struct __pyx_obj_7pyarrow_3lib_DoubleScalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12DoubleScalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DoubleScalar *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12DoubleScalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DoubleScalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_128_ndarray_to_arrow_type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_values, struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_type); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_130_handle_arrow_array_protocol(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_type, PyObject *__pyx_v_mask, PyObject *__pyx_v_size); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_132array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_type, PyObject *__pyx_v_mask, PyObject *__pyx_v_size, PyObject *__pyx_v_from_pandas, int __pyx_v_safe, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_134asarray(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_values, PyObject *__pyx_v_type); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_136infer_type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_values, PyObject *__pyx_v_mask, PyObject *__pyx_v_from_pandas); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_138_normalize_slice(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arrow_obj, PyObject *__pyx_v_key); /* proto */
static int __pyx_pf_7pyarrow_3lib_16_FunctionContext___cinit__(struct __pyx_obj_7pyarrow_3lib__FunctionContext *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16_FunctionContext_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__FunctionContext *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16_FunctionContext_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__FunctionContext *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_140_restore_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18_PandasConvertible_to_pandas(struct __pyx_obj_7pyarrow_3lib__PandasConvertible *__pyx_v_self, PyObject *__pyx_v_memory_pool, PyObject *__pyx_v_categories, int __pyx_v_strings_to_categorical, int __pyx_v_zero_copy_only, int __pyx_v_integer_object_nulls, int __pyx_v_date_as_object, int __pyx_v_use_threads, int __pyx_v_deduplicate_objects, int __pyx_v_ignore_metadata, int __pyx_v_split_blocks, int __pyx_v_self_destruct, PyObject *__pyx_v_types_mapper); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18_PandasConvertible_2__reduce_cython__(struct __pyx_obj_7pyarrow_3lib__PandasConvertible *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18_PandasConvertible_4__setstate_cython__(struct __pyx_obj_7pyarrow_3lib__PandasConvertible *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_5Array___init__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_2__eq__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_4_debug_print(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_6diff(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_8cast(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, PyObject *__pyx_v_target_type, int __pyx_v_safe); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_10view(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, PyObject *__pyx_v_target_type); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_12sum(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_14unique(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_16dictionary_encode(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_18from_pandas(PyObject *__pyx_v_obj, PyObject *__pyx_v_mask, PyObject *__pyx_v_type, int __pyx_v_safe, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_20__reduce__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_22from_buffers(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_type, PyObject *__pyx_v_length, PyObject *__pyx_v_buffers, PyObject *__pyx_v_null_count, PyObject *__pyx_v_offset, PyObject *__pyx_v_children); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_10null_count___get__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_6nbytes___get__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_24__sizeof__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_26__iter__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_29__repr__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_31format(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, int __pyx_v_indent, int __pyx_v_window); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_33__str__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_35equals(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_other); /* proto */
static Py_ssize_t __pyx_pf_7pyarrow_3lib_5Array_37__len__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_39isnull(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_41__getitem__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_43slice(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, PyObject *__pyx_v_offset, PyObject *__pyx_v_length); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_45take(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_indices); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_47filter(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_mask); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_49_to_pandas(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, PyObject *__pyx_v_options, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_51__array__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, PyObject *__pyx_v_dtype); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_53to_numpy(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, PyObject *__pyx_v_zero_copy_only, PyObject *__pyx_v_writable); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_55to_pylist(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_57validate(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, PyObject *__pyx_v_full); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_6offset___get__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_59buffers(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_4type___get__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_5_name___get__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_9ListArray_from_arrays(PyObject *__pyx_v_offsets, PyObject *__pyx_v_values, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_9ListArray_6values___get__(struct __pyx_obj_7pyarrow_3lib_ListArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_9ListArray_7offsets___get__(struct __pyx_obj_7pyarrow_3lib_ListArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_9ListArray_2flatten(struct __pyx_obj_7pyarrow_3lib_ListArray *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14LargeListArray_from_arrays(PyObject *__pyx_v_offsets, PyObject *__pyx_v_values, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14LargeListArray_6values___get__(struct __pyx_obj_7pyarrow_3lib_LargeListArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14LargeListArray_7offsets___get__(struct __pyx_obj_7pyarrow_3lib_LargeListArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14LargeListArray_2flatten(struct __pyx_obj_7pyarrow_3lib_LargeListArray *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8MapArray_from_arrays(PyObject *__pyx_v_offsets, PyObject *__pyx_v_keys, PyObject *__pyx_v_items, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8MapArray_4keys___get__(struct __pyx_obj_7pyarrow_3lib_MapArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8MapArray_5items___get__(struct __pyx_obj_7pyarrow_3lib_MapArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18FixedSizeListArray_from_arrays(PyObject *__pyx_v_values, int32_t __pyx_v_list_size); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18FixedSizeListArray_6values___get__(struct __pyx_obj_7pyarrow_3lib_FixedSizeListArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18FixedSizeListArray_2flatten(struct __pyx_obj_7pyarrow_3lib_FixedSizeListArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10UnionArray_from_dense(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_types, struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_value_offsets, PyObject *__pyx_v_children, PyObject *__pyx_v_field_names, PyObject *__pyx_v_type_codes); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10UnionArray_2from_sparse(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_types, PyObject *__pyx_v_children, PyObject *__pyx_v_field_names, PyObject *__pyx_v_type_codes); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11StringArray_from_buffers(int __pyx_v_length, struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_value_offsets, struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_data, struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_null_bitmap, int __pyx_v_null_count, int __pyx_v_offset); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16LargeStringArray_from_buffers(int __pyx_v_length, struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_value_offsets, struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_data, struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_null_bitmap, int __pyx_v_null_count, int __pyx_v_offset); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15DictionaryArray_dictionary_encode(struct __pyx_obj_7pyarrow_3lib_DictionaryArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15DictionaryArray_10dictionary___get__(struct __pyx_obj_7pyarrow_3lib_DictionaryArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15DictionaryArray_7indices___get__(struct __pyx_obj_7pyarrow_3lib_DictionaryArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15DictionaryArray_2from_arrays(PyObject *__pyx_v_indices, PyObject *__pyx_v_dictionary, PyObject *__pyx_v_mask, int __pyx_v_ordered, int __pyx_v_from_pandas, int __pyx_v_safe, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11StructArray_field(struct __pyx_obj_7pyarrow_3lib_StructArray *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11StructArray_2flatten(struct __pyx_obj_7pyarrow_3lib_StructArray *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11StructArray_4from_arrays(PyObject *__pyx_v_arrays, PyObject *__pyx_v_names, PyObject *__pyx_v_fields); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14ExtensionArray_7storage___get__(struct __pyx_obj_7pyarrow_3lib_ExtensionArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14ExtensionArray_from_storage(struct __pyx_obj_7pyarrow_3lib_BaseExtensionType *__pyx_v_typ, struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_storage); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14ExtensionArray_2_to_pandas(struct __pyx_obj_7pyarrow_3lib_ExtensionArray *__pyx_v_self, PyObject *__pyx_v_options, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14ExtensionArray_4to_numpy(struct __pyx_obj_7pyarrow_3lib_ExtensionArray *__pyx_v_self, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_142concat_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arrays, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static int __pyx_pf_7pyarrow_3lib_13StringBuilder___cinit__(struct __pyx_obj_7pyarrow_3lib_StringBuilder *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13StringBuilder_2append(struct __pyx_obj_7pyarrow_3lib_StringBuilder *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13StringBuilder_4append_values(struct __pyx_obj_7pyarrow_3lib_StringBuilder *__pyx_v_self, PyObject *__pyx_v_values); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13StringBuilder_6finish(struct __pyx_obj_7pyarrow_3lib_StringBuilder *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13StringBuilder_10null_count___get__(struct __pyx_obj_7pyarrow_3lib_StringBuilder *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_pf_7pyarrow_3lib_13StringBuilder_8__len__(struct __pyx_obj_7pyarrow_3lib_StringBuilder *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13StringBuilder_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_StringBuilder *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13StringBuilder_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_StringBuilder *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_12ChunkedArray___cinit__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_3lib_12ChunkedArray_2__init__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_4__reduce__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_4data___get__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_4type___get__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_6length(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_pf_7pyarrow_3lib_12ChunkedArray_8__len__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_10__repr__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_12format(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, int __pyx_v_indent, int __pyx_v_window); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_14__str__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_16validate(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, PyObject *__pyx_v_full); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_10null_count___get__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_6nbytes___get__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_18__sizeof__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_20__iter__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_23__getitem__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_25__eq__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_27equals(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_29_to_pandas(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, PyObject *__pyx_v_options, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_31__array__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, PyObject *__pyx_v_dtype); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_33cast(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, PyObject *__pyx_v_target_type, int __pyx_v_safe); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_35dictionary_encode(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_37flatten(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_39unique(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_41slice(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, PyObject *__pyx_v_offset, PyObject *__pyx_v_length); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_10num_chunks___get__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_43chunk(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_6chunks___get__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_45iterchunks(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_48to_pylist(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_5_name___get__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_144chunked_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arrays, PyObject *__pyx_v_type); /* proto */
static int __pyx_pf_7pyarrow_3lib_11RecordBatch___cinit__(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_3lib_11RecordBatch_2__init__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_4__reduce__(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_pf_7pyarrow_3lib_11RecordBatch_6__len__(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_8validate(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self, PyObject *__pyx_v_full); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_10replace_schema_metadata(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self, PyObject *__pyx_v_metadata); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_11num_columns___get__(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_8num_rows___get__(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_6schema___get__(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_7columns___get__(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_12column(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_6nbytes___get__(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_14__sizeof__(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_16__getitem__(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_18serialize(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self, PyObject *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_20slice(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self, PyObject *__pyx_v_offset, PyObject *__pyx_v_length); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_22equals(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_24to_pydict(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_26_to_pandas(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self, PyObject *__pyx_v_options, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_28from_pandas(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_df, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, PyObject *__pyx_v_preserve_index, PyObject *__pyx_v_nthreads, PyObject *__pyx_v_columns); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_30from_arrays(PyObject *__pyx_v_arrays, PyObject *__pyx_v_names, PyObject *__pyx_v_schema, PyObject *__pyx_v_metadata); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_32from_struct_array(struct __pyx_obj_7pyarrow_3lib_StructArray *__pyx_v_struct_array); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_146_reconstruct_record_batch(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_columns, PyObject *__pyx_v_schema); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_148table_to_blocks(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_options, struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_table, PyObject *__pyx_v_categories, PyObject *__pyx_v_extension_columns); /* proto */
static int __pyx_pf_7pyarrow_3lib_5Table___cinit__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_3lib_5Table_2__init__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_4__repr__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_6validate(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_full); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_8__reduce__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_10__getitem__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_12slice(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_offset, PyObject *__pyx_v_length); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_14replace_schema_metadata(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_metadata); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_16flatten(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_18combine_chunks(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_20__eq__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_22equals(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_24cast(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_target_schema, int __pyx_v_safe); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_26from_pandas(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_df, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, PyObject *__pyx_v_preserve_index, PyObject *__pyx_v_nthreads, PyObject *__pyx_v_columns, int __pyx_v_safe); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_28from_arrays(PyObject *__pyx_v_arrays, PyObject *__pyx_v_names, PyObject *__pyx_v_schema, PyObject *__pyx_v_metadata); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_30from_pydict(PyObject *__pyx_v_mapping, PyObject *__pyx_v_schema, PyObject *__pyx_v_metadata); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_32from_batches(PyObject *__pyx_v_batches, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_34to_batches(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_max_chunksize, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_36_to_pandas(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_options, PyObject *__pyx_v_categories, PyObject *__pyx_v_ignore_metadata, PyObject *__pyx_v_types_mapper); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_38to_pydict(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_6schema___get__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_40field(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_42column(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_44_column(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, int __pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_46itercolumns(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_7columns___get__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_11num_columns___get__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_8num_rows___get__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_pf_7pyarrow_3lib_5Table_49__len__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_5shape___get__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_6nbytes___get__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_51__sizeof__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_53add_column(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, int __pyx_v_i, PyObject *__pyx_v_field_, PyObject *__pyx_v_column); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_55append_column(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_field_, PyObject *__pyx_v_column); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_57remove_column(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, int __pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_59set_column(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, int __pyx_v_i, PyObject *__pyx_v_field_, PyObject *__pyx_v_column); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_12column_names___get__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_61rename_columns(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_names); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_63drop(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_columns); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_150_reconstruct_table(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arrays, PyObject *__pyx_v_schema); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_152record_batch(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_names, PyObject *__pyx_v_schema, PyObject *__pyx_v_metadata); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_154table(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_names, PyObject *__pyx_v_schema, PyObject *__pyx_v_metadata); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_156concat_tables(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_tables, bool __pyx_v_promote, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static int __pyx_pf_7pyarrow_3lib_6Tensor___init__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_2__repr__(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_4from_numpy(PyObject *__pyx_v_obj, PyObject *__pyx_v_dim_names); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_6to_numpy(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_8equals(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_10__eq__(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_12dim_name(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_9dim_names___get__(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_10is_mutable___get__(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_13is_contiguous___get__(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_4ndim___get__(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_4size___get__(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_5shape___get__(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_7strides___get__(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_3lib_6Tensor_14__getbuffer__(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self, Py_buffer *__pyx_v_buffer, CYTHON_UNUSED int __pyx_v_flags); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_4type___get__(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_16__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_18__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_15SparseCOOTensor___init__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_2__repr__(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_4from_dense_numpy(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_obj, PyObject *__pyx_v_dim_names); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_6from_numpy(PyObject *__pyx_v_data, PyObject *__pyx_v_coords, PyObject *__pyx_v_shape, PyObject *__pyx_v_dim_names); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_8from_scipy(PyObject *__pyx_v_obj, PyObject *__pyx_v_dim_names); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_10from_pydata_sparse(PyObject *__pyx_v_obj, PyObject *__pyx_v_dim_names); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_12from_tensor(PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_14to_numpy(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_16to_scipy(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_18to_pydata_sparse(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_20to_tensor(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_22equals(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_24__eq__(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_10is_mutable___get__(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_4ndim___get__(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_5shape___get__(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_4size___get__(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_26dim_name(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_9dim_names_7__get___genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_9dim_names___get__(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_15non_zero_length___get__(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_4type___get__(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_28__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_30__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_15SparseCSRMatrix___init__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_2__repr__(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_4from_dense_numpy(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_obj, PyObject *__pyx_v_dim_names); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_6from_numpy(PyObject *__pyx_v_data, PyObject *__pyx_v_indptr, PyObject *__pyx_v_indices, PyObject *__pyx_v_shape, PyObject *__pyx_v_dim_names); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_8from_scipy(PyObject *__pyx_v_obj, PyObject *__pyx_v_dim_names); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_10from_tensor(PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_12to_numpy(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_14to_scipy(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_16to_tensor(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_18equals(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_20__eq__(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_10is_mutable___get__(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_4ndim___get__(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_5shape___get__(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_4size___get__(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_22dim_name(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_9dim_names_7__get___genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_9dim_names___get__(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_15non_zero_length___get__(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_4type___get__(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_24__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_26__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_11CastOptions___init__(struct __pyx_obj_7pyarrow_3lib_CastOptions *__pyx_v_self, PyObject *__pyx_v_allow_int_overflow, PyObject *__pyx_v_allow_time_truncate, PyObject *__pyx_v_allow_time_overflow, PyObject *__pyx_v_allow_float_truncate, PyObject *__pyx_v_allow_invalid_utf8); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11CastOptions_2safe(void); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11CastOptions_4unsafe(void); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11CastOptions_18allow_int_overflow___get__(struct __pyx_obj_7pyarrow_3lib_CastOptions *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_3lib_11CastOptions_18allow_int_overflow_2__set__(struct __pyx_obj_7pyarrow_3lib_CastOptions *__pyx_v_self, int __pyx_v_flag); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11CastOptions_19allow_time_truncate___get__(struct __pyx_obj_7pyarrow_3lib_CastOptions *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_3lib_11CastOptions_19allow_time_truncate_2__set__(struct __pyx_obj_7pyarrow_3lib_CastOptions *__pyx_v_self, int __pyx_v_flag); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11CastOptions_19allow_time_overflow___get__(struct __pyx_obj_7pyarrow_3lib_CastOptions *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_3lib_11CastOptions_19allow_time_overflow_2__set__(struct __pyx_obj_7pyarrow_3lib_CastOptions *__pyx_v_self, int __pyx_v_flag); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11CastOptions_20allow_float_truncate___get__(struct __pyx_obj_7pyarrow_3lib_CastOptions *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_3lib_11CastOptions_20allow_float_truncate_2__set__(struct __pyx_obj_7pyarrow_3lib_CastOptions *__pyx_v_self, int __pyx_v_flag); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11CastOptions_18allow_invalid_utf8___get__(struct __pyx_obj_7pyarrow_3lib_CastOptions *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_3lib_11CastOptions_18allow_invalid_utf8_2__set__(struct __pyx_obj_7pyarrow_3lib_CastOptions *__pyx_v_self, int __pyx_v_flag); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11CastOptions_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_CastOptions *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11CastOptions_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_CastOptions *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_10NativeFile___cinit__(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static void __pyx_pf_7pyarrow_3lib_10NativeFile_2__dealloc__(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_4__enter__(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_6__exit__(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc_type, CYTHON_UNUSED PyObject *__pyx_v_exc_value, CYTHON_UNUSED PyObject *__pyx_v_tb); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_4mode___get__(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_8readable(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_10writable(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_12seekable(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_14isatty(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_16fileno(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_6closed___get__(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_18close(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_20_assert_open(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_22_assert_readable(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_24_assert_writable(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_26_assert_seekable(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_28size(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_30tell(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_32seek(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, int64_t __pyx_v_position, int __pyx_v_whence); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_34flush(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_36write(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_38read(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_nbytes); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_40read_at(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_nbytes, PyObject *__pyx_v_offset); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_42read1(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_nbytes); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_44readall(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_46readinto(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_b); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_48readline(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_size); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_50readlines(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_hint); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_52__iter__(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_54__next__(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_56read_buffer(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_nbytes); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_58truncate(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_60writelines(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_lines); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_8download_cleanup(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_8download_2cleanup(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_8download_4bg_write(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_62download(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_stream_or_path, PyObject *__pyx_v_buffer_size); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_6upload_bg_write(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_64upload(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_stream, PyObject *__pyx_v_buffer_size); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_66__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_68__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_10PythonFile___cinit__(struct __pyx_obj_7pyarrow_3lib_PythonFile *__pyx_v_self, PyObject *__pyx_v_handle, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10PythonFile_2truncate(struct __pyx_obj_7pyarrow_3lib_PythonFile *__pyx_v_self, PyObject *__pyx_v_pos); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10PythonFile_4readline(struct __pyx_obj_7pyarrow_3lib_PythonFile *__pyx_v_self, PyObject *__pyx_v_size); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10PythonFile_6readlines(struct __pyx_obj_7pyarrow_3lib_PythonFile *__pyx_v_self, PyObject *__pyx_v_hint); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10PythonFile_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_PythonFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10PythonFile_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_PythonFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16MemoryMappedFile_create(PyObject *__pyx_v_path, PyObject *__pyx_v_size); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16MemoryMappedFile_2_open(struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16MemoryMappedFile_4resize(struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *__pyx_v_self, PyObject *__pyx_v_new_size); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16MemoryMappedFile_6fileno(struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16MemoryMappedFile_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16MemoryMappedFile_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_158memory_map(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_160create_memory_map(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_size); /* proto */
static int __pyx_pf_7pyarrow_3lib_6OSFile___cinit__(struct __pyx_obj_7pyarrow_3lib_OSFile *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_mode, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6OSFile_2fileno(struct __pyx_obj_7pyarrow_3lib_OSFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6OSFile_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_OSFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6OSFile_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_OSFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_21FixedSizeBufferWriter___cinit__(struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_buffer); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_21FixedSizeBufferWriter_2set_memcopy_threads(struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *__pyx_v_self, int __pyx_v_num_threads); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_21FixedSizeBufferWriter_4set_memcopy_blocksize(struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *__pyx_v_self, int64_t __pyx_v_blocksize); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_21FixedSizeBufferWriter_6set_memcopy_threshold(struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *__pyx_v_self, int64_t __pyx_v_threshold); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_21FixedSizeBufferWriter_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_21FixedSizeBufferWriter_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_6Buffer___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_3lib_6Buffer_2__init__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_pf_7pyarrow_3lib_6Buffer_4__len__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_4size___get__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_7address___get__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_6hex(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_10is_mutable___get__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_6parent___get__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_8__getitem__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_10slice(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, PyObject *__pyx_v_offset, PyObject *__pyx_v_length); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_12equals(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_14__eq__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_16__reduce_ex__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, PyObject *__pyx_v_protocol); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_18to_pybytes(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_3lib_6Buffer_20__getbuffer__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, Py_buffer *__pyx_v_buffer, int __pyx_v_flags); /* proto */
#if PY_MAJOR_VERSION < 3
static Py_ssize_t __pyx_pf_7pyarrow_3lib_6Buffer_22__getsegcount__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, Py_ssize_t *__pyx_v_len_out); /* proto */
#endif
#if PY_MAJOR_VERSION < 3
static Py_ssize_t __pyx_pf_7pyarrow_3lib_6Buffer_24__getreadbuffer__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p); /* proto */
#endif
#if PY_MAJOR_VERSION < 3
static Py_ssize_t __pyx_pf_7pyarrow_3lib_6Buffer_26__getwritebuffer__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p); /* proto */
#endif
static PyObject *__pyx_pf_7pyarrow_3lib_15ResizableBuffer_resize(struct __pyx_obj_7pyarrow_3lib_ResizableBuffer *__pyx_v_self, int64_t __pyx_v_new_size, PyObject *__pyx_v_shrink_to_fit); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_162allocate_buffer(CYTHON_UNUSED PyObject *__pyx_self, int64_t __pyx_v_size, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool, PyObject *__pyx_v_resizable); /* proto */
static int __pyx_pf_7pyarrow_3lib_18BufferOutputStream___cinit__(struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18BufferOutputStream_2getvalue(struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18BufferOutputStream_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18BufferOutputStream_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_16MockOutputStream___cinit__(struct __pyx_obj_7pyarrow_3lib_MockOutputStream *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16MockOutputStream_2size(struct __pyx_obj_7pyarrow_3lib_MockOutputStream *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16MockOutputStream_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MockOutputStream *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16MockOutputStream_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MockOutputStream *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_12BufferReader___cinit__(struct __pyx_obj_7pyarrow_3lib_BufferReader *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12BufferReader_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12BufferReader_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_21CompressedInputStream___init__(struct __pyx_obj_7pyarrow_3lib_CompressedInputStream *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_stream, PyObject *__pyx_v_compression); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_21CompressedInputStream_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_CompressedInputStream *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_21CompressedInputStream_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_CompressedInputStream *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_22CompressedOutputStream___init__(struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_stream, PyObject *__pyx_v_compression); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_22CompressedOutputStream_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_22CompressedOutputStream_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_19BufferedInputStream___init__(struct __pyx_obj_7pyarrow_3lib_BufferedInputStream *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_stream, int __pyx_v_buffer_size, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19BufferedInputStream_2detach(struct __pyx_obj_7pyarrow_3lib_BufferedInputStream *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19BufferedInputStream_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferedInputStream *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19BufferedInputStream_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferedInputStream *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_20BufferedOutputStream___init__(struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_stream, int __pyx_v_buffer_size, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_20BufferedOutputStream_2detach(struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_20BufferedOutputStream_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_20BufferedOutputStream_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_164py_buffer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_166foreign_buffer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address, PyObject *__pyx_v_size, PyObject *__pyx_v_base); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_168as_buffer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_o); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_170_detect_compression(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_172compress(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_buf, PyObject *__pyx_v_codec, PyObject *__pyx_v_asbytes, PyObject *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_174decompress(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_buf, PyObject *__pyx_v_decompressed_size, PyObject *__pyx_v_codec, PyObject *__pyx_v_asbytes, PyObject *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_176input_stream(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source, PyObject *__pyx_v_compression, PyObject *__pyx_v_buffer_size); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_178output_stream(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source, PyObject *__pyx_v_compression, PyObject *__pyx_v_buffer_size); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_180have_libhdfs(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_182have_libhdfs3(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_184strip_hdfs_abspath(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem__connect(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_host, PyObject *__pyx_v_port, PyObject *__pyx_v_user, PyObject *__pyx_v_kerb_ticket, PyObject *__pyx_v_driver, PyObject *__pyx_v_extra_conf); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_2connect(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static void __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_4__dealloc__(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_6close(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_8exists(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_10isdir(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_12isfile(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_14get_capacity(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_16get_space_used(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_18df(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_20rename(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_new_path); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_22info(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_24stat(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_26ls(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, int __pyx_v_full_info); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_28chmod(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_30chown(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_owner, PyObject *__pyx_v_group); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_32mkdir(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_34delete(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, int __pyx_v_recursive); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_36open(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_mode, PyObject *__pyx_v_buffer_size, PyObject *__pyx_v_replication, PyObject *__pyx_v_default_block_size); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_38download(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_stream, PyObject *__pyx_v_buffer_size); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_40upload(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_stream, PyObject *__pyx_v_buffer_size); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_7is_open___get__(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_4host___get__(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_4user___get__(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_11kerb_ticket___get__(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_6driver___get__(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_4port___get__(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_10extra_conf___get__(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_42__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_44__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_14_HdfsFileNanny___cinit__(struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *__pyx_v_self, PyObject *__pyx_v_client, PyObject *__pyx_v_file_handle); /* proto */
static void __pyx_pf_7pyarrow_3lib_14_HdfsFileNanny_2__dealloc__(struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_HdfsFileNanny_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_HdfsFileNanny_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static void __pyx_pf_7pyarrow_3lib_8HdfsFile___dealloc__(struct __pyx_obj_7pyarrow_3lib_HdfsFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8HdfsFile_11buffer_size___get__(struct __pyx_obj_7pyarrow_3lib_HdfsFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8HdfsFile_4mode___get__(struct __pyx_obj_7pyarrow_3lib_HdfsFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8HdfsFile_6parent___get__(struct __pyx_obj_7pyarrow_3lib_HdfsFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8HdfsFile_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_HdfsFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8HdfsFile_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_HdfsFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_7Message___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_3lib_7Message_2__init__(struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_7Message_4type___get__(struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_7Message_8metadata___get__(struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_7Message_4body___get__(struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_7Message_4equals(struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_7Message_6serialize_to(struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_sink, PyObject *__pyx_v_alignment, CYTHON_UNUSED PyObject *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_7Message_8serialize(struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self, PyObject *__pyx_v_alignment, PyObject *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_7Message_10__repr__(struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_7Message_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_7Message_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_13MessageReader___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MessageReader *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_3lib_13MessageReader_2__init__(struct __pyx_obj_7pyarrow_3lib_MessageReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13MessageReader_4open_stream(PyObject *__pyx_v_source); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13MessageReader_6__iter__(struct __pyx_obj_7pyarrow_3lib_MessageReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13MessageReader_9read_next_message(struct __pyx_obj_7pyarrow_3lib_MessageReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13MessageReader_11__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MessageReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13MessageReader_13__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MessageReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_write(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self, PyObject *__pyx_v_table_or_batch); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_2write_batch(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_batch); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_4write_table(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_table, PyObject *__pyx_v_max_chunksize, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_6close(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_8__enter__(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_10__exit__(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc_type, CYTHON_UNUSED PyObject *__pyx_v_exc_val, CYTHON_UNUSED PyObject *__pyx_v_exc_tb); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *__pyx_v_self); /* proto */
static void __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter_2__dealloc__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter_18_use_legacy_format___get__(struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter_4_open(struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *__pyx_v_self, PyObject *__pyx_v_sink, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, PyObject *__pyx_v_use_legacy_format); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchReader___iter__(struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_3get_next_batch(struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_5read_next_batch(struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_7read_all(struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_9__enter__(struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_11__exit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc_type, CYTHON_UNUSED PyObject *__pyx_v_exc_val, CYTHON_UNUSED PyObject *__pyx_v_exc_tb); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_13__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_15__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader_2_open(struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *__pyx_v_self, PyObject *__pyx_v_source); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader_6schema___get__(struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileWriter__open(struct __pyx_obj_7pyarrow_3lib__RecordBatchFileWriter *__pyx_v_self, PyObject *__pyx_v_sink, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, PyObject *__pyx_v_use_legacy_format); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileWriter_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchFileWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileWriter_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchFileWriter *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_2_open(struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *__pyx_v_self, PyObject *__pyx_v_source, PyObject *__pyx_v_footer_offset); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_18num_record_batches___get__(struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_4get_batch(struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *__pyx_v_self, int __pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_6read_all(struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_8__enter__(struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_10__exit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc_type, CYTHON_UNUSED PyObject *__pyx_v_exc_value, CYTHON_UNUSED PyObject *__pyx_v_traceback); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_6schema___get__(struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_186get_tensor_size(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_tensor); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_188get_record_batch_size(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_batch); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_190write_tensor(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_tensor, struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_dest); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_192read_tensor(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_194read_message(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_196read_schema(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *__pyx_v_dictionary_memo); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_198read_record_batch(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *__pyx_v_dictionary_memo); /* proto */
static int __pyx_pf_7pyarrow_3lib_13FeatherWriter___cinit__(struct __pyx_obj_7pyarrow_3lib_FeatherWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherWriter_2open(struct __pyx_obj_7pyarrow_3lib_FeatherWriter *__pyx_v_self, PyObject *__pyx_v_dest); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherWriter_4close(struct __pyx_obj_7pyarrow_3lib_FeatherWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherWriter_6write_array(struct __pyx_obj_7pyarrow_3lib_FeatherWriter *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_col, PyObject *__pyx_v_mask); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherWriter_8num_rows___get__(struct __pyx_obj_7pyarrow_3lib_FeatherWriter *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_3lib_13FeatherWriter_8num_rows_2__set__(struct __pyx_obj_7pyarrow_3lib_FeatherWriter *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherWriter_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FeatherWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherWriter_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FeatherWriter *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_13FeatherReader___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_2open(struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self, PyObject *__pyx_v_source, bool __pyx_v_use_memory_map); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_8num_rows___get__(struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_11num_columns___get__(struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_4get_column_name(struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self, int __pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_6get_column(struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self, int __pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_8_read(struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_10_read_indices(struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self, PyObject *__pyx_v_indices); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_12_read_names(struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self, PyObject *__pyx_v_names); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_14__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_16__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14is_named_tuple_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_200is_named_tuple(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_26SerializationCallbackError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message, PyObject *__pyx_v_example_object); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_28DeserializationCallbackError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message, PyObject *__pyx_v_type_id); /* proto */
static int __pyx_pf_7pyarrow_3lib_20SerializationContext___init__(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_2set_pickle(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self, PyObject *__pyx_v_serializer, PyObject *__pyx_v_deserializer); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_4clone(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_6register_type(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self, PyObject *__pyx_v_type_, PyObject *__pyx_v_type_id, PyObject *__pyx_v_pickle, PyObject *__pyx_v_custom_serializer, PyObject *__pyx_v_custom_deserializer); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_8_serialize_callback(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_10_deserialize_callback(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self, PyObject *__pyx_v_serialized_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_12serialize(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_14serialize_to(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self, PyObject *__pyx_v_value, PyObject *__pyx_v_sink); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_16deserialize(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self, PyObject *__pyx_v_what); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_18deserialize_components(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self, PyObject *__pyx_v_what); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_20__reduce_cython__(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_22__setstate_cython__(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_202_get_default_context(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_11total_bytes___get__(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_write_to(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self, PyObject *__pyx_v_sink); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_2deserialize(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_context); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_4to_buffer(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self, PyObject *__pyx_v_nthreads); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_6from_components(PyObject *__pyx_v_components); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_8to_components(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self, PyObject *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_4base___get__(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_204serialize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value, struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_context); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_206serialize_to(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value, PyObject *__pyx_v_sink, struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_context); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_208read_serialized(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source, PyObject *__pyx_v_base); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_210deserialize_from(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source, PyObject *__pyx_v_base, struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_context); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_212deserialize_components(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_components, struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_context); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_214deserialize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_context); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_216benchmark_PandasObjectIsNull(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_218__pyx_unpickle__PandasAPIShim(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_220__pyx_unpickle_Scalar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_222__pyx_unpickle__PandasConvertible(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_224__pyx_unpickle_SerializationContext(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_tp_new_7pyarrow_3lib_Message(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_MemoryPool(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_DataType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_ListType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_LargeListType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_MapType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_FixedSizeListType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_StructType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_DictionaryMemo(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_DictionaryType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_TimestampType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Time32Type(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Time64Type(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_DurationType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_FixedSizeBinaryType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Decimal128Type(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_BaseExtensionType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_ExtensionType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_PyExtensionType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Field(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Schema(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Scalar(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_NAType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_ArrayValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_ScalarValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Int8Value(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Int64Value(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_ListValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_LargeListValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_MapValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_FixedSizeListValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_StructValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_UnionValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_StringValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_FixedSizeBinaryValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib__PandasConvertible(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Tensor(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_SparseCSRMatrix(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_SparseCOOTensor(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_NullArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_BooleanArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_NumericArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_IntegerArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_FloatingPointArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Int8Array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt8Array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Int16Array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt16Array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Int32Array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt32Array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Int64Array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt64Array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_HalfFloatArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_FloatArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_DoubleArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_FixedSizeBinaryArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Decimal128Array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_StructArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_ListArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_LargeListArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_MapArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_FixedSizeListArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_UnionArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_StringArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_BinaryArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_DictionaryArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_ExtensionArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_ChunkedArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Table(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_RecordBatch(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Buffer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_ResizableBuffer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_NativeFile(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_BufferedInputStream(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_BufferedOutputStream(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_CompressedInputStream(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_CompressedOutputStream(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib__CRecordBatchWriter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib__CRecordBatchReader(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_CastOptions(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib__PandasAPIShim(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_LoggingMemoryPool(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_ProxyMemoryPool(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_UnionType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_UnknownExtensionType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib__ExtensionRegistryNanny(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_NullType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_BooleanValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt8Value(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Int16Value(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt16Value(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Int32Value(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt32Value(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt64Value(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Date32Value(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Date64Value(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Time32Value(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Time64Value(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_TimestampValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_DurationValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_HalfFloatValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_FloatValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_DoubleValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_DecimalValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_LargeStringValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_BinaryValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_LargeBinaryValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_DictionaryValue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt8Scalar(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Int8Scalar(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt16Scalar(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Int16Scalar(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt32Scalar(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Int32Scalar(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt64Scalar(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Int64Scalar(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_FloatScalar(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_DoubleScalar(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib__FunctionContext(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Date32Array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Date64Array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_TimestampArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Time32Array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Time64Array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_DurationArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_LargeStringArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_LargeBinaryArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_StringBuilder(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_PythonFile(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_MemoryMappedFile(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_OSFile(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_FixedSizeBufferWriter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_BufferOutputStream(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_MockOutputStream(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_BufferReader(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_HadoopFileSystem(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib__HdfsFileNanny(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_HdfsFile(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_MessageReader(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib__RecordBatchStreamWriter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib__RecordBatchStreamReader(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib__RecordBatchFileWriter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib__RecordBatchFileReader(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_FeatherWriter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_FeatherReader(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_SerializationContext(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_SerializedPyObject(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct____iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_1___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_2___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_5___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_6___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_7___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_8___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_9___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_10___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_11_iterchunks(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_12_itercolumns(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_13___get__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_14_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_15___get__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_16_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_17_download(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_18_upload(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_19___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_20___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_22_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_update = {0, &__pyx_n_s_update, 0, 0, 0};
static PyObject *__pyx_float_0_01;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_3;
static PyObject *__pyx_int_5;
static PyObject *__pyx_int_8;
static PyObject *__pyx_int_50;
static PyObject *__pyx_int_60;
static PyObject *__pyx_int_1000;
static PyObject *__pyx_int_1970;
static PyObject *__pyx_int_65536;
static PyObject *__pyx_int_1000000;
static PyObject *__pyx_int_66417547;
static PyObject *__pyx_int_93969614;
static PyObject *__pyx_int_162458991;
static PyObject *__pyx_int_222419149;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_tuple_;
static PyObject *__pyx_tuple__4;
static PyObject *__pyx_tuple__5;
static PyObject *__pyx_tuple__6;
static PyObject *__pyx_tuple__7;
static PyObject *__pyx_tuple__8;
static PyObject *__pyx_tuple__9;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_tuple__12;
static PyObject *__pyx_tuple__13;
static PyObject *__pyx_tuple__14;
static PyObject *__pyx_tuple__15;
static PyObject *__pyx_tuple__16;
static PyObject *__pyx_tuple__17;
static PyObject *__pyx_tuple__18;
static PyObject *__pyx_tuple__19;
static PyObject *__pyx_tuple__20;
static PyObject *__pyx_tuple__21;
static PyObject *__pyx_tuple__22;
static PyObject *__pyx_tuple__23;
static PyObject *__pyx_tuple__24;
static PyObject *__pyx_tuple__25;
static PyObject *__pyx_tuple__26;
static PyObject *__pyx_tuple__29;
static PyObject *__pyx_tuple__30;
static PyObject *__pyx_tuple__32;
static PyObject *__pyx_tuple__33;
static PyObject *__pyx_tuple__34;
static PyObject *__pyx_tuple__35;
static PyObject *__pyx_tuple__36;
static PyObject *__pyx_tuple__37;
static PyObject *__pyx_tuple__38;
static PyObject *__pyx_tuple__39;
static PyObject *__pyx_tuple__40;
static PyObject *__pyx_tuple__41;
static PyObject *__pyx_tuple__42;
static PyObject *__pyx_tuple__43;
static PyObject *__pyx_tuple__44;
static PyObject *__pyx_tuple__45;
static PyObject *__pyx_tuple__46;
static PyObject *__pyx_tuple__47;
static PyObject *__pyx_tuple__48;
static PyObject *__pyx_tuple__49;
static PyObject *__pyx_tuple__50;
static PyObject *__pyx_tuple__51;
static PyObject *__pyx_tuple__52;
static PyObject *__pyx_tuple__53;
static PyObject *__pyx_tuple__54;
static PyObject *__pyx_tuple__55;
static PyObject *__pyx_tuple__56;
static PyObject *__pyx_tuple__57;
static PyObject *__pyx_tuple__58;
static PyObject *__pyx_tuple__59;
static PyObject *__pyx_tuple__60;
static PyObject *__pyx_tuple__61;
static PyObject *__pyx_tuple__62;
static PyObject *__pyx_tuple__63;
static PyObject *__pyx_tuple__64;
static PyObject *__pyx_tuple__65;
static PyObject *__pyx_tuple__66;
static PyObject *__pyx_tuple__67;
static PyObject *__pyx_tuple__68;
static PyObject *__pyx_tuple__69;
static PyObject *__pyx_tuple__70;
static PyObject *__pyx_tuple__71;
static PyObject *__pyx_tuple__72;
static PyObject *__pyx_tuple__73;
static PyObject *__pyx_tuple__74;
static PyObject *__pyx_tuple__75;
static PyObject *__pyx_tuple__76;
static PyObject *__pyx_tuple__77;
static PyObject *__pyx_tuple__78;
static PyObject *__pyx_tuple__79;
static PyObject *__pyx_tuple__80;
static PyObject *__pyx_tuple__81;
static PyObject *__pyx_tuple__82;
static PyObject *__pyx_tuple__83;
static PyObject *__pyx_tuple__84;
static PyObject *__pyx_tuple__85;
static PyObject *__pyx_tuple__86;
static PyObject *__pyx_tuple__87;
static PyObject *__pyx_tuple__88;
static PyObject *__pyx_tuple__89;
static PyObject *__pyx_tuple__90;
static PyObject *__pyx_tuple__91;
static PyObject *__pyx_tuple__92;
static PyObject *__pyx_tuple__93;
static PyObject *__pyx_tuple__94;
static PyObject *__pyx_tuple__95;
static PyObject *__pyx_tuple__96;
static PyObject *__pyx_tuple__97;
static PyObject *__pyx_tuple__98;
static PyObject *__pyx_tuple__99;
static PyObject *__pyx_slice__181;
static PyObject *__pyx_tuple__100;
static PyObject *__pyx_tuple__101;
static PyObject *__pyx_tuple__102;
static PyObject *__pyx_tuple__103;
static PyObject *__pyx_tuple__104;
static PyObject *__pyx_tuple__105;
static PyObject *__pyx_tuple__106;
static PyObject *__pyx_tuple__107;
static PyObject *__pyx_tuple__108;
static PyObject *__pyx_tuple__109;
static PyObject *__pyx_tuple__110;
static PyObject *__pyx_tuple__111;
static PyObject *__pyx_tuple__112;
static PyObject *__pyx_tuple__113;
static PyObject *__pyx_tuple__114;
static PyObject *__pyx_tuple__115;
static PyObject *__pyx_tuple__116;
static PyObject *__pyx_tuple__117;
static PyObject *__pyx_tuple__118;
static PyObject *__pyx_tuple__119;
static PyObject *__pyx_tuple__120;
static PyObject *__pyx_tuple__121;
static PyObject *__pyx_tuple__122;
static PyObject *__pyx_tuple__123;
static PyObject *__pyx_tuple__124;
static PyObject *__pyx_tuple__125;
static PyObject *__pyx_tuple__126;
static PyObject *__pyx_tuple__127;
static PyObject *__pyx_tuple__128;
static PyObject *__pyx_tuple__129;
static PyObject *__pyx_tuple__130;
static PyObject *__pyx_tuple__131;
static PyObject *__pyx_tuple__132;
static PyObject *__pyx_tuple__133;
static PyObject *__pyx_tuple__134;
static PyObject *__pyx_tuple__135;
static PyObject *__pyx_tuple__136;
static PyObject *__pyx_tuple__137;
static PyObject *__pyx_tuple__138;
static PyObject *__pyx_tuple__139;
static PyObject *__pyx_tuple__140;
static PyObject *__pyx_tuple__141;
static PyObject *__pyx_tuple__142;
static PyObject *__pyx_tuple__143;
static PyObject *__pyx_tuple__144;
static PyObject *__pyx_tuple__145;
static PyObject *__pyx_tuple__146;
static PyObject *__pyx_tuple__147;
static PyObject *__pyx_tuple__148;
static PyObject *__pyx_tuple__149;
static PyObject *__pyx_tuple__150;
static PyObject *__pyx_tuple__151;
static PyObject *__pyx_tuple__152;
static PyObject *__pyx_tuple__153;
static PyObject *__pyx_tuple__154;
static PyObject *__pyx_tuple__155;
static PyObject *__pyx_tuple__156;
static PyObject *__pyx_tuple__157;
static PyObject *__pyx_tuple__158;
static PyObject *__pyx_tuple__159;
static PyObject *__pyx_tuple__160;
static PyObject *__pyx_tuple__161;
static PyObject *__pyx_tuple__162;
static PyObject *__pyx_tuple__163;
static PyObject *__pyx_tuple__164;
static PyObject *__pyx_tuple__165;
static PyObject *__pyx_tuple__166;
static PyObject *__pyx_tuple__167;
static PyObject *__pyx_tuple__168;
static PyObject *__pyx_tuple__170;
static PyObject *__pyx_tuple__171;
static PyObject *__pyx_tuple__172;
static PyObject *__pyx_tuple__173;
static PyObject *__pyx_tuple__174;
static PyObject *__pyx_tuple__175;
static PyObject *__pyx_tuple__176;
static PyObject *__pyx_tuple__177;
static PyObject *__pyx_tuple__178;
static PyObject *__pyx_tuple__179;
static PyObject *__pyx_tuple__180;
static PyObject *__pyx_tuple__182;
static PyObject *__pyx_tuple__183;
static PyObject *__pyx_tuple__184;
static PyObject *__pyx_tuple__185;
static PyObject *__pyx_tuple__186;
static PyObject *__pyx_tuple__187;
static PyObject *__pyx_tuple__188;
static PyObject *__pyx_tuple__189;
static PyObject *__pyx_tuple__190;
static PyObject *__pyx_tuple__191;
static PyObject *__pyx_tuple__192;
static PyObject *__pyx_tuple__193;
static PyObject *__pyx_tuple__194;
static PyObject *__pyx_tuple__195;
static PyObject *__pyx_tuple__196;
static PyObject *__pyx_tuple__197;
static PyObject *__pyx_tuple__201;
static PyObject *__pyx_tuple__203;
static PyObject *__pyx_tuple__205;
static PyObject *__pyx_tuple__206;
static PyObject *__pyx_tuple__207;
static PyObject *__pyx_tuple__208;
static PyObject *__pyx_tuple__209;
static PyObject *__pyx_tuple__210;
static PyObject *__pyx_tuple__211;
static PyObject *__pyx_tuple__212;
static PyObject *__pyx_tuple__213;
static PyObject *__pyx_tuple__214;
static PyObject *__pyx_tuple__215;
static PyObject *__pyx_tuple__216;
static PyObject *__pyx_tuple__217;
static PyObject *__pyx_tuple__218;
static PyObject *__pyx_tuple__219;
static PyObject *__pyx_tuple__220;
static PyObject *__pyx_tuple__221;
static PyObject *__pyx_tuple__222;
static PyObject *__pyx_tuple__223;
static PyObject *__pyx_tuple__224;
static PyObject *__pyx_tuple__225;
static PyObject *__pyx_tuple__226;
static PyObject *__pyx_tuple__227;
static PyObject *__pyx_tuple__228;
static PyObject *__pyx_tuple__229;
static PyObject *__pyx_tuple__230;
static PyObject *__pyx_tuple__231;
static PyObject *__pyx_tuple__232;
static PyObject *__pyx_tuple__233;
static PyObject *__pyx_tuple__234;
static PyObject *__pyx_tuple__235;
static PyObject *__pyx_tuple__236;
static PyObject *__pyx_tuple__237;
static PyObject *__pyx_tuple__238;
static PyObject *__pyx_tuple__239;
static PyObject *__pyx_tuple__240;
static PyObject *__pyx_tuple__241;
static PyObject *__pyx_tuple__242;
static PyObject *__pyx_tuple__243;
static PyObject *__pyx_tuple__244;
static PyObject *__pyx_tuple__245;
static PyObject *__pyx_tuple__246;
static PyObject *__pyx_tuple__247;
static PyObject *__pyx_tuple__248;
static PyObject *__pyx_tuple__249;
static PyObject *__pyx_tuple__250;
static PyObject *__pyx_tuple__251;
static PyObject *__pyx_tuple__252;
static PyObject *__pyx_tuple__253;
static PyObject *__pyx_tuple__254;
static PyObject *__pyx_tuple__255;
static PyObject *__pyx_tuple__256;
static PyObject *__pyx_tuple__257;
static PyObject *__pyx_tuple__258;
static PyObject *__pyx_tuple__259;
static PyObject *__pyx_tuple__260;
static PyObject *__pyx_tuple__261;
static PyObject *__pyx_tuple__262;
static PyObject *__pyx_tuple__263;
static PyObject *__pyx_tuple__264;
static PyObject *__pyx_tuple__265;
static PyObject *__pyx_tuple__266;
static PyObject *__pyx_tuple__267;
static PyObject *__pyx_tuple__268;
static PyObject *__pyx_tuple__269;
static PyObject *__pyx_tuple__270;
static PyObject *__pyx_tuple__271;
static PyObject *__pyx_tuple__272;
static PyObject *__pyx_tuple__273;
static PyObject *__pyx_tuple__274;
static PyObject *__pyx_tuple__275;
static PyObject *__pyx_tuple__276;
static PyObject *__pyx_tuple__277;
static PyObject *__pyx_tuple__278;
static PyObject *__pyx_tuple__279;
static PyObject *__pyx_tuple__280;
static PyObject *__pyx_tuple__281;
static PyObject *__pyx_tuple__283;
static PyObject *__pyx_tuple__285;
static PyObject *__pyx_tuple__287;
static PyObject *__pyx_tuple__289;
static PyObject *__pyx_tuple__291;
static PyObject *__pyx_tuple__293;
static PyObject *__pyx_tuple__295;
static PyObject *__pyx_tuple__297;
static PyObject *__pyx_tuple__299;
static PyObject *__pyx_tuple__301;
static PyObject *__pyx_tuple__302;
static PyObject *__pyx_tuple__303;
static PyObject *__pyx_tuple__305;
static PyObject *__pyx_tuple__307;
static PyObject *__pyx_tuple__309;
static PyObject *__pyx_tuple__321;
static PyObject *__pyx_tuple__322;
static PyObject *__pyx_tuple__324;
static PyObject *__pyx_tuple__326;
static PyObject *__pyx_tuple__328;
static PyObject *__pyx_tuple__330;
static PyObject *__pyx_tuple__332;
static PyObject *__pyx_tuple__341;
static PyObject *__pyx_tuple__346;
static PyObject *__pyx_tuple__348;
static PyObject *__pyx_tuple__350;
static PyObject *__pyx_tuple__352;
static PyObject *__pyx_tuple__353;
static PyObject *__pyx_tuple__354;
static PyObject *__pyx_tuple__355;
static PyObject *__pyx_tuple__356;
static PyObject *__pyx_tuple__358;
static PyObject *__pyx_tuple__360;
static PyObject *__pyx_tuple__362;
static PyObject *__pyx_tuple__364;
static PyObject *__pyx_tuple__366;
static PyObject *__pyx_tuple__368;
static PyObject *__pyx_tuple__370;
static PyObject *__pyx_tuple__372;
static PyObject *__pyx_tuple__374;
static PyObject *__pyx_tuple__376;
static PyObject *__pyx_tuple__378;
static PyObject *__pyx_tuple__380;
static PyObject *__pyx_tuple__382;
static PyObject *__pyx_tuple__384;
static PyObject *__pyx_tuple__386;
static PyObject *__pyx_tuple__388;
static PyObject *__pyx_tuple__390;
static PyObject *__pyx_tuple__392;
static PyObject *__pyx_tuple__394;
static PyObject *__pyx_tuple__396;
static PyObject *__pyx_tuple__398;
static PyObject *__pyx_tuple__400;
static PyObject *__pyx_tuple__402;
static PyObject *__pyx_tuple__404;
static PyObject *__pyx_tuple__406;
static PyObject *__pyx_tuple__408;
static PyObject *__pyx_tuple__410;
static PyObject *__pyx_tuple__412;
static PyObject *__pyx_tuple__414;
static PyObject *__pyx_tuple__416;
static PyObject *__pyx_tuple__418;
static PyObject *__pyx_tuple__420;
static PyObject *__pyx_tuple__422;
static PyObject *__pyx_tuple__424;
static PyObject *__pyx_tuple__426;
static PyObject *__pyx_tuple__428;
static PyObject *__pyx_tuple__430;
static PyObject *__pyx_tuple__432;
static PyObject *__pyx_tuple__434;
static PyObject *__pyx_tuple__436;
static PyObject *__pyx_tuple__438;
static PyObject *__pyx_tuple__440;
static PyObject *__pyx_tuple__442;
static PyObject *__pyx_tuple__444;
static PyObject *__pyx_tuple__446;
static PyObject *__pyx_tuple__448;
static PyObject *__pyx_tuple__450;
static PyObject *__pyx_tuple__452;
static PyObject *__pyx_tuple__454;
static PyObject *__pyx_tuple__456;
static PyObject *__pyx_tuple__458;
static PyObject *__pyx_tuple__460;
static PyObject *__pyx_tuple__462;
static PyObject *__pyx_tuple__464;
static PyObject *__pyx_tuple__466;
static PyObject *__pyx_tuple__470;
static PyObject *__pyx_tuple__472;
static PyObject *__pyx_tuple__474;
static PyObject *__pyx_tuple__476;
static PyObject *__pyx_tuple__478;
static PyObject *__pyx_tuple__480;
static PyObject *__pyx_tuple__482;
static PyObject *__pyx_tuple__484;
static PyObject *__pyx_tuple__486;
static PyObject *__pyx_tuple__488;
static PyObject *__pyx_tuple__490;
static PyObject *__pyx_tuple__492;
static PyObject *__pyx_tuple__494;
static PyObject *__pyx_tuple__497;
static PyObject *__pyx_tuple__499;
static PyObject *__pyx_tuple__501;
static PyObject *__pyx_tuple__503;
static PyObject *__pyx_tuple__505;
static PyObject *__pyx_tuple__507;
static PyObject *__pyx_tuple__509;
static PyObject *__pyx_tuple__511;
static PyObject *__pyx_tuple__513;
static PyObject *__pyx_tuple__515;
static PyObject *__pyx_tuple__517;
static PyObject *__pyx_tuple__519;
static PyObject *__pyx_tuple__521;
static PyObject *__pyx_tuple__523;
static PyObject *__pyx_tuple__525;
static PyObject *__pyx_tuple__527;
static PyObject *__pyx_tuple__529;
static PyObject *__pyx_tuple__531;
static PyObject *__pyx_tuple__533;
static PyObject *__pyx_tuple__535;
static PyObject *__pyx_tuple__537;
static PyObject *__pyx_tuple__539;
static PyObject *__pyx_tuple__541;
static PyObject *__pyx_tuple__543;
static PyObject *__pyx_tuple__545;
static PyObject *__pyx_codeobj__31;
static PyObject *__pyx_codeobj__199;
static PyObject *__pyx_codeobj__200;
static PyObject *__pyx_codeobj__202;
static PyObject *__pyx_codeobj__204;
static PyObject *__pyx_codeobj__282;
static PyObject *__pyx_codeobj__284;
static PyObject *__pyx_codeobj__286;
static PyObject *__pyx_codeobj__288;
static PyObject *__pyx_codeobj__290;
static PyObject *__pyx_codeobj__292;
static PyObject *__pyx_codeobj__294;
static PyObject *__pyx_codeobj__296;
static PyObject *__pyx_codeobj__298;
static PyObject *__pyx_codeobj__300;
static PyObject *__pyx_codeobj__304;
static PyObject *__pyx_codeobj__306;
static PyObject *__pyx_codeobj__308;
static PyObject *__pyx_codeobj__310;
static PyObject *__pyx_codeobj__311;
static PyObject *__pyx_codeobj__312;
static PyObject *__pyx_codeobj__313;
static PyObject *__pyx_codeobj__314;
static PyObject *__pyx_codeobj__315;
static PyObject *__pyx_codeobj__316;
static PyObject *__pyx_codeobj__317;
static PyObject *__pyx_codeobj__318;
static PyObject *__pyx_codeobj__319;
static PyObject *__pyx_codeobj__320;
static PyObject *__pyx_codeobj__323;
static PyObject *__pyx_codeobj__325;
static PyObject *__pyx_codeobj__327;
static PyObject *__pyx_codeobj__329;
static PyObject *__pyx_codeobj__331;
static PyObject *__pyx_codeobj__333;
static PyObject *__pyx_codeobj__334;
static PyObject *__pyx_codeobj__335;
static PyObject *__pyx_codeobj__336;
static PyObject *__pyx_codeobj__337;
static PyObject *__pyx_codeobj__338;
static PyObject *__pyx_codeobj__339;
static PyObject *__pyx_codeobj__340;
static PyObject *__pyx_codeobj__342;
static PyObject *__pyx_codeobj__343;
static PyObject *__pyx_codeobj__344;
static PyObject *__pyx_codeobj__345;
static PyObject *__pyx_codeobj__347;
static PyObject *__pyx_codeobj__349;
static PyObject *__pyx_codeobj__351;
static PyObject *__pyx_codeobj__357;
static PyObject *__pyx_codeobj__359;
static PyObject *__pyx_codeobj__361;
static PyObject *__pyx_codeobj__363;
static PyObject *__pyx_codeobj__365;
static PyObject *__pyx_codeobj__367;
static PyObject *__pyx_codeobj__369;
static PyObject *__pyx_codeobj__371;
static PyObject *__pyx_codeobj__373;
static PyObject *__pyx_codeobj__375;
static PyObject *__pyx_codeobj__377;
static PyObject *__pyx_codeobj__379;
static PyObject *__pyx_codeobj__381;
static PyObject *__pyx_codeobj__383;
static PyObject *__pyx_codeobj__385;
static PyObject *__pyx_codeobj__387;
static PyObject *__pyx_codeobj__389;
static PyObject *__pyx_codeobj__391;
static PyObject *__pyx_codeobj__393;
static PyObject *__pyx_codeobj__395;
static PyObject *__pyx_codeobj__397;
static PyObject *__pyx_codeobj__399;
static PyObject *__pyx_codeobj__401;
static PyObject *__pyx_codeobj__403;
static PyObject *__pyx_codeobj__405;
static PyObject *__pyx_codeobj__407;
static PyObject *__pyx_codeobj__409;
static PyObject *__pyx_codeobj__411;
static PyObject *__pyx_codeobj__413;
static PyObject *__pyx_codeobj__415;
static PyObject *__pyx_codeobj__417;
static PyObject *__pyx_codeobj__419;
static PyObject *__pyx_codeobj__421;
static PyObject *__pyx_codeobj__423;
static PyObject *__pyx_codeobj__425;
static PyObject *__pyx_codeobj__427;
static PyObject *__pyx_codeobj__429;
static PyObject *__pyx_codeobj__431;
static PyObject *__pyx_codeobj__433;
static PyObject *__pyx_codeobj__435;
static PyObject *__pyx_codeobj__437;
static PyObject *__pyx_codeobj__439;
static PyObject *__pyx_codeobj__441;
static PyObject *__pyx_codeobj__443;
static PyObject *__pyx_codeobj__445;
static PyObject *__pyx_codeobj__447;
static PyObject *__pyx_codeobj__449;
static PyObject *__pyx_codeobj__451;
static PyObject *__pyx_codeobj__453;
static PyObject *__pyx_codeobj__455;
static PyObject *__pyx_codeobj__457;
static PyObject *__pyx_codeobj__459;
static PyObject *__pyx_codeobj__461;
static PyObject *__pyx_codeobj__463;
static PyObject *__pyx_codeobj__465;
static PyObject *__pyx_codeobj__467;
static PyObject *__pyx_codeobj__468;
static PyObject *__pyx_codeobj__469;
static PyObject *__pyx_codeobj__471;
static PyObject *__pyx_codeobj__473;
static PyObject *__pyx_codeobj__475;
static PyObject *__pyx_codeobj__477;
static PyObject *__pyx_codeobj__479;
static PyObject *__pyx_codeobj__481;
static PyObject *__pyx_codeobj__483;
static PyObject *__pyx_codeobj__485;
static PyObject *__pyx_codeobj__487;
static PyObject *__pyx_codeobj__489;
static PyObject *__pyx_codeobj__491;
static PyObject *__pyx_codeobj__493;
static PyObject *__pyx_codeobj__495;
static PyObject *__pyx_codeobj__496;
static PyObject *__pyx_codeobj__498;
static PyObject *__pyx_codeobj__500;
static PyObject *__pyx_codeobj__502;
static PyObject *__pyx_codeobj__504;
static PyObject *__pyx_codeobj__506;
static PyObject *__pyx_codeobj__508;
static PyObject *__pyx_codeobj__510;
static PyObject *__pyx_codeobj__512;
static PyObject *__pyx_codeobj__514;
static PyObject *__pyx_codeobj__516;
static PyObject *__pyx_codeobj__518;
static PyObject *__pyx_codeobj__520;
static PyObject *__pyx_codeobj__522;
static PyObject *__pyx_codeobj__524;
static PyObject *__pyx_codeobj__526;
static PyObject *__pyx_codeobj__528;
static PyObject *__pyx_codeobj__530;
static PyObject *__pyx_codeobj__532;
static PyObject *__pyx_codeobj__534;
static PyObject *__pyx_codeobj__536;
static PyObject *__pyx_codeobj__538;
static PyObject *__pyx_codeobj__540;
static PyObject *__pyx_codeobj__542;
static PyObject *__pyx_codeobj__544;
static PyObject *__pyx_codeobj__546;
/* Late includes */

/* "pyarrow/lib.pyx":47
 * 
 * 
 * def cpu_count():             # <<<<<<<<<<<<<<
 *     """
 *     Return the number of threads to use in parallel operations.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_1cpu_count(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_cpu_count[] = "cpu_count()\n\n    Return the number of threads to use in parallel operations.\n\n    The number of threads is determined at startup by inspecting the\n    ``OMP_NUM_THREADS`` and ``OMP_THREAD_LIMIT`` environment variables.\n    If neither is present, it will default to the number of hardware threads\n    on the system.  It can be modified at runtime by calling\n    :func:`set_cpu_count()`.\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_1cpu_count = {"cpu_count", (PyCFunction)__pyx_pw_7pyarrow_3lib_1cpu_count, METH_NOARGS, __pyx_doc_7pyarrow_3lib_cpu_count};
static PyObject *__pyx_pw_7pyarrow_3lib_1cpu_count(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cpu_count (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_cpu_count(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_cpu_count(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("cpu_count", 0);

  /* "pyarrow/lib.pyx":57
 *     :func:`set_cpu_count()`.
 *     """
 *     return GetCpuThreadPoolCapacity()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(arrow::GetCpuThreadPoolCapacity()); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/lib.pyx":47
 * 
 * 
 * def cpu_count():             # <<<<<<<<<<<<<<
 *     """
 *     Return the number of threads to use in parallel operations.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.cpu_count", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/lib.pyx":60
 * 
 * 
 * def set_cpu_count(int count):             # <<<<<<<<<<<<<<
 *     """
 *     Set the number of threads to use in parallel operations.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_3set_cpu_count(PyObject *__pyx_self, PyObject *__pyx_arg_count); /*proto*/
static char __pyx_doc_7pyarrow_3lib_2set_cpu_count[] = "set_cpu_count(int count)\n\n    Set the number of threads to use in parallel operations.\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_3set_cpu_count = {"set_cpu_count", (PyCFunction)__pyx_pw_7pyarrow_3lib_3set_cpu_count, METH_O, __pyx_doc_7pyarrow_3lib_2set_cpu_count};
static PyObject *__pyx_pw_7pyarrow_3lib_3set_cpu_count(PyObject *__pyx_self, PyObject *__pyx_arg_count) {
  int __pyx_v_count;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_cpu_count (wrapper)", 0);
  assert(__pyx_arg_count); {
    __pyx_v_count = __Pyx_PyInt_As_int(__pyx_arg_count); if (unlikely((__pyx_v_count == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 60, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.set_cpu_count", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_2set_cpu_count(__pyx_self, ((int)__pyx_v_count));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_2set_cpu_count(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_count) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("set_cpu_count", 0);

  /* "pyarrow/lib.pyx":64
 *     Set the number of threads to use in parallel operations.
 *     """
 *     if count < 1:             # <<<<<<<<<<<<<<
 *         raise ValueError("CPU count must be strictly positive")
 *     check_status(SetCpuThreadPoolCapacity(count))
 */
  __pyx_t_1 = ((__pyx_v_count < 1) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/lib.pyx":65
 *     """
 *     if count < 1:
 *         raise ValueError("CPU count must be strictly positive")             # <<<<<<<<<<<<<<
 *     check_status(SetCpuThreadPoolCapacity(count))
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 65, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(9, 65, __pyx_L1_error)

    /* "pyarrow/lib.pyx":64
 *     Set the number of threads to use in parallel operations.
 *     """
 *     if count < 1:             # <<<<<<<<<<<<<<
 *         raise ValueError("CPU count must be strictly positive")
 *     check_status(SetCpuThreadPoolCapacity(count))
 */
  }

  /* "pyarrow/lib.pyx":66
 *     if count < 1:
 *         raise ValueError("CPU count must be strictly positive")
 *     check_status(SetCpuThreadPoolCapacity(count))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_check_status(arrow::SetCpuThreadPoolCapacity(__pyx_v_count)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(9, 66, __pyx_L1_error)

  /* "pyarrow/lib.pyx":60
 * 
 * 
 * def set_cpu_count(int count):             # <<<<<<<<<<<<<<
 *     """
 *     Set the number of threads to use in parallel operations.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.set_cpu_count", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":38
 *         bint _pd024
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self._tried_importing_pandas = False
 *         self._have_pandas = 0
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim___init__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_14_PandasAPIShim___init__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/pandas-shim.pxi":39
 * 
 *     def __init__(self):
 *         self._tried_importing_pandas = False             # <<<<<<<<<<<<<<
 *         self._have_pandas = 0
 * 
 */
  __pyx_v_self->_tried_importing_pandas = 0;

  /* "pyarrow/pandas-shim.pxi":40
 *     def __init__(self):
 *         self._tried_importing_pandas = False
 *         self._have_pandas = 0             # <<<<<<<<<<<<<<
 * 
 *     cdef _import_pandas(self, bint raise_):
 */
  __pyx_v_self->_have_pandas = 0;

  /* "pyarrow/pandas-shim.pxi":38
 *         bint _pd024
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self._tried_importing_pandas = False
 *         self._have_pandas = 0
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":42
 *         self._have_pandas = 0
 * 
 *     cdef _import_pandas(self, bint raise_):             # <<<<<<<<<<<<<<
 *         try:
 *             import pandas as pd
 */

static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim__import_pandas(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, int __pyx_v_raise_) {
  PyObject *__pyx_v_pd = NULL;
  PyObject *__pyx_v_pdcompat = NULL;
  PyObject *__pyx_v_LooseVersion = NULL;
  PyObject *__pyx_v_DatetimeTZDtype = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("_import_pandas", 0);

  /* "pyarrow/pandas-shim.pxi":43
 * 
 *     cdef _import_pandas(self, bint raise_):
 *         try:             # <<<<<<<<<<<<<<
 *             import pandas as pd
 *             import pyarrow.pandas_compat as pdcompat
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "pyarrow/pandas-shim.pxi":44
 *     cdef _import_pandas(self, bint raise_):
 *         try:
 *             import pandas as pd             # <<<<<<<<<<<<<<
 *             import pyarrow.pandas_compat as pdcompat
 *         except ImportError:
 */
      __pyx_t_4 = __Pyx_Import(__pyx_n_s_pandas, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 44, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_v_pd = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "pyarrow/pandas-shim.pxi":45
 *         try:
 *             import pandas as pd
 *             import pyarrow.pandas_compat as pdcompat             # <<<<<<<<<<<<<<
 *         except ImportError:
 *             self._have_pandas = False
 */
      __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 45, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_n_s__2);
      __Pyx_GIVEREF(__pyx_n_s__2);
      PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s__2);
      __pyx_t_5 = __Pyx_Import(__pyx_n_s_pyarrow_pandas_compat, __pyx_t_4, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 45, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_pdcompat = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "pyarrow/pandas-shim.pxi":43
 * 
 *     cdef _import_pandas(self, bint raise_):
 *         try:             # <<<<<<<<<<<<<<
 *             import pandas as pd
 *             import pyarrow.pandas_compat as pdcompat
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "pyarrow/pandas-shim.pxi":46
 *             import pandas as pd
 *             import pyarrow.pandas_compat as pdcompat
 *         except ImportError:             # <<<<<<<<<<<<<<
 *             self._have_pandas = False
 *             if raise_:
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim._import_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(3, 46, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_7);

      /* "pyarrow/pandas-shim.pxi":47
 *             import pyarrow.pandas_compat as pdcompat
 *         except ImportError:
 *             self._have_pandas = False             # <<<<<<<<<<<<<<
 *             if raise_:
 *                 raise
 */
      __pyx_v_self->_have_pandas = 0;

      /* "pyarrow/pandas-shim.pxi":48
 *         except ImportError:
 *             self._have_pandas = False
 *             if raise_:             # <<<<<<<<<<<<<<
 *                 raise
 *             else:
 */
      __pyx_t_8 = (__pyx_v_raise_ != 0);
      if (unlikely(__pyx_t_8)) {

        /* "pyarrow/pandas-shim.pxi":49
 *             self._have_pandas = False
 *             if raise_:
 *                 raise             # <<<<<<<<<<<<<<
 *             else:
 *                 return
 */
        __Pyx_GIVEREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_ErrRestoreWithState(__pyx_t_5, __pyx_t_4, __pyx_t_7);
        __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_7 = 0; 
        __PYX_ERR(3, 49, __pyx_L5_except_error)

        /* "pyarrow/pandas-shim.pxi":48
 *         except ImportError:
 *             self._have_pandas = False
 *             if raise_:             # <<<<<<<<<<<<<<
 *                 raise
 *             else:
 */
      }

      /* "pyarrow/pandas-shim.pxi":51
 *                 raise
 *             else:
 *                 return             # <<<<<<<<<<<<<<
 * 
 *         self._pd = pd
 */
      /*else*/ {
        __Pyx_XDECREF(__pyx_r);
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L6_except_return;
      }
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/pandas-shim.pxi":43
 * 
 *     cdef _import_pandas(self, bint raise_):
 *         try:             # <<<<<<<<<<<<<<
 *             import pandas as pd
 *             import pyarrow.pandas_compat as pdcompat
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L8_try_end:;
  }

  /* "pyarrow/pandas-shim.pxi":53
 *                 return
 * 
 *         self._pd = pd             # <<<<<<<<<<<<<<
 *         self._version = pd.__version__
 *         from distutils.version import LooseVersion
 */
  __Pyx_INCREF(__pyx_v_pd);
  __Pyx_GIVEREF(__pyx_v_pd);
  __Pyx_GOTREF(__pyx_v_self->_pd);
  __Pyx_DECREF(__pyx_v_self->_pd);
  __pyx_v_self->_pd = __pyx_v_pd;

  /* "pyarrow/pandas-shim.pxi":54
 * 
 *         self._pd = pd
 *         self._version = pd.__version__             # <<<<<<<<<<<<<<
 *         from distutils.version import LooseVersion
 *         self._loose_version = LooseVersion(pd.__version__)
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_pd, __pyx_n_s_version); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  __Pyx_GOTREF(__pyx_v_self->_version);
  __Pyx_DECREF(__pyx_v_self->_version);
  __pyx_v_self->_version = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "pyarrow/pandas-shim.pxi":55
 *         self._pd = pd
 *         self._version = pd.__version__
 *         from distutils.version import LooseVersion             # <<<<<<<<<<<<<<
 *         self._loose_version = LooseVersion(pd.__version__)
 * 
 */
  __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_n_s_LooseVersion);
  __Pyx_GIVEREF(__pyx_n_s_LooseVersion);
  PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_LooseVersion);
  __pyx_t_4 = __Pyx_Import(__pyx_n_s_distutils_version, __pyx_t_7, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_LooseVersion); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_t_7);
  __pyx_v_LooseVersion = __pyx_t_7;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/pandas-shim.pxi":56
 *         self._version = pd.__version__
 *         from distutils.version import LooseVersion
 *         self._loose_version = LooseVersion(pd.__version__)             # <<<<<<<<<<<<<<
 * 
 *         self._compat_module = pdcompat
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_pd, __pyx_n_s_version); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_v_LooseVersion);
  __pyx_t_5 = __pyx_v_LooseVersion; __pyx_t_9 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_4 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_9, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_self->_loose_version);
  __Pyx_DECREF(__pyx_v_self->_loose_version);
  __pyx_v_self->_loose_version = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pyarrow/pandas-shim.pxi":58
 *         self._loose_version = LooseVersion(pd.__version__)
 * 
 *         self._compat_module = pdcompat             # <<<<<<<<<<<<<<
 *         self._data_frame = pd.DataFrame
 *         self._index = pd.Index
 */
  __Pyx_INCREF(__pyx_v_pdcompat);
  __Pyx_GIVEREF(__pyx_v_pdcompat);
  __Pyx_GOTREF(__pyx_v_self->_compat_module);
  __Pyx_DECREF(__pyx_v_self->_compat_module);
  __pyx_v_self->_compat_module = __pyx_v_pdcompat;

  /* "pyarrow/pandas-shim.pxi":59
 * 
 *         self._compat_module = pdcompat
 *         self._data_frame = pd.DataFrame             # <<<<<<<<<<<<<<
 *         self._index = pd.Index
 *         self._categorical_type = pd.Categorical
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_pd, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_self->_data_frame);
  __Pyx_DECREF(__pyx_v_self->_data_frame);
  __pyx_v_self->_data_frame = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pyarrow/pandas-shim.pxi":60
 *         self._compat_module = pdcompat
 *         self._data_frame = pd.DataFrame
 *         self._index = pd.Index             # <<<<<<<<<<<<<<
 *         self._categorical_type = pd.Categorical
 *         self._series = pd.Series
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_pd, __pyx_n_s_Index); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_self->_index);
  __Pyx_DECREF(__pyx_v_self->_index);
  __pyx_v_self->_index = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pyarrow/pandas-shim.pxi":61
 *         self._data_frame = pd.DataFrame
 *         self._index = pd.Index
 *         self._categorical_type = pd.Categorical             # <<<<<<<<<<<<<<
 *         self._series = pd.Series
 *         if self._loose_version >= LooseVersion('0.23.0'):
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_pd, __pyx_n_s_Categorical); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_self->_categorical_type);
  __Pyx_DECREF(__pyx_v_self->_categorical_type);
  __pyx_v_self->_categorical_type = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pyarrow/pandas-shim.pxi":62
 *         self._index = pd.Index
 *         self._categorical_type = pd.Categorical
 *         self._series = pd.Series             # <<<<<<<<<<<<<<
 *         if self._loose_version >= LooseVersion('0.23.0'):
 *             self._extension_array = pd.api.extensions.ExtensionArray
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_pd, __pyx_n_s_Series); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_self->_series);
  __Pyx_DECREF(__pyx_v_self->_series);
  __pyx_v_self->_series = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pyarrow/pandas-shim.pxi":63
 *         self._categorical_type = pd.Categorical
 *         self._series = pd.Series
 *         if self._loose_version >= LooseVersion('0.23.0'):             # <<<<<<<<<<<<<<
 *             self._extension_array = pd.api.extensions.ExtensionArray
 *             self._array_like_types = (
 */
  __Pyx_INCREF(__pyx_v_LooseVersion);
  __pyx_t_5 = __pyx_v_LooseVersion; __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_kp_u_0_23_0) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_u_0_23_0);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_RichCompare(__pyx_v_self->_loose_version, __pyx_t_4, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 63, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(3, 63, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_8) {

    /* "pyarrow/pandas-shim.pxi":64
 *         self._series = pd.Series
 *         if self._loose_version >= LooseVersion('0.23.0'):
 *             self._extension_array = pd.api.extensions.ExtensionArray             # <<<<<<<<<<<<<<
 *             self._array_like_types = (
 *                 self._series, self._index, self._categorical_type,
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_pd, __pyx_n_s_api); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 64, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_extensions); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 64, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ExtensionArray); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 64, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GIVEREF(__pyx_t_5);
    __Pyx_GOTREF(__pyx_v_self->_extension_array);
    __Pyx_DECREF(__pyx_v_self->_extension_array);
    __pyx_v_self->_extension_array = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "pyarrow/pandas-shim.pxi":66
 *             self._extension_array = pd.api.extensions.ExtensionArray
 *             self._array_like_types = (
 *                 self._series, self._index, self._categorical_type,             # <<<<<<<<<<<<<<
 *                 self._extension_array)
 *             self._extension_dtype = pd.api.extensions.ExtensionDtype
 */
    __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 66, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_self->_series);
    __Pyx_GIVEREF(__pyx_v_self->_series);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->_series);
    __Pyx_INCREF(__pyx_v_self->_index);
    __Pyx_GIVEREF(__pyx_v_self->_index);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_self->_index);
    __Pyx_INCREF(__pyx_v_self->_categorical_type);
    __Pyx_GIVEREF(__pyx_v_self->_categorical_type);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_self->_categorical_type);
    __Pyx_INCREF(__pyx_v_self->_extension_array);
    __Pyx_GIVEREF(__pyx_v_self->_extension_array);
    PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_self->_extension_array);

    /* "pyarrow/pandas-shim.pxi":65
 *         if self._loose_version >= LooseVersion('0.23.0'):
 *             self._extension_array = pd.api.extensions.ExtensionArray
 *             self._array_like_types = (             # <<<<<<<<<<<<<<
 *                 self._series, self._index, self._categorical_type,
 *                 self._extension_array)
 */
    __Pyx_GIVEREF(__pyx_t_5);
    __Pyx_GOTREF(__pyx_v_self->_array_like_types);
    __Pyx_DECREF(__pyx_v_self->_array_like_types);
    __pyx_v_self->_array_like_types = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "pyarrow/pandas-shim.pxi":68
 *                 self._series, self._index, self._categorical_type,
 *                 self._extension_array)
 *             self._extension_dtype = pd.api.extensions.ExtensionDtype             # <<<<<<<<<<<<<<
 *         else:
 *             self._extension_array = None
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_pd, __pyx_n_s_api); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 68, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_extensions); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 68, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ExtensionDtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 68, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GIVEREF(__pyx_t_5);
    __Pyx_GOTREF(__pyx_v_self->_extension_dtype);
    __Pyx_DECREF(__pyx_v_self->_extension_dtype);
    __pyx_v_self->_extension_dtype = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "pyarrow/pandas-shim.pxi":63
 *         self._categorical_type = pd.Categorical
 *         self._series = pd.Series
 *         if self._loose_version >= LooseVersion('0.23.0'):             # <<<<<<<<<<<<<<
 *             self._extension_array = pd.api.extensions.ExtensionArray
 *             self._array_like_types = (
 */
    goto __pyx_L12;
  }

  /* "pyarrow/pandas-shim.pxi":70
 *             self._extension_dtype = pd.api.extensions.ExtensionDtype
 *         else:
 *             self._extension_array = None             # <<<<<<<<<<<<<<
 *             self._array_like_types = (
 *                 self._series, self._index, self._categorical_type)
 */
  /*else*/ {
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_self->_extension_array);
    __Pyx_DECREF(__pyx_v_self->_extension_array);
    __pyx_v_self->_extension_array = Py_None;

    /* "pyarrow/pandas-shim.pxi":72
 *             self._extension_array = None
 *             self._array_like_types = (
 *                 self._series, self._index, self._categorical_type)             # <<<<<<<<<<<<<<
 *             self._extension_dtype = None
 * 
 */
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 72, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_self->_series);
    __Pyx_GIVEREF(__pyx_v_self->_series);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->_series);
    __Pyx_INCREF(__pyx_v_self->_index);
    __Pyx_GIVEREF(__pyx_v_self->_index);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_self->_index);
    __Pyx_INCREF(__pyx_v_self->_categorical_type);
    __Pyx_GIVEREF(__pyx_v_self->_categorical_type);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_self->_categorical_type);

    /* "pyarrow/pandas-shim.pxi":71
 *         else:
 *             self._extension_array = None
 *             self._array_like_types = (             # <<<<<<<<<<<<<<
 *                 self._series, self._index, self._categorical_type)
 *             self._extension_dtype = None
 */
    __Pyx_GIVEREF(__pyx_t_5);
    __Pyx_GOTREF(__pyx_v_self->_array_like_types);
    __Pyx_DECREF(__pyx_v_self->_array_like_types);
    __pyx_v_self->_array_like_types = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "pyarrow/pandas-shim.pxi":73
 *             self._array_like_types = (
 *                 self._series, self._index, self._categorical_type)
 *             self._extension_dtype = None             # <<<<<<<<<<<<<<
 * 
 *         if self._loose_version >= LooseVersion('0.20.0'):
 */
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_self->_extension_dtype);
    __Pyx_DECREF(__pyx_v_self->_extension_dtype);
    __pyx_v_self->_extension_dtype = Py_None;
  }
  __pyx_L12:;

  /* "pyarrow/pandas-shim.pxi":75
 *             self._extension_dtype = None
 * 
 *         if self._loose_version >= LooseVersion('0.20.0'):             # <<<<<<<<<<<<<<
 *             from pandas.api.types import DatetimeTZDtype
 *             self._types_api = pd.api.types
 */
  __Pyx_INCREF(__pyx_v_LooseVersion);
  __pyx_t_4 = __pyx_v_LooseVersion; __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_7, __pyx_kp_u_0_20_0) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_0_20_0);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_RichCompare(__pyx_v_self->_loose_version, __pyx_t_5, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 75, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(3, 75, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_8) {

    /* "pyarrow/pandas-shim.pxi":76
 * 
 *         if self._loose_version >= LooseVersion('0.20.0'):
 *             from pandas.api.types import DatetimeTZDtype             # <<<<<<<<<<<<<<
 *             self._types_api = pd.api.types
 *         elif self._loose_version >= LooseVersion('0.19.0'):
 */
    __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 76, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_n_s_DatetimeTZDtype);
    __Pyx_GIVEREF(__pyx_n_s_DatetimeTZDtype);
    PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_DatetimeTZDtype);
    __pyx_t_5 = __Pyx_Import(__pyx_n_s_pandas_api_types, __pyx_t_4, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 76, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_DatetimeTZDtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 76, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_DatetimeTZDtype = __pyx_t_4;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "pyarrow/pandas-shim.pxi":77
 *         if self._loose_version >= LooseVersion('0.20.0'):
 *             from pandas.api.types import DatetimeTZDtype
 *             self._types_api = pd.api.types             # <<<<<<<<<<<<<<
 *         elif self._loose_version >= LooseVersion('0.19.0'):
 *             from pandas.types.dtypes import DatetimeTZDtype
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_pd, __pyx_n_s_api); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 77, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_types); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 77, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_GOTREF(__pyx_v_self->_types_api);
    __Pyx_DECREF(__pyx_v_self->_types_api);
    __pyx_v_self->_types_api = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "pyarrow/pandas-shim.pxi":75
 *             self._extension_dtype = None
 * 
 *         if self._loose_version >= LooseVersion('0.20.0'):             # <<<<<<<<<<<<<<
 *             from pandas.api.types import DatetimeTZDtype
 *             self._types_api = pd.api.types
 */
    goto __pyx_L13;
  }

  /* "pyarrow/pandas-shim.pxi":78
 *             from pandas.api.types import DatetimeTZDtype
 *             self._types_api = pd.api.types
 *         elif self._loose_version >= LooseVersion('0.19.0'):             # <<<<<<<<<<<<<<
 *             from pandas.types.dtypes import DatetimeTZDtype
 *             self._types_api = pd.api.types
 */
  __Pyx_INCREF(__pyx_v_LooseVersion);
  __pyx_t_5 = __pyx_v_LooseVersion; __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_kp_u_0_19_0) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_u_0_19_0);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_RichCompare(__pyx_v_self->_loose_version, __pyx_t_4, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 78, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(3, 78, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_8) {

    /* "pyarrow/pandas-shim.pxi":79
 *             self._types_api = pd.api.types
 *         elif self._loose_version >= LooseVersion('0.19.0'):
 *             from pandas.types.dtypes import DatetimeTZDtype             # <<<<<<<<<<<<<<
 *             self._types_api = pd.api.types
 *         else:
 */
    __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 79, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_n_s_DatetimeTZDtype);
    __Pyx_GIVEREF(__pyx_n_s_DatetimeTZDtype);
    PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_DatetimeTZDtype);
    __pyx_t_4 = __Pyx_Import(__pyx_n_s_pandas_types_dtypes, __pyx_t_5, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 79, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_DatetimeTZDtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 79, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_5);
    __pyx_v_DatetimeTZDtype = __pyx_t_5;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/pandas-shim.pxi":80
 *         elif self._loose_version >= LooseVersion('0.19.0'):
 *             from pandas.types.dtypes import DatetimeTZDtype
 *             self._types_api = pd.api.types             # <<<<<<<<<<<<<<
 *         else:
 *             from pandas.types.dtypes import DatetimeTZDtype
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_pd, __pyx_n_s_api); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 80, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_types); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 80, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GIVEREF(__pyx_t_5);
    __Pyx_GOTREF(__pyx_v_self->_types_api);
    __Pyx_DECREF(__pyx_v_self->_types_api);
    __pyx_v_self->_types_api = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "pyarrow/pandas-shim.pxi":78
 *             from pandas.api.types import DatetimeTZDtype
 *             self._types_api = pd.api.types
 *         elif self._loose_version >= LooseVersion('0.19.0'):             # <<<<<<<<<<<<<<
 *             from pandas.types.dtypes import DatetimeTZDtype
 *             self._types_api = pd.api.types
 */
    goto __pyx_L13;
  }

  /* "pyarrow/pandas-shim.pxi":82
 *             self._types_api = pd.api.types
 *         else:
 *             from pandas.types.dtypes import DatetimeTZDtype             # <<<<<<<<<<<<<<
 *             self._types_api = pd.core.common
 * 
 */
  /*else*/ {
    __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 82, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_n_s_DatetimeTZDtype);
    __Pyx_GIVEREF(__pyx_n_s_DatetimeTZDtype);
    PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_DatetimeTZDtype);
    __pyx_t_4 = __Pyx_Import(__pyx_n_s_pandas_types_dtypes, __pyx_t_5, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 82, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_DatetimeTZDtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 82, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_5);
    __pyx_v_DatetimeTZDtype = __pyx_t_5;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/pandas-shim.pxi":83
 *         else:
 *             from pandas.types.dtypes import DatetimeTZDtype
 *             self._types_api = pd.core.common             # <<<<<<<<<<<<<<
 * 
 *         self._datetimetz_type = DatetimeTZDtype
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_pd, __pyx_n_s_core); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 83, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_common); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 83, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GIVEREF(__pyx_t_5);
    __Pyx_GOTREF(__pyx_v_self->_types_api);
    __Pyx_DECREF(__pyx_v_self->_types_api);
    __pyx_v_self->_types_api = __pyx_t_5;
    __pyx_t_5 = 0;
  }
  __pyx_L13:;

  /* "pyarrow/pandas-shim.pxi":85
 *             self._types_api = pd.core.common
 * 
 *         self._datetimetz_type = DatetimeTZDtype             # <<<<<<<<<<<<<<
 *         self._have_pandas = True
 * 
 */
  __Pyx_INCREF(__pyx_v_DatetimeTZDtype);
  __Pyx_GIVEREF(__pyx_v_DatetimeTZDtype);
  __Pyx_GOTREF(__pyx_v_self->_datetimetz_type);
  __Pyx_DECREF(__pyx_v_self->_datetimetz_type);
  __pyx_v_self->_datetimetz_type = __pyx_v_DatetimeTZDtype;

  /* "pyarrow/pandas-shim.pxi":86
 * 
 *         self._datetimetz_type = DatetimeTZDtype
 *         self._have_pandas = True             # <<<<<<<<<<<<<<
 * 
 *         if self._loose_version > LooseVersion('0.25'):
 */
  __pyx_v_self->_have_pandas = 1;

  /* "pyarrow/pandas-shim.pxi":88
 *         self._have_pandas = True
 * 
 *         if self._loose_version > LooseVersion('0.25'):             # <<<<<<<<<<<<<<
 *             self.has_sparse = False
 *         else:
 */
  __Pyx_INCREF(__pyx_v_LooseVersion);
  __pyx_t_4 = __pyx_v_LooseVersion; __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_7, __pyx_kp_u_0_25) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_0_25);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_RichCompare(__pyx_v_self->_loose_version, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 88, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(3, 88, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_8) {

    /* "pyarrow/pandas-shim.pxi":89
 * 
 *         if self._loose_version > LooseVersion('0.25'):
 *             self.has_sparse = False             # <<<<<<<<<<<<<<
 *         else:
 *             self.has_sparse = True
 */
    __pyx_v_self->has_sparse = 0;

    /* "pyarrow/pandas-shim.pxi":88
 *         self._have_pandas = True
 * 
 *         if self._loose_version > LooseVersion('0.25'):             # <<<<<<<<<<<<<<
 *             self.has_sparse = False
 *         else:
 */
    goto __pyx_L14;
  }

  /* "pyarrow/pandas-shim.pxi":91
 *             self.has_sparse = False
 *         else:
 *             self.has_sparse = True             # <<<<<<<<<<<<<<
 * 
 *         self._pd024 = self._loose_version >= LooseVersion('0.24')
 */
  /*else*/ {
    __pyx_v_self->has_sparse = 1;
  }
  __pyx_L14:;

  /* "pyarrow/pandas-shim.pxi":93
 *             self.has_sparse = True
 * 
 *         self._pd024 = self._loose_version >= LooseVersion('0.24')             # <<<<<<<<<<<<<<
 * 
 *     cdef inline _check_import(self, bint raise_=True):
 */
  __Pyx_INCREF(__pyx_v_LooseVersion);
  __pyx_t_5 = __pyx_v_LooseVersion; __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_kp_u_0_24) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_u_0_24);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_RichCompare(__pyx_v_self->_loose_version, __pyx_t_4, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 93, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 93, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_self->_pd024 = __pyx_t_8;

  /* "pyarrow/pandas-shim.pxi":42
 *         self._have_pandas = 0
 * 
 *     cdef _import_pandas(self, bint raise_):             # <<<<<<<<<<<<<<
 *         try:
 *             import pandas as pd
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim._import_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pd);
  __Pyx_XDECREF(__pyx_v_pdcompat);
  __Pyx_XDECREF(__pyx_v_LooseVersion);
  __Pyx_XDECREF(__pyx_v_DatetimeTZDtype);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":95
 *         self._pd024 = self._loose_version >= LooseVersion('0.24')
 * 
 *     cdef inline _check_import(self, bint raise_=True):             # <<<<<<<<<<<<<<
 *         if self._tried_importing_pandas:
 *             if not self._have_pandas and raise_:
 */

static CYTHON_INLINE PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim__check_import(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, struct __pyx_opt_args_7pyarrow_3lib_14_PandasAPIShim__check_import *__pyx_optional_args) {
  int __pyx_v_raise_ = ((int)1);
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("_check_import", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_raise_ = __pyx_optional_args->raise_;
    }
  }

  /* "pyarrow/pandas-shim.pxi":96
 * 
 *     cdef inline _check_import(self, bint raise_=True):
 *         if self._tried_importing_pandas:             # <<<<<<<<<<<<<<
 *             if not self._have_pandas and raise_:
 *                 self._import_pandas(raise_)
 */
  __pyx_t_1 = (__pyx_v_self->_tried_importing_pandas != 0);
  if (__pyx_t_1) {

    /* "pyarrow/pandas-shim.pxi":97
 *     cdef inline _check_import(self, bint raise_=True):
 *         if self._tried_importing_pandas:
 *             if not self._have_pandas and raise_:             # <<<<<<<<<<<<<<
 *                 self._import_pandas(raise_)
 *             return
 */
    __pyx_t_2 = ((!(__pyx_v_self->_have_pandas != 0)) != 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_2 = (__pyx_v_raise_ != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L5_bool_binop_done:;
    if (__pyx_t_1) {

      /* "pyarrow/pandas-shim.pxi":98
 *         if self._tried_importing_pandas:
 *             if not self._have_pandas and raise_:
 *                 self._import_pandas(raise_)             # <<<<<<<<<<<<<<
 *             return
 * 
 */
      __pyx_t_3 = ((struct __pyx_vtabstruct_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self->__pyx_vtab)->_import_pandas(__pyx_v_self, __pyx_v_raise_); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 98, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "pyarrow/pandas-shim.pxi":97
 *     cdef inline _check_import(self, bint raise_=True):
 *         if self._tried_importing_pandas:
 *             if not self._have_pandas and raise_:             # <<<<<<<<<<<<<<
 *                 self._import_pandas(raise_)
 *             return
 */
    }

    /* "pyarrow/pandas-shim.pxi":99
 *             if not self._have_pandas and raise_:
 *                 self._import_pandas(raise_)
 *             return             # <<<<<<<<<<<<<<
 * 
 *         self._tried_importing_pandas = True
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/pandas-shim.pxi":96
 * 
 *     cdef inline _check_import(self, bint raise_=True):
 *         if self._tried_importing_pandas:             # <<<<<<<<<<<<<<
 *             if not self._have_pandas and raise_:
 *                 self._import_pandas(raise_)
 */
  }

  /* "pyarrow/pandas-shim.pxi":101
 *             return
 * 
 *         self._tried_importing_pandas = True             # <<<<<<<<<<<<<<
 *         self._import_pandas(raise_)
 * 
 */
  __pyx_v_self->_tried_importing_pandas = 1;

  /* "pyarrow/pandas-shim.pxi":102
 * 
 *         self._tried_importing_pandas = True
 *         self._import_pandas(raise_)             # <<<<<<<<<<<<<<
 * 
 *     def series(self, *args, **kwargs):
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self->__pyx_vtab)->_import_pandas(__pyx_v_self, __pyx_v_raise_); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/pandas-shim.pxi":95
 *         self._pd024 = self._loose_version >= LooseVersion('0.24')
 * 
 *     cdef inline _check_import(self, bint raise_=True):             # <<<<<<<<<<<<<<
 *         if self._tried_importing_pandas:
 *             if not self._have_pandas and raise_:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim._check_import", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":104
 *         self._import_pandas(raise_)
 * 
 *     def series(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return self._series(*args, **kwargs)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_3series(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_2series[] = "_PandasAPIShim.series(self, *args, **kwargs)";
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_3series(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("series (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "series", 1))) return NULL;
  if (unlikely(__pyx_kwds)) {
    __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return NULL;
    __Pyx_GOTREF(__pyx_v_kwargs);
  } else {
    __pyx_v_kwargs = NULL;
  }
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_2series(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_2series(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("series", 0);

  /* "pyarrow/pandas-shim.pxi":105
 * 
 *     def series(self, *args, **kwargs):
 *         self._check_import()             # <<<<<<<<<<<<<<
 *         return self._series(*args, **kwargs)
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim__check_import(__pyx_v_self, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/pandas-shim.pxi":106
 *     def series(self, *args, **kwargs):
 *         self._check_import()
 *         return self._series(*args, **kwargs)             # <<<<<<<<<<<<<<
 * 
 *     def data_frame(self, *args, **kwargs):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_self->_series, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/pandas-shim.pxi":104
 *         self._import_pandas(raise_)
 * 
 *     def series(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return self._series(*args, **kwargs)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.series", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":108
 *         return self._series(*args, **kwargs)
 * 
 *     def data_frame(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return self._data_frame(*args, **kwargs)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_5data_frame(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_4data_frame[] = "_PandasAPIShim.data_frame(self, *args, **kwargs)";
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_5data_frame(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("data_frame (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "data_frame", 1))) return NULL;
  if (unlikely(__pyx_kwds)) {
    __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return NULL;
    __Pyx_GOTREF(__pyx_v_kwargs);
  } else {
    __pyx_v_kwargs = NULL;
  }
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_4data_frame(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_4data_frame(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("data_frame", 0);

  /* "pyarrow/pandas-shim.pxi":109
 * 
 *     def data_frame(self, *args, **kwargs):
 *         self._check_import()             # <<<<<<<<<<<<<<
 *         return self._data_frame(*args, **kwargs)
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim__check_import(__pyx_v_self, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/pandas-shim.pxi":110
 *     def data_frame(self, *args, **kwargs):
 *         self._check_import()
 *         return self._data_frame(*args, **kwargs)             # <<<<<<<<<<<<<<
 * 
 *     cdef inline bint _have_pandas_internal(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_self->_data_frame, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/pandas-shim.pxi":108
 *         return self._series(*args, **kwargs)
 * 
 *     def data_frame(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return self._data_frame(*args, **kwargs)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.data_frame", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":112
 *         return self._data_frame(*args, **kwargs)
 * 
 *     cdef inline bint _have_pandas_internal(self):             # <<<<<<<<<<<<<<
 *         if not self._tried_importing_pandas:
 *             self._check_import(raise_=False)
 */

static CYTHON_INLINE int __pyx_f_7pyarrow_3lib_14_PandasAPIShim__have_pandas_internal(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7pyarrow_3lib_14_PandasAPIShim__check_import __pyx_t_3;
  __Pyx_RefNannySetupContext("_have_pandas_internal", 0);

  /* "pyarrow/pandas-shim.pxi":113
 * 
 *     cdef inline bint _have_pandas_internal(self):
 *         if not self._tried_importing_pandas:             # <<<<<<<<<<<<<<
 *             self._check_import(raise_=False)
 *         return self._have_pandas
 */
  __pyx_t_1 = ((!(__pyx_v_self->_tried_importing_pandas != 0)) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/pandas-shim.pxi":114
 *     cdef inline bint _have_pandas_internal(self):
 *         if not self._tried_importing_pandas:
 *             self._check_import(raise_=False)             # <<<<<<<<<<<<<<
 *         return self._have_pandas
 * 
 */
    __pyx_t_3.__pyx_n = 1;
    __pyx_t_3.raise_ = 0;
    __pyx_t_2 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim__check_import(__pyx_v_self, &__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 114, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pyarrow/pandas-shim.pxi":113
 * 
 *     cdef inline bint _have_pandas_internal(self):
 *         if not self._tried_importing_pandas:             # <<<<<<<<<<<<<<
 *             self._check_import(raise_=False)
 *         return self._have_pandas
 */
  }

  /* "pyarrow/pandas-shim.pxi":115
 *         if not self._tried_importing_pandas:
 *             self._check_import(raise_=False)
 *         return self._have_pandas             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_r = __pyx_v_self->_have_pandas;
  goto __pyx_L0;

  /* "pyarrow/pandas-shim.pxi":112
 *         return self._data_frame(*args, **kwargs)
 * 
 *     cdef inline bint _have_pandas_internal(self):             # <<<<<<<<<<<<<<
 *         if not self._tried_importing_pandas:
 *             self._check_import(raise_=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("pyarrow.lib._PandasAPIShim._have_pandas_internal", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":118
 * 
 *     @property
 *     def have_pandas(self):             # <<<<<<<<<<<<<<
 *         return self._have_pandas_internal()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_11have_pandas_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_11have_pandas_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_11have_pandas___get__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_11have_pandas___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/pandas-shim.pxi":119
 *     @property
 *     def have_pandas(self):
 *         return self._have_pandas_internal()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_7pyarrow_3lib_14_PandasAPIShim__have_pandas_internal(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/pandas-shim.pxi":118
 * 
 *     @property
 *     def have_pandas(self):             # <<<<<<<<<<<<<<
 *         return self._have_pandas_internal()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.have_pandas.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":122
 * 
 *     @property
 *     def compat(self):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return self._compat_module
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_6compat_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_6compat_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_6compat___get__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_6compat___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/pandas-shim.pxi":123
 *     @property
 *     def compat(self):
 *         self._check_import()             # <<<<<<<<<<<<<<
 *         return self._compat_module
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim__check_import(__pyx_v_self, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/pandas-shim.pxi":124
 *     def compat(self):
 *         self._check_import()
 *         return self._compat_module             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_compat_module);
  __pyx_r = __pyx_v_self->_compat_module;
  goto __pyx_L0;

  /* "pyarrow/pandas-shim.pxi":122
 * 
 *     @property
 *     def compat(self):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return self._compat_module
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.compat.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":127
 * 
 *     @property
 *     def pd(self):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return self._pd
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_2pd_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_2pd_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_2pd___get__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_2pd___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/pandas-shim.pxi":128
 *     @property
 *     def pd(self):
 *         self._check_import()             # <<<<<<<<<<<<<<
 *         return self._pd
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim__check_import(__pyx_v_self, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/pandas-shim.pxi":129
 *     def pd(self):
 *         self._check_import()
 *         return self._pd             # <<<<<<<<<<<<<<
 * 
 *     cpdef infer_dtype(self, obj):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_pd);
  __pyx_r = __pyx_v_self->_pd;
  goto __pyx_L0;

  /* "pyarrow/pandas-shim.pxi":127
 * 
 *     @property
 *     def pd(self):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return self._pd
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.pd.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":131
 *         return self._pd
 * 
 *     cpdef infer_dtype(self, obj):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         try:
 */

static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_7infer_dtype(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim_infer_dtype(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_RefNannySetupContext("infer_dtype", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_infer_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 131, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_7infer_dtype)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_obj);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 131, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pyarrow/pandas-shim.pxi":132
 * 
 *     cpdef infer_dtype(self, obj):
 *         self._check_import()             # <<<<<<<<<<<<<<
 *         try:
 *             return self._types_api.infer_dtype(obj, skipna=False)
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim__check_import(__pyx_v_self, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/pandas-shim.pxi":133
 *     cpdef infer_dtype(self, obj):
 *         self._check_import()
 *         try:             # <<<<<<<<<<<<<<
 *             return self._types_api.infer_dtype(obj, skipna=False)
 *         except AttributeError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    /*try:*/ {

      /* "pyarrow/pandas-shim.pxi":134
 *         self._check_import()
 *         try:
 *             return self._types_api.infer_dtype(obj, skipna=False)             # <<<<<<<<<<<<<<
 *         except AttributeError:
 *             return self._pd.lib.infer_dtype(obj)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_types_api, __pyx_n_s_infer_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 134, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 134, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_obj);
      __Pyx_GIVEREF(__pyx_v_obj);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
      __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 134, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_skipna, Py_False) < 0) __PYX_ERR(3, 134, __pyx_L3_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 134, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L7_try_return;

      /* "pyarrow/pandas-shim.pxi":133
 *     cpdef infer_dtype(self, obj):
 *         self._check_import()
 *         try:             # <<<<<<<<<<<<<<
 *             return self._types_api.infer_dtype(obj, skipna=False)
 *         except AttributeError:
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/pandas-shim.pxi":135
 *         try:
 *             return self._types_api.infer_dtype(obj, skipna=False)
 *         except AttributeError:             # <<<<<<<<<<<<<<
 *             return self._pd.lib.infer_dtype(obj)
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
    if (__pyx_t_8) {
      __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.infer_dtype", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2) < 0) __PYX_ERR(3, 135, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_t_2);

      /* "pyarrow/pandas-shim.pxi":136
 *             return self._types_api.infer_dtype(obj, skipna=False)
 *         except AttributeError:
 *             return self._pd.lib.infer_dtype(obj)             # <<<<<<<<<<<<<<
 * 
 *     cpdef pandas_dtype(self, dtype):
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_pd, __pyx_n_s_lib); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 136, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_infer_dtype); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 136, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_10, function);
        }
      }
      __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_9, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_obj);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 136, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/pandas-shim.pxi":133
 *     cpdef infer_dtype(self, obj):
 *         self._check_import()
 *         try:             # <<<<<<<<<<<<<<
 *             return self._types_api.infer_dtype(obj, skipna=False)
 *         except AttributeError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    goto __pyx_L0;
  }

  /* "pyarrow/pandas-shim.pxi":131
 *         return self._pd
 * 
 *     cpdef infer_dtype(self, obj):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         try:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.infer_dtype", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_7infer_dtype(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_6infer_dtype[] = "_PandasAPIShim.infer_dtype(self, obj)";
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_7infer_dtype(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("infer_dtype (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_6infer_dtype(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_6infer_dtype(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("infer_dtype", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim_infer_dtype(__pyx_v_self, __pyx_v_obj, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.infer_dtype", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":138
 *             return self._pd.lib.infer_dtype(obj)
 * 
 *     cpdef pandas_dtype(self, dtype):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         try:
 */

static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_9pandas_dtype(PyObject *__pyx_v_self, PyObject *__pyx_v_dtype); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim_pandas_dtype(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_dtype, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("pandas_dtype", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pandas_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 138, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_9pandas_dtype)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_dtype) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_dtype);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 138, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pyarrow/pandas-shim.pxi":139
 * 
 *     cpdef pandas_dtype(self, dtype):
 *         self._check_import()             # <<<<<<<<<<<<<<
 *         try:
 *             return self._types_api.pandas_dtype(dtype)
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim__check_import(__pyx_v_self, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/pandas-shim.pxi":140
 *     cpdef pandas_dtype(self, dtype):
 *         self._check_import()
 *         try:             # <<<<<<<<<<<<<<
 *             return self._types_api.pandas_dtype(dtype)
 *         except AttributeError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    /*try:*/ {

      /* "pyarrow/pandas-shim.pxi":141
 *         self._check_import()
 *         try:
 *             return self._types_api.pandas_dtype(dtype)             # <<<<<<<<<<<<<<
 *         except AttributeError:
 *             return None
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_types_api, __pyx_n_s_pandas_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 141, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_dtype) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_dtype);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 141, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L7_try_return;

      /* "pyarrow/pandas-shim.pxi":140
 *     cpdef pandas_dtype(self, dtype):
 *         self._check_import()
 *         try:             # <<<<<<<<<<<<<<
 *             return self._types_api.pandas_dtype(dtype)
 *         except AttributeError:
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/pandas-shim.pxi":142
 *         try:
 *             return self._types_api.pandas_dtype(dtype)
 *         except AttributeError:             # <<<<<<<<<<<<<<
 *             return None
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
    if (__pyx_t_8) {
      __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.pandas_dtype", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(3, 142, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_3);

      /* "pyarrow/pandas-shim.pxi":143
 *             return self._types_api.pandas_dtype(dtype)
 *         except AttributeError:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/pandas-shim.pxi":140
 *     cpdef pandas_dtype(self, dtype):
 *         self._check_import()
 *         try:             # <<<<<<<<<<<<<<
 *             return self._types_api.pandas_dtype(dtype)
 *         except AttributeError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    goto __pyx_L0;
  }

  /* "pyarrow/pandas-shim.pxi":138
 *             return self._pd.lib.infer_dtype(obj)
 * 
 *     cpdef pandas_dtype(self, dtype):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         try:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.pandas_dtype", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_9pandas_dtype(PyObject *__pyx_v_self, PyObject *__pyx_v_dtype); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_8pandas_dtype[] = "_PandasAPIShim.pandas_dtype(self, dtype)";
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_9pandas_dtype(PyObject *__pyx_v_self, PyObject *__pyx_v_dtype) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pandas_dtype (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_8pandas_dtype(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self), ((PyObject *)__pyx_v_dtype));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_8pandas_dtype(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_dtype) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("pandas_dtype", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim_pandas_dtype(__pyx_v_self, __pyx_v_dtype, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.pandas_dtype", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":146
 * 
 *     @property
 *     def loose_version(self):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return self._loose_version
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_13loose_version_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_13loose_version_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_13loose_version___get__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_13loose_version___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/pandas-shim.pxi":147
 *     @property
 *     def loose_version(self):
 *         self._check_import()             # <<<<<<<<<<<<<<
 *         return self._loose_version
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim__check_import(__pyx_v_self, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/pandas-shim.pxi":148
 *     def loose_version(self):
 *         self._check_import()
 *         return self._loose_version             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_loose_version);
  __pyx_r = __pyx_v_self->_loose_version;
  goto __pyx_L0;

  /* "pyarrow/pandas-shim.pxi":146
 * 
 *     @property
 *     def loose_version(self):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return self._loose_version
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.loose_version.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":151
 * 
 *     @property
 *     def version(self):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return self._version
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_7version_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_7version_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_7version___get__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_7version___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/pandas-shim.pxi":152
 *     @property
 *     def version(self):
 *         self._check_import()             # <<<<<<<<<<<<<<
 *         return self._version
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim__check_import(__pyx_v_self, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/pandas-shim.pxi":153
 *     def version(self):
 *         self._check_import()
 *         return self._version             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_version);
  __pyx_r = __pyx_v_self->_version;
  goto __pyx_L0;

  /* "pyarrow/pandas-shim.pxi":151
 * 
 *     @property
 *     def version(self):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return self._version
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.version.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":156
 * 
 *     @property
 *     def categorical_type(self):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return self._categorical_type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_16categorical_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_16categorical_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_16categorical_type___get__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_16categorical_type___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/pandas-shim.pxi":157
 *     @property
 *     def categorical_type(self):
 *         self._check_import()             # <<<<<<<<<<<<<<
 *         return self._categorical_type
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim__check_import(__pyx_v_self, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/pandas-shim.pxi":158
 *     def categorical_type(self):
 *         self._check_import()
 *         return self._categorical_type             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_categorical_type);
  __pyx_r = __pyx_v_self->_categorical_type;
  goto __pyx_L0;

  /* "pyarrow/pandas-shim.pxi":156
 * 
 *     @property
 *     def categorical_type(self):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return self._categorical_type
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.categorical_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":161
 * 
 *     @property
 *     def datetimetz_type(self):             # <<<<<<<<<<<<<<
 *         return self._datetimetz_type
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_15datetimetz_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_15datetimetz_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_15datetimetz_type___get__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_15datetimetz_type___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/pandas-shim.pxi":162
 *     @property
 *     def datetimetz_type(self):
 *         return self._datetimetz_type             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_datetimetz_type);
  __pyx_r = __pyx_v_self->_datetimetz_type;
  goto __pyx_L0;

  /* "pyarrow/pandas-shim.pxi":161
 * 
 *     @property
 *     def datetimetz_type(self):             # <<<<<<<<<<<<<<
 *         return self._datetimetz_type
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":165
 * 
 *     @property
 *     def extension_dtype(self):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return self._extension_dtype
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_15extension_dtype_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_15extension_dtype_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_15extension_dtype___get__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_15extension_dtype___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/pandas-shim.pxi":166
 *     @property
 *     def extension_dtype(self):
 *         self._check_import()             # <<<<<<<<<<<<<<
 *         return self._extension_dtype
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim__check_import(__pyx_v_self, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/pandas-shim.pxi":167
 *     def extension_dtype(self):
 *         self._check_import()
 *         return self._extension_dtype             # <<<<<<<<<<<<<<
 * 
 *     cpdef is_array_like(self, obj):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_extension_dtype);
  __pyx_r = __pyx_v_self->_extension_dtype;
  goto __pyx_L0;

  /* "pyarrow/pandas-shim.pxi":165
 * 
 *     @property
 *     def extension_dtype(self):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return self._extension_dtype
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.extension_dtype.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":169
 *         return self._extension_dtype
 * 
 *     cpdef is_array_like(self, obj):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return isinstance(obj, self._array_like_types)
 */

static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_11is_array_like(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_array_like(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("is_array_like", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_array_like); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 169, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_11is_array_like)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_obj);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 169, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pyarrow/pandas-shim.pxi":170
 * 
 *     cpdef is_array_like(self, obj):
 *         self._check_import()             # <<<<<<<<<<<<<<
 *         return isinstance(obj, self._array_like_types)
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim__check_import(__pyx_v_self, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/pandas-shim.pxi":171
 *     cpdef is_array_like(self, obj):
 *         self._check_import()
 *         return isinstance(obj, self._array_like_types)             # <<<<<<<<<<<<<<
 * 
 *     cpdef is_categorical(self, obj):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_v_self->_array_like_types;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_5 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(3, 171, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/pandas-shim.pxi":169
 *         return self._extension_dtype
 * 
 *     cpdef is_array_like(self, obj):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return isinstance(obj, self._array_like_types)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.is_array_like", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_11is_array_like(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_10is_array_like[] = "_PandasAPIShim.is_array_like(self, obj)";
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_11is_array_like(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_array_like (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_10is_array_like(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_10is_array_like(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("is_array_like", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_array_like(__pyx_v_self, __pyx_v_obj, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.is_array_like", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":173
 *         return isinstance(obj, self._array_like_types)
 * 
 *     cpdef is_categorical(self, obj):             # <<<<<<<<<<<<<<
 *         if self._have_pandas_internal():
 *             return isinstance(obj, self._categorical_type)
 */

static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_13is_categorical(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_categorical(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("is_categorical", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_categorical); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 173, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_13is_categorical)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_obj);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 173, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pyarrow/pandas-shim.pxi":174
 * 
 *     cpdef is_categorical(self, obj):
 *         if self._have_pandas_internal():             # <<<<<<<<<<<<<<
 *             return isinstance(obj, self._categorical_type)
 *         else:
 */
  __pyx_t_5 = (__pyx_f_7pyarrow_3lib_14_PandasAPIShim__have_pandas_internal(__pyx_v_self) != 0);
  if (__pyx_t_5) {

    /* "pyarrow/pandas-shim.pxi":175
 *     cpdef is_categorical(self, obj):
 *         if self._have_pandas_internal():
 *             return isinstance(obj, self._categorical_type)             # <<<<<<<<<<<<<<
 *         else:
 *             return False
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __pyx_v_self->_categorical_type;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_5 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(3, 175, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 175, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "pyarrow/pandas-shim.pxi":174
 * 
 *     cpdef is_categorical(self, obj):
 *         if self._have_pandas_internal():             # <<<<<<<<<<<<<<
 *             return isinstance(obj, self._categorical_type)
 *         else:
 */
  }

  /* "pyarrow/pandas-shim.pxi":177
 *             return isinstance(obj, self._categorical_type)
 *         else:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *     cpdef is_datetimetz(self, obj):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;
  }

  /* "pyarrow/pandas-shim.pxi":173
 *         return isinstance(obj, self._array_like_types)
 * 
 *     cpdef is_categorical(self, obj):             # <<<<<<<<<<<<<<
 *         if self._have_pandas_internal():
 *             return isinstance(obj, self._categorical_type)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.is_categorical", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_13is_categorical(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_12is_categorical[] = "_PandasAPIShim.is_categorical(self, obj)";
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_13is_categorical(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_categorical (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_12is_categorical(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_12is_categorical(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("is_categorical", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_categorical(__pyx_v_self, __pyx_v_obj, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.is_categorical", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":179
 *             return False
 * 
 *     cpdef is_datetimetz(self, obj):             # <<<<<<<<<<<<<<
 *         if self._have_pandas_internal():
 *             return isinstance(obj, self._datetimetz_type)
 */

static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_15is_datetimetz(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_datetimetz(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("is_datetimetz", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_datetimetz); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 179, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_15is_datetimetz)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_obj);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 179, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pyarrow/pandas-shim.pxi":180
 * 
 *     cpdef is_datetimetz(self, obj):
 *         if self._have_pandas_internal():             # <<<<<<<<<<<<<<
 *             return isinstance(obj, self._datetimetz_type)
 *         else:
 */
  __pyx_t_5 = (__pyx_f_7pyarrow_3lib_14_PandasAPIShim__have_pandas_internal(__pyx_v_self) != 0);
  if (__pyx_t_5) {

    /* "pyarrow/pandas-shim.pxi":181
 *     cpdef is_datetimetz(self, obj):
 *         if self._have_pandas_internal():
 *             return isinstance(obj, self._datetimetz_type)             # <<<<<<<<<<<<<<
 *         else:
 *             return False
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __pyx_v_self->_datetimetz_type;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_5 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(3, 181, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 181, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "pyarrow/pandas-shim.pxi":180
 * 
 *     cpdef is_datetimetz(self, obj):
 *         if self._have_pandas_internal():             # <<<<<<<<<<<<<<
 *             return isinstance(obj, self._datetimetz_type)
 *         else:
 */
  }

  /* "pyarrow/pandas-shim.pxi":183
 *             return isinstance(obj, self._datetimetz_type)
 *         else:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *     cpdef is_sparse(self, obj):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;
  }

  /* "pyarrow/pandas-shim.pxi":179
 *             return False
 * 
 *     cpdef is_datetimetz(self, obj):             # <<<<<<<<<<<<<<
 *         if self._have_pandas_internal():
 *             return isinstance(obj, self._datetimetz_type)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.is_datetimetz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_15is_datetimetz(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_14is_datetimetz[] = "_PandasAPIShim.is_datetimetz(self, obj)";
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_15is_datetimetz(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_datetimetz (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_14is_datetimetz(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_14is_datetimetz(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("is_datetimetz", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_datetimetz(__pyx_v_self, __pyx_v_obj, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.is_datetimetz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":185
 *             return False
 * 
 *     cpdef is_sparse(self, obj):             # <<<<<<<<<<<<<<
 *         if self._have_pandas_internal():
 *             return self._types_api.is_sparse(obj)
 */

static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_17is_sparse(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_sparse(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("is_sparse", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_sparse); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 185, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_17is_sparse)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_obj);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 185, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pyarrow/pandas-shim.pxi":186
 * 
 *     cpdef is_sparse(self, obj):
 *         if self._have_pandas_internal():             # <<<<<<<<<<<<<<
 *             return self._types_api.is_sparse(obj)
 *         else:
 */
  __pyx_t_5 = (__pyx_f_7pyarrow_3lib_14_PandasAPIShim__have_pandas_internal(__pyx_v_self) != 0);
  if (__pyx_t_5) {

    /* "pyarrow/pandas-shim.pxi":187
 *     cpdef is_sparse(self, obj):
 *         if self._have_pandas_internal():
 *             return self._types_api.is_sparse(obj)             # <<<<<<<<<<<<<<
 *         else:
 *             return False
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_types_api, __pyx_n_s_is_sparse); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 187, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_obj);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 187, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "pyarrow/pandas-shim.pxi":186
 * 
 *     cpdef is_sparse(self, obj):
 *         if self._have_pandas_internal():             # <<<<<<<<<<<<<<
 *             return self._types_api.is_sparse(obj)
 *         else:
 */
  }

  /* "pyarrow/pandas-shim.pxi":189
 *             return self._types_api.is_sparse(obj)
 *         else:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *     cpdef is_data_frame(self, obj):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;
  }

  /* "pyarrow/pandas-shim.pxi":185
 *             return False
 * 
 *     cpdef is_sparse(self, obj):             # <<<<<<<<<<<<<<
 *         if self._have_pandas_internal():
 *             return self._types_api.is_sparse(obj)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.is_sparse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_17is_sparse(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_16is_sparse[] = "_PandasAPIShim.is_sparse(self, obj)";
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_17is_sparse(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_sparse (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_16is_sparse(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_16is_sparse(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("is_sparse", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_sparse(__pyx_v_self, __pyx_v_obj, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.is_sparse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":191
 *             return False
 * 
 *     cpdef is_data_frame(self, obj):             # <<<<<<<<<<<<<<
 *         if self._have_pandas_internal():
 *             return isinstance(obj, self._data_frame)
 */

static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_19is_data_frame(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_data_frame(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("is_data_frame", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_data_frame); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 191, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_19is_data_frame)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_obj);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 191, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pyarrow/pandas-shim.pxi":192
 * 
 *     cpdef is_data_frame(self, obj):
 *         if self._have_pandas_internal():             # <<<<<<<<<<<<<<
 *             return isinstance(obj, self._data_frame)
 *         else:
 */
  __pyx_t_5 = (__pyx_f_7pyarrow_3lib_14_PandasAPIShim__have_pandas_internal(__pyx_v_self) != 0);
  if (__pyx_t_5) {

    /* "pyarrow/pandas-shim.pxi":193
 *     cpdef is_data_frame(self, obj):
 *         if self._have_pandas_internal():
 *             return isinstance(obj, self._data_frame)             # <<<<<<<<<<<<<<
 *         else:
 *             return False
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __pyx_v_self->_data_frame;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_5 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(3, 193, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "pyarrow/pandas-shim.pxi":192
 * 
 *     cpdef is_data_frame(self, obj):
 *         if self._have_pandas_internal():             # <<<<<<<<<<<<<<
 *             return isinstance(obj, self._data_frame)
 *         else:
 */
  }

  /* "pyarrow/pandas-shim.pxi":195
 *             return isinstance(obj, self._data_frame)
 *         else:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *     cpdef is_series(self, obj):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;
  }

  /* "pyarrow/pandas-shim.pxi":191
 *             return False
 * 
 *     cpdef is_data_frame(self, obj):             # <<<<<<<<<<<<<<
 *         if self._have_pandas_internal():
 *             return isinstance(obj, self._data_frame)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.is_data_frame", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_19is_data_frame(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_18is_data_frame[] = "_PandasAPIShim.is_data_frame(self, obj)";
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_19is_data_frame(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_data_frame (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_18is_data_frame(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_18is_data_frame(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("is_data_frame", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_data_frame(__pyx_v_self, __pyx_v_obj, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.is_data_frame", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":197
 *             return False
 * 
 *     cpdef is_series(self, obj):             # <<<<<<<<<<<<<<
 *         if self._have_pandas_internal():
 *             return isinstance(obj, self._series)
 */

static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_21is_series(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_series(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("is_series", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_series); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 197, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_21is_series)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_obj);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 197, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pyarrow/pandas-shim.pxi":198
 * 
 *     cpdef is_series(self, obj):
 *         if self._have_pandas_internal():             # <<<<<<<<<<<<<<
 *             return isinstance(obj, self._series)
 *         else:
 */
  __pyx_t_5 = (__pyx_f_7pyarrow_3lib_14_PandasAPIShim__have_pandas_internal(__pyx_v_self) != 0);
  if (__pyx_t_5) {

    /* "pyarrow/pandas-shim.pxi":199
 *     cpdef is_series(self, obj):
 *         if self._have_pandas_internal():
 *             return isinstance(obj, self._series)             # <<<<<<<<<<<<<<
 *         else:
 *             return False
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __pyx_v_self->_series;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_5 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(3, 199, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 199, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "pyarrow/pandas-shim.pxi":198
 * 
 *     cpdef is_series(self, obj):
 *         if self._have_pandas_internal():             # <<<<<<<<<<<<<<
 *             return isinstance(obj, self._series)
 *         else:
 */
  }

  /* "pyarrow/pandas-shim.pxi":201
 *             return isinstance(obj, self._series)
 *         else:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *     cpdef is_index(self, obj):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;
  }

  /* "pyarrow/pandas-shim.pxi":197
 *             return False
 * 
 *     cpdef is_series(self, obj):             # <<<<<<<<<<<<<<
 *         if self._have_pandas_internal():
 *             return isinstance(obj, self._series)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.is_series", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_21is_series(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_20is_series[] = "_PandasAPIShim.is_series(self, obj)";
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_21is_series(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_series (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_20is_series(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_20is_series(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("is_series", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_series(__pyx_v_self, __pyx_v_obj, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.is_series", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":203
 *             return False
 * 
 *     cpdef is_index(self, obj):             # <<<<<<<<<<<<<<
 *         if self._have_pandas_internal():
 *             return isinstance(obj, self._index)
 */

static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_23is_index(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_index(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("is_index", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 203, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_23is_index)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_obj);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 203, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pyarrow/pandas-shim.pxi":204
 * 
 *     cpdef is_index(self, obj):
 *         if self._have_pandas_internal():             # <<<<<<<<<<<<<<
 *             return isinstance(obj, self._index)
 *         else:
 */
  __pyx_t_5 = (__pyx_f_7pyarrow_3lib_14_PandasAPIShim__have_pandas_internal(__pyx_v_self) != 0);
  if (__pyx_t_5) {

    /* "pyarrow/pandas-shim.pxi":205
 *     cpdef is_index(self, obj):
 *         if self._have_pandas_internal():
 *             return isinstance(obj, self._index)             # <<<<<<<<<<<<<<
 *         else:
 *             return False
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __pyx_v_self->_index;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_5 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(3, 205, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 205, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "pyarrow/pandas-shim.pxi":204
 * 
 *     cpdef is_index(self, obj):
 *         if self._have_pandas_internal():             # <<<<<<<<<<<<<<
 *             return isinstance(obj, self._index)
 *         else:
 */
  }

  /* "pyarrow/pandas-shim.pxi":207
 *             return isinstance(obj, self._index)
 *         else:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_values(self, obj):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;
  }

  /* "pyarrow/pandas-shim.pxi":203
 *             return False
 * 
 *     cpdef is_index(self, obj):             # <<<<<<<<<<<<<<
 *         if self._have_pandas_internal():
 *             return isinstance(obj, self._index)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.is_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_23is_index(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_22is_index[] = "_PandasAPIShim.is_index(self, obj)";
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_23is_index(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_index (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_22is_index(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_22is_index(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("is_index", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_index(__pyx_v_self, __pyx_v_obj, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.is_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":209
 *             return False
 * 
 *     cpdef get_values(self, obj):             # <<<<<<<<<<<<<<
 *         """
 *         Get the underlying array values of a pandas Series or Index in the
 */

static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_25get_values(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib_14_PandasAPIShim_get_values(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("get_values", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 209, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_25get_values)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_obj);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 209, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pyarrow/pandas-shim.pxi":216
 *         Assumes obj is a pandas Series or Index.
 *         """
 *         self._check_import()             # <<<<<<<<<<<<<<
 *         if isinstance(obj.dtype, (self.pd.api.types.IntervalDtype,
 *                                   self.pd.api.types.PeriodDtype)):
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim__check_import(__pyx_v_self, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/pandas-shim.pxi":217
 *         """
 *         self._check_import()
 *         if isinstance(obj.dtype, (self.pd.api.types.IntervalDtype,             # <<<<<<<<<<<<<<
 *                                   self.pd.api.types.PeriodDtype)):
 *             if self._pd024:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pd); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_api); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_IntervalDtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/pandas-shim.pxi":218
 *         self._check_import()
 *         if isinstance(obj.dtype, (self.pd.api.types.IntervalDtype,
 *                                   self.pd.api.types.PeriodDtype)):             # <<<<<<<<<<<<<<
 *             if self._pd024:
 *                 # only since pandas 0.24, interval and period are stored as
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pd); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_api); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_PeriodDtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/pandas-shim.pxi":217
 *         """
 *         self._check_import()
 *         if isinstance(obj.dtype, (self.pd.api.types.IntervalDtype,             # <<<<<<<<<<<<<<
 *                                   self.pd.api.types.PeriodDtype)):
 *             if self._pd024:
 */
  __pyx_t_6 = PyObject_IsInstance(__pyx_t_1, __pyx_t_3); 
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (!__pyx_t_7) {
  } else {
    __pyx_t_5 = __pyx_t_7;
    goto __pyx_L4_bool_binop_done;
  }

  /* "pyarrow/pandas-shim.pxi":218
 *         self._check_import()
 *         if isinstance(obj.dtype, (self.pd.api.types.IntervalDtype,
 *                                   self.pd.api.types.PeriodDtype)):             # <<<<<<<<<<<<<<
 *             if self._pd024:
 *                 # only since pandas 0.24, interval and period are stored as
 */
  __pyx_t_7 = PyObject_IsInstance(__pyx_t_1, __pyx_t_4); 
  __pyx_t_6 = (__pyx_t_7 != 0);
  __pyx_t_5 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/pandas-shim.pxi":217
 *         """
 *         self._check_import()
 *         if isinstance(obj.dtype, (self.pd.api.types.IntervalDtype,             # <<<<<<<<<<<<<<
 *                                   self.pd.api.types.PeriodDtype)):
 *             if self._pd024:
 */
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {

    /* "pyarrow/pandas-shim.pxi":219
 *         if isinstance(obj.dtype, (self.pd.api.types.IntervalDtype,
 *                                   self.pd.api.types.PeriodDtype)):
 *             if self._pd024:             # <<<<<<<<<<<<<<
 *                 # only since pandas 0.24, interval and period are stored as
 *                 # such in Series
 */
    __pyx_t_6 = (__pyx_v_self->_pd024 != 0);
    if (__pyx_t_6) {

      /* "pyarrow/pandas-shim.pxi":222
 *                 # only since pandas 0.24, interval and period are stored as
 *                 # such in Series
 *                 return obj.array             # <<<<<<<<<<<<<<
 *         return obj.values
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 222, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* "pyarrow/pandas-shim.pxi":219
 *         if isinstance(obj.dtype, (self.pd.api.types.IntervalDtype,
 *                                   self.pd.api.types.PeriodDtype)):
 *             if self._pd024:             # <<<<<<<<<<<<<<
 *                 # only since pandas 0.24, interval and period are stored as
 *                 # such in Series
 */
    }

    /* "pyarrow/pandas-shim.pxi":217
 *         """
 *         self._check_import()
 *         if isinstance(obj.dtype, (self.pd.api.types.IntervalDtype,             # <<<<<<<<<<<<<<
 *                                   self.pd.api.types.PeriodDtype)):
 *             if self._pd024:
 */
  }

  /* "pyarrow/pandas-shim.pxi":223
 *                 # such in Series
 *                 return obj.array
 *         return obj.values             # <<<<<<<<<<<<<<
 * 
 *     def assert_frame_equal(self, *args, **kwargs):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/pandas-shim.pxi":209
 *             return False
 * 
 *     cpdef get_values(self, obj):             # <<<<<<<<<<<<<<
 *         """
 *         Get the underlying array values of a pandas Series or Index in the
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.get_values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_25get_values(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_24get_values[] = "_PandasAPIShim.get_values(self, obj)\n\n        Get the underlying array values of a pandas Series or Index in the\n        format (np.ndarray or pandas ExtensionArray) as we need them.\n\n        Assumes obj is a pandas Series or Index.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_25get_values(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_values (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_24get_values(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_24get_values(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("get_values", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim_get_values(__pyx_v_self, __pyx_v_obj, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.get_values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":225
 *         return obj.values
 * 
 *     def assert_frame_equal(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return self._pd.util.testing.assert_frame_equal
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_27assert_frame_equal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_26assert_frame_equal[] = "_PandasAPIShim.assert_frame_equal(self, *args, **kwargs)";
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_27assert_frame_equal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_args = 0;
  CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("assert_frame_equal (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "assert_frame_equal", 1))) return NULL;
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_26assert_frame_equal(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_26assert_frame_equal(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("assert_frame_equal", 0);

  /* "pyarrow/pandas-shim.pxi":226
 * 
 *     def assert_frame_equal(self, *args, **kwargs):
 *         self._check_import()             # <<<<<<<<<<<<<<
 *         return self._pd.util.testing.assert_frame_equal
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim__check_import(__pyx_v_self, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/pandas-shim.pxi":227
 *     def assert_frame_equal(self, *args, **kwargs):
 *         self._check_import()
 *         return self._pd.util.testing.assert_frame_equal             # <<<<<<<<<<<<<<
 * 
 *     def get_rangeindex_attribute(self, level, name):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_pd, __pyx_n_s_util); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_testing); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_assert_frame_equal); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/pandas-shim.pxi":225
 *         return obj.values
 * 
 *     def assert_frame_equal(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         self._check_import()
 *         return self._pd.util.testing.assert_frame_equal
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.assert_frame_equal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":229
 *         return self._pd.util.testing.assert_frame_equal
 * 
 *     def get_rangeindex_attribute(self, level, name):             # <<<<<<<<<<<<<<
 *         # public start/stop/step attributes added in pandas 0.25.0
 *         self._check_import()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_29get_rangeindex_attribute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_28get_rangeindex_attribute[] = "_PandasAPIShim.get_rangeindex_attribute(self, level, name)";
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_29get_rangeindex_attribute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_level = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_rangeindex_attribute (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,&__pyx_n_s_name,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_rangeindex_attribute", 1, 2, 2, 1); __PYX_ERR(3, 229, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_rangeindex_attribute") < 0)) __PYX_ERR(3, 229, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_level = values[0];
    __pyx_v_name = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_rangeindex_attribute", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 229, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.get_rangeindex_attribute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_28get_rangeindex_attribute(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self), __pyx_v_level, __pyx_v_name);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_28get_rangeindex_attribute(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v_level, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("get_rangeindex_attribute", 0);

  /* "pyarrow/pandas-shim.pxi":231
 *     def get_rangeindex_attribute(self, level, name):
 *         # public start/stop/step attributes added in pandas 0.25.0
 *         self._check_import()             # <<<<<<<<<<<<<<
 *         if hasattr(level, name):
 *             return getattr(level, name)
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim__check_import(__pyx_v_self, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/pandas-shim.pxi":232
 *         # public start/stop/step attributes added in pandas 0.25.0
 *         self._check_import()
 *         if hasattr(level, name):             # <<<<<<<<<<<<<<
 *             return getattr(level, name)
 *         return getattr(level, '_' + name)
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_level, __pyx_v_name); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(3, 232, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/pandas-shim.pxi":233
 *         self._check_import()
 *         if hasattr(level, name):
 *             return getattr(level, name)             # <<<<<<<<<<<<<<
 *         return getattr(level, '_' + name)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_GetAttr(__pyx_v_level, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "pyarrow/pandas-shim.pxi":232
 *         # public start/stop/step attributes added in pandas 0.25.0
 *         self._check_import()
 *         if hasattr(level, name):             # <<<<<<<<<<<<<<
 *             return getattr(level, name)
 *         return getattr(level, '_' + name)
 */
  }

  /* "pyarrow/pandas-shim.pxi":234
 *         if hasattr(level, name):
 *             return getattr(level, name)
 *         return getattr(level, '_' + name)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyNumber_Add(__pyx_n_u__3, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetAttr(__pyx_v_level, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/pandas-shim.pxi":229
 *         return self._pd.util.testing.assert_frame_equal
 * 
 *     def get_rangeindex_attribute(self, level, name):             # <<<<<<<<<<<<<<
 *         # public start/stop/step attributes added in pandas 0.25.0
 *         self._check_import()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.get_rangeindex_attribute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":30
 * 
 *     cdef readonly:
 *         object _loose_version, _version             # <<<<<<<<<<<<<<
 *         object _pd, _types_api, _compat_module
 *         object _data_frame, _index, _series, _categorical_type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_14_loose_version_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_14_loose_version_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_14_loose_version___get__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_14_loose_version___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_loose_version);
  __pyx_r = __pyx_v_self->_loose_version;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_8_version_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_8_version_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_8_version___get__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_8_version___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_version);
  __pyx_r = __pyx_v_self->_version;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":31
 *     cdef readonly:
 *         object _loose_version, _version
 *         object _pd, _types_api, _compat_module             # <<<<<<<<<<<<<<
 *         object _data_frame, _index, _series, _categorical_type
 *         object _datetimetz_type, _extension_array, _extension_dtype
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_3_pd_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_3_pd_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_3_pd___get__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_3_pd___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_pd);
  __pyx_r = __pyx_v_self->_pd;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_10_types_api_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_10_types_api_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_10_types_api___get__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_10_types_api___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_types_api);
  __pyx_r = __pyx_v_self->_types_api;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_14_compat_module_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_14_compat_module_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_14_compat_module___get__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_14_compat_module___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_compat_module);
  __pyx_r = __pyx_v_self->_compat_module;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":32
 *         object _loose_version, _version
 *         object _pd, _types_api, _compat_module
 *         object _data_frame, _index, _series, _categorical_type             # <<<<<<<<<<<<<<
 *         object _datetimetz_type, _extension_array, _extension_dtype
 *         object _array_like_types
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_11_data_frame_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_11_data_frame_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_11_data_frame___get__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_11_data_frame___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_data_frame);
  __pyx_r = __pyx_v_self->_data_frame;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_6_index_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_6_index_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_6_index___get__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_6_index___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_index);
  __pyx_r = __pyx_v_self->_index;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_7_series_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_7_series_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_7_series___get__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_7_series___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_series);
  __pyx_r = __pyx_v_self->_series;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_17_categorical_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_17_categorical_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_17_categorical_type___get__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_17_categorical_type___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_categorical_type);
  __pyx_r = __pyx_v_self->_categorical_type;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":33
 *         object _pd, _types_api, _compat_module
 *         object _data_frame, _index, _series, _categorical_type
 *         object _datetimetz_type, _extension_array, _extension_dtype             # <<<<<<<<<<<<<<
 *         object _array_like_types
 *         bint has_sparse
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_16_datetimetz_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_16_datetimetz_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_16_datetimetz_type___get__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_16_datetimetz_type___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_datetimetz_type);
  __pyx_r = __pyx_v_self->_datetimetz_type;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_16_extension_array_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_16_extension_array_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_16_extension_array___get__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_16_extension_array___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_extension_array);
  __pyx_r = __pyx_v_self->_extension_array;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_16_extension_dtype_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_16_extension_dtype_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_16_extension_dtype___get__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_16_extension_dtype___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_extension_dtype);
  __pyx_r = __pyx_v_self->_extension_dtype;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":34
 *         object _data_frame, _index, _series, _categorical_type
 *         object _datetimetz_type, _extension_array, _extension_dtype
 *         object _array_like_types             # <<<<<<<<<<<<<<
 *         bint has_sparse
 *         bint _pd024
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_17_array_like_types_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_17_array_like_types_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_17_array_like_types___get__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_17_array_like_types___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_array_like_types);
  __pyx_r = __pyx_v_self->_array_like_types;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":35
 *         object _datetimetz_type, _extension_array, _extension_dtype
 *         object _array_like_types
 *         bint has_sparse             # <<<<<<<<<<<<<<
 *         bint _pd024
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_10has_sparse_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_10has_sparse_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_10has_sparse___get__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_10has_sparse___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->has_sparse); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.has_sparse.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/pandas-shim.pxi":36
 *         object _array_like_types
 *         bint has_sparse
 *         bint _pd024             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_6_pd024_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_6_pd024_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_6_pd024___get__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_6_pd024___get__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_pd024); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim._pd024.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_31__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_30__reduce_cython__[] = "_PandasAPIShim.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_31__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_30__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_30__reduce_cython__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self._array_like_types, self._categorical_type, self._compat_module, self._data_frame, self._datetimetz_type, self._extension_array, self._extension_dtype, self._have_pandas, self._index, self._loose_version, self._pd, self._pd024, self._series, self._tried_importing_pandas, self._types_api, self._version, self.has_sparse)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_have_pandas); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->_pd024); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_self->_tried_importing_pandas); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_self->has_sparse); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(17); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_self->_array_like_types);
  __Pyx_GIVEREF(__pyx_v_self->_array_like_types);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->_array_like_types);
  __Pyx_INCREF(__pyx_v_self->_categorical_type);
  __Pyx_GIVEREF(__pyx_v_self->_categorical_type);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_self->_categorical_type);
  __Pyx_INCREF(__pyx_v_self->_compat_module);
  __Pyx_GIVEREF(__pyx_v_self->_compat_module);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_self->_compat_module);
  __Pyx_INCREF(__pyx_v_self->_data_frame);
  __Pyx_GIVEREF(__pyx_v_self->_data_frame);
  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_self->_data_frame);
  __Pyx_INCREF(__pyx_v_self->_datetimetz_type);
  __Pyx_GIVEREF(__pyx_v_self->_datetimetz_type);
  PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_v_self->_datetimetz_type);
  __Pyx_INCREF(__pyx_v_self->_extension_array);
  __Pyx_GIVEREF(__pyx_v_self->_extension_array);
  PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_v_self->_extension_array);
  __Pyx_INCREF(__pyx_v_self->_extension_dtype);
  __Pyx_GIVEREF(__pyx_v_self->_extension_dtype);
  PyTuple_SET_ITEM(__pyx_t_5, 6, __pyx_v_self->_extension_dtype);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_5, 7, __pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->_index);
  __Pyx_GIVEREF(__pyx_v_self->_index);
  PyTuple_SET_ITEM(__pyx_t_5, 8, __pyx_v_self->_index);
  __Pyx_INCREF(__pyx_v_self->_loose_version);
  __Pyx_GIVEREF(__pyx_v_self->_loose_version);
  PyTuple_SET_ITEM(__pyx_t_5, 9, __pyx_v_self->_loose_version);
  __Pyx_INCREF(__pyx_v_self->_pd);
  __Pyx_GIVEREF(__pyx_v_self->_pd);
  PyTuple_SET_ITEM(__pyx_t_5, 10, __pyx_v_self->_pd);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 11, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_self->_series);
  __Pyx_GIVEREF(__pyx_v_self->_series);
  PyTuple_SET_ITEM(__pyx_t_5, 12, __pyx_v_self->_series);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 13, __pyx_t_3);
  __Pyx_INCREF(__pyx_v_self->_types_api);
  __Pyx_GIVEREF(__pyx_v_self->_types_api);
  PyTuple_SET_ITEM(__pyx_t_5, 14, __pyx_v_self->_types_api);
  __Pyx_INCREF(__pyx_v_self->_version);
  __Pyx_GIVEREF(__pyx_v_self->_version);
  PyTuple_SET_ITEM(__pyx_t_5, 15, __pyx_v_self->_version);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 16, __pyx_t_4);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_v_state = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self._array_like_types, self._categorical_type, self._compat_module, self._data_frame, self._datetimetz_type, self._extension_array, self._extension_dtype, self._have_pandas, self._index, self._loose_version, self._pd, self._pd024, self._series, self._tried_importing_pandas, self._types_api, self._version, self.has_sparse)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_5 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v__dict = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "(tree fragment)":7
 *     state = (self._array_like_types, self._categorical_type, self._compat_module, self._data_frame, self._datetimetz_type, self._extension_array, self._extension_dtype, self._have_pandas, self._index, self._loose_version, self._pd, self._pd024, self._series, self._tried_importing_pandas, self._types_api, self._version, self.has_sparse)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_6 = (__pyx_v__dict != Py_None);
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v__dict);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self._array_like_types is not None or self._categorical_type is not None or self._compat_module is not None or self._data_frame is not None or self._datetimetz_type is not None or self._extension_array is not None or self._extension_dtype is not None or self._index is not None or self._loose_version is not None or self._pd is not None or self._series is not None or self._types_api is not None or self._version is not None
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self._array_like_types, self._categorical_type, self._compat_module, self._data_frame, self._datetimetz_type, self._extension_array, self._extension_dtype, self._have_pandas, self._index, self._loose_version, self._pd, self._pd024, self._series, self._tried_importing_pandas, self._types_api, self._version, self.has_sparse)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self._array_like_types is not None or self._categorical_type is not None or self._compat_module is not None or self._data_frame is not None or self._datetimetz_type is not None or self._extension_array is not None or self._extension_dtype is not None or self._index is not None or self._loose_version is not None or self._pd is not None or self._series is not None or self._types_api is not None or self._version is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle__PandasAPIShim, (type(self), 0x3f5738b, None), state
 */
  /*else*/ {
    __pyx_t_6 = (__pyx_v_self->_array_like_types != Py_None);
    __pyx_t_8 = (__pyx_t_6 != 0);
    if (!__pyx_t_8) {
    } else {
      __pyx_t_7 = __pyx_t_8;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_8 = (__pyx_v_self->_categorical_type != Py_None);
    __pyx_t_6 = (__pyx_t_8 != 0);
    if (!__pyx_t_6) {
    } else {
      __pyx_t_7 = __pyx_t_6;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_6 = (__pyx_v_self->_compat_module != Py_None);
    __pyx_t_8 = (__pyx_t_6 != 0);
    if (!__pyx_t_8) {
    } else {
      __pyx_t_7 = __pyx_t_8;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_8 = (__pyx_v_self->_data_frame != Py_None);
    __pyx_t_6 = (__pyx_t_8 != 0);
    if (!__pyx_t_6) {
    } else {
      __pyx_t_7 = __pyx_t_6;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_6 = (__pyx_v_self->_datetimetz_type != Py_None);
    __pyx_t_8 = (__pyx_t_6 != 0);
    if (!__pyx_t_8) {
    } else {
      __pyx_t_7 = __pyx_t_8;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_8 = (__pyx_v_self->_extension_array != Py_None);
    __pyx_t_6 = (__pyx_t_8 != 0);
    if (!__pyx_t_6) {
    } else {
      __pyx_t_7 = __pyx_t_6;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_6 = (__pyx_v_self->_extension_dtype != Py_None);
    __pyx_t_8 = (__pyx_t_6 != 0);
    if (!__pyx_t_8) {
    } else {
      __pyx_t_7 = __pyx_t_8;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_8 = (__pyx_v_self->_index != Py_None);
    __pyx_t_6 = (__pyx_t_8 != 0);
    if (!__pyx_t_6) {
    } else {
      __pyx_t_7 = __pyx_t_6;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_6 = (__pyx_v_self->_loose_version != Py_None);
    __pyx_t_8 = (__pyx_t_6 != 0);
    if (!__pyx_t_8) {
    } else {
      __pyx_t_7 = __pyx_t_8;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_8 = (__pyx_v_self->_pd != Py_None);
    __pyx_t_6 = (__pyx_t_8 != 0);
    if (!__pyx_t_6) {
    } else {
      __pyx_t_7 = __pyx_t_6;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_6 = (__pyx_v_self->_series != Py_None);
    __pyx_t_8 = (__pyx_t_6 != 0);
    if (!__pyx_t_8) {
    } else {
      __pyx_t_7 = __pyx_t_8;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_8 = (__pyx_v_self->_types_api != Py_None);
    __pyx_t_6 = (__pyx_t_8 != 0);
    if (!__pyx_t_6) {
    } else {
      __pyx_t_7 = __pyx_t_6;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_6 = (__pyx_v_self->_version != Py_None);
    __pyx_t_8 = (__pyx_t_6 != 0);
    __pyx_t_7 = __pyx_t_8;
    __pyx_L4_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_7;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self._array_like_types is not None or self._categorical_type is not None or self._compat_module is not None or self._data_frame is not None or self._datetimetz_type is not None or self._extension_array is not None or self._extension_dtype is not None or self._index is not None or self._loose_version is not None or self._pd is not None or self._series is not None or self._types_api is not None or self._version is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle__PandasAPIShim, (type(self), 0x3f5738b, None), state
 *     else:
 */
  __pyx_t_7 = (__pyx_v_use_setstate != 0);
  if (__pyx_t_7) {

    /* "(tree fragment)":13
 *         use_setstate = self._array_like_types is not None or self._categorical_type is not None or self._compat_module is not None or self._data_frame is not None or self._datetimetz_type is not None or self._extension_array is not None or self._extension_dtype is not None or self._index is not None or self._loose_version is not None or self._pd is not None or self._series is not None or self._types_api is not None or self._version is not None
 *     if use_setstate:
 *         return __pyx_unpickle__PandasAPIShim, (type(self), 0x3f5738b, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle__PandasAPIShim, (type(self), 0x3f5738b, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle__PandasAPIShim); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_66417547);
    __Pyx_GIVEREF(__pyx_int_66417547);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_66417547);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_5, 2, Py_None);
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self._array_like_types is not None or self._categorical_type is not None or self._compat_module is not None or self._data_frame is not None or self._datetimetz_type is not None or self._extension_array is not None or self._extension_dtype is not None or self._index is not None or self._loose_version is not None or self._pd is not None or self._series is not None or self._types_api is not None or self._version is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle__PandasAPIShim, (type(self), 0x3f5738b, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle__PandasAPIShim, (type(self), 0x3f5738b, None), state
 *     else:
 *         return __pyx_unpickle__PandasAPIShim, (type(self), 0x3f5738b, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle__PandasAPIShim__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle__PandasAPIShim); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_66417547);
    __Pyx_GIVEREF(__pyx_int_66417547);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_66417547);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
    __pyx_t_3 = 0;
    __pyx_t_5 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle__PandasAPIShim, (type(self), 0x3f5738b, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle__PandasAPIShim__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_33__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_32__setstate_cython__[] = "_PandasAPIShim.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_33__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_PandasAPIShim_32__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_PandasAPIShim_32__setstate_cython__(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle__PandasAPIShim, (type(self), 0x3f5738b, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle__PandasAPIShim__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(10, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_7pyarrow_3lib___pyx_unpickle__PandasAPIShim__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle__PandasAPIShim, (type(self), 0x3f5738b, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle__PandasAPIShim__set_state(self, __pyx_state)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._PandasAPIShim.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/error.pxi":36
 * 
 * class ArrowKeyError(KeyError, ArrowException):
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         # Override KeyError.__str__, as it uses the repr() of the key
 *         return ArrowException.__str__(self)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13ArrowKeyError_1__str__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13ArrowKeyError___str__[] = "ArrowKeyError.__str__(self)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_13ArrowKeyError_1__str__ = {"__str__", (PyCFunction)__pyx_pw_7pyarrow_3lib_13ArrowKeyError_1__str__, METH_O, __pyx_doc_7pyarrow_3lib_13ArrowKeyError___str__};
static PyObject *__pyx_pw_7pyarrow_3lib_13ArrowKeyError_1__str__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13ArrowKeyError___str__(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13ArrowKeyError___str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "pyarrow/error.pxi":38
 *     def __str__(self):
 *         # Override KeyError.__str__, as it uses the repr() of the key
 *         return ArrowException.__str__(self)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ArrowException); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_str); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_self) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/error.pxi":36
 * 
 * class ArrowKeyError(KeyError, ArrowException):
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         # Override KeyError.__str__, as it uses the repr() of the key
 *         return ArrowException.__str__(self)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.ArrowKeyError.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/error.pxi":67
 * # This function could be written directly in C++ if we didn't
 * # define Arrow-specific subclasses (ArrowInvalid etc.)
 * cdef int check_status(const CStatus& status) nogil except -1:             # <<<<<<<<<<<<<<
 *     if status.ok():
 *         return 0
 */

static int __pyx_f_7pyarrow_3lib_check_status(arrow::Status const &__pyx_v_status) {
  PyObject *__pyx_v_message = NULL;
  std::shared_ptr<arrow::StatusDetail>  __pyx_v_detail;
  int __pyx_v_errno;
  int __pyx_v_winerror;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif
  __Pyx_RefNannySetupContext("check_status", 1);

  /* "pyarrow/error.pxi":68
 * # define Arrow-specific subclasses (ArrowInvalid etc.)
 * cdef int check_status(const CStatus& status) nogil except -1:
 *     if status.ok():             # <<<<<<<<<<<<<<
 *         return 0
 * 
 */
  /*try:*/ {
    __pyx_t_1 = (__pyx_v_status.ok() != 0);
    if (__pyx_t_1) {

      /* "pyarrow/error.pxi":69
 * cdef int check_status(const CStatus& status) nogil except -1:
 *     if status.ok():
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     with gil:
 */
      __pyx_r = 0;
      goto __pyx_L3_return;

      /* "pyarrow/error.pxi":68
 * # define Arrow-specific subclasses (ArrowInvalid etc.)
 * cdef int check_status(const CStatus& status) nogil except -1:
 *     if status.ok():             # <<<<<<<<<<<<<<
 *         return 0
 * 
 */
    }

    /* "pyarrow/error.pxi":71
 *         return 0
 * 
 *     with gil:             # <<<<<<<<<<<<<<
 *         if IsPyError(status):
 *             RestorePyError(status)
 */
    {
        #ifdef WITH_THREAD
        PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
        #endif
        /*try:*/ {

          /* "pyarrow/error.pxi":72
 * 
 *     with gil:
 *         if IsPyError(status):             # <<<<<<<<<<<<<<
 *             RestorePyError(status)
 *             return -1
 */
          __pyx_t_1 = (arrow::py::IsPyError(__pyx_v_status) != 0);
          if (__pyx_t_1) {

            /* "pyarrow/error.pxi":73
 *     with gil:
 *         if IsPyError(status):
 *             RestorePyError(status)             # <<<<<<<<<<<<<<
 *             return -1
 * 
 */
            arrow::py::RestorePyError(__pyx_v_status);

            /* "pyarrow/error.pxi":74
 *         if IsPyError(status):
 *             RestorePyError(status)
 *             return -1             # <<<<<<<<<<<<<<
 * 
 *         # We don't use Status::ToString() as it would redundantly include
 */
            __pyx_r = -1;
            goto __pyx_L7_return;

            /* "pyarrow/error.pxi":72
 * 
 *     with gil:
 *         if IsPyError(status):             # <<<<<<<<<<<<<<
 *             RestorePyError(status)
 *             return -1
 */
          }

          /* "pyarrow/error.pxi":78
 *         # We don't use Status::ToString() as it would redundantly include
 *         # the C++ class name.
 *         message = frombytes(status.message())             # <<<<<<<<<<<<<<
 *         detail = status.detail()
 *         if detail != nullptr:
 */
          __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 78, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_status.message()); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 78, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_5 = NULL;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
            __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
            if (likely(__pyx_t_5)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
              __Pyx_INCREF(__pyx_t_5);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_3, function);
            }
          }
          __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 78, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_v_message = __pyx_t_2;
          __pyx_t_2 = 0;

          /* "pyarrow/error.pxi":79
 *         # the C++ class name.
 *         message = frombytes(status.message())
 *         detail = status.detail()             # <<<<<<<<<<<<<<
 *         if detail != nullptr:
 *             message += ". Detail: " + frombytes(detail.get().ToString())
 */
          __pyx_v_detail = __pyx_v_status.detail();

          /* "pyarrow/error.pxi":80
 *         message = frombytes(status.message())
 *         detail = status.detail()
 *         if detail != nullptr:             # <<<<<<<<<<<<<<
 *             message += ". Detail: " + frombytes(detail.get().ToString())
 * 
 */
          __pyx_t_1 = ((__pyx_v_detail != nullptr) != 0);
          if (__pyx_t_1) {

            /* "pyarrow/error.pxi":81
 *         detail = status.detail()
 *         if detail != nullptr:
 *             message += ". Detail: " + frombytes(detail.get().ToString())             # <<<<<<<<<<<<<<
 * 
 *         if status.IsInvalid():
 */
            __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 81, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_detail.get()->ToString()); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 81, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_5 = NULL;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
              __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
              if (likely(__pyx_t_5)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
                __Pyx_INCREF(__pyx_t_5);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_3, function);
              }
            }
            __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __pyx_t_3 = PyNumber_Add(__pyx_kp_u_Detail, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 81, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_message, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_DECREF_SET(__pyx_v_message, __pyx_t_2);
            __pyx_t_2 = 0;

            /* "pyarrow/error.pxi":80
 *         message = frombytes(status.message())
 *         detail = status.detail()
 *         if detail != nullptr:             # <<<<<<<<<<<<<<
 *             message += ". Detail: " + frombytes(detail.get().ToString())
 * 
 */
          }

          /* "pyarrow/error.pxi":83
 *             message += ". Detail: " + frombytes(detail.get().ToString())
 * 
 *         if status.IsInvalid():             # <<<<<<<<<<<<<<
 *             raise ArrowInvalid(message)
 *         elif status.IsIOError():
 */
          __pyx_t_1 = (__pyx_v_status.IsInvalid() != 0);
          if (unlikely(__pyx_t_1)) {

            /* "pyarrow/error.pxi":84
 * 
 *         if status.IsInvalid():
 *             raise ArrowInvalid(message)             # <<<<<<<<<<<<<<
 *         elif status.IsIOError():
 *             # Note: OSError constructor is
 */
            __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ArrowInvalid); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_4 = NULL;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
              __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
              if (likely(__pyx_t_4)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
                __Pyx_INCREF(__pyx_t_4);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_3, function);
              }
            }
            __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_message) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_message);
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_Raise(__pyx_t_2, 0, 0, 0);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __PYX_ERR(0, 84, __pyx_L8_error)

            /* "pyarrow/error.pxi":83
 *             message += ". Detail: " + frombytes(detail.get().ToString())
 * 
 *         if status.IsInvalid():             # <<<<<<<<<<<<<<
 *             raise ArrowInvalid(message)
 *         elif status.IsIOError():
 */
          }

          /* "pyarrow/error.pxi":85
 *         if status.IsInvalid():
 *             raise ArrowInvalid(message)
 *         elif status.IsIOError():             # <<<<<<<<<<<<<<
 *             # Note: OSError constructor is
 *             #   OSError(message)
 */
          __pyx_t_1 = (__pyx_v_status.IsIOError() != 0);
          if (__pyx_t_1) {

            /* "pyarrow/error.pxi":92
 *             # or (on Windows)
 *             #   OSError(errno, message, filename, winerror)
 *             errno = ErrnoFromStatus(status)             # <<<<<<<<<<<<<<
 *             winerror = WinErrorFromStatus(status)
 *             if winerror != 0:
 */
            __pyx_v_errno = arrow::internal::ErrnoFromStatus(__pyx_v_status);

            /* "pyarrow/error.pxi":93
 *             #   OSError(errno, message, filename, winerror)
 *             errno = ErrnoFromStatus(status)
 *             winerror = WinErrorFromStatus(status)             # <<<<<<<<<<<<<<
 *             if winerror != 0:
 *                 raise IOError(errno, message, None, winerror)
 */
            __pyx_v_winerror = arrow::internal::WinErrorFromStatus(__pyx_v_status);

            /* "pyarrow/error.pxi":94
 *             errno = ErrnoFromStatus(status)
 *             winerror = WinErrorFromStatus(status)
 *             if winerror != 0:             # <<<<<<<<<<<<<<
 *                 raise IOError(errno, message, None, winerror)
 *             elif errno != 0:
 */
            __pyx_t_1 = ((__pyx_v_winerror != 0) != 0);
            if (unlikely(__pyx_t_1)) {

              /* "pyarrow/error.pxi":95
 *             winerror = WinErrorFromStatus(status)
 *             if winerror != 0:
 *                 raise IOError(errno, message, None, winerror)             # <<<<<<<<<<<<<<
 *             elif errno != 0:
 *                 raise IOError(errno, message)
 */
              __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_errno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_winerror); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_3);
              __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 95, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_GIVEREF(__pyx_t_2);
              PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
              __Pyx_INCREF(__pyx_v_message);
              __Pyx_GIVEREF(__pyx_v_message);
              PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_message);
              __Pyx_INCREF(Py_None);
              __Pyx_GIVEREF(Py_None);
              PyTuple_SET_ITEM(__pyx_t_4, 2, Py_None);
              __Pyx_GIVEREF(__pyx_t_3);
              PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3);
              __pyx_t_2 = 0;
              __pyx_t_3 = 0;
              __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_Raise(__pyx_t_3, 0, 0, 0);
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              __PYX_ERR(0, 95, __pyx_L8_error)

              /* "pyarrow/error.pxi":94
 *             errno = ErrnoFromStatus(status)
 *             winerror = WinErrorFromStatus(status)
 *             if winerror != 0:             # <<<<<<<<<<<<<<
 *                 raise IOError(errno, message, None, winerror)
 *             elif errno != 0:
 */
            }

            /* "pyarrow/error.pxi":96
 *             if winerror != 0:
 *                 raise IOError(errno, message, None, winerror)
 *             elif errno != 0:             # <<<<<<<<<<<<<<
 *                 raise IOError(errno, message)
 *             else:
 */
            __pyx_t_1 = ((__pyx_v_errno != 0) != 0);
            if (unlikely(__pyx_t_1)) {

              /* "pyarrow/error.pxi":97
 *                 raise IOError(errno, message, None, winerror)
 *             elif errno != 0:
 *                 raise IOError(errno, message)             # <<<<<<<<<<<<<<
 *             else:
 *                 raise IOError(message)
 */
              __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_errno); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_3);
              __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_GIVEREF(__pyx_t_3);
              PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
              __Pyx_INCREF(__pyx_v_message);
              __Pyx_GIVEREF(__pyx_v_message);
              PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_message);
              __pyx_t_3 = 0;
              __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_Raise(__pyx_t_3, 0, 0, 0);
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              __PYX_ERR(0, 97, __pyx_L8_error)

              /* "pyarrow/error.pxi":96
 *             if winerror != 0:
 *                 raise IOError(errno, message, None, winerror)
 *             elif errno != 0:             # <<<<<<<<<<<<<<
 *                 raise IOError(errno, message)
 *             else:
 */
            }

            /* "pyarrow/error.pxi":99
 *                 raise IOError(errno, message)
 *             else:
 *                 raise IOError(message)             # <<<<<<<<<<<<<<
 *         elif status.IsOutOfMemory():
 *             raise ArrowMemoryError(message)
 */
            /*else*/ {
              __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_v_message); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_Raise(__pyx_t_3, 0, 0, 0);
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              __PYX_ERR(0, 99, __pyx_L8_error)
            }

            /* "pyarrow/error.pxi":85
 *         if status.IsInvalid():
 *             raise ArrowInvalid(message)
 *         elif status.IsIOError():             # <<<<<<<<<<<<<<
 *             # Note: OSError constructor is
 *             #   OSError(message)
 */
          }

          /* "pyarrow/error.pxi":100
 *             else:
 *                 raise IOError(message)
 *         elif status.IsOutOfMemory():             # <<<<<<<<<<<<<<
 *             raise ArrowMemoryError(message)
 *         elif status.IsKeyError():
 */
          __pyx_t_1 = (__pyx_v_status.IsOutOfMemory() != 0);
          if (unlikely(__pyx_t_1)) {

            /* "pyarrow/error.pxi":101
 *                 raise IOError(message)
 *         elif status.IsOutOfMemory():
 *             raise ArrowMemoryError(message)             # <<<<<<<<<<<<<<
 *         elif status.IsKeyError():
 *             raise ArrowKeyError(message)
 */
            __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ArrowMemoryError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 101, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_2 = NULL;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
              __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
              if (likely(__pyx_t_2)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
                __Pyx_INCREF(__pyx_t_2);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_4, function);
              }
            }
            __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_2, __pyx_v_message) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_message);
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 101, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_Raise(__pyx_t_3, 0, 0, 0);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __PYX_ERR(0, 101, __pyx_L8_error)

            /* "pyarrow/error.pxi":100
 *             else:
 *                 raise IOError(message)
 *         elif status.IsOutOfMemory():             # <<<<<<<<<<<<<<
 *             raise ArrowMemoryError(message)
 *         elif status.IsKeyError():
 */
          }

          /* "pyarrow/error.pxi":102
 *         elif status.IsOutOfMemory():
 *             raise ArrowMemoryError(message)
 *         elif status.IsKeyError():             # <<<<<<<<<<<<<<
 *             raise ArrowKeyError(message)
 *         elif status.IsNotImplemented():
 */
          __pyx_t_1 = (__pyx_v_status.IsKeyError() != 0);
          if (unlikely(__pyx_t_1)) {

            /* "pyarrow/error.pxi":103
 *             raise ArrowMemoryError(message)
 *         elif status.IsKeyError():
 *             raise ArrowKeyError(message)             # <<<<<<<<<<<<<<
 *         elif status.IsNotImplemented():
 *             raise ArrowNotImplementedError(message)
 */
            __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ArrowKeyError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 103, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_2 = NULL;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
              __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
              if (likely(__pyx_t_2)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
                __Pyx_INCREF(__pyx_t_2);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_4, function);
              }
            }
            __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_2, __pyx_v_message) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_message);
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_Raise(__pyx_t_3, 0, 0, 0);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __PYX_ERR(0, 103, __pyx_L8_error)

            /* "pyarrow/error.pxi":102
 *         elif status.IsOutOfMemory():
 *             raise ArrowMemoryError(message)
 *         elif status.IsKeyError():             # <<<<<<<<<<<<<<
 *             raise ArrowKeyError(message)
 *         elif status.IsNotImplemented():
 */
          }

          /* "pyarrow/error.pxi":104
 *         elif status.IsKeyError():
 *             raise ArrowKeyError(message)
 *         elif status.IsNotImplemented():             # <<<<<<<<<<<<<<
 *             raise ArrowNotImplementedError(message)
 *         elif status.IsTypeError():
 */
          __pyx_t_1 = (__pyx_v_status.IsNotImplemented() != 0);
          if (unlikely(__pyx_t_1)) {

            /* "pyarrow/error.pxi":105
 *             raise ArrowKeyError(message)
 *         elif status.IsNotImplemented():
 *             raise ArrowNotImplementedError(message)             # <<<<<<<<<<<<<<
 *         elif status.IsTypeError():
 *             raise ArrowTypeError(message)
 */
            __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ArrowNotImplementedError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 105, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_2 = NULL;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
              __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
              if (likely(__pyx_t_2)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
                __Pyx_INCREF(__pyx_t_2);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_4, function);
              }
            }
            __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_2, __pyx_v_message) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_message);
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_Raise(__pyx_t_3, 0, 0, 0);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __PYX_ERR(0, 105, __pyx_L8_error)

            /* "pyarrow/error.pxi":104
 *         elif status.IsKeyError():
 *             raise ArrowKeyError(message)
 *         elif status.IsNotImplemented():             # <<<<<<<<<<<<<<
 *             raise ArrowNotImplementedError(message)
 *         elif status.IsTypeError():
 */
          }

          /* "pyarrow/error.pxi":106
 *         elif status.IsNotImplemented():
 *             raise ArrowNotImplementedError(message)
 *         elif status.IsTypeError():             # <<<<<<<<<<<<<<
 *             raise ArrowTypeError(message)
 *         elif status.IsCapacityError():
 */
          __pyx_t_1 = (__pyx_v_status.IsTypeError() != 0);
          if (unlikely(__pyx_t_1)) {

            /* "pyarrow/error.pxi":107
 *             raise ArrowNotImplementedError(message)
 *         elif status.IsTypeError():
 *             raise ArrowTypeError(message)             # <<<<<<<<<<<<<<
 *         elif status.IsCapacityError():
 *             raise ArrowCapacityError(message)
 */
            __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ArrowTypeError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 107, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_2 = NULL;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
              __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
              if (likely(__pyx_t_2)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
                __Pyx_INCREF(__pyx_t_2);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_4, function);
              }
            }
            __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_2, __pyx_v_message) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_message);
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 107, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_Raise(__pyx_t_3, 0, 0, 0);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __PYX_ERR(0, 107, __pyx_L8_error)

            /* "pyarrow/error.pxi":106
 *         elif status.IsNotImplemented():
 *             raise ArrowNotImplementedError(message)
 *         elif status.IsTypeError():             # <<<<<<<<<<<<<<
 *             raise ArrowTypeError(message)
 *         elif status.IsCapacityError():
 */
          }

          /* "pyarrow/error.pxi":108
 *         elif status.IsTypeError():
 *             raise ArrowTypeError(message)
 *         elif status.IsCapacityError():             # <<<<<<<<<<<<<<
 *             raise ArrowCapacityError(message)
 *         elif status.IsIndexError():
 */
          __pyx_t_1 = (__pyx_v_status.IsCapacityError() != 0);
          if (unlikely(__pyx_t_1)) {

            /* "pyarrow/error.pxi":109
 *             raise ArrowTypeError(message)
 *         elif status.IsCapacityError():
 *             raise ArrowCapacityError(message)             # <<<<<<<<<<<<<<
 *         elif status.IsIndexError():
 *             raise ArrowIndexError(message)
 */
            __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ArrowCapacityError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 109, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_2 = NULL;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
              __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
              if (likely(__pyx_t_2)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
                __Pyx_INCREF(__pyx_t_2);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_4, function);
              }
            }
            __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_2, __pyx_v_message) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_message);
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 109, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_Raise(__pyx_t_3, 0, 0, 0);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __PYX_ERR(0, 109, __pyx_L8_error)

            /* "pyarrow/error.pxi":108
 *         elif status.IsTypeError():
 *             raise ArrowTypeError(message)
 *         elif status.IsCapacityError():             # <<<<<<<<<<<<<<
 *             raise ArrowCapacityError(message)
 *         elif status.IsIndexError():
 */
          }

          /* "pyarrow/error.pxi":110
 *         elif status.IsCapacityError():
 *             raise ArrowCapacityError(message)
 *         elif status.IsIndexError():             # <<<<<<<<<<<<<<
 *             raise ArrowIndexError(message)
 *         elif status.IsSerializationError():
 */
          __pyx_t_1 = (__pyx_v_status.IsIndexError() != 0);
          if (unlikely(__pyx_t_1)) {

            /* "pyarrow/error.pxi":111
 *             raise ArrowCapacityError(message)
 *         elif status.IsIndexError():
 *             raise ArrowIndexError(message)             # <<<<<<<<<<<<<<
 *         elif status.IsSerializationError():
 *             raise ArrowSerializationError(message)
 */
            __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ArrowIndexError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 111, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_2 = NULL;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
              __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
              if (likely(__pyx_t_2)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
                __Pyx_INCREF(__pyx_t_2);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_4, function);
              }
            }
            __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_2, __pyx_v_message) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_message);
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 111, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_Raise(__pyx_t_3, 0, 0, 0);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __PYX_ERR(0, 111, __pyx_L8_error)

            /* "pyarrow/error.pxi":110
 *         elif status.IsCapacityError():
 *             raise ArrowCapacityError(message)
 *         elif status.IsIndexError():             # <<<<<<<<<<<<<<
 *             raise ArrowIndexError(message)
 *         elif status.IsSerializationError():
 */
          }

          /* "pyarrow/error.pxi":112
 *         elif status.IsIndexError():
 *             raise ArrowIndexError(message)
 *         elif status.IsSerializationError():             # <<<<<<<<<<<<<<
 *             raise ArrowSerializationError(message)
 *         else:
 */
          __pyx_t_1 = (__pyx_v_status.IsSerializationError() != 0);
          if (unlikely(__pyx_t_1)) {

            /* "pyarrow/error.pxi":113
 *             raise ArrowIndexError(message)
 *         elif status.IsSerializationError():
 *             raise ArrowSerializationError(message)             # <<<<<<<<<<<<<<
 *         else:
 *             message = frombytes(status.ToString())
 */
            __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ArrowSerializationError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 113, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_2 = NULL;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
              __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
              if (likely(__pyx_t_2)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
                __Pyx_INCREF(__pyx_t_2);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_4, function);
              }
            }
            __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_2, __pyx_v_message) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_message);
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_Raise(__pyx_t_3, 0, 0, 0);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __PYX_ERR(0, 113, __pyx_L8_error)

            /* "pyarrow/error.pxi":112
 *         elif status.IsIndexError():
 *             raise ArrowIndexError(message)
 *         elif status.IsSerializationError():             # <<<<<<<<<<<<<<
 *             raise ArrowSerializationError(message)
 *         else:
 */
          }

          /* "pyarrow/error.pxi":115
 *             raise ArrowSerializationError(message)
 *         else:
 *             message = frombytes(status.ToString())             # <<<<<<<<<<<<<<
 *             raise ArrowException(message)
 * 
 */
          /*else*/ {
            __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 115, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_status.ToString()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_5 = NULL;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
              __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
              if (likely(__pyx_t_5)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
                __Pyx_INCREF(__pyx_t_5);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_4, function);
              }
            }
            __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2);
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 115, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF_SET(__pyx_v_message, __pyx_t_3);
            __pyx_t_3 = 0;

            /* "pyarrow/error.pxi":116
 *         else:
 *             message = frombytes(status.ToString())
 *             raise ArrowException(message)             # <<<<<<<<<<<<<<
 * 
 * 
 */
            __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ArrowException); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 116, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_2 = NULL;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
              __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
              if (likely(__pyx_t_2)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
                __Pyx_INCREF(__pyx_t_2);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_4, function);
              }
            }
            __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_2, __pyx_v_message) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_message);
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 116, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_Raise(__pyx_t_3, 0, 0, 0);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __PYX_ERR(0, 116, __pyx_L8_error)
          }
        }

        /* "pyarrow/error.pxi":71
 *         return 0
 * 
 *     with gil:             # <<<<<<<<<<<<<<
 *         if IsPyError(status):
 *             RestorePyError(status)
 */
        /*finally:*/ {
          __pyx_L7_return: {
            #ifdef WITH_THREAD
            __Pyx_PyGILState_Release(__pyx_gilstate_save);
            #endif
            goto __pyx_L3_return;
          }
          __pyx_L8_error: {
            #ifdef WITH_THREAD
            __Pyx_PyGILState_Release(__pyx_gilstate_save);
            #endif
            goto __pyx_L4_error;
          }
        }
    }
  }

  /* "pyarrow/error.pxi":68
 * # define Arrow-specific subclasses (ArrowInvalid etc.)
 * cdef int check_status(const CStatus& status) nogil except -1:
 *     if status.ok():             # <<<<<<<<<<<<<<
 *         return 0
 * 
 */
  /*finally:*/ {
    __pyx_L3_return: {
      #ifdef WITH_THREAD
      __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
      #endif
      goto __pyx_L0;
    }
    __pyx_L4_error: {
      #ifdef WITH_THREAD
      __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
      #endif
      goto __pyx_L1_error;
    }
  }

  /* "pyarrow/error.pxi":67
 * # This function could be written directly in C++ if we didn't
 * # define Arrow-specific subclasses (ArrowInvalid etc.)
 * cdef int check_status(const CStatus& status) nogil except -1:             # <<<<<<<<<<<<<<
 *     if status.ok():
 *         return 0
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.check_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_message);
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "pyarrow/error.pxi":120
 * 
 * # This is an API function for C++ PyArrow
 * cdef api int pyarrow_internal_check_status(const CStatus& status) \             # <<<<<<<<<<<<<<
 *         nogil except -1:
 *     return check_status(status)
 */

static int __pyx_f_7pyarrow_3lib_pyarrow_internal_check_status(arrow::Status const &__pyx_v_status) {
  int __pyx_r;
  int __pyx_t_1;

  /* "pyarrow/error.pxi":122
 * cdef api int pyarrow_internal_check_status(const CStatus& status) \
 *         nogil except -1:
 *     return check_status(status)             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_status); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 122, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "pyarrow/error.pxi":120
 * 
 * # This is an API function for C++ PyArrow
 * cdef api int pyarrow_internal_check_status(const CStatus& status) \             # <<<<<<<<<<<<<<
 *         nogil except -1:
 *     return check_status(status)
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("pyarrow.lib.pyarrow_internal_check_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "pyarrow/memory.pxi":31
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly, "
 *                         "use pyarrow.*_memory_pool instead."
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_10MemoryPool_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_10MemoryPool_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_10MemoryPool___init__(((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_10MemoryPool___init__(struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/memory.pxi":34
 *         raise TypeError("Do not call {}'s constructor directly, "
 *                         "use pyarrow.*_memory_pool instead."
 *                         .format(self.__class__.__name__))             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, CMemoryPool* pool):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Do_not_call_s_constructor_direct, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/memory.pxi":32
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call {}'s constructor directly, "             # <<<<<<<<<<<<<<
 *                         "use pyarrow.*_memory_pool instead."
 *                         .format(self.__class__.__name__))
 */
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __PYX_ERR(11, 32, __pyx_L1_error)

  /* "pyarrow/memory.pxi":31
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly, "
 *                         "use pyarrow.*_memory_pool instead."
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.MemoryPool.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/memory.pxi":36
 *                         .format(self.__class__.__name__))
 * 
 *     cdef void init(self, CMemoryPool* pool):             # <<<<<<<<<<<<<<
 *         self.pool = pool
 * 
 */

static void __pyx_f_7pyarrow_3lib_10MemoryPool_init(struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_self,  arrow::MemoryPool *__pyx_v_pool) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/memory.pxi":37
 * 
 *     cdef void init(self, CMemoryPool* pool):
 *         self.pool = pool             # <<<<<<<<<<<<<<
 * 
 *     def bytes_allocated(self):
 */
  __pyx_v_self->pool = __pyx_v_pool;

  /* "pyarrow/memory.pxi":36
 *                         .format(self.__class__.__name__))
 * 
 *     cdef void init(self, CMemoryPool* pool):             # <<<<<<<<<<<<<<
 *         self.pool = pool
 * 
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/memory.pxi":39
 *         self.pool = pool
 * 
 *     def bytes_allocated(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of bytes that are currently allocated from this
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10MemoryPool_3bytes_allocated(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10MemoryPool_2bytes_allocated[] = "MemoryPool.bytes_allocated(self)\n\n        Return the number of bytes that are currently allocated from this\n        memory pool.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10MemoryPool_3bytes_allocated(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bytes_allocated (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10MemoryPool_2bytes_allocated(((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10MemoryPool_2bytes_allocated(struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("bytes_allocated", 0);

  /* "pyarrow/memory.pxi":44
 *         memory pool.
 *         """
 *         return self.pool.bytes_allocated()             # <<<<<<<<<<<<<<
 * 
 *     def max_memory(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->pool->bytes_allocated()); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/memory.pxi":39
 *         self.pool = pool
 * 
 *     def bytes_allocated(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of bytes that are currently allocated from this
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.MemoryPool.bytes_allocated", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/memory.pxi":46
 *         return self.pool.bytes_allocated()
 * 
 *     def max_memory(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the peak memory allocation in this memory pool.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10MemoryPool_5max_memory(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10MemoryPool_4max_memory[] = "MemoryPool.max_memory(self)\n\n        Return the peak memory allocation in this memory pool.\n        This can be an approximate number in multi-threaded applications.\n\n        None is returned if the pool implementation doesn't know how to\n        compute this number.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10MemoryPool_5max_memory(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("max_memory (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10MemoryPool_4max_memory(((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10MemoryPool_4max_memory(struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_self) {
  int64_t __pyx_v_ret;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("max_memory", 0);

  /* "pyarrow/memory.pxi":54
 *         compute this number.
 *         """
 *         ret = self.pool.max_memory()             # <<<<<<<<<<<<<<
 *         return ret if ret >= 0 else None
 * 
 */
  __pyx_v_ret = __pyx_v_self->pool->max_memory();

  /* "pyarrow/memory.pxi":55
 *         """
 *         ret = self.pool.max_memory()
 *         return ret if ret >= 0 else None             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  if (((__pyx_v_ret >= 0) != 0)) {
    __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_ret); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 55, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(Py_None);
    __pyx_t_1 = Py_None;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/memory.pxi":46
 *         return self.pool.bytes_allocated()
 * 
 *     def max_memory(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the peak memory allocation in this memory pool.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.MemoryPool.max_memory", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.pool cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10MemoryPool_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10MemoryPool_6__reduce_cython__[] = "MemoryPool.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10MemoryPool_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10MemoryPool_6__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10MemoryPool_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.pool cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.pool cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.pool cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.MemoryPool.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.pool cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.pool cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10MemoryPool_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10MemoryPool_8__setstate_cython__[] = "MemoryPool.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_10MemoryPool_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10MemoryPool_8__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10MemoryPool_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.pool cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.pool cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.pool cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.pool cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.MemoryPool.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/memory.pxi":58
 * 
 * 
 * cdef CMemoryPool* maybe_unbox_memory_pool(MemoryPool memory_pool):             # <<<<<<<<<<<<<<
 *     if memory_pool is None:
 *         return c_get_memory_pool()
 */

static  arrow::MemoryPool *__pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool) {
   arrow::MemoryPool *__pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("maybe_unbox_memory_pool", 0);

  /* "pyarrow/memory.pxi":59
 * 
 * cdef CMemoryPool* maybe_unbox_memory_pool(MemoryPool memory_pool):
 *     if memory_pool is None:             # <<<<<<<<<<<<<<
 *         return c_get_memory_pool()
 *     else:
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_memory_pool) == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/memory.pxi":60
 * cdef CMemoryPool* maybe_unbox_memory_pool(MemoryPool memory_pool):
 *     if memory_pool is None:
 *         return c_get_memory_pool()             # <<<<<<<<<<<<<<
 *     else:
 *         return memory_pool.pool
 */
    __pyx_r =  arrow::py::get_memory_pool();
    goto __pyx_L0;

    /* "pyarrow/memory.pxi":59
 * 
 * cdef CMemoryPool* maybe_unbox_memory_pool(MemoryPool memory_pool):
 *     if memory_pool is None:             # <<<<<<<<<<<<<<
 *         return c_get_memory_pool()
 *     else:
 */
  }

  /* "pyarrow/memory.pxi":62
 *         return c_get_memory_pool()
 *     else:
 *         return memory_pool.pool             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_r = __pyx_v_memory_pool->pool;
    goto __pyx_L0;
  }

  /* "pyarrow/memory.pxi":58
 * 
 * 
 * cdef CMemoryPool* maybe_unbox_memory_pool(MemoryPool memory_pool):             # <<<<<<<<<<<<<<
 *     if memory_pool is None:
 *         return c_get_memory_pool()
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/memory.pxi":69
 *         unique_ptr[CLoggingMemoryPool] logging_pool
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly, "
 *                         "use pyarrow.logging_memory_pool instead."
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_17LoggingMemoryPool_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_17LoggingMemoryPool_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_17LoggingMemoryPool___init__(((struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_17LoggingMemoryPool___init__(struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/memory.pxi":72
 *         raise TypeError("Do not call {}'s constructor directly, "
 *                         "use pyarrow.logging_memory_pool instead."
 *                         .format(self.__class__.__name__))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Do_not_call_s_constructor_direct_2, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/memory.pxi":70
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call {}'s constructor directly, "             # <<<<<<<<<<<<<<
 *                         "use pyarrow.logging_memory_pool instead."
 *                         .format(self.__class__.__name__))
 */
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __PYX_ERR(11, 70, __pyx_L1_error)

  /* "pyarrow/memory.pxi":69
 *         unique_ptr[CLoggingMemoryPool] logging_pool
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly, "
 *                         "use pyarrow.logging_memory_pool instead."
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.LoggingMemoryPool.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.logging_pool,self.pool cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_17LoggingMemoryPool_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_17LoggingMemoryPool_2__reduce_cython__[] = "LoggingMemoryPool.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_17LoggingMemoryPool_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_17LoggingMemoryPool_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_17LoggingMemoryPool_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.logging_pool,self.pool cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.logging_pool,self.pool cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.logging_pool,self.pool cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.LoggingMemoryPool.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.logging_pool,self.pool cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.logging_pool,self.pool cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_17LoggingMemoryPool_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_17LoggingMemoryPool_4__setstate_cython__[] = "LoggingMemoryPool.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_17LoggingMemoryPool_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_17LoggingMemoryPool_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_17LoggingMemoryPool_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.logging_pool,self.pool cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.logging_pool,self.pool cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.logging_pool,self.pool cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.logging_pool,self.pool cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.LoggingMemoryPool.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/memory.pxi":84
 *         unique_ptr[CProxyMemoryPool] proxy_pool
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly, "
 *                         "use pyarrow.proxy_memory_pool instead."
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_15ProxyMemoryPool_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_15ProxyMemoryPool_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_15ProxyMemoryPool___init__(((struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_15ProxyMemoryPool___init__(struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/memory.pxi":87
 *         raise TypeError("Do not call {}'s constructor directly, "
 *                         "use pyarrow.proxy_memory_pool instead."
 *                         .format(self.__class__.__name__))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Do_not_call_s_constructor_direct_3, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/memory.pxi":85
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call {}'s constructor directly, "             # <<<<<<<<<<<<<<
 *                         "use pyarrow.proxy_memory_pool instead."
 *                         .format(self.__class__.__name__))
 */
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __PYX_ERR(11, 85, __pyx_L1_error)

  /* "pyarrow/memory.pxi":84
 *         unique_ptr[CProxyMemoryPool] proxy_pool
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly, "
 *                         "use pyarrow.proxy_memory_pool instead."
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.ProxyMemoryPool.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.pool,self.proxy_pool cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15ProxyMemoryPool_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15ProxyMemoryPool_2__reduce_cython__[] = "ProxyMemoryPool.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_15ProxyMemoryPool_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15ProxyMemoryPool_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15ProxyMemoryPool_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.pool,self.proxy_pool cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.pool,self.proxy_pool cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.pool,self.proxy_pool cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.ProxyMemoryPool.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.pool,self.proxy_pool cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.pool,self.proxy_pool cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15ProxyMemoryPool_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15ProxyMemoryPool_4__setstate_cython__[] = "ProxyMemoryPool.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_15ProxyMemoryPool_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15ProxyMemoryPool_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15ProxyMemoryPool_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.pool,self.proxy_pool cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.pool,self.proxy_pool cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.pool,self.proxy_pool cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.pool,self.proxy_pool cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.ProxyMemoryPool.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/memory.pxi":90
 * 
 * 
 * def default_memory_pool():             # <<<<<<<<<<<<<<
 *     """
 *     Return the process-global memory pool.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5default_memory_pool(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_4default_memory_pool[] = "default_memory_pool()\n\n    Return the process-global memory pool.\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_5default_memory_pool = {"default_memory_pool", (PyCFunction)__pyx_pw_7pyarrow_3lib_5default_memory_pool, METH_NOARGS, __pyx_doc_7pyarrow_3lib_4default_memory_pool};
static PyObject *__pyx_pw_7pyarrow_3lib_5default_memory_pool(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("default_memory_pool (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_4default_memory_pool(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_4default_memory_pool(CYTHON_UNUSED PyObject *__pyx_self) {
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_pool = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("default_memory_pool", 0);

  /* "pyarrow/memory.pxi":95
 *     """
 *     cdef:
 *         MemoryPool pool = MemoryPool.__new__(MemoryPool)             # <<<<<<<<<<<<<<
 *     pool.init(c_get_memory_pool())
 *     return pool
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_MemoryPool(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_MemoryPool), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 95, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/memory.pxi":96
 *     cdef:
 *         MemoryPool pool = MemoryPool.__new__(MemoryPool)
 *     pool.init(c_get_memory_pool())             # <<<<<<<<<<<<<<
 *     return pool
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_MemoryPool *)__pyx_v_pool->__pyx_vtab)->init(__pyx_v_pool,  arrow::py::get_memory_pool());

  /* "pyarrow/memory.pxi":97
 *         MemoryPool pool = MemoryPool.__new__(MemoryPool)
 *     pool.init(c_get_memory_pool())
 *     return pool             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_pool));
  __pyx_r = ((PyObject *)__pyx_v_pool);
  goto __pyx_L0;

  /* "pyarrow/memory.pxi":90
 * 
 * 
 * def default_memory_pool():             # <<<<<<<<<<<<<<
 *     """
 *     Return the process-global memory pool.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.default_memory_pool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_pool);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/memory.pxi":100
 * 
 * 
 * def proxy_memory_pool(MemoryPool parent):             # <<<<<<<<<<<<<<
 *     """
 *     Create and return a MemoryPool instance that redirects to the
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_7proxy_memory_pool(PyObject *__pyx_self, PyObject *__pyx_v_parent); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6proxy_memory_pool[] = "proxy_memory_pool(MemoryPool parent)\n\n    Create and return a MemoryPool instance that redirects to the\n    *parent*, but with separate allocation statistics.\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_7proxy_memory_pool = {"proxy_memory_pool", (PyCFunction)__pyx_pw_7pyarrow_3lib_7proxy_memory_pool, METH_O, __pyx_doc_7pyarrow_3lib_6proxy_memory_pool};
static PyObject *__pyx_pw_7pyarrow_3lib_7proxy_memory_pool(PyObject *__pyx_self, PyObject *__pyx_v_parent) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("proxy_memory_pool (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "parent", 0))) __PYX_ERR(11, 100, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_6proxy_memory_pool(__pyx_self, ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_v_parent));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6proxy_memory_pool(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_parent) {
  struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool *__pyx_v_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("proxy_memory_pool", 0);

  /* "pyarrow/memory.pxi":105
 *     *parent*, but with separate allocation statistics.
 *     """
 *     cdef ProxyMemoryPool out = ProxyMemoryPool.__new__(ProxyMemoryPool)             # <<<<<<<<<<<<<<
 *     out.proxy_pool.reset(new CProxyMemoryPool(parent.pool))
 *     out.init(out.proxy_pool.get())
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_ProxyMemoryPool(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_ProxyMemoryPool), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 105, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/memory.pxi":106
 *     """
 *     cdef ProxyMemoryPool out = ProxyMemoryPool.__new__(ProxyMemoryPool)
 *     out.proxy_pool.reset(new CProxyMemoryPool(parent.pool))             # <<<<<<<<<<<<<<
 *     out.init(out.proxy_pool.get())
 *     return out
 */
  __pyx_v_out->proxy_pool.reset(new  arrow::ProxyMemoryPool(__pyx_v_parent->pool));

  /* "pyarrow/memory.pxi":107
 *     cdef ProxyMemoryPool out = ProxyMemoryPool.__new__(ProxyMemoryPool)
 *     out.proxy_pool.reset(new CProxyMemoryPool(parent.pool))
 *     out.init(out.proxy_pool.get())             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_ProxyMemoryPool *)__pyx_v_out->__pyx_base.__pyx_vtab)->__pyx_base.init(((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_v_out), __pyx_v_out->proxy_pool.get());

  /* "pyarrow/memory.pxi":108
 *     out.proxy_pool.reset(new CProxyMemoryPool(parent.pool))
 *     out.init(out.proxy_pool.get())
 *     return out             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = ((PyObject *)__pyx_v_out);
  goto __pyx_L0;

  /* "pyarrow/memory.pxi":100
 * 
 * 
 * def proxy_memory_pool(MemoryPool parent):             # <<<<<<<<<<<<<<
 *     """
 *     Create and return a MemoryPool instance that redirects to the
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.proxy_memory_pool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/memory.pxi":111
 * 
 * 
 * def logging_memory_pool(MemoryPool parent):             # <<<<<<<<<<<<<<
 *     """
 *     Create and return a MemoryPool instance that redirects to the
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9logging_memory_pool(PyObject *__pyx_self, PyObject *__pyx_v_parent); /*proto*/
static char __pyx_doc_7pyarrow_3lib_8logging_memory_pool[] = "logging_memory_pool(MemoryPool parent)\n\n    Create and return a MemoryPool instance that redirects to the\n    *parent*, but also dumps allocation logs on stderr.\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_9logging_memory_pool = {"logging_memory_pool", (PyCFunction)__pyx_pw_7pyarrow_3lib_9logging_memory_pool, METH_O, __pyx_doc_7pyarrow_3lib_8logging_memory_pool};
static PyObject *__pyx_pw_7pyarrow_3lib_9logging_memory_pool(PyObject *__pyx_self, PyObject *__pyx_v_parent) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("logging_memory_pool (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "parent", 0))) __PYX_ERR(11, 111, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_8logging_memory_pool(__pyx_self, ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_v_parent));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8logging_memory_pool(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_parent) {
  struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *__pyx_v_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("logging_memory_pool", 0);

  /* "pyarrow/memory.pxi":116
 *     *parent*, but also dumps allocation logs on stderr.
 *     """
 *     cdef LoggingMemoryPool out = LoggingMemoryPool.__new__(             # <<<<<<<<<<<<<<
 *         LoggingMemoryPool, parent)
 *     out.logging_pool.reset(new CLoggingMemoryPool(parent.pool))
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_parent));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_parent));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_parent));
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_LoggingMemoryPool(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_LoggingMemoryPool), __pyx_t_1, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 116, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/memory.pxi":118
 *     cdef LoggingMemoryPool out = LoggingMemoryPool.__new__(
 *         LoggingMemoryPool, parent)
 *     out.logging_pool.reset(new CLoggingMemoryPool(parent.pool))             # <<<<<<<<<<<<<<
 *     out.init(out.logging_pool.get())
 *     return out
 */
  __pyx_v_out->logging_pool.reset(new  arrow::LoggingMemoryPool(__pyx_v_parent->pool));

  /* "pyarrow/memory.pxi":119
 *         LoggingMemoryPool, parent)
 *     out.logging_pool.reset(new CLoggingMemoryPool(parent.pool))
 *     out.init(out.logging_pool.get())             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_LoggingMemoryPool *)__pyx_v_out->__pyx_base.__pyx_vtab)->__pyx_base.init(((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_v_out), __pyx_v_out->logging_pool.get());

  /* "pyarrow/memory.pxi":120
 *     out.logging_pool.reset(new CLoggingMemoryPool(parent.pool))
 *     out.init(out.logging_pool.get())
 *     return out             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = ((PyObject *)__pyx_v_out);
  goto __pyx_L0;

  /* "pyarrow/memory.pxi":111
 * 
 * 
 * def logging_memory_pool(MemoryPool parent):             # <<<<<<<<<<<<<<
 *     """
 *     Create and return a MemoryPool instance that redirects to the
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.logging_memory_pool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/memory.pxi":123
 * 
 * 
 * def set_memory_pool(MemoryPool pool):             # <<<<<<<<<<<<<<
 *     c_set_default_memory_pool(pool.pool)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11set_memory_pool(PyObject *__pyx_self, PyObject *__pyx_v_pool); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10set_memory_pool[] = "set_memory_pool(MemoryPool pool)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_11set_memory_pool = {"set_memory_pool", (PyCFunction)__pyx_pw_7pyarrow_3lib_11set_memory_pool, METH_O, __pyx_doc_7pyarrow_3lib_10set_memory_pool};
static PyObject *__pyx_pw_7pyarrow_3lib_11set_memory_pool(PyObject *__pyx_self, PyObject *__pyx_v_pool) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_memory_pool (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "pool", 0))) __PYX_ERR(11, 123, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_10set_memory_pool(__pyx_self, ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_v_pool));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10set_memory_pool(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_pool) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_memory_pool", 0);

  /* "pyarrow/memory.pxi":124
 * 
 * def set_memory_pool(MemoryPool pool):
 *     c_set_default_memory_pool(pool.pool)             # <<<<<<<<<<<<<<
 * 
 * 
 */
   arrow::py::set_default_memory_pool(__pyx_v_pool->pool);

  /* "pyarrow/memory.pxi":123
 * 
 * 
 * def set_memory_pool(MemoryPool pool):             # <<<<<<<<<<<<<<
 *     c_set_default_memory_pool(pool.pool)
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/memory.pxi":132
 * 
 * 
 * def log_memory_allocations(enable=True):             # <<<<<<<<<<<<<<
 *     """
 *     Enable or disable memory allocator logging for debugging purposes
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13log_memory_allocations(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12log_memory_allocations[] = "log_memory_allocations(enable=True)\n\n    Enable or disable memory allocator logging for debugging purposes\n\n    Parameters\n    ----------\n    enable : boolean, default True\n        Pass False to disable logging\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_13log_memory_allocations = {"log_memory_allocations", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_13log_memory_allocations, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_12log_memory_allocations};
static PyObject *__pyx_pw_7pyarrow_3lib_13log_memory_allocations(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_enable = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("log_memory_allocations (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_enable,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_True);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_enable);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "log_memory_allocations") < 0)) __PYX_ERR(11, 132, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_enable = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("log_memory_allocations", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(11, 132, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.log_memory_allocations", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_12log_memory_allocations(__pyx_self, __pyx_v_enable);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12log_memory_allocations(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_enable) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("log_memory_allocations", 0);

  /* "pyarrow/memory.pxi":141
 *         Pass False to disable logging
 *     """
 *     if enable:             # <<<<<<<<<<<<<<
 *         set_memory_pool(_logging_memory_pool)
 *     else:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_enable); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(11, 141, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/memory.pxi":142
 *     """
 *     if enable:
 *         set_memory_pool(_logging_memory_pool)             # <<<<<<<<<<<<<<
 *     else:
 *         set_memory_pool(_default_memory_pool)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_set_memory_pool); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 142, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_7pyarrow_3lib__logging_memory_pool)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_7pyarrow_3lib__logging_memory_pool));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 142, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pyarrow/memory.pxi":141
 *         Pass False to disable logging
 *     """
 *     if enable:             # <<<<<<<<<<<<<<
 *         set_memory_pool(_logging_memory_pool)
 *     else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/memory.pxi":144
 *         set_memory_pool(_logging_memory_pool)
 *     else:
 *         set_memory_pool(_default_memory_pool)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_set_memory_pool); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 144, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_7pyarrow_3lib__default_memory_pool)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_7pyarrow_3lib__default_memory_pool));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 144, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "pyarrow/memory.pxi":132
 * 
 * 
 * def log_memory_allocations(enable=True):             # <<<<<<<<<<<<<<
 *     """
 *     Enable or disable memory allocator logging for debugging purposes
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.log_memory_allocations", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/memory.pxi":147
 * 
 * 
 * def total_allocated_bytes():             # <<<<<<<<<<<<<<
 *     """
 *     Return the currently allocated bytes from the default memory pool.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15total_allocated_bytes(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14total_allocated_bytes[] = "total_allocated_bytes()\n\n    Return the currently allocated bytes from the default memory pool.\n    Other memory pools may not be accounted for.\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_15total_allocated_bytes = {"total_allocated_bytes", (PyCFunction)__pyx_pw_7pyarrow_3lib_15total_allocated_bytes, METH_NOARGS, __pyx_doc_7pyarrow_3lib_14total_allocated_bytes};
static PyObject *__pyx_pw_7pyarrow_3lib_15total_allocated_bytes(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("total_allocated_bytes (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14total_allocated_bytes(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14total_allocated_bytes(CYTHON_UNUSED PyObject *__pyx_self) {
   arrow::MemoryPool *__pyx_v_pool;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("total_allocated_bytes", 0);

  /* "pyarrow/memory.pxi":152
 *     Other memory pools may not be accounted for.
 *     """
 *     cdef CMemoryPool* pool = c_get_memory_pool()             # <<<<<<<<<<<<<<
 *     return pool.bytes_allocated()
 * 
 */
  __pyx_v_pool =  arrow::py::get_memory_pool();

  /* "pyarrow/memory.pxi":153
 *     """
 *     cdef CMemoryPool* pool = c_get_memory_pool()
 *     return pool.bytes_allocated()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_pool->bytes_allocated()); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/memory.pxi":147
 * 
 * 
 * def total_allocated_bytes():             # <<<<<<<<<<<<<<
 *     """
 *     Return the currently allocated bytes from the default memory pool.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.total_allocated_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/memory.pxi":156
 * 
 * 
 * def jemalloc_set_decay_ms(decay_ms):             # <<<<<<<<<<<<<<
 *     """
 *     Set arenas.dirty_decay_ms and arenas.muzzy_decay_ms to indicated number of
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_17jemalloc_set_decay_ms(PyObject *__pyx_self, PyObject *__pyx_v_decay_ms); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16jemalloc_set_decay_ms[] = "jemalloc_set_decay_ms(decay_ms)\n\n    Set arenas.dirty_decay_ms and arenas.muzzy_decay_ms to indicated number of\n    milliseconds. A value of 0 (the default) results in dirty / muzzy memory\n    pages being released right away to the OS, while a higher value will result\n    in a time-based decay. See the jemalloc docs for more information\n\n    It's best to set this at the start of your application.\n\n    Parameters\n    ----------\n    decay_ms : int\n        Number of milliseconds to set for jemalloc decay conf parameters. Note\n        that this change will only affect future memory arenas\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_17jemalloc_set_decay_ms = {"jemalloc_set_decay_ms", (PyCFunction)__pyx_pw_7pyarrow_3lib_17jemalloc_set_decay_ms, METH_O, __pyx_doc_7pyarrow_3lib_16jemalloc_set_decay_ms};
static PyObject *__pyx_pw_7pyarrow_3lib_17jemalloc_set_decay_ms(PyObject *__pyx_self, PyObject *__pyx_v_decay_ms) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("jemalloc_set_decay_ms (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16jemalloc_set_decay_ms(__pyx_self, ((PyObject *)__pyx_v_decay_ms));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16jemalloc_set_decay_ms(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_decay_ms) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("jemalloc_set_decay_ms", 0);

  /* "pyarrow/memory.pxi":171
 *         that this change will only affect future memory arenas
 *     """
 *     check_status(c_jemalloc_set_decay_ms(decay_ms))             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_decay_ms); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(11, 171, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status( arrow::jemalloc_set_decay_ms(__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 171, __pyx_L1_error)

  /* "pyarrow/memory.pxi":156
 * 
 * 
 * def jemalloc_set_decay_ms(decay_ms):             # <<<<<<<<<<<<<<
 *     """
 *     Set arenas.dirty_decay_ms and arenas.muzzy_decay_ms to indicated number of
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.jemalloc_set_decay_ms", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":69
 * 
 * 
 * cdef bytes _datatype_to_pep3118(CDataType* type):             # <<<<<<<<<<<<<<
 *     """
 *     Construct a PEP 3118 format string describing the given datatype.
 */

static PyObject *__pyx_f_7pyarrow_3lib__datatype_to_pep3118( arrow::DataType *__pyx_v_type) {
  PyObject *__pyx_v_char = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("_datatype_to_pep3118", 0);

  /* "pyarrow/types.pxi":74
 *     None is returned for unsupported types.
 *     """
 *     try:             # <<<<<<<<<<<<<<
 *         char = _pep3118_type_map[type.id()]
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "pyarrow/types.pxi":75
 *     """
 *     try:
 *         char = _pep3118_type_map[type.id()]             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         return None
 */
      if (unlikely(__pyx_v_7pyarrow_3lib__pep3118_type_map == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(4, 75, __pyx_L3_error)
      }
      __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type(__pyx_v_type->id()); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 75, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_7pyarrow_3lib__pep3118_type_map, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 75, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_char = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "pyarrow/types.pxi":74
 *     None is returned for unsupported types.
 *     """
 *     try:             # <<<<<<<<<<<<<<
 *         char = _pep3118_type_map[type.id()]
 *     except KeyError:
 */
    }

    /* "pyarrow/types.pxi":79
 *         return None
 *     else:
 *         if char in b'bBhHiIqQ':             # <<<<<<<<<<<<<<
 *             # Use "standard" int widths, not native
 *             return b'=' + char
 */
    /*else:*/ {
      __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_v_char, __pyx_n_b_bBhHiIqQ, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 79, __pyx_L5_except_error)
      __pyx_t_7 = (__pyx_t_6 != 0);
      if (__pyx_t_7) {

        /* "pyarrow/types.pxi":81
 *         if char in b'bBhHiIqQ':
 *             # Use "standard" int widths, not native
 *             return b'=' + char             # <<<<<<<<<<<<<<
 *         else:
 *             return char
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_5 = PyNumber_Add(__pyx_kp_b__10, __pyx_v_char); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 81, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(4, 81, __pyx_L5_except_error)
        __pyx_r = ((PyObject*)__pyx_t_5);
        __pyx_t_5 = 0;
        goto __pyx_L6_except_return;

        /* "pyarrow/types.pxi":79
 *         return None
 *     else:
 *         if char in b'bBhHiIqQ':             # <<<<<<<<<<<<<<
 *             # Use "standard" int widths, not native
 *             return b'=' + char
 */
      }

      /* "pyarrow/types.pxi":83
 *             return b'=' + char
 *         else:
 *             return char             # <<<<<<<<<<<<<<
 * 
 * 
 */
      /*else*/ {
        __Pyx_XDECREF(__pyx_r);
        if (!(likely(PyBytes_CheckExact(__pyx_v_char))||((__pyx_v_char) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_char)->tp_name), 0))) __PYX_ERR(4, 83, __pyx_L5_except_error)
        __Pyx_INCREF(__pyx_v_char);
        __pyx_r = ((PyObject*)__pyx_v_char);
        goto __pyx_L6_except_return;
      }
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "pyarrow/types.pxi":76
 *     try:
 *         char = _pep3118_type_map[type.id()]
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         return None
 *     else:
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_8) {
      __Pyx_AddTraceback("pyarrow.lib._datatype_to_pep3118", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_9) < 0) __PYX_ERR(4, 76, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_9);

      /* "pyarrow/types.pxi":77
 *         char = _pep3118_type_map[type.id()]
 *     except KeyError:
 *         return None             # <<<<<<<<<<<<<<
 *     else:
 *         if char in b'bBhHiIqQ':
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/types.pxi":74
 *     None is returned for unsupported types.
 *     """
 *     try:             # <<<<<<<<<<<<<<
 *         char = _pep3118_type_map[type.id()]
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "pyarrow/types.pxi":69
 * 
 * 
 * cdef bytes _datatype_to_pep3118(CDataType* type):             # <<<<<<<<<<<<<<
 *     """
 *     Construct a PEP 3118 format string describing the given datatype.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pyarrow.lib._datatype_to_pep3118", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_char);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":86
 * 
 * 
 * def _is_primitive(Type type):             # <<<<<<<<<<<<<<
 *     # This is simply a redirect, the official API is in pyarrow.types.
 *     return is_primitive(type)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19_is_primitive(PyObject *__pyx_self, PyObject *__pyx_arg_type); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18_is_primitive[] = "_is_primitive(Type type)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_19_is_primitive = {"_is_primitive", (PyCFunction)__pyx_pw_7pyarrow_3lib_19_is_primitive, METH_O, __pyx_doc_7pyarrow_3lib_18_is_primitive};
static PyObject *__pyx_pw_7pyarrow_3lib_19_is_primitive(PyObject *__pyx_self, PyObject *__pyx_arg_type) {
  enum  arrow::Type::type __pyx_v_type;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_is_primitive (wrapper)", 0);
  assert(__pyx_arg_type); {
    __pyx_v_type = ((enum  arrow::Type::type)__Pyx_PyInt_As_enum____arrow_3a__3a_Type_3a__3a_type(__pyx_arg_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 86, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._is_primitive", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_18_is_primitive(__pyx_self, ((enum  arrow::Type::type)__pyx_v_type));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18_is_primitive(CYTHON_UNUSED PyObject *__pyx_self, enum  arrow::Type::type __pyx_v_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("_is_primitive", 0);

  /* "pyarrow/types.pxi":88
 * def _is_primitive(Type type):
 *     # This is simply a redirect, the official API is in pyarrow.types.
 *     return is_primitive(type)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(arrow::is_primitive(__pyx_v_type)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":86
 * 
 * 
 * def _is_primitive(Type type):             # <<<<<<<<<<<<<<
 *     # This is simply a redirect, the official API is in pyarrow.types.
 *     return is_primitive(type)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._is_primitive", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":102
 *     Each data type is an *instance* of this class.
 *     """
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_8DataType_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_8DataType_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_8DataType___cinit__(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_8DataType___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":105
 *         pass
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly, use public "
 *                         "functions like pyarrow.int64, pyarrow.list_, etc. "
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_8DataType_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_8DataType_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_8DataType_2__init__(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_8DataType_2__init__(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/types.pxi":108
 *         raise TypeError("Do not call {}'s constructor directly, use public "
 *                         "functions like pyarrow.int64, pyarrow.list_, etc. "
 *                         "instead.".format(self.__class__.__name__))             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Do_not_call_s_constructor_direct_4, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":106
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call {}'s constructor directly, use public "             # <<<<<<<<<<<<<<
 *                         "functions like pyarrow.int64, pyarrow.list_, etc. "
 *                         "instead.".format(self.__class__.__name__))
 */
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __PYX_ERR(4, 106, __pyx_L1_error)

  /* "pyarrow/types.pxi":105
 *         pass
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly, use public "
 *                         "functions like pyarrow.int64, pyarrow.list_, etc. "
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.DataType.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":110
 *                         "instead.".format(self.__class__.__name__))
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         assert type != nullptr
 *         self.sp_type = type
 */

static void __pyx_f_7pyarrow_3lib_8DataType_init(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/types.pxi":111
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         assert type != nullptr             # <<<<<<<<<<<<<<
 *         self.sp_type = type
 *         self.type = type.get()
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    if (unlikely(!((__pyx_v_type != nullptr) != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(4, 111, __pyx_L1_error)
    }
  }
  #endif

  /* "pyarrow/types.pxi":112
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         assert type != nullptr
 *         self.sp_type = type             # <<<<<<<<<<<<<<
 *         self.type = type.get()
 *         self.pep3118_format = _datatype_to_pep3118(self.type)
 */
  __pyx_v_self->sp_type = __pyx_v_type;

  /* "pyarrow/types.pxi":113
 *         assert type != nullptr
 *         self.sp_type = type
 *         self.type = type.get()             # <<<<<<<<<<<<<<
 *         self.pep3118_format = _datatype_to_pep3118(self.type)
 * 
 */
  __pyx_v_self->type = __pyx_v_type.get();

  /* "pyarrow/types.pxi":114
 *         self.sp_type = type
 *         self.type = type.get()
 *         self.pep3118_format = _datatype_to_pep3118(self.type)             # <<<<<<<<<<<<<<
 * 
 *     cdef Field child(self, int i):
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__datatype_to_pep3118(__pyx_v_self->type); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->pep3118_format);
  __Pyx_DECREF(__pyx_v_self->pep3118_format);
  __pyx_v_self->pep3118_format = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":110
 *                         "instead.".format(self.__class__.__name__))
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         assert type != nullptr
 *         self.sp_type = type
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DataType.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/types.pxi":116
 *         self.pep3118_format = _datatype_to_pep3118(self.type)
 * 
 *     cdef Field child(self, int i):             # <<<<<<<<<<<<<<
 *         cdef int index = <int> _normalize_index(i, self.type.num_children())
 *         return pyarrow_wrap_field(self.type.child(index))
 */

static struct __pyx_obj_7pyarrow_3lib_Field *__pyx_f_7pyarrow_3lib_8DataType_child(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self, int __pyx_v_i) {
  int __pyx_v_index;
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("child", 0);

  /* "pyarrow/types.pxi":117
 * 
 *     cdef Field child(self, int i):
 *         cdef int index = <int> _normalize_index(i, self.type.num_children())             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_field(self.type.child(index))
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__normalize_index(__pyx_v_i, __pyx_v_self->type->num_children()); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1L))) __PYX_ERR(4, 117, __pyx_L1_error)
  __pyx_v_index = ((int)__pyx_t_1);

  /* "pyarrow/types.pxi":118
 *     cdef Field child(self, int i):
 *         cdef int index = <int> _normalize_index(i, self.type.num_children())
 *         return pyarrow_wrap_field(self.type.child(index))             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_field(__pyx_v_self->type->child(__pyx_v_index)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(4, 118, __pyx_L1_error)
  __pyx_r = ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":116
 *         self.pep3118_format = _datatype_to_pep3118(self.type)
 * 
 *     cdef Field child(self, int i):             # <<<<<<<<<<<<<<
 *         cdef int index = <int> _normalize_index(i, self.type.num_children())
 *         return pyarrow_wrap_field(self.type.child(index))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.DataType.child", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":121
 * 
 *     @property
 *     def id(self):             # <<<<<<<<<<<<<<
 *         return self.type.id()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8DataType_2id_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_8DataType_2id_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8DataType_2id___get__(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8DataType_2id___get__(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":122
 *     @property
 *     def id(self):
 *         return self.type.id()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type(__pyx_v_self->type->id()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":121
 * 
 *     @property
 *     def id(self):             # <<<<<<<<<<<<<<
 *         return self.type.id()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DataType.id.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":125
 * 
 *     @property
 *     def bit_width(self):             # <<<<<<<<<<<<<<
 *         cdef _CFixedWidthTypePtr ty
 *         ty = dynamic_cast[_CFixedWidthTypePtr](self.type)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8DataType_9bit_width_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_8DataType_9bit_width_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8DataType_9bit_width___get__(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8DataType_9bit_width___get__(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self) {
  __pyx_t_7pyarrow_3lib__CFixedWidthTypePtr __pyx_v_ty;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __pyx_t_7pyarrow_3lib__CFixedWidthTypePtr __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":127
 *     def bit_width(self):
 *         cdef _CFixedWidthTypePtr ty
 *         ty = dynamic_cast[_CFixedWidthTypePtr](self.type)             # <<<<<<<<<<<<<<
 *         if ty == nullptr:
 *             raise ValueError("Non-fixed width type")
 */
  try {
    __pyx_t_1 = dynamic_cast<__pyx_t_7pyarrow_3lib__CFixedWidthTypePtr>(__pyx_v_self->type);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(4, 127, __pyx_L1_error)
  }
  __pyx_v_ty = __pyx_t_1;

  /* "pyarrow/types.pxi":128
 *         cdef _CFixedWidthTypePtr ty
 *         ty = dynamic_cast[_CFixedWidthTypePtr](self.type)
 *         if ty == nullptr:             # <<<<<<<<<<<<<<
 *             raise ValueError("Non-fixed width type")
 *         return ty.bit_width()
 */
  __pyx_t_2 = ((__pyx_v_ty == nullptr) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/types.pxi":129
 *         ty = dynamic_cast[_CFixedWidthTypePtr](self.type)
 *         if ty == nullptr:
 *             raise ValueError("Non-fixed width type")             # <<<<<<<<<<<<<<
 *         return ty.bit_width()
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 129, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(4, 129, __pyx_L1_error)

    /* "pyarrow/types.pxi":128
 *         cdef _CFixedWidthTypePtr ty
 *         ty = dynamic_cast[_CFixedWidthTypePtr](self.type)
 *         if ty == nullptr:             # <<<<<<<<<<<<<<
 *             raise ValueError("Non-fixed width type")
 *         return ty.bit_width()
 */
  }

  /* "pyarrow/types.pxi":130
 *         if ty == nullptr:
 *             raise ValueError("Non-fixed width type")
 *         return ty.bit_width()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_ty->bit_width()); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":125
 * 
 *     @property
 *     def bit_width(self):             # <<<<<<<<<<<<<<
 *         cdef _CFixedWidthTypePtr ty
 *         ty = dynamic_cast[_CFixedWidthTypePtr](self.type)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.DataType.bit_width.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":133
 * 
 *     @property
 *     def num_children(self):             # <<<<<<<<<<<<<<
 *         """
 *         The number of child fields.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8DataType_12num_children_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_8DataType_12num_children_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8DataType_12num_children___get__(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8DataType_12num_children___get__(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":137
 *         The number of child fields.
 *         """
 *         return self.type.num_children()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->type->num_children()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":133
 * 
 *     @property
 *     def num_children(self):             # <<<<<<<<<<<<<<
 *         """
 *         The number of child fields.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DataType.num_children.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":140
 * 
 *     @property
 *     def num_buffers(self):             # <<<<<<<<<<<<<<
 *         """
 *         Number of data buffers required to construct Array type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8DataType_11num_buffers_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_8DataType_11num_buffers_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8DataType_11num_buffers___get__(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8DataType_11num_buffers___get__(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":145
 *         excluding children
 *         """
 *         return self.type.layout().bit_widths.size()             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_self->type->layout().bit_widths.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":140
 * 
 *     @property
 *     def num_buffers(self):             # <<<<<<<<<<<<<<
 *         """
 *         Number of data buffers required to construct Array type
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DataType.num_buffers.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":147
 *         return self.type.layout().bit_widths.size()
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return frombytes(self.type.ToString())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8DataType_5__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_8DataType_5__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8DataType_4__str__(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8DataType_4__str__(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "pyarrow/types.pxi":148
 * 
 *     def __str__(self):
 *         return frombytes(self.type.ToString())             # <<<<<<<<<<<<<<
 * 
 *     def __hash__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_self->type->ToString()); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":147
 *         return self.type.layout().bit_widths.size()
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return frombytes(self.type.ToString())
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.DataType.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":150
 *         return frombytes(self.type.ToString())
 * 
 *     def __hash__(self):             # <<<<<<<<<<<<<<
 *         return hash(str(self))
 * 
 */

/* Python wrapper */
static Py_hash_t __pyx_pw_7pyarrow_3lib_8DataType_7__hash__(PyObject *__pyx_v_self); /*proto*/
static Py_hash_t __pyx_pw_7pyarrow_3lib_8DataType_7__hash__(PyObject *__pyx_v_self) {
  Py_hash_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8DataType_6__hash__(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static Py_hash_t __pyx_pf_7pyarrow_3lib_8DataType_6__hash__(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self) {
  Py_hash_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_hash_t __pyx_t_2;
  __Pyx_RefNannySetupContext("__hash__", 0);

  /* "pyarrow/types.pxi":151
 * 
 *     def __hash__(self):
 *         return hash(str(self))             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_hash_t)-1))) __PYX_ERR(4, 151, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":150
 *         return frombytes(self.type.ToString())
 * 
 *     def __hash__(self):             # <<<<<<<<<<<<<<
 *         return hash(str(self))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DataType.__hash__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":153
 *         return hash(str(self))
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return type_for_alias, (str(self),)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8DataType_9__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_8DataType_8__reduce__[] = "DataType.__reduce__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_8DataType_9__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8DataType_8__reduce__(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8DataType_8__reduce__(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pyarrow/types.pxi":154
 * 
 *     def __reduce__(self):
 *         return type_for_alias, (str(self),)             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_type_for_alias); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":153
 *         return hash(str(self))
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return type_for_alias, (str(self),)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.DataType.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":156
 *         return type_for_alias, (str(self),)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return '{0.__class__.__name__}({0})'.format(self)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8DataType_11__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_8DataType_11__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8DataType_10__repr__(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8DataType_10__repr__(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pyarrow/types.pxi":157
 * 
 *     def __repr__(self):
 *         return '{0.__class__.__name__}({0})'.format(self)             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_0___class_____name___0, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self));
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":156
 *         return type_for_alias, (str(self),)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return '{0.__class__.__name__}({0})'.format(self)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.DataType.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":159
 *         return '{0.__class__.__name__}({0})'.format(self)
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         try:
 *             return self.equals(other)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8DataType_13__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_8DataType_13__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8DataType_12__eq__(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self), ((PyObject *)__pyx_v_other));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8DataType_12__eq__(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("__eq__", 0);

  /* "pyarrow/types.pxi":160
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except (TypeError, ValueError):
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "pyarrow/types.pxi":161
 *     def __eq__(self, other):
 *         try:
 *             return self.equals(other)             # <<<<<<<<<<<<<<
 *         except (TypeError, ValueError):
 *             return NotImplemented
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_equals); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 161, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_other) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_other);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 161, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L7_try_return;

      /* "pyarrow/types.pxi":160
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except (TypeError, ValueError):
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/types.pxi":162
 *         try:
 *             return self.equals(other)
 *         except (TypeError, ValueError):             # <<<<<<<<<<<<<<
 *             return NotImplemented
 * 
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("pyarrow.lib.DataType.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(4, 162, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);

      /* "pyarrow/types.pxi":163
 *             return self.equals(other)
 *         except (TypeError, ValueError):
 *             return NotImplemented             # <<<<<<<<<<<<<<
 * 
 *     def equals(self, other):
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_builtin_NotImplemented);
      __pyx_r = __pyx_builtin_NotImplemented;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/types.pxi":160
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except (TypeError, ValueError):
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "pyarrow/types.pxi":159
 *         return '{0.__class__.__name__}({0})'.format(self)
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         try:
 *             return self.equals(other)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.DataType.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":165
 *             return NotImplemented
 * 
 *     def equals(self, other):             # <<<<<<<<<<<<<<
 *         """
 *         Return true if type is equivalent to passed value
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8DataType_15equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static char __pyx_doc_7pyarrow_3lib_8DataType_14equals[] = "DataType.equals(self, other)\n\n        Return true if type is equivalent to passed value\n\n        Parameters\n        ----------\n        other : DataType or string convertible to DataType\n\n        Returns\n        -------\n        is_equal : boolean\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_8DataType_15equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("equals (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8DataType_14equals(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self), ((PyObject *)__pyx_v_other));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8DataType_14equals(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self, PyObject *__pyx_v_other) {
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_other_type = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("equals", 0);

  /* "pyarrow/types.pxi":179
 *         cdef DataType other_type
 * 
 *         if not isinstance(other, DataType):             # <<<<<<<<<<<<<<
 *             if not isinstance(other, six.string_types):
 *                 raise TypeError(other)
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_7pyarrow_3lib_DataType); 
  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
  if (__pyx_t_2) {

    /* "pyarrow/types.pxi":180
 * 
 *         if not isinstance(other, DataType):
 *             if not isinstance(other, six.string_types):             # <<<<<<<<<<<<<<
 *                 raise TypeError(other)
 *             other_type = type_for_alias(other)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_six); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 180, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_string_types); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 180, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = PyObject_IsInstance(__pyx_v_other, __pyx_t_4); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(4, 180, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0);
    if (unlikely(__pyx_t_1)) {

      /* "pyarrow/types.pxi":181
 *         if not isinstance(other, DataType):
 *             if not isinstance(other, six.string_types):
 *                 raise TypeError(other)             # <<<<<<<<<<<<<<
 *             other_type = type_for_alias(other)
 *         else:
 */
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_v_other); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(4, 181, __pyx_L1_error)

      /* "pyarrow/types.pxi":180
 * 
 *         if not isinstance(other, DataType):
 *             if not isinstance(other, six.string_types):             # <<<<<<<<<<<<<<
 *                 raise TypeError(other)
 *             other_type = type_for_alias(other)
 */
    }

    /* "pyarrow/types.pxi":182
 *             if not isinstance(other, six.string_types):
 *                 raise TypeError(other)
 *             other_type = type_for_alias(other)             # <<<<<<<<<<<<<<
 *         else:
 *             other_type = other
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_type_for_alias); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 182, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_other) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_other);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 182, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(4, 182, __pyx_L1_error)
    __pyx_v_other_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/types.pxi":179
 *         cdef DataType other_type
 * 
 *         if not isinstance(other, DataType):             # <<<<<<<<<<<<<<
 *             if not isinstance(other, six.string_types):
 *                 raise TypeError(other)
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":184
 *             other_type = type_for_alias(other)
 *         else:
 *             other_type = other             # <<<<<<<<<<<<<<
 * 
 *         return self.type.Equals(deref(other_type.type))
 */
  /*else*/ {
    if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(4, 184, __pyx_L1_error)
    __pyx_t_4 = __pyx_v_other;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_other_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_4);
    __pyx_t_4 = 0;
  }
  __pyx_L3:;

  /* "pyarrow/types.pxi":186
 *             other_type = other
 * 
 *         return self.type.Equals(deref(other_type.type))             # <<<<<<<<<<<<<<
 * 
 *     def to_pandas_dtype(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_self->type->Equals((*__pyx_v_other_type->type))); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":165
 *             return NotImplemented
 * 
 *     def equals(self, other):             # <<<<<<<<<<<<<<
 *         """
 *         Return true if type is equivalent to passed value
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.DataType.equals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_other_type);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":188
 *         return self.type.Equals(deref(other_type.type))
 * 
 *     def to_pandas_dtype(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the equivalent NumPy / Pandas dtype.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8DataType_17to_pandas_dtype(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_8DataType_16to_pandas_dtype[] = "DataType.to_pandas_dtype(self)\n\n        Return the equivalent NumPy / Pandas dtype.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_8DataType_17to_pandas_dtype(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_pandas_dtype (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8DataType_16to_pandas_dtype(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8DataType_16to_pandas_dtype(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_self) {
  enum  arrow::Type::type __pyx_v_type_id;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("to_pandas_dtype", 0);

  /* "pyarrow/types.pxi":192
 *         Return the equivalent NumPy / Pandas dtype.
 *         """
 *         cdef Type type_id = self.type.id()             # <<<<<<<<<<<<<<
 *         if type_id in _pandas_type_map:
 *             return _pandas_type_map[type_id]
 */
  __pyx_v_type_id = __pyx_v_self->type->id();

  /* "pyarrow/types.pxi":193
 *         """
 *         cdef Type type_id = self.type.id()
 *         if type_id in _pandas_type_map:             # <<<<<<<<<<<<<<
 *             return _pandas_type_map[type_id]
 *         else:
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type(__pyx_v_type_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(__pyx_v_7pyarrow_3lib__pandas_type_map == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(4, 193, __pyx_L1_error)
  }
  __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_t_1, __pyx_v_7pyarrow_3lib__pandas_type_map, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 193, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (likely(__pyx_t_3)) {

    /* "pyarrow/types.pxi":194
 *         cdef Type type_id = self.type.id()
 *         if type_id in _pandas_type_map:
 *             return _pandas_type_map[type_id]             # <<<<<<<<<<<<<<
 *         else:
 *             raise NotImplementedError(str(self))
 */
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(__pyx_v_7pyarrow_3lib__pandas_type_map == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(4, 194, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type(__pyx_v_type_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 194, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_7pyarrow_3lib__pandas_type_map, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 194, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":193
 *         """
 *         cdef Type type_id = self.type.id()
 *         if type_id in _pandas_type_map:             # <<<<<<<<<<<<<<
 *             return _pandas_type_map[type_id]
 *         else:
 */
  }

  /* "pyarrow/types.pxi":196
 *             return _pandas_type_map[type_id]
 *         else:
 *             raise NotImplementedError(str(self))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 196, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 196, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 196, __pyx_L1_error)
  }

  /* "pyarrow/types.pxi":188
 *         return self.type.Equals(deref(other_type.type))
 * 
 *     def to_pandas_dtype(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the equivalent NumPy / Pandas dtype.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.DataType.to_pandas_dtype", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":203
 *     Tracking container for dictionary-encoded fields
 *     """
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.sp_memo.reset(new CDictionaryMemo())
 *         self.memo = self.sp_memo.get()
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_14DictionaryMemo_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_14DictionaryMemo_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_14DictionaryMemo___cinit__(((struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_14DictionaryMemo___cinit__(struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
   arrow::ipc::DictionaryMemo *__pyx_t_1;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/types.pxi":204
 *     """
 *     def __cinit__(self):
 *         self.sp_memo.reset(new CDictionaryMemo())             # <<<<<<<<<<<<<<
 *         self.memo = self.sp_memo.get()
 * 
 */
  try {
    __pyx_t_1 = new  arrow::ipc::DictionaryMemo();
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(4, 204, __pyx_L1_error)
  }
  __pyx_v_self->sp_memo.reset(__pyx_t_1);

  /* "pyarrow/types.pxi":205
 *     def __cinit__(self):
 *         self.sp_memo.reset(new CDictionaryMemo())
 *         self.memo = self.sp_memo.get()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->memo = __pyx_v_self->sp_memo.get();

  /* "pyarrow/types.pxi":203
 *     Tracking container for dictionary-encoded fields
 *     """
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.sp_memo.reset(new CDictionaryMemo())
 *         self.memo = self.sp_memo.get()
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.DictionaryMemo.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14DictionaryMemo_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14DictionaryMemo_2__reduce_cython__[] = "DictionaryMemo.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_14DictionaryMemo_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14DictionaryMemo_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14DictionaryMemo_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DictionaryMemo.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14DictionaryMemo_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14DictionaryMemo_4__setstate_cython__[] = "DictionaryMemo.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_14DictionaryMemo_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14DictionaryMemo_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14DictionaryMemo_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DictionaryMemo.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":213
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.dict_type = <const CDictionaryType*> type.get()
 */

static void __pyx_f_7pyarrow_3lib_14DictionaryType_init(struct __pyx_obj_7pyarrow_3lib_DictionaryType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/types.pxi":214
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)             # <<<<<<<<<<<<<<
 *         self.dict_type = <const CDictionaryType*> type.get()
 * 
 */
  __pyx_f_7pyarrow_3lib_8DataType_init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self), __pyx_v_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 214, __pyx_L1_error)

  /* "pyarrow/types.pxi":215
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)
 *         self.dict_type = <const CDictionaryType*> type.get()             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  __pyx_v_self->dict_type = (( arrow::DictionaryType const *)__pyx_v_type.get());

  /* "pyarrow/types.pxi":213
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.dict_type = <const CDictionaryType*> type.get()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.DictionaryType.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/types.pxi":217
 *         self.dict_type = <const CDictionaryType*> type.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return dictionary, (self.index_type, self.value_type, self.ordered)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14DictionaryType_1__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14DictionaryType___reduce__[] = "DictionaryType.__reduce__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_14DictionaryType_1__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14DictionaryType___reduce__(((struct __pyx_obj_7pyarrow_3lib_DictionaryType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14DictionaryType___reduce__(struct __pyx_obj_7pyarrow_3lib_DictionaryType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pyarrow/types.pxi":218
 * 
 *     def __reduce__(self):
 *         return dictionary, (self.index_type, self.value_type, self.ordered)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_dictionary); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_index_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ordered); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
  __pyx_t_1 = 0;
  __pyx_t_5 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":217
 *         self.dict_type = <const CDictionaryType*> type.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return dictionary, (self.index_type, self.value_type, self.ordered)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.DictionaryType.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":221
 * 
 *     @property
 *     def ordered(self):             # <<<<<<<<<<<<<<
 *         """
 *         Whether the dictionary is ordered, i.e. whether the ordering of values
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14DictionaryType_7ordered_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14DictionaryType_7ordered_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14DictionaryType_7ordered___get__(((struct __pyx_obj_7pyarrow_3lib_DictionaryType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14DictionaryType_7ordered___get__(struct __pyx_obj_7pyarrow_3lib_DictionaryType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":226
 *         in the dictionary is important.
 *         """
 *         return self.dict_type.ordered()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->dict_type->ordered()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":221
 * 
 *     @property
 *     def ordered(self):             # <<<<<<<<<<<<<<
 *         """
 *         Whether the dictionary is ordered, i.e. whether the ordering of values
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DictionaryType.ordered.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":229
 * 
 *     @property
 *     def index_type(self):             # <<<<<<<<<<<<<<
 *         """
 *         The data type of dictionary indices (a signed integer type).
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14DictionaryType_10index_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14DictionaryType_10index_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14DictionaryType_10index_type___get__(((struct __pyx_obj_7pyarrow_3lib_DictionaryType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14DictionaryType_10index_type___get__(struct __pyx_obj_7pyarrow_3lib_DictionaryType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":233
 *         The data type of dictionary indices (a signed integer type).
 *         """
 *         return pyarrow_wrap_data_type(self.dict_type.index_type())             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_self->dict_type->index_type()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":229
 * 
 *     @property
 *     def index_type(self):             # <<<<<<<<<<<<<<
 *         """
 *         The data type of dictionary indices (a signed integer type).
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DictionaryType.index_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":236
 * 
 *     @property
 *     def value_type(self):             # <<<<<<<<<<<<<<
 *         """
 *         The dictionary value type. The dictionary values are found in an
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14DictionaryType_10value_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14DictionaryType_10value_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14DictionaryType_10value_type___get__(((struct __pyx_obj_7pyarrow_3lib_DictionaryType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14DictionaryType_10value_type___get__(struct __pyx_obj_7pyarrow_3lib_DictionaryType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":241
 *         instance of DictionaryArray
 *         """
 *         return pyarrow_wrap_data_type(self.dict_type.value_type())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_self->dict_type->value_type()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":236
 * 
 *     @property
 *     def value_type(self):             # <<<<<<<<<<<<<<
 *         """
 *         The dictionary value type. The dictionary values are found in an
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DictionaryType.value_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":249
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.list_type = <const CListType*> type.get()
 */

static void __pyx_f_7pyarrow_3lib_8ListType_init(struct __pyx_obj_7pyarrow_3lib_ListType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/types.pxi":250
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)             # <<<<<<<<<<<<<<
 *         self.list_type = <const CListType*> type.get()
 * 
 */
  __pyx_f_7pyarrow_3lib_8DataType_init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self), __pyx_v_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 250, __pyx_L1_error)

  /* "pyarrow/types.pxi":251
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)
 *         self.list_type = <const CListType*> type.get()             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  __pyx_v_self->list_type = (( arrow::ListType const *)__pyx_v_type.get());

  /* "pyarrow/types.pxi":249
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.list_type = <const CListType*> type.get()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.ListType.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/types.pxi":253
 *         self.list_type = <const CListType*> type.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return list_, (self.value_type,)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8ListType_1__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_8ListType___reduce__[] = "ListType.__reduce__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_8ListType_1__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8ListType___reduce__(((struct __pyx_obj_7pyarrow_3lib_ListType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8ListType___reduce__(struct __pyx_obj_7pyarrow_3lib_ListType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pyarrow/types.pxi":254
 * 
 *     def __reduce__(self):
 *         return list_, (self.value_type,)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_list); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":253
 *         self.list_type = <const CListType*> type.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return list_, (self.value_type,)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.ListType.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":257
 * 
 *     @property
 *     def value_type(self):             # <<<<<<<<<<<<<<
 *         """
 *         The data type of list values.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8ListType_10value_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_8ListType_10value_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8ListType_10value_type___get__(((struct __pyx_obj_7pyarrow_3lib_ListType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8ListType_10value_type___get__(struct __pyx_obj_7pyarrow_3lib_ListType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":261
 *         The data type of list values.
 *         """
 *         return pyarrow_wrap_data_type(self.list_type.value_type())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_self->list_type->value_type()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":257
 * 
 *     @property
 *     def value_type(self):             # <<<<<<<<<<<<<<
 *         """
 *         The data type of list values.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.ListType.value_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":270
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.list_type = <const CLargeListType*> type.get()
 */

static void __pyx_f_7pyarrow_3lib_13LargeListType_init(struct __pyx_obj_7pyarrow_3lib_LargeListType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/types.pxi":271
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)             # <<<<<<<<<<<<<<
 *         self.list_type = <const CLargeListType*> type.get()
 * 
 */
  __pyx_f_7pyarrow_3lib_8DataType_init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self), __pyx_v_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 271, __pyx_L1_error)

  /* "pyarrow/types.pxi":272
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)
 *         self.list_type = <const CLargeListType*> type.get()             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  __pyx_v_self->list_type = (( arrow::LargeListType const *)__pyx_v_type.get());

  /* "pyarrow/types.pxi":270
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.list_type = <const CLargeListType*> type.get()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.LargeListType.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/types.pxi":274
 *         self.list_type = <const CLargeListType*> type.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return large_list, (self.value_type,)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13LargeListType_1__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13LargeListType___reduce__[] = "LargeListType.__reduce__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_13LargeListType_1__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13LargeListType___reduce__(((struct __pyx_obj_7pyarrow_3lib_LargeListType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13LargeListType___reduce__(struct __pyx_obj_7pyarrow_3lib_LargeListType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pyarrow/types.pxi":275
 * 
 *     def __reduce__(self):
 *         return large_list, (self.value_type,)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_large_list); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":274
 *         self.list_type = <const CLargeListType*> type.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return large_list, (self.value_type,)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.LargeListType.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":278
 * 
 *     @property
 *     def value_type(self):             # <<<<<<<<<<<<<<
 *         """
 *         The data type of large list values.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13LargeListType_10value_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_13LargeListType_10value_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13LargeListType_10value_type___get__(((struct __pyx_obj_7pyarrow_3lib_LargeListType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13LargeListType_10value_type___get__(struct __pyx_obj_7pyarrow_3lib_LargeListType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":282
 *         The data type of large list values.
 *         """
 *         return pyarrow_wrap_data_type(self.list_type.value_type())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_self->list_type->value_type()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 282, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":278
 * 
 *     @property
 *     def value_type(self):             # <<<<<<<<<<<<<<
 *         """
 *         The data type of large list values.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.LargeListType.value_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":290
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.map_type = <const CMapType*> type.get()
 */

static void __pyx_f_7pyarrow_3lib_7MapType_init(struct __pyx_obj_7pyarrow_3lib_MapType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/types.pxi":291
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)             # <<<<<<<<<<<<<<
 *         self.map_type = <const CMapType*> type.get()
 * 
 */
  __pyx_f_7pyarrow_3lib_8DataType_init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self), __pyx_v_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 291, __pyx_L1_error)

  /* "pyarrow/types.pxi":292
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)
 *         self.map_type = <const CMapType*> type.get()             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  __pyx_v_self->map_type = (( arrow::MapType const *)__pyx_v_type.get());

  /* "pyarrow/types.pxi":290
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.map_type = <const CMapType*> type.get()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.MapType.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/types.pxi":294
 *         self.map_type = <const CMapType*> type.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return map_, (self.key_type, self.item_type)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_7MapType_1__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_7MapType___reduce__[] = "MapType.__reduce__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_7MapType_1__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_7MapType___reduce__(((struct __pyx_obj_7pyarrow_3lib_MapType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_7MapType___reduce__(struct __pyx_obj_7pyarrow_3lib_MapType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pyarrow/types.pxi":295
 * 
 *     def __reduce__(self):
 *         return map_, (self.key_type, self.item_type)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_map_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_key_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_item_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":294
 *         self.map_type = <const CMapType*> type.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return map_, (self.key_type, self.item_type)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.MapType.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":298
 * 
 *     @property
 *     def key_type(self):             # <<<<<<<<<<<<<<
 *         """
 *         The data type of keys in the map entries.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_7MapType_8key_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_7MapType_8key_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_7MapType_8key_type___get__(((struct __pyx_obj_7pyarrow_3lib_MapType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_7MapType_8key_type___get__(struct __pyx_obj_7pyarrow_3lib_MapType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":302
 *         The data type of keys in the map entries.
 *         """
 *         return pyarrow_wrap_data_type(self.map_type.key_type())             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_self->map_type->key_type()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":298
 * 
 *     @property
 *     def key_type(self):             # <<<<<<<<<<<<<<
 *         """
 *         The data type of keys in the map entries.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.MapType.key_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":305
 * 
 *     @property
 *     def item_type(self):             # <<<<<<<<<<<<<<
 *         """
 *         The data type of items in the map entries.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_7MapType_9item_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_7MapType_9item_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_7MapType_9item_type___get__(((struct __pyx_obj_7pyarrow_3lib_MapType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_7MapType_9item_type___get__(struct __pyx_obj_7pyarrow_3lib_MapType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":309
 *         The data type of items in the map entries.
 *         """
 *         return pyarrow_wrap_data_type(self.map_type.item_type())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_self->map_type->item_type()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":305
 * 
 *     @property
 *     def item_type(self):             # <<<<<<<<<<<<<<
 *         """
 *         The data type of items in the map entries.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.MapType.item_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":317
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.list_type = <const CFixedSizeListType*> type.get()
 */

static void __pyx_f_7pyarrow_3lib_17FixedSizeListType_init(struct __pyx_obj_7pyarrow_3lib_FixedSizeListType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/types.pxi":318
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)             # <<<<<<<<<<<<<<
 *         self.list_type = <const CFixedSizeListType*> type.get()
 * 
 */
  __pyx_f_7pyarrow_3lib_8DataType_init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self), __pyx_v_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 318, __pyx_L1_error)

  /* "pyarrow/types.pxi":319
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)
 *         self.list_type = <const CFixedSizeListType*> type.get()             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  __pyx_v_self->list_type = (( arrow::FixedSizeListType const *)__pyx_v_type.get());

  /* "pyarrow/types.pxi":317
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.list_type = <const CFixedSizeListType*> type.get()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.FixedSizeListType.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/types.pxi":321
 *         self.list_type = <const CFixedSizeListType*> type.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return list_, (self.value_type, self.list_size)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_17FixedSizeListType_1__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_17FixedSizeListType___reduce__[] = "FixedSizeListType.__reduce__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_17FixedSizeListType_1__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_17FixedSizeListType___reduce__(((struct __pyx_obj_7pyarrow_3lib_FixedSizeListType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_17FixedSizeListType___reduce__(struct __pyx_obj_7pyarrow_3lib_FixedSizeListType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pyarrow/types.pxi":322
 * 
 *     def __reduce__(self):
 *         return list_, (self.value_type, self.list_size)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_list); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_list_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":321
 *         self.list_type = <const CFixedSizeListType*> type.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return list_, (self.value_type, self.list_size)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.FixedSizeListType.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":325
 * 
 *     @property
 *     def value_type(self):             # <<<<<<<<<<<<<<
 *         """
 *         The data type of large list values.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_17FixedSizeListType_10value_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_17FixedSizeListType_10value_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_17FixedSizeListType_10value_type___get__(((struct __pyx_obj_7pyarrow_3lib_FixedSizeListType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_17FixedSizeListType_10value_type___get__(struct __pyx_obj_7pyarrow_3lib_FixedSizeListType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":329
 *         The data type of large list values.
 *         """
 *         return pyarrow_wrap_data_type(self.list_type.value_type())             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_self->list_type->value_type()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":325
 * 
 *     @property
 *     def value_type(self):             # <<<<<<<<<<<<<<
 *         """
 *         The data type of large list values.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FixedSizeListType.value_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":332
 * 
 *     @property
 *     def list_size(self):             # <<<<<<<<<<<<<<
 *         """
 *         The size of the fixed size lists.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_17FixedSizeListType_9list_size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_17FixedSizeListType_9list_size_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_17FixedSizeListType_9list_size___get__(((struct __pyx_obj_7pyarrow_3lib_FixedSizeListType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_17FixedSizeListType_9list_size___get__(struct __pyx_obj_7pyarrow_3lib_FixedSizeListType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":336
 *         The size of the fixed size lists.
 *         """
 *         return self.list_type.list_size()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_self->list_type->list_size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":332
 * 
 *     @property
 *     def list_size(self):             # <<<<<<<<<<<<<<
 *         """
 *         The size of the fixed size lists.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FixedSizeListType.list_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":344
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.struct_type = <const CStructType*> type.get()
 */

static void __pyx_f_7pyarrow_3lib_10StructType_init(struct __pyx_obj_7pyarrow_3lib_StructType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/types.pxi":345
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)             # <<<<<<<<<<<<<<
 *         self.struct_type = <const CStructType*> type.get()
 * 
 */
  __pyx_f_7pyarrow_3lib_8DataType_init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self), __pyx_v_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 345, __pyx_L1_error)

  /* "pyarrow/types.pxi":346
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)
 *         self.struct_type = <const CStructType*> type.get()             # <<<<<<<<<<<<<<
 * 
 *     cdef Field field(self, int i):
 */
  __pyx_v_self->struct_type = (( arrow::StructType const *)__pyx_v_type.get());

  /* "pyarrow/types.pxi":344
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.struct_type = <const CStructType*> type.get()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.StructType.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/types.pxi":348
 *         self.struct_type = <const CStructType*> type.get()
 * 
 *     cdef Field field(self, int i):             # <<<<<<<<<<<<<<
 *         """
 *         Return a child field by its index.
 */

static struct __pyx_obj_7pyarrow_3lib_Field *__pyx_f_7pyarrow_3lib_10StructType_field(struct __pyx_obj_7pyarrow_3lib_StructType *__pyx_v_self, int __pyx_v_i) {
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("field", 0);

  /* "pyarrow/types.pxi":352
 *         Return a child field by its index.
 *         """
 *         return self.child(i)             # <<<<<<<<<<<<<<
 * 
 *     cdef Field field_by_name(self, name):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7pyarrow_3lib_StructType *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.child(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self), __pyx_v_i)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":348
 *         self.struct_type = <const CStructType*> type.get()
 * 
 *     cdef Field field(self, int i):             # <<<<<<<<<<<<<<
 *         """
 *         Return a child field by its index.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.StructType.field", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":354
 *         return self.child(i)
 * 
 *     cdef Field field_by_name(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         Return a child field by its name rather than its index.
 */

static struct __pyx_obj_7pyarrow_3lib_Field *__pyx_f_7pyarrow_3lib_10StructType_field_by_name(struct __pyx_obj_7pyarrow_3lib_StructType *__pyx_v_self, PyObject *__pyx_v_name) {
  std::vector<std::shared_ptr< arrow::Field> >  __pyx_v_fields;
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("field_by_name", 0);

  /* "pyarrow/types.pxi":360
 *         cdef vector[shared_ptr[CField]] fields
 * 
 *         fields = self.struct_type.GetAllFieldsByName(tobytes(name))             # <<<<<<<<<<<<<<
 *         if fields.size() == 0:
 *             raise KeyError(name)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_name);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 360, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_fields = __pyx_v_self->struct_type->GetAllFieldsByName(__pyx_t_4);

  /* "pyarrow/types.pxi":361
 * 
 *         fields = self.struct_type.GetAllFieldsByName(tobytes(name))
 *         if fields.size() == 0:             # <<<<<<<<<<<<<<
 *             raise KeyError(name)
 *         elif fields.size() > 1:
 */
  __pyx_t_5 = ((__pyx_v_fields.size() == 0) != 0);
  if (unlikely(__pyx_t_5)) {

    /* "pyarrow/types.pxi":362
 *         fields = self.struct_type.GetAllFieldsByName(tobytes(name))
 *         if fields.size() == 0:
 *             raise KeyError(name)             # <<<<<<<<<<<<<<
 *         elif fields.size() > 1:
 *             warnings.warn("Struct field name corresponds to more "
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 362, __pyx_L1_error)

    /* "pyarrow/types.pxi":361
 * 
 *         fields = self.struct_type.GetAllFieldsByName(tobytes(name))
 *         if fields.size() == 0:             # <<<<<<<<<<<<<<
 *             raise KeyError(name)
 *         elif fields.size() > 1:
 */
  }

  /* "pyarrow/types.pxi":363
 *         if fields.size() == 0:
 *             raise KeyError(name)
 *         elif fields.size() > 1:             # <<<<<<<<<<<<<<
 *             warnings.warn("Struct field name corresponds to more "
 *                           "than one field", UserWarning)
 */
  __pyx_t_5 = ((__pyx_v_fields.size() > 1) != 0);
  if (unlikely(__pyx_t_5)) {

    /* "pyarrow/types.pxi":364
 *             raise KeyError(name)
 *         elif fields.size() > 1:
 *             warnings.warn("Struct field name corresponds to more "             # <<<<<<<<<<<<<<
 *                           "than one field", UserWarning)
 *             raise KeyError(name)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_warnings); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 364, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_warn); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 364, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/types.pxi":365
 *         elif fields.size() > 1:
 *             warnings.warn("Struct field name corresponds to more "
 *                           "than one field", UserWarning)             # <<<<<<<<<<<<<<
 *             raise KeyError(name)
 *         else:
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 364, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/types.pxi":366
 *             warnings.warn("Struct field name corresponds to more "
 *                           "than one field", UserWarning)
 *             raise KeyError(name)             # <<<<<<<<<<<<<<
 *         else:
 *             return pyarrow_wrap_field(fields[0])
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 366, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 366, __pyx_L1_error)

    /* "pyarrow/types.pxi":363
 *         if fields.size() == 0:
 *             raise KeyError(name)
 *         elif fields.size() > 1:             # <<<<<<<<<<<<<<
 *             warnings.warn("Struct field name corresponds to more "
 *                           "than one field", UserWarning)
 */
  }

  /* "pyarrow/types.pxi":368
 *             raise KeyError(name)
 *         else:
 *             return pyarrow_wrap_field(fields[0])             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  /*else*/ {
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_field((__pyx_v_fields[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 368, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(4, 368, __pyx_L1_error)
    __pyx_r = ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/types.pxi":354
 *         return self.child(i)
 * 
 *     cdef Field field_by_name(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         Return a child field by its name rather than its index.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.StructType.field_by_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":370
 *             return pyarrow_wrap_field(fields[0])
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Like num_children().
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_7pyarrow_3lib_10StructType_1__len__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10StructType___len__[] = "\n        Like num_children().\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_10StructType___len__;
#endif
static Py_ssize_t __pyx_pw_7pyarrow_3lib_10StructType_1__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10StructType___len__(((struct __pyx_obj_7pyarrow_3lib_StructType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static Py_ssize_t __pyx_pf_7pyarrow_3lib_10StructType___len__(struct __pyx_obj_7pyarrow_3lib_StructType *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "pyarrow/types.pxi":374
 *         Like num_children().
 *         """
 *         return self.type.num_children()             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __pyx_r = __pyx_v_self->__pyx_base.type->num_children();
  goto __pyx_L0;

  /* "pyarrow/types.pxi":370
 *             return pyarrow_wrap_field(fields[0])
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Like num_children().
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pyarrow_3lib_10StructType_4generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/types.pxi":376
 *         return self.type.num_children()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterate over struct fields, in order.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10StructType_3__iter__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10StructType_2__iter__[] = "\n        Iterate over struct fields, in order.\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_10StructType_2__iter__;
#endif
static PyObject *__pyx_pw_7pyarrow_3lib_10StructType_3__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10StructType_2__iter__(((struct __pyx_obj_7pyarrow_3lib_StructType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10StructType_2__iter__(struct __pyx_obj_7pyarrow_3lib_StructType *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__ *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct____iter__(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct____iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(4, 376, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7pyarrow_3lib_10StructType_4generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_StructType___iter, __pyx_n_s_pyarrow_lib); if (unlikely(!gen)) __PYX_ERR(4, 376, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.StructType.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7pyarrow_3lib_10StructType_4generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__ *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(4, 376, __pyx_L1_error)

  /* "pyarrow/types.pxi":380
 *         Iterate over struct fields, in order.
 *         """
 *         for i in range(len(self)):             # <<<<<<<<<<<<<<
 *             yield self[i]
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(4, 380, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_cur_scope->__pyx_v_i = __pyx_t_3;

    /* "pyarrow/types.pxi":381
 *         """
 *         for i in range(len(self)):
 *             yield self[i]             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, i):
 */
    __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 381, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(4, 381, __pyx_L1_error)
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "pyarrow/types.pxi":376
 *         return self.type.num_children()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterate over struct fields, in order.
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":383
 *             yield self[i]
 * 
 *     def __getitem__(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Return the struct field with the given index or name.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10StructType_6__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10StructType_5__getitem__[] = "\n        Return the struct field with the given index or name.\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_10StructType_5__getitem__;
#endif
static PyObject *__pyx_pw_7pyarrow_3lib_10StructType_6__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10StructType_5__getitem__(((struct __pyx_obj_7pyarrow_3lib_StructType *)__pyx_v_self), ((PyObject *)__pyx_v_i));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10StructType_5__getitem__(struct __pyx_obj_7pyarrow_3lib_StructType *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "pyarrow/types.pxi":387
 *         Return the struct field with the given index or name.
 *         """
 *         if isinstance(i, six.string_types):             # <<<<<<<<<<<<<<
 *             return self.field_by_name(i)
 *         elif isinstance(i, six.integer_types):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_six); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_string_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_i, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(4, 387, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "pyarrow/types.pxi":388
 *         """
 *         if isinstance(i, six.string_types):
 *             return self.field_by_name(i)             # <<<<<<<<<<<<<<
 *         elif isinstance(i, six.integer_types):
 *             return self.child(i)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_7pyarrow_3lib_StructType *)__pyx_v_self->__pyx_base.__pyx_vtab)->field_by_name(__pyx_v_self, __pyx_v_i)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 388, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":387
 *         Return the struct field with the given index or name.
 *         """
 *         if isinstance(i, six.string_types):             # <<<<<<<<<<<<<<
 *             return self.field_by_name(i)
 *         elif isinstance(i, six.integer_types):
 */
  }

  /* "pyarrow/types.pxi":389
 *         if isinstance(i, six.string_types):
 *             return self.field_by_name(i)
 *         elif isinstance(i, six.integer_types):             # <<<<<<<<<<<<<<
 *             return self.child(i)
 *         else:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_six); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_integer_types); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = PyObject_IsInstance(__pyx_v_i, __pyx_t_1); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(4, 389, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (likely(__pyx_t_3)) {

    /* "pyarrow/types.pxi":390
 *             return self.field_by_name(i)
 *         elif isinstance(i, six.integer_types):
 *             return self.child(i)             # <<<<<<<<<<<<<<
 *         else:
 *             raise TypeError('Expected integer or string index')
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_i); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 390, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7pyarrow_3lib_StructType *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.child(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self), __pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 390, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":389
 *         if isinstance(i, six.string_types):
 *             return self.field_by_name(i)
 *         elif isinstance(i, six.integer_types):             # <<<<<<<<<<<<<<
 *             return self.child(i)
 *         else:
 */
  }

  /* "pyarrow/types.pxi":392
 *             return self.child(i)
 *         else:
 *             raise TypeError('Expected integer or string index')             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  /*else*/ {
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 392, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 392, __pyx_L1_error)
  }

  /* "pyarrow/types.pxi":383
 *             yield self[i]
 * 
 *     def __getitem__(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Return the struct field with the given index or name.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.StructType.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":394
 *             raise TypeError('Expected integer or string index')
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return struct, (list(self),)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10StructType_8__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10StructType_7__reduce__[] = "StructType.__reduce__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10StructType_8__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10StructType_7__reduce__(((struct __pyx_obj_7pyarrow_3lib_StructType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10StructType_7__reduce__(struct __pyx_obj_7pyarrow_3lib_StructType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pyarrow/types.pxi":395
 * 
 *     def __reduce__(self):
 *         return struct, (list(self),)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_struct); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PySequence_List(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":394
 *             raise TypeError('Expected integer or string index')
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return struct, (list(self),)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.StructType.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":403
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 * 
 */

static void __pyx_f_7pyarrow_3lib_9UnionType_init(struct __pyx_obj_7pyarrow_3lib_UnionType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/types.pxi":404
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_f_7pyarrow_3lib_8DataType_init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self), __pyx_v_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 404, __pyx_L1_error)

  /* "pyarrow/types.pxi":403
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.UnionType.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/types.pxi":407
 * 
 *     @property
 *     def mode(self):             # <<<<<<<<<<<<<<
 *         """
 *         The mode of the union ("dense" or "sparse").
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9UnionType_4mode_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_9UnionType_4mode_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9UnionType_4mode___get__(((struct __pyx_obj_7pyarrow_3lib_UnionType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_9UnionType_4mode___get__(struct __pyx_obj_7pyarrow_3lib_UnionType *__pyx_v_self) {
   arrow::UnionType *__pyx_v_type;
  int __pyx_v_mode;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":411
 *         The mode of the union ("dense" or "sparse").
 *         """
 *         cdef CUnionType* type = <CUnionType*> self.sp_type.get()             # <<<<<<<<<<<<<<
 *         cdef int mode = type.mode()
 *         if mode == _UnionMode_DENSE:
 */
  __pyx_v_type = (( arrow::UnionType *)__pyx_v_self->__pyx_base.sp_type.get());

  /* "pyarrow/types.pxi":412
 *         """
 *         cdef CUnionType* type = <CUnionType*> self.sp_type.get()
 *         cdef int mode = type.mode()             # <<<<<<<<<<<<<<
 *         if mode == _UnionMode_DENSE:
 *             return 'dense'
 */
  __pyx_v_mode = __pyx_v_type->mode();

  /* "pyarrow/types.pxi":413
 *         cdef CUnionType* type = <CUnionType*> self.sp_type.get()
 *         cdef int mode = type.mode()
 *         if mode == _UnionMode_DENSE:             # <<<<<<<<<<<<<<
 *             return 'dense'
 *         if mode == _UnionMode_SPARSE:
 */
  __pyx_t_1 = ((__pyx_v_mode ==  arrow::UnionMode::DENSE) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/types.pxi":414
 *         cdef int mode = type.mode()
 *         if mode == _UnionMode_DENSE:
 *             return 'dense'             # <<<<<<<<<<<<<<
 *         if mode == _UnionMode_SPARSE:
 *             return 'sparse'
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_dense);
    __pyx_r = __pyx_n_u_dense;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":413
 *         cdef CUnionType* type = <CUnionType*> self.sp_type.get()
 *         cdef int mode = type.mode()
 *         if mode == _UnionMode_DENSE:             # <<<<<<<<<<<<<<
 *             return 'dense'
 *         if mode == _UnionMode_SPARSE:
 */
  }

  /* "pyarrow/types.pxi":415
 *         if mode == _UnionMode_DENSE:
 *             return 'dense'
 *         if mode == _UnionMode_SPARSE:             # <<<<<<<<<<<<<<
 *             return 'sparse'
 *         assert 0
 */
  __pyx_t_1 = ((__pyx_v_mode ==  arrow::UnionMode::SPARSE) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/types.pxi":416
 *             return 'dense'
 *         if mode == _UnionMode_SPARSE:
 *             return 'sparse'             # <<<<<<<<<<<<<<
 *         assert 0
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_sparse);
    __pyx_r = __pyx_n_u_sparse;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":415
 *         if mode == _UnionMode_DENSE:
 *             return 'dense'
 *         if mode == _UnionMode_SPARSE:             # <<<<<<<<<<<<<<
 *             return 'sparse'
 *         assert 0
 */
  }

  /* "pyarrow/types.pxi":417
 *         if mode == _UnionMode_SPARSE:
 *             return 'sparse'
 *         assert 0             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    if (unlikely(!0)) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(4, 417, __pyx_L1_error)
    }
  }
  #endif

  /* "pyarrow/types.pxi":407
 * 
 *     @property
 *     def mode(self):             # <<<<<<<<<<<<<<
 *         """
 *         The mode of the union ("dense" or "sparse").
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.UnionType.mode.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":420
 * 
 *     @property
 *     def type_codes(self):             # <<<<<<<<<<<<<<
 *         """
 *         The type code to indicate each data type in this union.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9UnionType_10type_codes_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_9UnionType_10type_codes_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9UnionType_10type_codes___get__(((struct __pyx_obj_7pyarrow_3lib_UnionType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_9UnionType_10type_codes___get__(struct __pyx_obj_7pyarrow_3lib_UnionType *__pyx_v_self) {
   arrow::UnionType *__pyx_v_type;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":424
 *         The type code to indicate each data type in this union.
 *         """
 *         cdef CUnionType* type = <CUnionType*> self.sp_type.get()             # <<<<<<<<<<<<<<
 *         return type.type_codes()
 * 
 */
  __pyx_v_type = (( arrow::UnionType *)__pyx_v_self->__pyx_base.sp_type.get());

  /* "pyarrow/types.pxi":425
 *         """
 *         cdef CUnionType* type = <CUnionType*> self.sp_type.get()
 *         return type.type_codes()             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_vector_to_py_int8_t(__pyx_v_type->type_codes()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":420
 * 
 *     @property
 *     def type_codes(self):             # <<<<<<<<<<<<<<
 *         """
 *         The type code to indicate each data type in this union.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UnionType.type_codes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":427
 *         return type.type_codes()
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Like num_children()
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_7pyarrow_3lib_9UnionType_1__len__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_7pyarrow_3lib_9UnionType___len__[] = "\n        Like num_children()\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_9UnionType___len__;
#endif
static Py_ssize_t __pyx_pw_7pyarrow_3lib_9UnionType_1__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9UnionType___len__(((struct __pyx_obj_7pyarrow_3lib_UnionType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static Py_ssize_t __pyx_pf_7pyarrow_3lib_9UnionType___len__(struct __pyx_obj_7pyarrow_3lib_UnionType *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "pyarrow/types.pxi":431
 *         Like num_children()
 *         """
 *         return self.type.num_children()             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __pyx_r = __pyx_v_self->__pyx_base.type->num_children();
  goto __pyx_L0;

  /* "pyarrow/types.pxi":427
 *         return type.type_codes()
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Like num_children()
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pyarrow_3lib_9UnionType_4generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/types.pxi":433
 *         return self.type.num_children()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterate over union members, in order.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9UnionType_3__iter__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_7pyarrow_3lib_9UnionType_2__iter__[] = "\n        Iterate over union members, in order.\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_9UnionType_2__iter__;
#endif
static PyObject *__pyx_pw_7pyarrow_3lib_9UnionType_3__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9UnionType_2__iter__(((struct __pyx_obj_7pyarrow_3lib_UnionType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_9UnionType_2__iter__(struct __pyx_obj_7pyarrow_3lib_UnionType *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__ *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_1___iter__(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_1___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(4, 433, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7pyarrow_3lib_9UnionType_4generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_UnionType___iter, __pyx_n_s_pyarrow_lib); if (unlikely(!gen)) __PYX_ERR(4, 433, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.UnionType.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7pyarrow_3lib_9UnionType_4generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__ *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(4, 433, __pyx_L1_error)

  /* "pyarrow/types.pxi":437
 *         Iterate over union members, in order.
 *         """
 *         for i in range(len(self)):             # <<<<<<<<<<<<<<
 *             yield self[i]
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(4, 437, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_cur_scope->__pyx_v_i = __pyx_t_3;

    /* "pyarrow/types.pxi":438
 *         """
 *         for i in range(len(self)):
 *             yield self[i]             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, i):
 */
    __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 438, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(4, 438, __pyx_L1_error)
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "pyarrow/types.pxi":433
 *         return self.type.num_children()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterate over union members, in order.
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":440
 *             yield self[i]
 * 
 *     def __getitem__(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Return a child member by its index.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9UnionType_6__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_9UnionType_5__getitem__[] = "\n        Return a child member by its index.\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_9UnionType_5__getitem__;
#endif
static PyObject *__pyx_pw_7pyarrow_3lib_9UnionType_6__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9UnionType_5__getitem__(((struct __pyx_obj_7pyarrow_3lib_UnionType *)__pyx_v_self), ((PyObject *)__pyx_v_i));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_9UnionType_5__getitem__(struct __pyx_obj_7pyarrow_3lib_UnionType *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "pyarrow/types.pxi":444
 *         Return a child member by its index.
 *         """
 *         return self.child(i)             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_i); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 444, __pyx_L1_error)
  __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_7pyarrow_3lib_UnionType *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.child(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self), __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":440
 *             yield self[i]
 * 
 *     def __getitem__(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Return a child member by its index.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.UnionType.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":446
 *         return self.child(i)
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return union, (list(self), self.mode, self.type_codes)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9UnionType_8__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_9UnionType_7__reduce__[] = "UnionType.__reduce__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_9UnionType_8__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9UnionType_7__reduce__(((struct __pyx_obj_7pyarrow_3lib_UnionType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_9UnionType_7__reduce__(struct __pyx_obj_7pyarrow_3lib_UnionType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pyarrow/types.pxi":447
 * 
 *     def __reduce__(self):
 *         return union, (list(self), self.mode, self.type_codes)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_union); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PySequence_List(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_type_codes); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
  __pyx_t_1 = 0;
  __pyx_t_5 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":446
 *         return self.child(i)
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return union, (list(self), self.mode, self.type_codes)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.UnionType.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":455
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.ts_type = <const CTimestampType*> type.get()
 */

static void __pyx_f_7pyarrow_3lib_13TimestampType_init(struct __pyx_obj_7pyarrow_3lib_TimestampType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/types.pxi":456
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)             # <<<<<<<<<<<<<<
 *         self.ts_type = <const CTimestampType*> type.get()
 * 
 */
  __pyx_f_7pyarrow_3lib_8DataType_init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self), __pyx_v_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 456, __pyx_L1_error)

  /* "pyarrow/types.pxi":457
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)
 *         self.ts_type = <const CTimestampType*> type.get()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_v_self->ts_type = (( arrow::TimestampType const *)__pyx_v_type.get());

  /* "pyarrow/types.pxi":455
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.ts_type = <const CTimestampType*> type.get()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.TimestampType.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/types.pxi":460
 * 
 *     @property
 *     def unit(self):             # <<<<<<<<<<<<<<
 *         """
 *         The timestamp unit ('s', 'ms', 'us' or 'ns').
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13TimestampType_4unit_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_13TimestampType_4unit_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13TimestampType_4unit___get__(((struct __pyx_obj_7pyarrow_3lib_TimestampType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13TimestampType_4unit___get__(struct __pyx_obj_7pyarrow_3lib_TimestampType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":464
 *         The timestamp unit ('s', 'ms', 'us' or 'ns').
 *         """
 *         return timeunit_to_string(self.ts_type.unit())             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_timeunit_to_string(__pyx_v_self->ts_type->unit()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":460
 * 
 *     @property
 *     def unit(self):             # <<<<<<<<<<<<<<
 *         """
 *         The timestamp unit ('s', 'ms', 'us' or 'ns').
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.TimestampType.unit.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":467
 * 
 *     @property
 *     def tz(self):             # <<<<<<<<<<<<<<
 *         """
 *         The timestamp time zone, if any, or None.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13TimestampType_2tz_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_13TimestampType_2tz_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13TimestampType_2tz___get__(((struct __pyx_obj_7pyarrow_3lib_TimestampType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13TimestampType_2tz___get__(struct __pyx_obj_7pyarrow_3lib_TimestampType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":471
 *         The timestamp time zone, if any, or None.
 *         """
 *         if self.ts_type.timezone().size() > 0:             # <<<<<<<<<<<<<<
 *             return frombytes(self.ts_type.timezone())
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_self->ts_type->timezone().size() > 0) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/types.pxi":472
 *         """
 *         if self.ts_type.timezone().size() > 0:
 *             return frombytes(self.ts_type.timezone())             # <<<<<<<<<<<<<<
 *         else:
 *             return None
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 472, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_self->ts_type->timezone()); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 472, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 472, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":471
 *         The timestamp time zone, if any, or None.
 *         """
 *         if self.ts_type.timezone().size() > 0:             # <<<<<<<<<<<<<<
 *             return frombytes(self.ts_type.timezone())
 *         else:
 */
  }

  /* "pyarrow/types.pxi":474
 *             return frombytes(self.ts_type.timezone())
 *         else:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *     def to_pandas_dtype(self):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pyarrow/types.pxi":467
 * 
 *     @property
 *     def tz(self):             # <<<<<<<<<<<<<<
 *         """
 *         The timestamp time zone, if any, or None.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.TimestampType.tz.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":476
 *             return None
 * 
 *     def to_pandas_dtype(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the equivalent NumPy / Pandas dtype.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13TimestampType_1to_pandas_dtype(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13TimestampType_to_pandas_dtype[] = "TimestampType.to_pandas_dtype(self)\n\n        Return the equivalent NumPy / Pandas dtype.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_13TimestampType_1to_pandas_dtype(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_pandas_dtype (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13TimestampType_to_pandas_dtype(((struct __pyx_obj_7pyarrow_3lib_TimestampType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13TimestampType_to_pandas_dtype(struct __pyx_obj_7pyarrow_3lib_TimestampType *__pyx_v_self) {
  PyObject *__pyx_v_make_datetimetz = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("to_pandas_dtype", 0);

  /* "pyarrow/types.pxi":480
 *         Return the equivalent NumPy / Pandas dtype.
 *         """
 *         if self.tz is None:             # <<<<<<<<<<<<<<
 *             return _pandas_type_map[_Type_TIMESTAMP]
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tz); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/types.pxi":481
 *         """
 *         if self.tz is None:
 *             return _pandas_type_map[_Type_TIMESTAMP]             # <<<<<<<<<<<<<<
 *         else:
 *             # Return DatetimeTZ
 */
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(__pyx_v_7pyarrow_3lib__pandas_type_map == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(4, 481, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIMESTAMP); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 481, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_7pyarrow_3lib__pandas_type_map, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 481, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":480
 *         Return the equivalent NumPy / Pandas dtype.
 *         """
 *         if self.tz is None:             # <<<<<<<<<<<<<<
 *             return _pandas_type_map[_Type_TIMESTAMP]
 *         else:
 */
  }

  /* "pyarrow/types.pxi":484
 *         else:
 *             # Return DatetimeTZ
 *             from pyarrow.pandas_compat import make_datetimetz             # <<<<<<<<<<<<<<
 *             return make_datetimetz(self.tz)
 * 
 */
  /*else*/ {
    __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 484, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_n_s_make_datetimetz);
    __Pyx_GIVEREF(__pyx_n_s_make_datetimetz);
    PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_make_datetimetz);
    __pyx_t_1 = __Pyx_Import(__pyx_n_s_pyarrow_pandas_compat, __pyx_t_4, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 484, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_make_datetimetz); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 484, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_make_datetimetz = __pyx_t_4;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/types.pxi":485
 *             # Return DatetimeTZ
 *             from pyarrow.pandas_compat import make_datetimetz
 *             return make_datetimetz(self.tz)             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tz); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 485, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_make_datetimetz);
    __pyx_t_5 = __pyx_v_make_datetimetz; __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 485, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/types.pxi":476
 *             return None
 * 
 *     def to_pandas_dtype(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the equivalent NumPy / Pandas dtype.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.TimestampType.to_pandas_dtype", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_make_datetimetz);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":487
 *             return make_datetimetz(self.tz)
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return timestamp, (self.unit, self.tz)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13TimestampType_3__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13TimestampType_2__reduce__[] = "TimestampType.__reduce__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_13TimestampType_3__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13TimestampType_2__reduce__(((struct __pyx_obj_7pyarrow_3lib_TimestampType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13TimestampType_2__reduce__(struct __pyx_obj_7pyarrow_3lib_TimestampType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pyarrow/types.pxi":488
 * 
 *     def __reduce__(self):
 *         return timestamp, (self.unit, self.tz)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_timestamp); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unit); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tz); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":487
 *             return make_datetimetz(self.tz)
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return timestamp, (self.unit, self.tz)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.TimestampType.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":496
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.time_type = <const CTime32Type*> type.get()
 */

static void __pyx_f_7pyarrow_3lib_10Time32Type_init(struct __pyx_obj_7pyarrow_3lib_Time32Type *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/types.pxi":497
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)             # <<<<<<<<<<<<<<
 *         self.time_type = <const CTime32Type*> type.get()
 * 
 */
  __pyx_f_7pyarrow_3lib_8DataType_init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self), __pyx_v_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 497, __pyx_L1_error)

  /* "pyarrow/types.pxi":498
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)
 *         self.time_type = <const CTime32Type*> type.get()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_v_self->time_type = (( arrow::Time32Type const *)__pyx_v_type.get());

  /* "pyarrow/types.pxi":496
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.time_type = <const CTime32Type*> type.get()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.Time32Type.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/types.pxi":501
 * 
 *     @property
 *     def unit(self):             # <<<<<<<<<<<<<<
 *         """
 *         The time unit ('s', 'ms', 'us' or 'ns').
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10Time32Type_4unit_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_10Time32Type_4unit_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10Time32Type_4unit___get__(((struct __pyx_obj_7pyarrow_3lib_Time32Type *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10Time32Type_4unit___get__(struct __pyx_obj_7pyarrow_3lib_Time32Type *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":505
 *         The time unit ('s', 'ms', 'us' or 'ns').
 *         """
 *         return timeunit_to_string(self.time_type.unit())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_timeunit_to_string(__pyx_v_self->time_type->unit()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":501
 * 
 *     @property
 *     def unit(self):             # <<<<<<<<<<<<<<
 *         """
 *         The time unit ('s', 'ms', 'us' or 'ns').
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Time32Type.unit.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":513
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.time_type = <const CTime64Type*> type.get()
 */

static void __pyx_f_7pyarrow_3lib_10Time64Type_init(struct __pyx_obj_7pyarrow_3lib_Time64Type *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/types.pxi":514
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)             # <<<<<<<<<<<<<<
 *         self.time_type = <const CTime64Type*> type.get()
 * 
 */
  __pyx_f_7pyarrow_3lib_8DataType_init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self), __pyx_v_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 514, __pyx_L1_error)

  /* "pyarrow/types.pxi":515
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)
 *         self.time_type = <const CTime64Type*> type.get()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_v_self->time_type = (( arrow::Time64Type const *)__pyx_v_type.get());

  /* "pyarrow/types.pxi":513
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.time_type = <const CTime64Type*> type.get()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.Time64Type.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/types.pxi":518
 * 
 *     @property
 *     def unit(self):             # <<<<<<<<<<<<<<
 *         """
 *         The time unit ('s', 'ms', 'us' or 'ns').
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10Time64Type_4unit_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_10Time64Type_4unit_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10Time64Type_4unit___get__(((struct __pyx_obj_7pyarrow_3lib_Time64Type *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10Time64Type_4unit___get__(struct __pyx_obj_7pyarrow_3lib_Time64Type *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":522
 *         The time unit ('s', 'ms', 'us' or 'ns').
 *         """
 *         return timeunit_to_string(self.time_type.unit())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_timeunit_to_string(__pyx_v_self->time_type->unit()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":518
 * 
 *     @property
 *     def unit(self):             # <<<<<<<<<<<<<<
 *         """
 *         The time unit ('s', 'ms', 'us' or 'ns').
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Time64Type.unit.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":530
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.duration_type = <const CDurationType*> type.get()
 */

static void __pyx_f_7pyarrow_3lib_12DurationType_init(struct __pyx_obj_7pyarrow_3lib_DurationType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/types.pxi":531
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)             # <<<<<<<<<<<<<<
 *         self.duration_type = <const CDurationType*> type.get()
 * 
 */
  __pyx_f_7pyarrow_3lib_8DataType_init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self), __pyx_v_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 531, __pyx_L1_error)

  /* "pyarrow/types.pxi":532
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)
 *         self.duration_type = <const CDurationType*> type.get()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_v_self->duration_type = (( arrow::DurationType const *)__pyx_v_type.get());

  /* "pyarrow/types.pxi":530
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.duration_type = <const CDurationType*> type.get()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.DurationType.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/types.pxi":535
 * 
 *     @property
 *     def unit(self):             # <<<<<<<<<<<<<<
 *         """
 *         The duration unit ('s', 'ms', 'us' or 'ns').
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12DurationType_4unit_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_12DurationType_4unit_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12DurationType_4unit___get__(((struct __pyx_obj_7pyarrow_3lib_DurationType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12DurationType_4unit___get__(struct __pyx_obj_7pyarrow_3lib_DurationType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":539
 *         The duration unit ('s', 'ms', 'us' or 'ns').
 *         """
 *         return timeunit_to_string(self.duration_type.unit())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_timeunit_to_string(__pyx_v_self->duration_type->unit()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":535
 * 
 *     @property
 *     def unit(self):             # <<<<<<<<<<<<<<
 *         """
 *         The duration unit ('s', 'ms', 'us' or 'ns').
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DurationType.unit.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":547
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.fixed_size_binary_type = (
 */

static void __pyx_f_7pyarrow_3lib_19FixedSizeBinaryType_init(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/types.pxi":548
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)             # <<<<<<<<<<<<<<
 *         self.fixed_size_binary_type = (
 *             <const CFixedSizeBinaryType*> type.get())
 */
  __pyx_f_7pyarrow_3lib_8DataType_init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self), __pyx_v_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 548, __pyx_L1_error)

  /* "pyarrow/types.pxi":549
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)
 *         self.fixed_size_binary_type = (             # <<<<<<<<<<<<<<
 *             <const CFixedSizeBinaryType*> type.get())
 * 
 */
  __pyx_v_self->fixed_size_binary_type = (( arrow::FixedSizeBinaryType const *)__pyx_v_type.get());

  /* "pyarrow/types.pxi":547
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.fixed_size_binary_type = (
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.FixedSizeBinaryType.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/types.pxi":552
 *             <const CFixedSizeBinaryType*> type.get())
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return binary, (self.byte_width,)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19FixedSizeBinaryType_1__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19FixedSizeBinaryType___reduce__[] = "FixedSizeBinaryType.__reduce__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_19FixedSizeBinaryType_1__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_19FixedSizeBinaryType___reduce__(((struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19FixedSizeBinaryType___reduce__(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pyarrow/types.pxi":553
 * 
 *     def __reduce__(self):
 *         return binary, (self.byte_width,)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_binary); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 553, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_byte_width); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 553, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 553, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 553, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":552
 *             <const CFixedSizeBinaryType*> type.get())
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return binary, (self.byte_width,)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.FixedSizeBinaryType.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":556
 * 
 *     @property
 *     def byte_width(self):             # <<<<<<<<<<<<<<
 *         """
 *         The binary size in bytes.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19FixedSizeBinaryType_10byte_width_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_19FixedSizeBinaryType_10byte_width_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_19FixedSizeBinaryType_10byte_width___get__(((struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19FixedSizeBinaryType_10byte_width___get__(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":560
 *         The binary size in bytes.
 *         """
 *         return self.fixed_size_binary_type.byte_width()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->fixed_size_binary_type->byte_width()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":556
 * 
 *     @property
 *     def byte_width(self):             # <<<<<<<<<<<<<<
 *         """
 *         The binary size in bytes.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FixedSizeBinaryType.byte_width.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":568
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         FixedSizeBinaryType.init(self, type)
 *         self.decimal128_type = <const CDecimal128Type*> type.get()
 */

static void __pyx_f_7pyarrow_3lib_14Decimal128Type_init(struct __pyx_obj_7pyarrow_3lib_Decimal128Type *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/types.pxi":569
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         FixedSizeBinaryType.init(self, type)             # <<<<<<<<<<<<<<
 *         self.decimal128_type = <const CDecimal128Type*> type.get()
 * 
 */
  __pyx_f_7pyarrow_3lib_19FixedSizeBinaryType_init(((struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType *)__pyx_v_self), __pyx_v_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 569, __pyx_L1_error)

  /* "pyarrow/types.pxi":570
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         FixedSizeBinaryType.init(self, type)
 *         self.decimal128_type = <const CDecimal128Type*> type.get()             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  __pyx_v_self->decimal128_type = (( arrow::Decimal128Type const *)__pyx_v_type.get());

  /* "pyarrow/types.pxi":568
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         FixedSizeBinaryType.init(self, type)
 *         self.decimal128_type = <const CDecimal128Type*> type.get()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.Decimal128Type.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/types.pxi":572
 *         self.decimal128_type = <const CDecimal128Type*> type.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return decimal128, (self.precision, self.scale)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14Decimal128Type_1__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14Decimal128Type___reduce__[] = "Decimal128Type.__reduce__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_14Decimal128Type_1__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14Decimal128Type___reduce__(((struct __pyx_obj_7pyarrow_3lib_Decimal128Type *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14Decimal128Type___reduce__(struct __pyx_obj_7pyarrow_3lib_Decimal128Type *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pyarrow/types.pxi":573
 * 
 *     def __reduce__(self):
 *         return decimal128, (self.precision, self.scale)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_decimal128); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_precision); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_scale); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":572
 *         self.decimal128_type = <const CDecimal128Type*> type.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return decimal128, (self.precision, self.scale)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.Decimal128Type.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":576
 * 
 *     @property
 *     def precision(self):             # <<<<<<<<<<<<<<
 *         """
 *         The decimal precision, in number of decimal digits (an integer).
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14Decimal128Type_9precision_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14Decimal128Type_9precision_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14Decimal128Type_9precision___get__(((struct __pyx_obj_7pyarrow_3lib_Decimal128Type *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14Decimal128Type_9precision___get__(struct __pyx_obj_7pyarrow_3lib_Decimal128Type *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":580
 *         The decimal precision, in number of decimal digits (an integer).
 *         """
 *         return self.decimal128_type.precision()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->decimal128_type->precision()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 580, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":576
 * 
 *     @property
 *     def precision(self):             # <<<<<<<<<<<<<<
 *         """
 *         The decimal precision, in number of decimal digits (an integer).
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Decimal128Type.precision.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":583
 * 
 *     @property
 *     def scale(self):             # <<<<<<<<<<<<<<
 *         """
 *         The decimal scale (an integer).
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14Decimal128Type_5scale_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14Decimal128Type_5scale_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14Decimal128Type_5scale___get__(((struct __pyx_obj_7pyarrow_3lib_Decimal128Type *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14Decimal128Type_5scale___get__(struct __pyx_obj_7pyarrow_3lib_Decimal128Type *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":587
 *         The decimal scale (an integer).
 *         """
 *         return self.decimal128_type.scale()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->decimal128_type->scale()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":583
 * 
 *     @property
 *     def scale(self):             # <<<<<<<<<<<<<<
 *         """
 *         The decimal scale (an integer).
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Decimal128Type.scale.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":595
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.ext_type = <const CExtensionType*> type.get()
 */

static void __pyx_f_7pyarrow_3lib_17BaseExtensionType_init(struct __pyx_obj_7pyarrow_3lib_BaseExtensionType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/types.pxi":596
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)             # <<<<<<<<<<<<<<
 *         self.ext_type = <const CExtensionType*> type.get()
 * 
 */
  __pyx_f_7pyarrow_3lib_8DataType_init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self), __pyx_v_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 596, __pyx_L1_error)

  /* "pyarrow/types.pxi":597
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         DataType.init(self, type)
 *         self.ext_type = <const CExtensionType*> type.get()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_v_self->ext_type = (( arrow::ExtensionType const *)__pyx_v_type.get());

  /* "pyarrow/types.pxi":595
 *     """
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.ext_type = <const CExtensionType*> type.get()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.BaseExtensionType.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/types.pxi":600
 * 
 *     @property
 *     def extension_name(self):             # <<<<<<<<<<<<<<
 *         """
 *         The extension type name.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_17BaseExtensionType_14extension_name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_17BaseExtensionType_14extension_name_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_17BaseExtensionType_14extension_name___get__(((struct __pyx_obj_7pyarrow_3lib_BaseExtensionType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_17BaseExtensionType_14extension_name___get__(struct __pyx_obj_7pyarrow_3lib_BaseExtensionType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":604
 *         The extension type name.
 *         """
 *         return frombytes(self.ext_type.extension_name())             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_self->ext_type->extension_name()); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":600
 * 
 *     @property
 *     def extension_name(self):             # <<<<<<<<<<<<<<
 *         """
 *         The extension type name.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.BaseExtensionType.extension_name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":607
 * 
 *     @property
 *     def storage_type(self):             # <<<<<<<<<<<<<<
 *         """
 *         The underlying storage type.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_17BaseExtensionType_12storage_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_17BaseExtensionType_12storage_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_17BaseExtensionType_12storage_type___get__(((struct __pyx_obj_7pyarrow_3lib_BaseExtensionType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_17BaseExtensionType_12storage_type___get__(struct __pyx_obj_7pyarrow_3lib_BaseExtensionType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":611
 *         The underlying storage type.
 *         """
 *         return pyarrow_wrap_data_type(self.ext_type.storage_type())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_self->ext_type->storage_type()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 611, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":607
 * 
 *     @property
 *     def storage_type(self):             # <<<<<<<<<<<<<<
 *         """
 *         The underlying storage type.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.BaseExtensionType.storage_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":619
 *     """
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         if type(self) is ExtensionType:
 *             raise TypeError("Can only instantiate subclasses of "
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_13ExtensionType_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_13ExtensionType_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_13ExtensionType___cinit__(((struct __pyx_obj_7pyarrow_3lib_ExtensionType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_13ExtensionType___cinit__(struct __pyx_obj_7pyarrow_3lib_ExtensionType *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/types.pxi":620
 * 
 *     def __cinit__(self):
 *         if type(self) is ExtensionType:             # <<<<<<<<<<<<<<
 *             raise TypeError("Can only instantiate subclasses of "
 *                             "ExtensionType")
 */
  __pyx_t_1 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_ptype_7pyarrow_3lib_ExtensionType));
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/types.pxi":621
 *     def __cinit__(self):
 *         if type(self) is ExtensionType:
 *             raise TypeError("Can only instantiate subclasses of "             # <<<<<<<<<<<<<<
 *                             "ExtensionType")
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 621, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(4, 621, __pyx_L1_error)

    /* "pyarrow/types.pxi":620
 * 
 *     def __cinit__(self):
 *         if type(self) is ExtensionType:             # <<<<<<<<<<<<<<
 *             raise TypeError("Can only instantiate subclasses of "
 *                             "ExtensionType")
 */
  }

  /* "pyarrow/types.pxi":619
 *     """
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         if type(self) is ExtensionType:
 *             raise TypeError("Can only instantiate subclasses of "
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.ExtensionType.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":624
 *                             "ExtensionType")
 * 
 *     def __init__(self, DataType storage_type, extension_name):             # <<<<<<<<<<<<<<
 *         """
 *         Initialize an extension type instance.
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_13ExtensionType_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13ExtensionType_2__init__[] = "\n        Initialize an extension type instance.\n\n        This should be called at the end of the subclass'\n        ``__init__`` method.\n\n        Parameters\n        ----------\n        storage_type : DataType\n        extension_name : str\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_13ExtensionType_2__init__;
#endif
static int __pyx_pw_7pyarrow_3lib_13ExtensionType_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_storage_type = 0;
  PyObject *__pyx_v_extension_name = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_storage_type,&__pyx_n_s_extension_name,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_storage_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extension_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(4, 624, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(4, 624, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_storage_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)values[0]);
    __pyx_v_extension_name = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 624, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.ExtensionType.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_storage_type), __pyx_ptype_7pyarrow_3lib_DataType, 1, "storage_type", 0))) __PYX_ERR(4, 624, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_13ExtensionType_2__init__(((struct __pyx_obj_7pyarrow_3lib_ExtensionType *)__pyx_v_self), __pyx_v_storage_type, __pyx_v_extension_name);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_13ExtensionType_2__init__(struct __pyx_obj_7pyarrow_3lib_ExtensionType *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_storage_type, PyObject *__pyx_v_extension_name) {
  std::shared_ptr< arrow::ExtensionType>  __pyx_v_cpy_ext_type;
  std::string __pyx_v_c_extension_name;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/types.pxi":640
 *             c_string c_extension_name
 * 
 *         c_extension_name = tobytes(extension_name)             # <<<<<<<<<<<<<<
 * 
 *         assert storage_type is not None
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_extension_name) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_extension_name);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 640, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_extension_name = __pyx_t_4;

  /* "pyarrow/types.pxi":642
 *         c_extension_name = tobytes(extension_name)
 * 
 *         assert storage_type is not None             # <<<<<<<<<<<<<<
 *         check_status(CPyExtensionType.FromClass(
 *             storage_type.sp_type, c_extension_name, type(self),
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_5 = (((PyObject *)__pyx_v_storage_type) != Py_None);
    if (unlikely(!(__pyx_t_5 != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(4, 642, __pyx_L1_error)
    }
  }
  #endif

  /* "pyarrow/types.pxi":643
 * 
 *         assert storage_type is not None
 *         check_status(CPyExtensionType.FromClass(             # <<<<<<<<<<<<<<
 *             storage_type.sp_type, c_extension_name, type(self),
 *             &cpy_ext_type))
 */
  __pyx_t_6 = __pyx_f_7pyarrow_3lib_check_status( arrow::py::PyExtensionType::FromClass(__pyx_v_storage_type->sp_type, __pyx_v_c_extension_name, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), (&__pyx_v_cpy_ext_type))); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(4, 643, __pyx_L1_error)

  /* "pyarrow/types.pxi":646
 *             storage_type.sp_type, c_extension_name, type(self),
 *             &cpy_ext_type))
 *         self.init(<shared_ptr[CDataType]> cpy_ext_type)             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_ExtensionType *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self), ((std::shared_ptr< arrow::DataType> )__pyx_v_cpy_ext_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 646, __pyx_L1_error)

  /* "pyarrow/types.pxi":624
 *                             "ExtensionType")
 * 
 *     def __init__(self, DataType storage_type, extension_name):             # <<<<<<<<<<<<<<
 *         """
 *         Initialize an extension type instance.
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.ExtensionType.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":648
 *         self.init(<shared_ptr[CDataType]> cpy_ext_type)
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         BaseExtensionType.init(self, type)
 *         self.cpy_ext_type = <const CPyExtensionType*> type.get()
 */

static void __pyx_f_7pyarrow_3lib_13ExtensionType_init(struct __pyx_obj_7pyarrow_3lib_ExtensionType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/types.pxi":649
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         BaseExtensionType.init(self, type)             # <<<<<<<<<<<<<<
 *         self.cpy_ext_type = <const CPyExtensionType*> type.get()
 *         # Store weakref and serialized version of self on C++ type instance
 */
  __pyx_f_7pyarrow_3lib_17BaseExtensionType_init(((struct __pyx_obj_7pyarrow_3lib_BaseExtensionType *)__pyx_v_self), __pyx_v_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 649, __pyx_L1_error)

  /* "pyarrow/types.pxi":650
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:
 *         BaseExtensionType.init(self, type)
 *         self.cpy_ext_type = <const CPyExtensionType*> type.get()             # <<<<<<<<<<<<<<
 *         # Store weakref and serialized version of self on C++ type instance
 *         check_status(self.cpy_ext_type.SetInstance(self))
 */
  __pyx_v_self->cpy_ext_type = (( arrow::py::PyExtensionType const *)__pyx_v_type.get());

  /* "pyarrow/types.pxi":652
 *         self.cpy_ext_type = <const CPyExtensionType*> type.get()
 *         # Store weakref and serialized version of self on C++ type instance
 *         check_status(self.cpy_ext_type.SetInstance(self))             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, other):
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->cpy_ext_type->SetInstance(((PyObject *)__pyx_v_self))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 652, __pyx_L1_error)

  /* "pyarrow/types.pxi":648
 *         self.init(<shared_ptr[CDataType]> cpy_ext_type)
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type) except *:             # <<<<<<<<<<<<<<
 *         BaseExtensionType.init(self, type)
 *         self.cpy_ext_type = <const CPyExtensionType*> type.get()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.ExtensionType.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/types.pxi":654
 *         check_status(self.cpy_ext_type.SetInstance(self))
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         # Default implementation to avoid infinite recursion through
 *         # DataType.__eq__ -> ExtensionType::ExtensionEquals -> DataType.__eq__
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13ExtensionType_5__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_13ExtensionType_5__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13ExtensionType_4__eq__(((struct __pyx_obj_7pyarrow_3lib_ExtensionType *)__pyx_v_self), ((PyObject *)__pyx_v_other));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13ExtensionType_4__eq__(struct __pyx_obj_7pyarrow_3lib_ExtensionType *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__eq__", 0);

  /* "pyarrow/types.pxi":657
 *         # Default implementation to avoid infinite recursion through
 *         # DataType.__eq__ -> ExtensionType::ExtensionEquals -> DataType.__eq__
 *         if isinstance(other, ExtensionType):             # <<<<<<<<<<<<<<
 *             return (type(self) == type(other) and
 *                     self.extension_name == other.extension_name and
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_7pyarrow_3lib_ExtensionType); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/types.pxi":658
 *         # DataType.__eq__ -> ExtensionType::ExtensionEquals -> DataType.__eq__
 *         if isinstance(other, ExtensionType):
 *             return (type(self) == type(other) and             # <<<<<<<<<<<<<<
 *                     self.extension_name == other.extension_name and
 *                     self.storage_type == other.storage_type)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = PyObject_RichCompare(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), ((PyObject *)Py_TYPE(__pyx_v_other)), Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 658, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 658, __pyx_L1_error)
    if (__pyx_t_2) {
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_3 = __pyx_t_4;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L4_bool_binop_done;
    }

    /* "pyarrow/types.pxi":659
 *         if isinstance(other, ExtensionType):
 *             return (type(self) == type(other) and
 *                     self.extension_name == other.extension_name and             # <<<<<<<<<<<<<<
 *                     self.storage_type == other.storage_type)
 *         else:
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extension_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 659, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_extension_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 659, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 659, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 659, __pyx_L1_error)
    if (__pyx_t_2) {
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else {
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_3 = __pyx_t_6;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L4_bool_binop_done;
    }

    /* "pyarrow/types.pxi":660
 *             return (type(self) == type(other) and
 *                     self.extension_name == other.extension_name and
 *                     self.storage_type == other.storage_type)             # <<<<<<<<<<<<<<
 *         else:
 *             return NotImplemented
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_storage_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 660, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_storage_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 660, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 660, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_3 = __pyx_t_4;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_L4_bool_binop_done:;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":657
 *         # Default implementation to avoid infinite recursion through
 *         # DataType.__eq__ -> ExtensionType::ExtensionEquals -> DataType.__eq__
 *         if isinstance(other, ExtensionType):             # <<<<<<<<<<<<<<
 *             return (type(self) == type(other) and
 *                     self.extension_name == other.extension_name and
 */
  }

  /* "pyarrow/types.pxi":662
 *                     self.storage_type == other.storage_type)
 *         else:
 *             return NotImplemented             # <<<<<<<<<<<<<<
 * 
 *     def __arrow_ext_serialize__(self):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_builtin_NotImplemented);
    __pyx_r = __pyx_builtin_NotImplemented;
    goto __pyx_L0;
  }

  /* "pyarrow/types.pxi":654
 *         check_status(self.cpy_ext_type.SetInstance(self))
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         # Default implementation to avoid infinite recursion through
 *         # DataType.__eq__ -> ExtensionType::ExtensionEquals -> DataType.__eq__
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.ExtensionType.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":664
 *             return NotImplemented
 * 
 *     def __arrow_ext_serialize__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Serialized representation of metadata to reconstruct the type object.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13ExtensionType_7__arrow_ext_serialize__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13ExtensionType_6__arrow_ext_serialize__[] = "ExtensionType.__arrow_ext_serialize__(self)\n\n        Serialized representation of metadata to reconstruct the type object.\n\n        This method should return a bytes object, and those serialized bytes\n        are stored in the custom metadata of the Field holding an extension\n        type in an IPC message.\n        The bytes are passed to ``__arrow_ext_deserialize`` and should hold\n        sufficient information to reconstruct the data type instance.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_13ExtensionType_7__arrow_ext_serialize__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__arrow_ext_serialize__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13ExtensionType_6__arrow_ext_serialize__(((struct __pyx_obj_7pyarrow_3lib_ExtensionType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13ExtensionType_6__arrow_ext_serialize__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_ExtensionType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__arrow_ext_serialize__", 0);

  /* "pyarrow/types.pxi":674
 *         sufficient information to reconstruct the data type instance.
 *         """
 *         return NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_builtin_NotImplementedError);
  __pyx_r = __pyx_builtin_NotImplementedError;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":664
 *             return NotImplemented
 * 
 *     def __arrow_ext_serialize__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Serialized representation of metadata to reconstruct the type object.
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":677
 * 
 *     @classmethod
 *     def __arrow_ext_deserialize__(self, storage_type, serialized):             # <<<<<<<<<<<<<<
 *         """
 *         Return an extension type instance from the storage type and serialized
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13ExtensionType_9__arrow_ext_deserialize__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13ExtensionType_8__arrow_ext_deserialize__[] = "ExtensionType.__arrow_ext_deserialize__(type self, storage_type, serialized)\n\n        Return an extension type instance from the storage type and serialized\n        metadata.\n\n        This method should return an instance of the ExtensionType subclass\n        that matches the passed storage type and serialized metadata (the\n        return value of ``__arrow_ext_serialize__``).\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_13ExtensionType_9__arrow_ext_deserialize__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_storage_type = 0;
  CYTHON_UNUSED PyObject *__pyx_v_serialized = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__arrow_ext_deserialize__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_storage_type,&__pyx_n_s_serialized,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_storage_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_serialized)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__arrow_ext_deserialize__", 1, 2, 2, 1); __PYX_ERR(4, 677, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__arrow_ext_deserialize__") < 0)) __PYX_ERR(4, 677, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_storage_type = values[0];
    __pyx_v_serialized = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__arrow_ext_deserialize__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 677, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.ExtensionType.__arrow_ext_deserialize__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_13ExtensionType_8__arrow_ext_deserialize__(((PyTypeObject*)__pyx_v_self), __pyx_v_storage_type, __pyx_v_serialized);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13ExtensionType_8__arrow_ext_deserialize__(CYTHON_UNUSED PyTypeObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_storage_type, CYTHON_UNUSED PyObject *__pyx_v_serialized) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__arrow_ext_deserialize__", 0);

  /* "pyarrow/types.pxi":686
 *         return value of ``__arrow_ext_serialize__``).
 *         """
 *         return NotImplementedError             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_builtin_NotImplementedError);
  __pyx_r = __pyx_builtin_NotImplementedError;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":677
 * 
 *     @classmethod
 *     def __arrow_ext_deserialize__(self, storage_type, serialized):             # <<<<<<<<<<<<<<
 *         """
 *         Return an extension type instance from the storage type and serialized
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":695
 *     """
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         if type(self) is PyExtensionType:
 *             raise TypeError("Can only instantiate subclasses of "
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_15PyExtensionType_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_15PyExtensionType_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_15PyExtensionType___cinit__(((struct __pyx_obj_7pyarrow_3lib_PyExtensionType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_15PyExtensionType___cinit__(struct __pyx_obj_7pyarrow_3lib_PyExtensionType *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/types.pxi":696
 * 
 *     def __cinit__(self):
 *         if type(self) is PyExtensionType:             # <<<<<<<<<<<<<<
 *             raise TypeError("Can only instantiate subclasses of "
 *                             "PyExtensionType")
 */
  __pyx_t_1 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_ptype_7pyarrow_3lib_PyExtensionType));
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/types.pxi":697
 *     def __cinit__(self):
 *         if type(self) is PyExtensionType:
 *             raise TypeError("Can only instantiate subclasses of "             # <<<<<<<<<<<<<<
 *                             "PyExtensionType")
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(4, 697, __pyx_L1_error)

    /* "pyarrow/types.pxi":696
 * 
 *     def __cinit__(self):
 *         if type(self) is PyExtensionType:             # <<<<<<<<<<<<<<
 *             raise TypeError("Can only instantiate subclasses of "
 *                             "PyExtensionType")
 */
  }

  /* "pyarrow/types.pxi":695
 *     """
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         if type(self) is PyExtensionType:
 *             raise TypeError("Can only instantiate subclasses of "
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.PyExtensionType.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":700
 *                             "PyExtensionType")
 * 
 *     def __init__(self, DataType storage_type):             # <<<<<<<<<<<<<<
 *         ExtensionType.__init__(self, storage_type, "arrow.py_extension_type")
 * 
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_15PyExtensionType_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_15PyExtensionType_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_storage_type = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_storage_type,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_storage_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(4, 700, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_storage_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 700, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.PyExtensionType.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_storage_type), __pyx_ptype_7pyarrow_3lib_DataType, 1, "storage_type", 0))) __PYX_ERR(4, 700, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_15PyExtensionType_2__init__(((struct __pyx_obj_7pyarrow_3lib_PyExtensionType *)__pyx_v_self), __pyx_v_storage_type);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_15PyExtensionType_2__init__(struct __pyx_obj_7pyarrow_3lib_PyExtensionType *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_storage_type) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/types.pxi":701
 * 
 *     def __init__(self, DataType storage_type):
 *         ExtensionType.__init__(self, storage_type, "arrow.py_extension_type")             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_ExtensionType), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_storage_type), __pyx_kp_u_arrow_py_extension_type};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 701, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_storage_type), __pyx_kp_u_arrow_py_extension_type};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 701, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 701, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
    __Pyx_INCREF(((PyObject *)__pyx_v_storage_type));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_storage_type));
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, ((PyObject *)__pyx_v_storage_type));
    __Pyx_INCREF(__pyx_kp_u_arrow_py_extension_type);
    __Pyx_GIVEREF(__pyx_kp_u_arrow_py_extension_type);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_kp_u_arrow_py_extension_type);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 701, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":700
 *                             "PyExtensionType")
 * 
 *     def __init__(self, DataType storage_type):             # <<<<<<<<<<<<<<
 *         ExtensionType.__init__(self, storage_type, "arrow.py_extension_type")
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.PyExtensionType.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":703
 *         ExtensionType.__init__(self, storage_type, "arrow.py_extension_type")
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("Please implement {0}.__reduce__"
 *                                   .format(type(self).__name__))
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15PyExtensionType_5__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15PyExtensionType_4__reduce__[] = "PyExtensionType.__reduce__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_15PyExtensionType_5__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15PyExtensionType_4__reduce__(((struct __pyx_obj_7pyarrow_3lib_PyExtensionType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15PyExtensionType_4__reduce__(struct __pyx_obj_7pyarrow_3lib_PyExtensionType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pyarrow/types.pxi":705
 *     def __reduce__(self):
 *         raise NotImplementedError("Please implement {0}.__reduce__"
 *                                   .format(type(self).__name__))             # <<<<<<<<<<<<<<
 * 
 *     def __arrow_ext_serialize__(self):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Please_implement_0___reduce, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":704
 * 
 *     def __reduce__(self):
 *         raise NotImplementedError("Please implement {0}.__reduce__"             # <<<<<<<<<<<<<<
 *                                   .format(type(self).__name__))
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __PYX_ERR(4, 704, __pyx_L1_error)

  /* "pyarrow/types.pxi":703
 *         ExtensionType.__init__(self, storage_type, "arrow.py_extension_type")
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("Please implement {0}.__reduce__"
 *                                   .format(type(self).__name__))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.PyExtensionType.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":707
 *                                   .format(type(self).__name__))
 * 
 *     def __arrow_ext_serialize__(self):             # <<<<<<<<<<<<<<
 *         return builtin_pickle.dumps(self)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15PyExtensionType_7__arrow_ext_serialize__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15PyExtensionType_6__arrow_ext_serialize__[] = "PyExtensionType.__arrow_ext_serialize__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_15PyExtensionType_7__arrow_ext_serialize__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__arrow_ext_serialize__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15PyExtensionType_6__arrow_ext_serialize__(((struct __pyx_obj_7pyarrow_3lib_PyExtensionType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15PyExtensionType_6__arrow_ext_serialize__(struct __pyx_obj_7pyarrow_3lib_PyExtensionType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__arrow_ext_serialize__", 0);

  /* "pyarrow/types.pxi":708
 * 
 *     def __arrow_ext_serialize__(self):
 *         return builtin_pickle.dumps(self)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_builtin_pickle); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dumps); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_self));
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":707
 *                                   .format(type(self).__name__))
 * 
 *     def __arrow_ext_serialize__(self):             # <<<<<<<<<<<<<<
 *         return builtin_pickle.dumps(self)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.PyExtensionType.__arrow_ext_serialize__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":711
 * 
 *     @classmethod
 *     def __arrow_ext_deserialize__(cls, storage_type, serialized):             # <<<<<<<<<<<<<<
 *         try:
 *             ty = builtin_pickle.loads(serialized)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15PyExtensionType_9__arrow_ext_deserialize__(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15PyExtensionType_8__arrow_ext_deserialize__[] = "PyExtensionType.__arrow_ext_deserialize__(type cls, storage_type, serialized)";
static PyObject *__pyx_pw_7pyarrow_3lib_15PyExtensionType_9__arrow_ext_deserialize__(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_storage_type = 0;
  PyObject *__pyx_v_serialized = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__arrow_ext_deserialize__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_storage_type,&__pyx_n_s_serialized,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_storage_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_serialized)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__arrow_ext_deserialize__", 1, 2, 2, 1); __PYX_ERR(4, 711, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__arrow_ext_deserialize__") < 0)) __PYX_ERR(4, 711, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_storage_type = values[0];
    __pyx_v_serialized = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__arrow_ext_deserialize__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 711, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.PyExtensionType.__arrow_ext_deserialize__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_15PyExtensionType_8__arrow_ext_deserialize__(((PyTypeObject*)__pyx_v_cls), __pyx_v_storage_type, __pyx_v_serialized);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15PyExtensionType_8__arrow_ext_deserialize__(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_storage_type, PyObject *__pyx_v_serialized) {
  PyObject *__pyx_v_ty = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("__arrow_ext_deserialize__", 0);

  /* "pyarrow/types.pxi":712
 *     @classmethod
 *     def __arrow_ext_deserialize__(cls, storage_type, serialized):
 *         try:             # <<<<<<<<<<<<<<
 *             ty = builtin_pickle.loads(serialized)
 *         except Exception:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "pyarrow/types.pxi":713
 *     def __arrow_ext_deserialize__(cls, storage_type, serialized):
 *         try:
 *             ty = builtin_pickle.loads(serialized)             # <<<<<<<<<<<<<<
 *         except Exception:
 *             # For some reason, it's impossible to deserialize the
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_builtin_pickle); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 713, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_loads); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 713, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_serialized) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_serialized);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 713, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_v_ty = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "pyarrow/types.pxi":712
 *     @classmethod
 *     def __arrow_ext_deserialize__(cls, storage_type, serialized):
 *         try:             # <<<<<<<<<<<<<<
 *             ty = builtin_pickle.loads(serialized)
 *         except Exception:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/types.pxi":714
 *         try:
 *             ty = builtin_pickle.loads(serialized)
 *         except Exception:             # <<<<<<<<<<<<<<
 *             # For some reason, it's impossible to deserialize the
 *             # ExtensionType instance.  Perhaps the serialized data is
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_7) {
      __Pyx_AddTraceback("pyarrow.lib.PyExtensionType.__arrow_ext_deserialize__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(4, 714, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_5);

      /* "pyarrow/types.pxi":720
 *             # in an environment where the original Python class or module
 *             # is not available.  Fall back on a generic BaseExtensionType.
 *             return UnknownExtensionType(storage_type, serialized)             # <<<<<<<<<<<<<<
 * 
 *         if ty.storage_type != storage_type:
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 720, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_v_storage_type);
      __Pyx_GIVEREF(__pyx_v_storage_type);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_storage_type);
      __Pyx_INCREF(__pyx_v_serialized);
      __Pyx_GIVEREF(__pyx_v_serialized);
      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_serialized);
      __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pyarrow_3lib_UnknownExtensionType), __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 720, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_r = __pyx_t_9;
      __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/types.pxi":712
 *     @classmethod
 *     def __arrow_ext_deserialize__(cls, storage_type, serialized):
 *         try:             # <<<<<<<<<<<<<<
 *             ty = builtin_pickle.loads(serialized)
 *         except Exception:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L8_try_end:;
  }

  /* "pyarrow/types.pxi":722
 *             return UnknownExtensionType(storage_type, serialized)
 * 
 *         if ty.storage_type != storage_type:             # <<<<<<<<<<<<<<
 *             raise TypeError("Expected storage type {0} but got {1}"
 *                             .format(ty.storage_type, storage_type))
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_ty, __pyx_n_s_storage_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 722, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_v_storage_type, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 722, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(4, 722, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(__pyx_t_10)) {

    /* "pyarrow/types.pxi":724
 *         if ty.storage_type != storage_type:
 *             raise TypeError("Expected storage type {0} but got {1}"
 *                             .format(ty.storage_type, storage_type))             # <<<<<<<<<<<<<<
 *         return ty
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Expected_storage_type_0_but_got, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 724, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ty, __pyx_n_s_storage_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 724, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_9 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_4, __pyx_v_storage_type};
      __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 724, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_4, __pyx_v_storage_type};
      __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 724, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 724, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_9) {
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); __pyx_t_9 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_4);
      __Pyx_INCREF(__pyx_v_storage_type);
      __Pyx_GIVEREF(__pyx_v_storage_type);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_storage_type);
      __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 724, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "pyarrow/types.pxi":723
 * 
 *         if ty.storage_type != storage_type:
 *             raise TypeError("Expected storage type {0} but got {1}"             # <<<<<<<<<<<<<<
 *                             .format(ty.storage_type, storage_type))
 *         return ty
 */
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 723, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(4, 723, __pyx_L1_error)

    /* "pyarrow/types.pxi":722
 *             return UnknownExtensionType(storage_type, serialized)
 * 
 *         if ty.storage_type != storage_type:             # <<<<<<<<<<<<<<
 *             raise TypeError("Expected storage type {0} but got {1}"
 *                             .format(ty.storage_type, storage_type))
 */
  }

  /* "pyarrow/types.pxi":725
 *             raise TypeError("Expected storage type {0} but got {1}"
 *                             .format(ty.storage_type, storage_type))
 *         return ty             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ty);
  __pyx_r = __pyx_v_ty;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":711
 * 
 *     @classmethod
 *     def __arrow_ext_deserialize__(cls, storage_type, serialized):             # <<<<<<<<<<<<<<
 *         try:
 *             ty = builtin_pickle.loads(serialized)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pyarrow.lib.PyExtensionType.__arrow_ext_deserialize__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ty);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":737
 *         bytes serialized
 * 
 *     def __init__(self, DataType storage_type, serialized):             # <<<<<<<<<<<<<<
 *         self.serialized = serialized
 *         PyExtensionType.__init__(self, storage_type)
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_20UnknownExtensionType_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_20UnknownExtensionType_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_storage_type = 0;
  PyObject *__pyx_v_serialized = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_storage_type,&__pyx_n_s_serialized,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_storage_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_serialized)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(4, 737, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(4, 737, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_storage_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)values[0]);
    __pyx_v_serialized = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 737, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.UnknownExtensionType.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_storage_type), __pyx_ptype_7pyarrow_3lib_DataType, 1, "storage_type", 0))) __PYX_ERR(4, 737, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_20UnknownExtensionType___init__(((struct __pyx_obj_7pyarrow_3lib_UnknownExtensionType *)__pyx_v_self), __pyx_v_storage_type, __pyx_v_serialized);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_20UnknownExtensionType___init__(struct __pyx_obj_7pyarrow_3lib_UnknownExtensionType *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_storage_type, PyObject *__pyx_v_serialized) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/types.pxi":738
 * 
 *     def __init__(self, DataType storage_type, serialized):
 *         self.serialized = serialized             # <<<<<<<<<<<<<<
 *         PyExtensionType.__init__(self, storage_type)
 * 
 */
  if (!(likely(PyBytes_CheckExact(__pyx_v_serialized))||((__pyx_v_serialized) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_serialized)->tp_name), 0))) __PYX_ERR(4, 738, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_serialized;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->serialized);
  __Pyx_DECREF(__pyx_v_self->serialized);
  __pyx_v_self->serialized = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":739
 *     def __init__(self, DataType storage_type, serialized):
 *         self.serialized = serialized
 *         PyExtensionType.__init__(self, storage_type)             # <<<<<<<<<<<<<<
 * 
 *     def __arrow_ext_serialize__(self):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_PyExtensionType), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_storage_type)};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 739, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_storage_type)};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 739, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 739, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
    __Pyx_INCREF(((PyObject *)__pyx_v_storage_type));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_storage_type));
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, ((PyObject *)__pyx_v_storage_type));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 739, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":737
 *         bytes serialized
 * 
 *     def __init__(self, DataType storage_type, serialized):             # <<<<<<<<<<<<<<
 *         self.serialized = serialized
 *         PyExtensionType.__init__(self, storage_type)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.UnknownExtensionType.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":741
 *         PyExtensionType.__init__(self, storage_type)
 * 
 *     def __arrow_ext_serialize__(self):             # <<<<<<<<<<<<<<
 *         return self.serialized
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20UnknownExtensionType_3__arrow_ext_serialize__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20UnknownExtensionType_2__arrow_ext_serialize__[] = "UnknownExtensionType.__arrow_ext_serialize__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_20UnknownExtensionType_3__arrow_ext_serialize__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__arrow_ext_serialize__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_20UnknownExtensionType_2__arrow_ext_serialize__(((struct __pyx_obj_7pyarrow_3lib_UnknownExtensionType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20UnknownExtensionType_2__arrow_ext_serialize__(struct __pyx_obj_7pyarrow_3lib_UnknownExtensionType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__arrow_ext_serialize__", 0);

  /* "pyarrow/types.pxi":742
 * 
 *     def __arrow_ext_serialize__(self):
 *         return self.serialized             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->serialized);
  __pyx_r = __pyx_v_self->serialized;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":741
 *         PyExtensionType.__init__(self, storage_type)
 * 
 *     def __arrow_ext_serialize__(self):             # <<<<<<<<<<<<<<
 *         return self.serialized
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":748
 * 
 * 
 * def register_extension_type(ext_type):             # <<<<<<<<<<<<<<
 *     """
 *     Register a Python extension type.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_21register_extension_type(PyObject *__pyx_self, PyObject *__pyx_v_ext_type); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20register_extension_type[] = "register_extension_type(ext_type)\n\n    Register a Python extension type.\n\n    Registration is based on the extension name (so different registered types\n    need unique extension names). Registration needs an extension type\n    instance, but then works for any instance of the same subclass regardless\n    of parametrization of the type.\n\n    Parameters\n    ----------\n    ext_type : BaseExtensionType instance\n        The ExtensionType subclass to register.\n\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_21register_extension_type = {"register_extension_type", (PyCFunction)__pyx_pw_7pyarrow_3lib_21register_extension_type, METH_O, __pyx_doc_7pyarrow_3lib_20register_extension_type};
static PyObject *__pyx_pw_7pyarrow_3lib_21register_extension_type(PyObject *__pyx_self, PyObject *__pyx_v_ext_type) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("register_extension_type (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_20register_extension_type(__pyx_self, ((PyObject *)__pyx_v_ext_type));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20register_extension_type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ext_type) {
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v__type = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7pyarrow_3lib_ensure_type __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("register_extension_type", 0);

  /* "pyarrow/types.pxi":764
 *     """
 *     cdef:
 *         DataType _type = ensure_type(ext_type, allow_none=False)             # <<<<<<<<<<<<<<
 * 
 *     if not isinstance(_type, BaseExtensionType):
 */
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.allow_none = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_ensure_type(__pyx_v_ext_type, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 764, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":766
 *         DataType _type = ensure_type(ext_type, allow_none=False)
 * 
 *     if not isinstance(_type, BaseExtensionType):             # <<<<<<<<<<<<<<
 *         raise TypeError("Only extension types can be registered")
 * 
 */
  __pyx_t_3 = __Pyx_TypeCheck(((PyObject *)__pyx_v__type), __pyx_ptype_7pyarrow_3lib_BaseExtensionType); 
  __pyx_t_4 = ((!(__pyx_t_3 != 0)) != 0);
  if (unlikely(__pyx_t_4)) {

    /* "pyarrow/types.pxi":767
 * 
 *     if not isinstance(_type, BaseExtensionType):
 *         raise TypeError("Only extension types can be registered")             # <<<<<<<<<<<<<<
 * 
 *     # register on the C++ side
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 767, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 767, __pyx_L1_error)

    /* "pyarrow/types.pxi":766
 *         DataType _type = ensure_type(ext_type, allow_none=False)
 * 
 *     if not isinstance(_type, BaseExtensionType):             # <<<<<<<<<<<<<<
 *         raise TypeError("Only extension types can be registered")
 * 
 */
  }

  /* "pyarrow/types.pxi":770
 * 
 *     # register on the C++ side
 *     check_status(             # <<<<<<<<<<<<<<
 *         RegisterPyExtensionType(<shared_ptr[CDataType]> _type.sp_type))
 * 
 */
  __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::RegisterPyExtensionType(((std::shared_ptr< arrow::DataType> )__pyx_v__type->sp_type))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(4, 770, __pyx_L1_error)

  /* "pyarrow/types.pxi":774
 * 
 *     # register on the python side
 *     _python_extension_types_registry.append(_type)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_python_extension_types_registry); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_Append(__pyx_t_1, ((PyObject *)__pyx_v__type)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(4, 774, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":748
 * 
 * 
 * def register_extension_type(ext_type):             # <<<<<<<<<<<<<<
 *     """
 *     Register a Python extension type.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.register_extension_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__type);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":777
 * 
 * 
 * def unregister_extension_type(type_name):             # <<<<<<<<<<<<<<
 *     """
 *     Unregister a Python extension type.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_23unregister_extension_type(PyObject *__pyx_self, PyObject *__pyx_v_type_name); /*proto*/
static char __pyx_doc_7pyarrow_3lib_22unregister_extension_type[] = "unregister_extension_type(type_name)\n\n    Unregister a Python extension type.\n\n    Parameters\n    ----------\n    type_name : str\n        The name of the ExtensionType subclass to unregister.\n\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_23unregister_extension_type = {"unregister_extension_type", (PyCFunction)__pyx_pw_7pyarrow_3lib_23unregister_extension_type, METH_O, __pyx_doc_7pyarrow_3lib_22unregister_extension_type};
static PyObject *__pyx_pw_7pyarrow_3lib_23unregister_extension_type(PyObject *__pyx_self, PyObject *__pyx_v_type_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("unregister_extension_type (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_22unregister_extension_type(__pyx_self, ((PyObject *)__pyx_v_type_name));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_22unregister_extension_type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_type_name) {
  std::string __pyx_v_c_type_name;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("unregister_extension_type", 0);

  /* "pyarrow/types.pxi":788
 *     """
 *     cdef:
 *         c_string c_type_name = tobytes(type_name)             # <<<<<<<<<<<<<<
 *     check_status(UnregisterPyExtensionType(c_type_name))
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 788, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_type_name) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_type_name);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 788, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 788, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_type_name = __pyx_t_4;

  /* "pyarrow/types.pxi":789
 *     cdef:
 *         c_string c_type_name = tobytes(type_name)
 *     check_status(UnregisterPyExtensionType(c_type_name))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::UnregisterPyExtensionType(__pyx_v_c_type_name)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(4, 789, __pyx_L1_error)

  /* "pyarrow/types.pxi":777
 * 
 * 
 * def unregister_extension_type(type_name):             # <<<<<<<<<<<<<<
 *     """
 *     Unregister a Python extension type.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.unregister_extension_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":800
 *     Do not use this class's constructor directly; use pyarrow.field
 *     """
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_5Field_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_5Field_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Field___cinit__(((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_5Field___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":803
 *         pass
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call Field's constructor directly, use "
 *                         "`pyarrow.field` instead.")
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_5Field_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_5Field_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Field_2__init__(((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_5Field_2__init__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/types.pxi":804
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call Field's constructor directly, use "             # <<<<<<<<<<<<<<
 *                         "`pyarrow.field` instead.")
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 804, __pyx_L1_error)

  /* "pyarrow/types.pxi":803
 *         pass
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call Field's constructor directly, use "
 *                         "`pyarrow.field` instead.")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Field.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":807
 *                         "`pyarrow.field` instead.")
 * 
 *     cdef void init(self, const shared_ptr[CField]& field):             # <<<<<<<<<<<<<<
 *         self.sp_field = field
 *         self.field = field.get()
 */

static void __pyx_f_7pyarrow_3lib_5Field_init(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self, std::shared_ptr< arrow::Field>  const &__pyx_v_field) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/types.pxi":808
 * 
 *     cdef void init(self, const shared_ptr[CField]& field):
 *         self.sp_field = field             # <<<<<<<<<<<<<<
 *         self.field = field.get()
 *         self.type = pyarrow_wrap_data_type(field.get().type())
 */
  __pyx_v_self->sp_field = __pyx_v_field;

  /* "pyarrow/types.pxi":809
 *     cdef void init(self, const shared_ptr[CField]& field):
 *         self.sp_field = field
 *         self.field = field.get()             # <<<<<<<<<<<<<<
 *         self.type = pyarrow_wrap_data_type(field.get().type())
 * 
 */
  __pyx_v_self->field = __pyx_v_field.get();

  /* "pyarrow/types.pxi":810
 *         self.sp_field = field
 *         self.field = field.get()
 *         self.type = pyarrow_wrap_data_type(field.get().type())             # <<<<<<<<<<<<<<
 * 
 *     def equals(self, Field other):
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_field.get()->type()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 810, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(4, 810, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->type);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->type));
  __pyx_v_self->type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":807
 *                         "`pyarrow.field` instead.")
 * 
 *     cdef void init(self, const shared_ptr[CField]& field):             # <<<<<<<<<<<<<<
 *         self.sp_field = field
 *         self.field = field.get()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("pyarrow.lib.Field.init", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/types.pxi":812
 *         self.type = pyarrow_wrap_data_type(field.get().type())
 * 
 *     def equals(self, Field other):             # <<<<<<<<<<<<<<
 *         """
 *         Test if this field is equal to the other
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_5equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Field_4equals[] = "Field.equals(self, Field other)\n\n        Test if this field is equal to the other\n\n        Parameters\n        ----------\n        other : pyarrow.Field\n\n        Returns\n        -------\n        is_equal : boolean\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_5equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("equals (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_7pyarrow_3lib_Field, 1, "other", 0))) __PYX_ERR(4, 812, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Field_4equals(((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Field_4equals(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("equals", 0);

  /* "pyarrow/types.pxi":824
 *         is_equal : boolean
 *         """
 *         return self.field.Equals(deref(other.field))             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->field->Equals((*__pyx_v_other->field))); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 824, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":812
 *         self.type = pyarrow_wrap_data_type(field.get().type())
 * 
 *     def equals(self, Field other):             # <<<<<<<<<<<<<<
 *         """
 *         Test if this field is equal to the other
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Field.equals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":826
 *         return self.field.Equals(deref(other.field))
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         try:
 *             return self.equals(other)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_7__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_7__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Field_6__eq__(((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_v_self), ((PyObject *)__pyx_v_other));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Field_6__eq__(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("__eq__", 0);

  /* "pyarrow/types.pxi":827
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except TypeError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "pyarrow/types.pxi":828
 *     def __eq__(self, other):
 *         try:
 *             return self.equals(other)             # <<<<<<<<<<<<<<
 *         except TypeError:
 *             return NotImplemented
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_equals); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 828, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_other) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_other);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 828, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L7_try_return;

      /* "pyarrow/types.pxi":827
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except TypeError:
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/types.pxi":829
 *         try:
 *             return self.equals(other)
 *         except TypeError:             # <<<<<<<<<<<<<<
 *             return NotImplemented
 * 
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("pyarrow.lib.Field.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(4, 829, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);

      /* "pyarrow/types.pxi":830
 *             return self.equals(other)
 *         except TypeError:
 *             return NotImplemented             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_builtin_NotImplemented);
      __pyx_r = __pyx_builtin_NotImplemented;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/types.pxi":827
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except TypeError:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "pyarrow/types.pxi":826
 *         return self.field.Equals(deref(other.field))
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         try:
 *             return self.equals(other)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.Field.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":832
 *             return NotImplemented
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return field, (self.name, self.type, self.nullable, self.metadata)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_9__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Field_8__reduce__[] = "Field.__reduce__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_9__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Field_8__reduce__(((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Field_8__reduce__(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pyarrow/types.pxi":833
 * 
 *     def __reduce__(self):
 *         return field, (self.name, self.type, self.nullable, self.metadata)             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_field); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_nullable); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_metadata); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->type));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->type));
  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_self->type));
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
  __pyx_t_1 = 0;
  __pyx_t_5 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":832
 *             return NotImplemented
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return field, (self.name, self.type, self.nullable, self.metadata)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.Field.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":835
 *         return field, (self.name, self.type, self.nullable, self.metadata)
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return 'pyarrow.Field<{0}>'.format(frombytes(self.field.ToString()))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_11__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_11__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Field_10__str__(((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Field_10__str__(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "pyarrow/types.pxi":836
 * 
 *     def __str__(self):
 *         return 'pyarrow.Field<{0}>'.format(frombytes(self.field.ToString()))             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_pyarrow_Field_0, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 836, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 836, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_self->field->ToString()); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 836, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 836, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 836, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":835
 *         return field, (self.name, self.type, self.nullable, self.metadata)
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return 'pyarrow.Field<{0}>'.format(frombytes(self.field.ToString()))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.Field.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":838
 *         return 'pyarrow.Field<{0}>'.format(frombytes(self.field.ToString()))
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return self.__str__()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_13__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_13__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Field_12__repr__(((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Field_12__repr__(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pyarrow/types.pxi":839
 * 
 *     def __repr__(self):
 *         return self.__str__()             # <<<<<<<<<<<<<<
 * 
 *     def __hash__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_str); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 839, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 839, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":838
 *         return 'pyarrow.Field<{0}>'.format(frombytes(self.field.ToString()))
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return self.__str__()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Field.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":841
 *         return self.__str__()
 * 
 *     def __hash__(self):             # <<<<<<<<<<<<<<
 *         return hash((self.field.name(), self.type, self.field.nullable()))
 * 
 */

/* Python wrapper */
static Py_hash_t __pyx_pw_7pyarrow_3lib_5Field_15__hash__(PyObject *__pyx_v_self); /*proto*/
static Py_hash_t __pyx_pw_7pyarrow_3lib_5Field_15__hash__(PyObject *__pyx_v_self) {
  Py_hash_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Field_14__hash__(((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static Py_hash_t __pyx_pf_7pyarrow_3lib_5Field_14__hash__(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self) {
  Py_hash_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_hash_t __pyx_t_4;
  __Pyx_RefNannySetupContext("__hash__", 0);

  /* "pyarrow/types.pxi":842
 * 
 *     def __hash__(self):
 *         return hash((self.field.name(), self.type, self.field.nullable()))             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_self->field->name()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 842, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->field->nullable()); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 842, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 842, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->type));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->type));
  PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_self->type));
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_4 = PyObject_Hash(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_hash_t)-1))) __PYX_ERR(4, 842, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":841
 *         return self.__str__()
 * 
 *     def __hash__(self):             # <<<<<<<<<<<<<<
 *         return hash((self.field.name(), self.type, self.field.nullable()))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Field.__hash__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":845
 * 
 *     @property
 *     def nullable(self):             # <<<<<<<<<<<<<<
 *         return self.field.nullable()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_8nullable_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_8nullable_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Field_8nullable___get__(((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Field_8nullable___get__(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":846
 *     @property
 *     def nullable(self):
 *         return self.field.nullable()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->field->nullable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":845
 * 
 *     @property
 *     def nullable(self):             # <<<<<<<<<<<<<<
 *         return self.field.nullable()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Field.nullable.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":849
 * 
 *     @property
 *     def name(self):             # <<<<<<<<<<<<<<
 *         return frombytes(self.field.name())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_4name_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Field_4name___get__(((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Field_4name___get__(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":850
 *     @property
 *     def name(self):
 *         return frombytes(self.field.name())             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_self->field->name()); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":849
 * 
 *     @property
 *     def name(self):             # <<<<<<<<<<<<<<
 *         return frombytes(self.field.name())
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.Field.name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":853
 * 
 *     @property
 *     def metadata(self):             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_metadata(self.field.metadata())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_8metadata_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_8metadata_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Field_8metadata___get__(((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Field_8metadata___get__(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":854
 *     @property
 *     def metadata(self):
 *         return pyarrow_wrap_metadata(self.field.metadata())             # <<<<<<<<<<<<<<
 * 
 *     def add_metadata(self, metadata):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_metadata(__pyx_v_self->field->metadata()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 854, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":853
 * 
 *     @property
 *     def metadata(self):             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_metadata(self.field.metadata())
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Field.metadata.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":856
 *         return pyarrow_wrap_metadata(self.field.metadata())
 * 
 *     def add_metadata(self, metadata):             # <<<<<<<<<<<<<<
 *         warnings.warn("The 'add_metadata' method is deprecated, use "
 *                       "'with_metadata' instead", FutureWarning, stacklevel=2)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_17add_metadata(PyObject *__pyx_v_self, PyObject *__pyx_v_metadata); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Field_16add_metadata[] = "Field.add_metadata(self, metadata)";
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_17add_metadata(PyObject *__pyx_v_self, PyObject *__pyx_v_metadata) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_metadata (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Field_16add_metadata(((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_v_self), ((PyObject *)__pyx_v_metadata));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Field_16add_metadata(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self, PyObject *__pyx_v_metadata) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("add_metadata", 0);

  /* "pyarrow/types.pxi":857
 * 
 *     def add_metadata(self, metadata):
 *         warnings.warn("The 'add_metadata' method is deprecated, use "             # <<<<<<<<<<<<<<
 *                       "'with_metadata' instead", FutureWarning, stacklevel=2)
 *         return self.with_metadata(metadata)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_warnings); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 857, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_warn); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 857, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":858
 *     def add_metadata(self, metadata):
 *         warnings.warn("The 'add_metadata' method is deprecated, use "
 *                       "'with_metadata' instead", FutureWarning, stacklevel=2)             # <<<<<<<<<<<<<<
 *         return self.with_metadata(metadata)
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_stacklevel, __pyx_int_2) < 0) __PYX_ERR(4, 858, __pyx_L1_error)

  /* "pyarrow/types.pxi":857
 * 
 *     def add_metadata(self, metadata):
 *         warnings.warn("The 'add_metadata' method is deprecated, use "             # <<<<<<<<<<<<<<
 *                       "'with_metadata' instead", FutureWarning, stacklevel=2)
 *         return self.with_metadata(metadata)
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__20, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 857, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/types.pxi":859
 *         warnings.warn("The 'add_metadata' method is deprecated, use "
 *                       "'with_metadata' instead", FutureWarning, stacklevel=2)
 *         return self.with_metadata(metadata)             # <<<<<<<<<<<<<<
 * 
 *     def with_metadata(self, metadata):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_with_metadata); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 859, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_v_metadata) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_metadata);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 859, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":856
 *         return pyarrow_wrap_metadata(self.field.metadata())
 * 
 *     def add_metadata(self, metadata):             # <<<<<<<<<<<<<<
 *         warnings.warn("The 'add_metadata' method is deprecated, use "
 *                       "'with_metadata' instead", FutureWarning, stacklevel=2)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Field.add_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":861
 *         return self.with_metadata(metadata)
 * 
 *     def with_metadata(self, metadata):             # <<<<<<<<<<<<<<
 *         """
 *         Add metadata as dict of string keys and values to Field
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_19with_metadata(PyObject *__pyx_v_self, PyObject *__pyx_v_metadata); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Field_18with_metadata[] = "Field.with_metadata(self, metadata)\n\n        Add metadata as dict of string keys and values to Field\n\n        Parameters\n        ----------\n        metadata : dict\n            Keys and values must be string-like / coercible to bytes\n\n        Returns\n        -------\n        field : pyarrow.Field\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_19with_metadata(PyObject *__pyx_v_self, PyObject *__pyx_v_metadata) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("with_metadata (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Field_18with_metadata(((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_v_self), ((PyObject *)__pyx_v_metadata));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Field_18with_metadata(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self, PyObject *__pyx_v_metadata) {
  std::shared_ptr< arrow::Field>  __pyx_v_c_field;
  std::shared_ptr< arrow::KeyValueMetadata>  __pyx_v_c_meta;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("with_metadata", 0);

  /* "pyarrow/types.pxi":878
 *             shared_ptr[CKeyValueMetadata] c_meta
 * 
 *         if not isinstance(metadata, dict):             # <<<<<<<<<<<<<<
 *             raise TypeError('Metadata must be an instance of dict')
 * 
 */
  __pyx_t_1 = PyDict_Check(__pyx_v_metadata); 
  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/types.pxi":879
 * 
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')             # <<<<<<<<<<<<<<
 * 
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 879, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(4, 879, __pyx_L1_error)

    /* "pyarrow/types.pxi":878
 *             shared_ptr[CKeyValueMetadata] c_meta
 * 
 *         if not isinstance(metadata, dict):             # <<<<<<<<<<<<<<
 *             raise TypeError('Metadata must be an instance of dict')
 * 
 */
  }

  /* "pyarrow/types.pxi":881
 *             raise TypeError('Metadata must be an instance of dict')
 * 
 *         c_meta = pyarrow_unwrap_metadata(metadata)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             c_field = self.field.WithMetadata(c_meta)
 */
  __pyx_v_c_meta = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_metadata(__pyx_v_metadata);

  /* "pyarrow/types.pxi":882
 * 
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             c_field = self.field.WithMetadata(c_meta)
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/types.pxi":883
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 *         with nogil:
 *             c_field = self.field.WithMetadata(c_meta)             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_field(c_field)
 */
        __pyx_v_c_field = __pyx_v_self->field->WithMetadata(__pyx_v_c_meta);
      }

      /* "pyarrow/types.pxi":882
 * 
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             c_field = self.field.WithMetadata(c_meta)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L6;
        }
        __pyx_L6:;
      }
  }

  /* "pyarrow/types.pxi":885
 *             c_field = self.field.WithMetadata(c_meta)
 * 
 *         return pyarrow_wrap_field(c_field)             # <<<<<<<<<<<<<<
 * 
 *     def remove_metadata(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_field(__pyx_v_c_field); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 885, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":861
 *         return self.with_metadata(metadata)
 * 
 *     def with_metadata(self, metadata):             # <<<<<<<<<<<<<<
 *         """
 *         Add metadata as dict of string keys and values to Field
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Field.with_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":887
 *         return pyarrow_wrap_field(c_field)
 * 
 *     def remove_metadata(self):             # <<<<<<<<<<<<<<
 *         """
 *         Create new field without metadata, if any
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_21remove_metadata(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Field_20remove_metadata[] = "Field.remove_metadata(self)\n\n        Create new field without metadata, if any\n\n        Returns\n        -------\n        field : pyarrow.Field\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_21remove_metadata(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("remove_metadata (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Field_20remove_metadata(((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Field_20remove_metadata(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self) {
  std::shared_ptr< arrow::Field>  __pyx_v_new_field;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("remove_metadata", 0);

  /* "pyarrow/types.pxi":896
 *         """
 *         cdef shared_ptr[CField] new_field
 *         with nogil:             # <<<<<<<<<<<<<<
 *             new_field = self.field.RemoveMetadata()
 *         return pyarrow_wrap_field(new_field)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/types.pxi":897
 *         cdef shared_ptr[CField] new_field
 *         with nogil:
 *             new_field = self.field.RemoveMetadata()             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_field(new_field)
 * 
 */
        __pyx_v_new_field = __pyx_v_self->field->RemoveMetadata();
      }

      /* "pyarrow/types.pxi":896
 *         """
 *         cdef shared_ptr[CField] new_field
 *         with nogil:             # <<<<<<<<<<<<<<
 *             new_field = self.field.RemoveMetadata()
 *         return pyarrow_wrap_field(new_field)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/types.pxi":898
 *         with nogil:
 *             new_field = self.field.RemoveMetadata()
 *         return pyarrow_wrap_field(new_field)             # <<<<<<<<<<<<<<
 * 
 *     def flatten(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_field(__pyx_v_new_field); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":887
 *         return pyarrow_wrap_field(c_field)
 * 
 *     def remove_metadata(self):             # <<<<<<<<<<<<<<
 *         """
 *         Create new field without metadata, if any
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Field.remove_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":900
 *         return pyarrow_wrap_field(new_field)
 * 
 *     def flatten(self):             # <<<<<<<<<<<<<<
 *         """
 *         Flatten this field.  If a struct field, individual child fields
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_23flatten(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Field_22flatten[] = "Field.flatten(self)\n\n        Flatten this field.  If a struct field, individual child fields\n        will be returned with their names prefixed by the parent's name.\n\n        Returns\n        -------\n        fields : List[pyarrow.Field]\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_23flatten(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flatten (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Field_22flatten(((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Field_22flatten(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self) {
  std::vector<std::shared_ptr< arrow::Field> >  __pyx_v_flattened;
  std::shared_ptr< arrow::Field>  __pyx_7genexpr__pyx_v_f;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  std::vector<std::shared_ptr< arrow::Field> > ::iterator __pyx_t_2;
  std::shared_ptr< arrow::Field>  __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("flatten", 0);

  /* "pyarrow/types.pxi":910
 *         """
 *         cdef vector[shared_ptr[CField]] flattened
 *         with nogil:             # <<<<<<<<<<<<<<
 *             flattened = self.field.Flatten()
 *         return [pyarrow_wrap_field(f) for f in flattened]
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/types.pxi":911
 *         cdef vector[shared_ptr[CField]] flattened
 *         with nogil:
 *             flattened = self.field.Flatten()             # <<<<<<<<<<<<<<
 *         return [pyarrow_wrap_field(f) for f in flattened]
 * 
 */
        __pyx_v_flattened = __pyx_v_self->field->Flatten();
      }

      /* "pyarrow/types.pxi":910
 *         """
 *         cdef vector[shared_ptr[CField]] flattened
 *         with nogil:             # <<<<<<<<<<<<<<
 *             flattened = self.field.Flatten()
 *         return [pyarrow_wrap_field(f) for f in flattened]
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/types.pxi":912
 *         with nogil:
 *             flattened = self.field.Flatten()
 *         return [pyarrow_wrap_field(f) for f in flattened]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 912, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_v_flattened.begin();
    for (;;) {
      if (!(__pyx_t_2 != __pyx_v_flattened.end())) break;
      __pyx_t_3 = *__pyx_t_2;
      ++__pyx_t_2;
      __pyx_7genexpr__pyx_v_f = __pyx_t_3;
      __pyx_t_4 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_field(__pyx_7genexpr__pyx_v_f); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 912, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(4, 912, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":900
 *         return pyarrow_wrap_field(new_field)
 * 
 *     def flatten(self):             # <<<<<<<<<<<<<<
 *         """
 *         Flatten this field.  If a struct field, individual child fields
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.Field.flatten", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/lib.pxd":153
 * 
 *     cdef readonly:
 *         DataType type             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CField]& field)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_4type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_4type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Field_4type___get__(((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Field_4type___get__(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->type));
  __pyx_r = ((PyObject *)__pyx_v_self->type);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":917
 * cdef class Schema:
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_6Schema_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_6Schema_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema___cinit__(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_6Schema___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":920
 *         pass
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call Schema's constructor directly, use "
 *                         "`pyarrow.schema` instead.")
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_6Schema_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_6Schema_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_2__init__(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_6Schema_2__init__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/types.pxi":921
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call Schema's constructor directly, use "             # <<<<<<<<<<<<<<
 *                         "`pyarrow.schema` instead.")
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 921, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 921, __pyx_L1_error)

  /* "pyarrow/types.pxi":920
 *         pass
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call Schema's constructor directly, use "
 *                         "`pyarrow.schema` instead.")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Schema.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":924
 *                         "`pyarrow.schema` instead.")
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.schema.num_fields()
 * 
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_7pyarrow_3lib_6Schema_5__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pw_7pyarrow_3lib_6Schema_5__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_4__len__(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static Py_ssize_t __pyx_pf_7pyarrow_3lib_6Schema_4__len__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "pyarrow/types.pxi":925
 * 
 *     def __len__(self):
 *         return self.schema.num_fields()             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, key):
 */
  __pyx_r = __pyx_v_self->schema->num_fields();
  goto __pyx_L0;

  /* "pyarrow/types.pxi":924
 *                         "`pyarrow.schema` instead.")
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.schema.num_fields()
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":927
 *         return self.schema.num_fields()
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         # access by integer index
 *         return self._field(key)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_6__getitem__(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self), ((PyObject *)__pyx_v_key));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_6__getitem__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "pyarrow/types.pxi":929
 *     def __getitem__(self, key):
 *         # access by integer index
 *         return self._field(key)             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_field_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 929, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 929, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":927
 *         return self.schema.num_fields()
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         # access by integer index
 *         return self._field(key)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Schema.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pyarrow_3lib_6Schema_10generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/types.pxi":931
 *         return self._field(key)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         for i in range(len(self)):
 *             yield self[i]
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_9__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_9__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_8__iter__(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_8__iter__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__ *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_2___iter__(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_2___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(4, 931, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7pyarrow_3lib_6Schema_10generator2, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_Schema___iter, __pyx_n_s_pyarrow_lib); if (unlikely(!gen)) __PYX_ERR(4, 931, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.Schema.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7pyarrow_3lib_6Schema_10generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__ *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(4, 931, __pyx_L1_error)

  /* "pyarrow/types.pxi":932
 * 
 *     def __iter__(self):
 *         for i in range(len(self)):             # <<<<<<<<<<<<<<
 *             yield self[i]
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(4, 932, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_cur_scope->__pyx_v_i = __pyx_t_3;

    /* "pyarrow/types.pxi":933
 *     def __iter__(self):
 *         for i in range(len(self)):
 *             yield self[i]             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const vector[shared_ptr[CField]]& fields):
 */
    __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 933, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(4, 933, __pyx_L1_error)
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "pyarrow/types.pxi":931
 *         return self._field(key)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         for i in range(len(self)):
 *             yield self[i]
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":935
 *             yield self[i]
 * 
 *     cdef void init(self, const vector[shared_ptr[CField]]& fields):             # <<<<<<<<<<<<<<
 *         self.schema = new CSchema(fields)
 *         self.sp_schema.reset(self.schema)
 */

static void __pyx_f_7pyarrow_3lib_6Schema_init(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, std::vector<std::shared_ptr< arrow::Field> >  const &__pyx_v_fields) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/types.pxi":936
 * 
 *     cdef void init(self, const vector[shared_ptr[CField]]& fields):
 *         self.schema = new CSchema(fields)             # <<<<<<<<<<<<<<
 *         self.sp_schema.reset(self.schema)
 * 
 */
  __pyx_v_self->schema = new  arrow::Schema(__pyx_v_fields);

  /* "pyarrow/types.pxi":937
 *     cdef void init(self, const vector[shared_ptr[CField]]& fields):
 *         self.schema = new CSchema(fields)
 *         self.sp_schema.reset(self.schema)             # <<<<<<<<<<<<<<
 * 
 *     cdef void init_schema(self, const shared_ptr[CSchema]& schema):
 */
  __pyx_v_self->sp_schema.reset(__pyx_v_self->schema);

  /* "pyarrow/types.pxi":935
 *             yield self[i]
 * 
 *     cdef void init(self, const vector[shared_ptr[CField]]& fields):             # <<<<<<<<<<<<<<
 *         self.schema = new CSchema(fields)
 *         self.sp_schema.reset(self.schema)
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/types.pxi":939
 *         self.sp_schema.reset(self.schema)
 * 
 *     cdef void init_schema(self, const shared_ptr[CSchema]& schema):             # <<<<<<<<<<<<<<
 *         self.schema = schema.get()
 *         self.sp_schema = schema
 */

static void __pyx_f_7pyarrow_3lib_6Schema_init_schema(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, std::shared_ptr< arrow::Schema>  const &__pyx_v_schema) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init_schema", 0);

  /* "pyarrow/types.pxi":940
 * 
 *     cdef void init_schema(self, const shared_ptr[CSchema]& schema):
 *         self.schema = schema.get()             # <<<<<<<<<<<<<<
 *         self.sp_schema = schema
 * 
 */
  __pyx_v_self->schema = __pyx_v_schema.get();

  /* "pyarrow/types.pxi":941
 *     cdef void init_schema(self, const shared_ptr[CSchema]& schema):
 *         self.schema = schema.get()
 *         self.sp_schema = schema             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  __pyx_v_self->sp_schema = __pyx_v_schema;

  /* "pyarrow/types.pxi":939
 *         self.sp_schema.reset(self.schema)
 * 
 *     cdef void init_schema(self, const shared_ptr[CSchema]& schema):             # <<<<<<<<<<<<<<
 *         self.schema = schema.get()
 *         self.sp_schema = schema
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/types.pxi":943
 *         self.sp_schema = schema
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return schema, (list(self), self.metadata)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_12__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_11__reduce__[] = "Schema.__reduce__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_12__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_11__reduce__(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_11__reduce__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pyarrow/types.pxi":944
 * 
 *     def __reduce__(self):
 *         return schema, (list(self), self.metadata)             # <<<<<<<<<<<<<<
 * 
 *     def __hash__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_schema); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PySequence_List(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_metadata); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":943
 *         self.sp_schema = schema
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return schema, (list(self), self.metadata)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.Schema.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":946
 *         return schema, (list(self), self.metadata)
 * 
 *     def __hash__(self):             # <<<<<<<<<<<<<<
 *         return hash((tuple(self), self.metadata))
 * 
 */

/* Python wrapper */
static Py_hash_t __pyx_pw_7pyarrow_3lib_6Schema_14__hash__(PyObject *__pyx_v_self); /*proto*/
static Py_hash_t __pyx_pw_7pyarrow_3lib_6Schema_14__hash__(PyObject *__pyx_v_self) {
  Py_hash_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_13__hash__(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static Py_hash_t __pyx_pf_7pyarrow_3lib_6Schema_13__hash__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self) {
  Py_hash_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_hash_t __pyx_t_4;
  __Pyx_RefNannySetupContext("__hash__", 0);

  /* "pyarrow/types.pxi":947
 * 
 *     def __hash__(self):
 *         return hash((tuple(self), self.metadata))             # <<<<<<<<<<<<<<
 * 
 *     def __sizeof__(self):
 */
  __pyx_t_1 = PySequence_Tuple(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 947, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_metadata); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 947, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 947, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_4 = PyObject_Hash(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_hash_t)-1))) __PYX_ERR(4, 947, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":946
 *         return schema, (list(self), self.metadata)
 * 
 *     def __hash__(self):             # <<<<<<<<<<<<<<
 *         return hash((tuple(self), self.metadata))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Schema.__hash__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":949
 *         return hash((tuple(self), self.metadata))
 * 
 *     def __sizeof__(self):             # <<<<<<<<<<<<<<
 *         size = 0
 *         if self.metadata:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_16__sizeof__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_15__sizeof__[] = "Schema.__sizeof__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_16__sizeof__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sizeof__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_15__sizeof__(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_15__sizeof__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self) {
  PyObject *__pyx_v_size = NULL;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("__sizeof__", 0);

  /* "pyarrow/types.pxi":950
 * 
 *     def __sizeof__(self):
 *         size = 0             # <<<<<<<<<<<<<<
 *         if self.metadata:
 *             for key, value in self.metadata.items():
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_size = __pyx_int_0;

  /* "pyarrow/types.pxi":951
 *     def __sizeof__(self):
 *         size = 0
 *         if self.metadata:             # <<<<<<<<<<<<<<
 *             for key, value in self.metadata.items():
 *                 size += sys.getsizeof(key)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_metadata); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 951, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 951, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pyarrow/types.pxi":952
 *         size = 0
 *         if self.metadata:
 *             for key, value in self.metadata.items():             # <<<<<<<<<<<<<<
 *                 size += sys.getsizeof(key)
 *                 size += sys.getsizeof(value)
 */
    __pyx_t_3 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_metadata); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 952, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (unlikely(__pyx_t_6 == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
      __PYX_ERR(4, 952, __pyx_L1_error)
    }
    __pyx_t_7 = __Pyx_dict_iterator(__pyx_t_6, 0, __pyx_n_s_items, (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 952, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_7;
    __pyx_t_7 = 0;
    while (1) {
      __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_4, &__pyx_t_3, &__pyx_t_7, &__pyx_t_6, NULL, __pyx_t_5);
      if (unlikely(__pyx_t_8 == 0)) break;
      if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(4, 952, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "pyarrow/types.pxi":953
 *         if self.metadata:
 *             for key, value in self.metadata.items():
 *                 size += sys.getsizeof(key)             # <<<<<<<<<<<<<<
 *                 size += sys.getsizeof(value)
 * 
 */
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_sys); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 953, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_getsizeof); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 953, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
        }
      }
      __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_7, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_key);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 953, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_v_size, __pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 953, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF_SET(__pyx_v_size, __pyx_t_9);
      __pyx_t_9 = 0;

      /* "pyarrow/types.pxi":954
 *             for key, value in self.metadata.items():
 *                 size += sys.getsizeof(key)
 *                 size += sys.getsizeof(value)             # <<<<<<<<<<<<<<
 * 
 *         return size + super(Schema, self).__sizeof__()
 */
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 954, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getsizeof); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 954, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      __pyx_t_9 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_6, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_value);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 954, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_size, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 954, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF_SET(__pyx_v_size, __pyx_t_7);
      __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/types.pxi":951
 *     def __sizeof__(self):
 *         size = 0
 *         if self.metadata:             # <<<<<<<<<<<<<<
 *             for key, value in self.metadata.items():
 *                 size += sys.getsizeof(key)
 */
  }

  /* "pyarrow/types.pxi":956
 *                 size += sys.getsizeof(value)
 * 
 *         return size + super(Schema, self).__sizeof__()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 956, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_7pyarrow_3lib_Schema));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7pyarrow_3lib_Schema));
  PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Schema));
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)__pyx_v_self));
  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_7, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 956, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_sizeof); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 956, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 956, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyNumber_Add(__pyx_v_size, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 956, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":949
 *         return hash((tuple(self), self.metadata))
 * 
 *     def __sizeof__(self):             # <<<<<<<<<<<<<<
 *         size = 0
 *         if self.metadata:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pyarrow.lib.Schema.__sizeof__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_size);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":959
 * 
 *     @property
 *     def pandas_metadata(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return deserialized-from-JSON pandas metadata field (if it exists)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_15pandas_metadata_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_15pandas_metadata_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_15pandas_metadata___get__(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_15pandas_metadata___get__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self) {
  PyObject *__pyx_v_metadata = NULL;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_json = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":963
 *         Return deserialized-from-JSON pandas metadata field (if it exists)
 *         """
 *         metadata = self.metadata             # <<<<<<<<<<<<<<
 *         key = b'pandas'
 *         if metadata is None or key not in metadata:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_metadata); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 963, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_metadata = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":964
 *         """
 *         metadata = self.metadata
 *         key = b'pandas'             # <<<<<<<<<<<<<<
 *         if metadata is None or key not in metadata:
 *             return None
 */
  __Pyx_INCREF(__pyx_n_b_pandas);
  __pyx_v_key = __pyx_n_b_pandas;

  /* "pyarrow/types.pxi":965
 *         metadata = self.metadata
 *         key = b'pandas'
 *         if metadata is None or key not in metadata:             # <<<<<<<<<<<<<<
 *             return None
 * 
 */
  __pyx_t_3 = (__pyx_v_metadata == Py_None);
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_key, __pyx_v_metadata, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(4, 965, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pyarrow/types.pxi":966
 *         key = b'pandas'
 *         if metadata is None or key not in metadata:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *         import json
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/types.pxi":965
 *         metadata = self.metadata
 *         key = b'pandas'
 *         if metadata is None or key not in metadata:             # <<<<<<<<<<<<<<
 *             return None
 * 
 */
  }

  /* "pyarrow/types.pxi":968
 *             return None
 * 
 *         import json             # <<<<<<<<<<<<<<
 *         return json.loads(metadata[key].decode('utf8'))
 * 
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_json, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_json = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":969
 * 
 *         import json
 *         return json.loads(metadata[key].decode('utf8'))             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_json, __pyx_n_s_loads); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 969, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_metadata, __pyx_v_key); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 969, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_decode); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 969, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
    }
  }
  __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, __pyx_n_u_utf8) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_n_u_utf8);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 969, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 969, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":959
 * 
 *     @property
 *     def pandas_metadata(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return deserialized-from-JSON pandas metadata field (if it exists)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow.lib.Schema.pandas_metadata.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_metadata);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_json);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":972
 * 
 *     @property
 *     def names(self):             # <<<<<<<<<<<<<<
 *         """
 *         The schema's field names.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_5names_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_5names_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_5names___get__(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_5names___get__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self) {
  int __pyx_v_i;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":981
 *         """
 *         cdef int i
 *         result = []             # <<<<<<<<<<<<<<
 *         for i in range(self.schema.num_fields()):
 *             name = frombytes(self.schema.field(i).get().name())
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 981, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":982
 *         cdef int i
 *         result = []
 *         for i in range(self.schema.num_fields()):             # <<<<<<<<<<<<<<
 *             name = frombytes(self.schema.field(i).get().name())
 *             result.append(name)
 */
  __pyx_t_2 = __pyx_v_self->schema->num_fields();
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "pyarrow/types.pxi":983
 *         result = []
 *         for i in range(self.schema.num_fields()):
 *             name = frombytes(self.schema.field(i).get().name())             # <<<<<<<<<<<<<<
 *             result.append(name)
 *         return result
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 983, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_self->schema->field(__pyx_v_i).get()->name()); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 983, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 983, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/types.pxi":984
 *         for i in range(self.schema.num_fields()):
 *             name = frombytes(self.schema.field(i).get().name())
 *             result.append(name)             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_name); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(4, 984, __pyx_L1_error)
  }

  /* "pyarrow/types.pxi":985
 *             name = frombytes(self.schema.field(i).get().name())
 *             result.append(name)
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":972
 * 
 *     @property
 *     def names(self):             # <<<<<<<<<<<<<<
 *         """
 *         The schema's field names.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.Schema.names.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":988
 * 
 *     @property
 *     def types(self):             # <<<<<<<<<<<<<<
 *         """
 *         The schema's field types.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_5types_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_5types_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_5types___get__(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_5types___get__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self) {
  PyObject *__pyx_8genexpr1__pyx_v_field = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":996
 *         list of DataType
 *         """
 *         return [field.type for field in self]             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 996, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (likely(PyList_CheckExact(((PyObject *)__pyx_v_self))) || PyTuple_CheckExact(((PyObject *)__pyx_v_self))) {
      __pyx_t_2 = ((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
      __pyx_t_4 = NULL;
    } else {
      __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 996, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 996, __pyx_L5_error)
    }
    for (;;) {
      if (likely(!__pyx_t_4)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(4, 996, __pyx_L5_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 996, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        } else {
          if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(4, 996, __pyx_L5_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 996, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        }
      } else {
        __pyx_t_5 = __pyx_t_4(__pyx_t_2);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(4, 996, __pyx_L5_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_field, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr1__pyx_v_field, __pyx_n_s_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 996, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(4, 996, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_field); __pyx_8genexpr1__pyx_v_field = 0;
    goto __pyx_L8_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_field); __pyx_8genexpr1__pyx_v_field = 0;
    goto __pyx_L1_error;
    __pyx_L8_exit_scope:;
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":988
 * 
 *     @property
 *     def types(self):             # <<<<<<<<<<<<<<
 *         """
 *         The schema's field types.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.Schema.types.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_field);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":999
 * 
 *     @property
 *     def metadata(self):             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_metadata(self.schema.metadata())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_8metadata_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_8metadata_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_8metadata___get__(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_8metadata___get__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":1000
 *     @property
 *     def metadata(self):
 *         return pyarrow_wrap_metadata(self.schema.metadata())             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_metadata(__pyx_v_self->schema->metadata()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":999
 * 
 *     @property
 *     def metadata(self):             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_metadata(self.schema.metadata())
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Schema.metadata.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1002
 *         return pyarrow_wrap_metadata(self.schema.metadata())
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         try:
 *             return self.equals(other)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_18__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_18__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_17__eq__(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self), ((PyObject *)__pyx_v_other));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_17__eq__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("__eq__", 0);

  /* "pyarrow/types.pxi":1003
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except TypeError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "pyarrow/types.pxi":1004
 *     def __eq__(self, other):
 *         try:
 *             return self.equals(other)             # <<<<<<<<<<<<<<
 *         except TypeError:
 *             return NotImplemented
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_equals); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1004, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_other) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_other);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1004, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L7_try_return;

      /* "pyarrow/types.pxi":1003
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except TypeError:
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/types.pxi":1005
 *         try:
 *             return self.equals(other)
 *         except TypeError:             # <<<<<<<<<<<<<<
 *             return NotImplemented
 * 
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("pyarrow.lib.Schema.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(4, 1005, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);

      /* "pyarrow/types.pxi":1006
 *             return self.equals(other)
 *         except TypeError:
 *             return NotImplemented             # <<<<<<<<<<<<<<
 * 
 *     def empty_table(self):
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_builtin_NotImplemented);
      __pyx_r = __pyx_builtin_NotImplemented;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/types.pxi":1003
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except TypeError:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "pyarrow/types.pxi":1002
 *         return pyarrow_wrap_metadata(self.schema.metadata())
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         try:
 *             return self.equals(other)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.Schema.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1008
 *             return NotImplemented
 * 
 *     def empty_table(self):             # <<<<<<<<<<<<<<
 *         """
 *         Provide an empty table according to the schema.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_20empty_table(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_19empty_table[] = "Schema.empty_table(self)\n\n        Provide an empty table according to the schema.\n\n        Returns\n        -------\n        table: pyarrow.Table\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_20empty_table(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("empty_table (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_19empty_table(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_19empty_table(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self) {
  PyObject *__pyx_v_arrays = NULL;
  PyObject *__pyx_v_names = NULL;
  PyObject *__pyx_v_field = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("empty_table", 0);

  /* "pyarrow/types.pxi":1016
 *         table: pyarrow.Table
 *         """
 *         arrays = []             # <<<<<<<<<<<<<<
 *         names = []
 *         for field in self:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1016, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_arrays = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":1017
 *         """
 *         arrays = []
 *         names = []             # <<<<<<<<<<<<<<
 *         for field in self:
 *             arrays.append(array([], type=field.type))
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1017, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_names = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":1018
 *         arrays = []
 *         names = []
 *         for field in self:             # <<<<<<<<<<<<<<
 *             arrays.append(array([], type=field.type))
 *             names.append(field.name)
 */
  if (likely(PyList_CheckExact(((PyObject *)__pyx_v_self))) || PyTuple_CheckExact(((PyObject *)__pyx_v_self))) {
    __pyx_t_1 = ((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1018, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1018, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(4, 1018, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1018, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(4, 1018, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1018, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(4, 1018, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_field, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/types.pxi":1019
 *         names = []
 *         for field in self:
 *             arrays.append(array([], type=field.type))             # <<<<<<<<<<<<<<
 *             names.append(field.name)
 *         return Table.from_arrays(
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1019, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1019, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1019, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1019, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_field, __pyx_n_s_type); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 1019, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_type, __pyx_t_7) < 0) __PYX_ERR(4, 1019, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 1019, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_arrays, __pyx_t_7); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(4, 1019, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "pyarrow/types.pxi":1020
 *         for field in self:
 *             arrays.append(array([], type=field.type))
 *             names.append(field.name)             # <<<<<<<<<<<<<<
 *         return Table.from_arrays(
 *             arrays=arrays,
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_field, __pyx_n_s_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 1020, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_names, __pyx_t_7); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(4, 1020, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "pyarrow/types.pxi":1018
 *         arrays = []
 *         names = []
 *         for field in self:             # <<<<<<<<<<<<<<
 *             arrays.append(array([], type=field.type))
 *             names.append(field.name)
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":1021
 *             arrays.append(array([], type=field.type))
 *             names.append(field.name)
 *         return Table.from_arrays(             # <<<<<<<<<<<<<<
 *             arrays=arrays,
 *             names=names,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_Table), __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyarrow/types.pxi":1022
 *             names.append(field.name)
 *         return Table.from_arrays(
 *             arrays=arrays,             # <<<<<<<<<<<<<<
 *             names=names,
 *             metadata=self.metadata
 */
  __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 1022, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_arrays, __pyx_v_arrays) < 0) __PYX_ERR(4, 1022, __pyx_L1_error)

  /* "pyarrow/types.pxi":1023
 *         return Table.from_arrays(
 *             arrays=arrays,
 *             names=names,             # <<<<<<<<<<<<<<
 *             metadata=self.metadata
 *         )
 */
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_names, __pyx_v_names) < 0) __PYX_ERR(4, 1022, __pyx_L1_error)

  /* "pyarrow/types.pxi":1024
 *             arrays=arrays,
 *             names=names,
 *             metadata=self.metadata             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_metadata); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1024, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_metadata, __pyx_t_5) < 0) __PYX_ERR(4, 1022, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":1021
 *             arrays.append(array([], type=field.type))
 *             names.append(field.name)
 *         return Table.from_arrays(             # <<<<<<<<<<<<<<
 *             arrays=arrays,
 *             names=names,
 */
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1008
 *             return NotImplemented
 * 
 *     def empty_table(self):             # <<<<<<<<<<<<<<
 *         """
 *         Provide an empty table according to the schema.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.Schema.empty_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_arrays);
  __Pyx_XDECREF(__pyx_v_names);
  __Pyx_XDECREF(__pyx_v_field);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1027
 *         )
 * 
 *     def equals(self, Schema other not None, bint check_metadata=True):             # <<<<<<<<<<<<<<
 *         """
 *         Test if this schema is equal to the other
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_22equals(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_21equals[] = "Schema.equals(self, Schema other, bool check_metadata=True)\n\n        Test if this schema is equal to the other\n\n        Parameters\n        ----------\n        other :  pyarrow.Schema\n        check_metadata : bool, default False\n            Key/value metadata must be equal too\n\n        Returns\n        -------\n        is_equal : boolean\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_22equals(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_other = 0;
  int __pyx_v_check_metadata;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("equals (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_check_metadata,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_check_metadata);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "equals") < 0)) __PYX_ERR(4, 1027, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_other = ((struct __pyx_obj_7pyarrow_3lib_Schema *)values[0]);
    if (values[1]) {
      __pyx_v_check_metadata = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_check_metadata == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 1027, __pyx_L3_error)
    } else {
      __pyx_v_check_metadata = ((int)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("equals", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 1027, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Schema.equals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_7pyarrow_3lib_Schema, 0, "other", 0))) __PYX_ERR(4, 1027, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_21equals(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self), __pyx_v_other, __pyx_v_check_metadata);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_21equals(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_other, int __pyx_v_check_metadata) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("equals", 0);

  /* "pyarrow/types.pxi":1041
 *         is_equal : boolean
 *         """
 *         return self.sp_schema.get().Equals(deref(other.schema),             # <<<<<<<<<<<<<<
 *                                            check_metadata)
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/types.pxi":1042
 *         """
 *         return self.sp_schema.get().Equals(deref(other.schema),
 *                                            check_metadata)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->sp_schema.get()->Equals((*__pyx_v_other->schema), __pyx_v_check_metadata)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1041, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1027
 *         )
 * 
 *     def equals(self, Schema other not None, bint check_metadata=True):             # <<<<<<<<<<<<<<
 *         """
 *         Test if this schema is equal to the other
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Schema.equals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1045
 * 
 *     @classmethod
 *     def from_pandas(cls, df, preserve_index=None):             # <<<<<<<<<<<<<<
 *         """
 *         Returns implied schema from dataframe
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_24from_pandas(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_23from_pandas[] = "Schema.from_pandas(type cls, df, preserve_index=None)\n\n        Returns implied schema from dataframe\n\n        Parameters\n        ----------\n        df : pandas.DataFrame\n        preserve_index : bool, default True\n            Whether to store the index as an additional column (or columns, for\n            MultiIndex) in the resulting `Table`.\n            The default of None will store the index as a column, except for\n            RangeIndex which is stored as metadata only. Use\n            ``preserve_index=True`` to force it to be stored as a column.\n\n        Returns\n        -------\n        pyarrow.Schema\n\n        Examples\n        --------\n\n        >>> import pandas as pd\n        >>> import pyarrow as pa\n        >>> df = pd.DataFrame({\n            ...     'int': [1, 2],\n            ...     'str': ['a', 'b']\n            ... })\n        >>> pa.Schema.from_pandas(df)\n        int: int64\n        str: string\n        __index_level_0__: int64\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_24from_pandas(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_df = 0;
  PyObject *__pyx_v_preserve_index = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_pandas (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_df,&__pyx_n_s_preserve_index,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_df)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_preserve_index);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_pandas") < 0)) __PYX_ERR(4, 1045, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_df = values[0];
    __pyx_v_preserve_index = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_pandas", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 1045, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Schema.from_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_23from_pandas(((PyTypeObject*)__pyx_v_cls), __pyx_v_df, __pyx_v_preserve_index);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_23from_pandas(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_df, PyObject *__pyx_v_preserve_index) {
  PyObject *__pyx_v_dataframe_to_types = NULL;
  PyObject *__pyx_v_names = NULL;
  PyObject *__pyx_v_types = NULL;
  PyObject *__pyx_v_metadata = NULL;
  PyObject *__pyx_v_fields = NULL;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_type_ = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("from_pandas", 0);

  /* "pyarrow/types.pxi":1077
 *         __index_level_0__: int64
 *         """
 *         from pyarrow.pandas_compat import dataframe_to_types             # <<<<<<<<<<<<<<
 *         names, types, metadata = dataframe_to_types(
 *             df,
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1077, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_dataframe_to_types);
  __Pyx_GIVEREF(__pyx_n_s_dataframe_to_types);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_dataframe_to_types);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_pyarrow_pandas_compat, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1077, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_dataframe_to_types); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1077, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_dataframe_to_types = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":1078
 *         """
 *         from pyarrow.pandas_compat import dataframe_to_types
 *         names, types, metadata = dataframe_to_types(             # <<<<<<<<<<<<<<
 *             df,
 *             preserve_index=preserve_index
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1078, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_df);
  __Pyx_GIVEREF(__pyx_v_df);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_df);

  /* "pyarrow/types.pxi":1080
 *         names, types, metadata = dataframe_to_types(
 *             df,
 *             preserve_index=preserve_index             # <<<<<<<<<<<<<<
 *         )
 *         fields = []
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1080, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_preserve_index, __pyx_v_preserve_index) < 0) __PYX_ERR(4, 1080, __pyx_L1_error)

  /* "pyarrow/types.pxi":1078
 *         """
 *         from pyarrow.pandas_compat import dataframe_to_types
 *         names, types, metadata = dataframe_to_types(             # <<<<<<<<<<<<<<
 *             df,
 *             preserve_index=preserve_index
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_dataframe_to_types, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1078, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
    PyObject* sequence = __pyx_t_3;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 3)) {
      if (size > 3) __Pyx_RaiseTooManyValuesError(3);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(4, 1078, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 2); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_4);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1078, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1078, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1078, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1078, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 2; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(4, 1078, __pyx_L1_error)
    __pyx_t_6 = NULL;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(4, 1078, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_names = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_types = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_metadata = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pyarrow/types.pxi":1082
 *             preserve_index=preserve_index
 *         )
 *         fields = []             # <<<<<<<<<<<<<<
 *         for name, type_ in zip(names, types):
 *             fields.append(field(name, type_))
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1082, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_fields = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyarrow/types.pxi":1083
 *         )
 *         fields = []
 *         for name, type_ in zip(names, types):             # <<<<<<<<<<<<<<
 *             fields.append(field(name, type_))
 *         return schema(fields, metadata)
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1083, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_names);
  __Pyx_GIVEREF(__pyx_v_names);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_names);
  __Pyx_INCREF(__pyx_v_types);
  __Pyx_GIVEREF(__pyx_v_types);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_types);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1083, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1083, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1083, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(4, 1083, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1083, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(4, 1083, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1083, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_8(__pyx_t_3);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(4, 1083, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
      PyObject* sequence = __pyx_t_4;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(4, 1083, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      #else
      __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1083, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1083, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #endif
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1083, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
      index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L7_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      index = 1; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(4, 1083, __pyx_L1_error)
      __pyx_t_6 = NULL;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L8_unpacking_done;
      __pyx_L7_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(4, 1083, __pyx_L1_error)
      __pyx_L8_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_type_, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/types.pxi":1084
 *         fields = []
 *         for name, type_ in zip(names, types):
 *             fields.append(field(name, type_))             # <<<<<<<<<<<<<<
 *         return schema(fields, metadata)
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_field); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1084, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = NULL;
    __pyx_t_9 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_9 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_name, __pyx_v_type_};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1084, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_name, __pyx_v_type_};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1084, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1084, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__pyx_t_2) {
        __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
      }
      __Pyx_INCREF(__pyx_v_name);
      __Pyx_GIVEREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_9, __pyx_v_name);
      __Pyx_INCREF(__pyx_v_type_);
      __Pyx_GIVEREF(__pyx_v_type_);
      PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_9, __pyx_v_type_);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1084, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_fields, __pyx_t_4); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(4, 1084, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/types.pxi":1083
 *         )
 *         fields = []
 *         for name, type_ in zip(names, types):             # <<<<<<<<<<<<<<
 *             fields.append(field(name, type_))
 *         return schema(fields, metadata)
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/types.pxi":1085
 *         for name, type_ in zip(names, types):
 *             fields.append(field(name, type_))
 *         return schema(fields, metadata)             # <<<<<<<<<<<<<<
 * 
 *     def field(self, i):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_schema); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1085, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_9 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_fields, __pyx_v_metadata};
    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1085, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_fields, __pyx_v_metadata};
    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1085, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1085, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_1) {
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL;
    }
    __Pyx_INCREF(__pyx_v_fields);
    __Pyx_GIVEREF(__pyx_v_fields);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_9, __pyx_v_fields);
    __Pyx_INCREF(__pyx_v_metadata);
    __Pyx_GIVEREF(__pyx_v_metadata);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_9, __pyx_v_metadata);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1085, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1045
 * 
 *     @classmethod
 *     def from_pandas(cls, df, preserve_index=None):             # <<<<<<<<<<<<<<
 *         """
 *         Returns implied schema from dataframe
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.Schema.from_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dataframe_to_types);
  __Pyx_XDECREF(__pyx_v_names);
  __Pyx_XDECREF(__pyx_v_types);
  __Pyx_XDECREF(__pyx_v_metadata);
  __Pyx_XDECREF(__pyx_v_fields);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_type_);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1087
 *         return schema(fields, metadata)
 * 
 *     def field(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Select a field by its column name or numeric index.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_26field(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_25field[] = "Schema.field(self, i)\n\n        Select a field by its column name or numeric index.\n\n        Parameters\n        ----------\n        i : int or string\n\n        Returns\n        -------\n        pyarrow.Field\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_26field(PyObject *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("field (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_25field(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self), ((PyObject *)__pyx_v_i));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_25field(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_v_field_index = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("field", 0);

  /* "pyarrow/types.pxi":1099
 *         pyarrow.Field
 *         """
 *         if isinstance(i, six.string_types):             # <<<<<<<<<<<<<<
 *             field_index = self.get_field_index(i)
 *             if field_index < 0:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_six); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1099, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_string_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1099, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_i, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(4, 1099, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "pyarrow/types.pxi":1100
 *         """
 *         if isinstance(i, six.string_types):
 *             field_index = self.get_field_index(i)             # <<<<<<<<<<<<<<
 *             if field_index < 0:
 *                 raise KeyError("Column {} does not exist in schema".format(i))
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_field_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1100, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v_i) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_i);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1100, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_field_index = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pyarrow/types.pxi":1101
 *         if isinstance(i, six.string_types):
 *             field_index = self.get_field_index(i)
 *             if field_index < 0:             # <<<<<<<<<<<<<<
 *                 raise KeyError("Column {} does not exist in schema".format(i))
 *             else:
 */
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_field_index, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1101, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(4, 1101, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(__pyx_t_4)) {

      /* "pyarrow/types.pxi":1102
 *             field_index = self.get_field_index(i)
 *             if field_index < 0:
 *                 raise KeyError("Column {} does not exist in schema".format(i))             # <<<<<<<<<<<<<<
 *             else:
 *                 return self._field(field_index)
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Column_does_not_exist_in_schema, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1102, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v_i) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_i);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1102, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1102, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(4, 1102, __pyx_L1_error)

      /* "pyarrow/types.pxi":1101
 *         if isinstance(i, six.string_types):
 *             field_index = self.get_field_index(i)
 *             if field_index < 0:             # <<<<<<<<<<<<<<
 *                 raise KeyError("Column {} does not exist in schema".format(i))
 *             else:
 */
    }

    /* "pyarrow/types.pxi":1104
 *                 raise KeyError("Column {} does not exist in schema".format(i))
 *             else:
 *                 return self._field(field_index)             # <<<<<<<<<<<<<<
 *         elif isinstance(i, six.integer_types):
 *             return self._field(i)
 */
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_field_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1104, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_v_field_index) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_field_index);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1104, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    }

    /* "pyarrow/types.pxi":1099
 *         pyarrow.Field
 *         """
 *         if isinstance(i, six.string_types):             # <<<<<<<<<<<<<<
 *             field_index = self.get_field_index(i)
 *             if field_index < 0:
 */
  }

  /* "pyarrow/types.pxi":1105
 *             else:
 *                 return self._field(field_index)
 *         elif isinstance(i, six.integer_types):             # <<<<<<<<<<<<<<
 *             return self._field(i)
 *         else:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_six); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_integer_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = PyObject_IsInstance(__pyx_v_i, __pyx_t_2); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(4, 1105, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (likely(__pyx_t_3)) {

    /* "pyarrow/types.pxi":1106
 *                 return self._field(field_index)
 *         elif isinstance(i, six.integer_types):
 *             return self._field(i)             # <<<<<<<<<<<<<<
 *         else:
 *             raise TypeError("Index must either be string or integer")
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_field_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1106, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v_i) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_i);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1106, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":1105
 *             else:
 *                 return self._field(field_index)
 *         elif isinstance(i, six.integer_types):             # <<<<<<<<<<<<<<
 *             return self._field(i)
 *         else:
 */
  }

  /* "pyarrow/types.pxi":1108
 *             return self._field(i)
 *         else:
 *             raise TypeError("Index must either be string or integer")             # <<<<<<<<<<<<<<
 * 
 *     def _field(self, int i):
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1108, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 1108, __pyx_L1_error)
  }

  /* "pyarrow/types.pxi":1087
 *         return schema(fields, metadata)
 * 
 *     def field(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Select a field by its column name or numeric index.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.Schema.field", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_field_index);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1110
 *             raise TypeError("Index must either be string or integer")
 * 
 *     def _field(self, int i):             # <<<<<<<<<<<<<<
 *         """Select a field by its numeric index."""
 *         cdef int index = <int> _normalize_index(i, self.schema.num_fields())
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_28_field(PyObject *__pyx_v_self, PyObject *__pyx_arg_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_27_field[] = "Schema._field(self, int i)\nSelect a field by its numeric index.";
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_28_field(PyObject *__pyx_v_self, PyObject *__pyx_arg_i) {
  int __pyx_v_i;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_field (wrapper)", 0);
  assert(__pyx_arg_i); {
    __pyx_v_i = __Pyx_PyInt_As_int(__pyx_arg_i); if (unlikely((__pyx_v_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 1110, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Schema._field", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_27_field(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self), ((int)__pyx_v_i));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_27_field(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, int __pyx_v_i) {
  int __pyx_v_index;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("_field", 0);

  /* "pyarrow/types.pxi":1112
 *     def _field(self, int i):
 *         """Select a field by its numeric index."""
 *         cdef int index = <int> _normalize_index(i, self.schema.num_fields())             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_field(self.schema.field(index))
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__normalize_index(__pyx_v_i, __pyx_v_self->schema->num_fields()); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1L))) __PYX_ERR(4, 1112, __pyx_L1_error)
  __pyx_v_index = ((int)__pyx_t_1);

  /* "pyarrow/types.pxi":1113
 *         """Select a field by its numeric index."""
 *         cdef int index = <int> _normalize_index(i, self.schema.num_fields())
 *         return pyarrow_wrap_field(self.schema.field(index))             # <<<<<<<<<<<<<<
 * 
 *     def field_by_name(self, name):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_field(__pyx_v_self->schema->field(__pyx_v_index)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1110
 *             raise TypeError("Index must either be string or integer")
 * 
 *     def _field(self, int i):             # <<<<<<<<<<<<<<
 *         """Select a field by its numeric index."""
 *         cdef int index = <int> _normalize_index(i, self.schema.num_fields())
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Schema._field", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1115
 *         return pyarrow_wrap_field(self.schema.field(index))
 * 
 *     def field_by_name(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         Access a field by its name rather than the column index.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_30field_by_name(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_29field_by_name[] = "Schema.field_by_name(self, name)\n\n        Access a field by its name rather than the column index.\n\n        Parameters\n        ----------\n        name: str\n\n        Returns\n        -------\n        field: pyarrow.Field\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_30field_by_name(PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("field_by_name (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_29field_by_name(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self), ((PyObject *)__pyx_v_name));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_29field_by_name(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, PyObject *__pyx_v_name) {
  std::vector<std::shared_ptr< arrow::Field> >  __pyx_v_results;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("field_by_name", 0);

  /* "pyarrow/types.pxi":1130
 *             vector[shared_ptr[CField]] results
 * 
 *         warnings.warn(             # <<<<<<<<<<<<<<
 *             "The 'field_by_name' method is deprecated, use 'field' instead",
 *             FutureWarning, stacklevel=2)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_warnings); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_warn); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":1132
 *         warnings.warn(
 *             "The 'field_by_name' method is deprecated, use 'field' instead",
 *             FutureWarning, stacklevel=2)             # <<<<<<<<<<<<<<
 * 
 *         results = self.schema.GetAllFieldsByName(tobytes(name))
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_stacklevel, __pyx_int_2) < 0) __PYX_ERR(4, 1132, __pyx_L1_error)

  /* "pyarrow/types.pxi":1130
 *             vector[shared_ptr[CField]] results
 * 
 *         warnings.warn(             # <<<<<<<<<<<<<<
 *             "The 'field_by_name' method is deprecated, use 'field' instead",
 *             FutureWarning, stacklevel=2)
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__24, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/types.pxi":1134
 *             FutureWarning, stacklevel=2)
 * 
 *         results = self.schema.GetAllFieldsByName(tobytes(name))             # <<<<<<<<<<<<<<
 *         if results.size() == 0:
 *             return None
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_name);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1134, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_results = __pyx_v_self->schema->GetAllFieldsByName(__pyx_t_4);

  /* "pyarrow/types.pxi":1135
 * 
 *         results = self.schema.GetAllFieldsByName(tobytes(name))
 *         if results.size() == 0:             # <<<<<<<<<<<<<<
 *             return None
 *         elif results.size() > 1:
 */
  __pyx_t_5 = ((__pyx_v_results.size() == 0) != 0);
  if (__pyx_t_5) {

    /* "pyarrow/types.pxi":1136
 *         results = self.schema.GetAllFieldsByName(tobytes(name))
 *         if results.size() == 0:
 *             return None             # <<<<<<<<<<<<<<
 *         elif results.size() > 1:
 *             warnings.warn("Schema field name corresponds to more "
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/types.pxi":1135
 * 
 *         results = self.schema.GetAllFieldsByName(tobytes(name))
 *         if results.size() == 0:             # <<<<<<<<<<<<<<
 *             return None
 *         elif results.size() > 1:
 */
  }

  /* "pyarrow/types.pxi":1137
 *         if results.size() == 0:
 *             return None
 *         elif results.size() > 1:             # <<<<<<<<<<<<<<
 *             warnings.warn("Schema field name corresponds to more "
 *                           "than one field", UserWarning)
 */
  __pyx_t_5 = ((__pyx_v_results.size() > 1) != 0);
  if (__pyx_t_5) {

    /* "pyarrow/types.pxi":1138
 *             return None
 *         elif results.size() > 1:
 *             warnings.warn("Schema field name corresponds to more "             # <<<<<<<<<<<<<<
 *                           "than one field", UserWarning)
 *             return None
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_warnings); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1138, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_warn); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1138, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "pyarrow/types.pxi":1139
 *         elif results.size() > 1:
 *             warnings.warn("Schema field name corresponds to more "
 *                           "than one field", UserWarning)             # <<<<<<<<<<<<<<
 *             return None
 *         else:
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1138, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "pyarrow/types.pxi":1140
 *             warnings.warn("Schema field name corresponds to more "
 *                           "than one field", UserWarning)
 *             return None             # <<<<<<<<<<<<<<
 *         else:
 *             return pyarrow_wrap_field(results[0])
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/types.pxi":1137
 *         if results.size() == 0:
 *             return None
 *         elif results.size() > 1:             # <<<<<<<<<<<<<<
 *             warnings.warn("Schema field name corresponds to more "
 *                           "than one field", UserWarning)
 */
  }

  /* "pyarrow/types.pxi":1142
 *             return None
 *         else:
 *             return pyarrow_wrap_field(results[0])             # <<<<<<<<<<<<<<
 * 
 *     def get_field_index(self, name):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_field((__pyx_v_results[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1142, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/types.pxi":1115
 *         return pyarrow_wrap_field(self.schema.field(index))
 * 
 *     def field_by_name(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         Access a field by its name rather than the column index.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Schema.field_by_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1144
 *             return pyarrow_wrap_field(results[0])
 * 
 *     def get_field_index(self, name):             # <<<<<<<<<<<<<<
 *         return self.schema.GetFieldIndex(tobytes(name))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_32get_field_index(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_31get_field_index[] = "Schema.get_field_index(self, name)";
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_32get_field_index(PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_field_index (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_31get_field_index(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self), ((PyObject *)__pyx_v_name));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_31get_field_index(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  __Pyx_RefNannySetupContext("get_field_index", 0);

  /* "pyarrow/types.pxi":1145
 * 
 *     def get_field_index(self, name):
 *         return self.schema.GetFieldIndex(tobytes(name))             # <<<<<<<<<<<<<<
 * 
 *     def append(self, Field field):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_name);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1145, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->schema->GetFieldIndex(__pyx_t_4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1144
 *             return pyarrow_wrap_field(results[0])
 * 
 *     def get_field_index(self, name):             # <<<<<<<<<<<<<<
 *         return self.schema.GetFieldIndex(tobytes(name))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Schema.get_field_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1147
 *         return self.schema.GetFieldIndex(tobytes(name))
 * 
 *     def append(self, Field field):             # <<<<<<<<<<<<<<
 *         """
 *         Append a field at the end of the schema.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_34append(PyObject *__pyx_v_self, PyObject *__pyx_v_field); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_33append[] = "Schema.append(self, Field field)\n\n        Append a field at the end of the schema.\n\n        In contrast to Python's ``list.append()`` it does return a new\n        object, leaving the original Schema unmodified.\n\n        Parameters\n        ----------\n        field: Field\n\n        Returns\n        -------\n        schema: Schema\n            New object with appended field.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_34append(PyObject *__pyx_v_self, PyObject *__pyx_v_field) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("append (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field), __pyx_ptype_7pyarrow_3lib_Field, 1, "field", 0))) __PYX_ERR(4, 1147, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_33append(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_v_field));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_33append(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_field) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("append", 0);

  /* "pyarrow/types.pxi":1163
 *             New object with appended field.
 *         """
 *         return self.insert(self.schema.num_fields(), field)             # <<<<<<<<<<<<<<
 * 
 *     def insert(self, int i, Field field):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_insert); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->schema->num_fields()); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, ((PyObject *)__pyx_v_field)};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1163, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, ((PyObject *)__pyx_v_field)};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1163, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1163, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_3);
    __Pyx_INCREF(((PyObject *)__pyx_v_field));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_field));
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__pyx_v_field));
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1163, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1147
 *         return self.schema.GetFieldIndex(tobytes(name))
 * 
 *     def append(self, Field field):             # <<<<<<<<<<<<<<
 *         """
 *         Append a field at the end of the schema.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.Schema.append", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1165
 *         return self.insert(self.schema.num_fields(), field)
 * 
 *     def insert(self, int i, Field field):             # <<<<<<<<<<<<<<
 *         """
 *         Add a field at position i to the schema.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_36insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_35insert[] = "Schema.insert(self, int i, Field field)\n\n        Add a field at position i to the schema.\n\n        Parameters\n        ----------\n        i: int\n        field: Field\n\n        Returns\n        -------\n        schema: Schema\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_36insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_i;
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_field = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_i,&__pyx_n_s_field,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, 1); __PYX_ERR(4, 1165, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "insert") < 0)) __PYX_ERR(4, 1165, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_i = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 1165, __pyx_L3_error)
    __pyx_v_field = ((struct __pyx_obj_7pyarrow_3lib_Field *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 1165, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Schema.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field), __pyx_ptype_7pyarrow_3lib_Field, 1, "field", 0))) __PYX_ERR(4, 1165, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_35insert(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self), __pyx_v_i, __pyx_v_field);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_35insert(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, int __pyx_v_i, struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_field) {
  std::shared_ptr< arrow::Schema>  __pyx_v_new_schema;
  std::shared_ptr< arrow::Field>  __pyx_v_c_field;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr< arrow::Field>  __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("insert", 0);

  /* "pyarrow/types.pxi":1182
 *             shared_ptr[CField] c_field
 * 
 *         c_field = field.sp_field             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_t_1 = __pyx_v_field->sp_field;
  __pyx_v_c_field = __pyx_t_1;

  /* "pyarrow/types.pxi":1184
 *         c_field = field.sp_field
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.schema.AddField(i, c_field, &new_schema))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/types.pxi":1185
 * 
 *         with nogil:
 *             check_status(self.schema.AddField(i, c_field, &new_schema))             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_schema(new_schema)
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->schema->AddField(__pyx_v_i, __pyx_v_c_field, (&__pyx_v_new_schema))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(4, 1185, __pyx_L4_error)
      }

      /* "pyarrow/types.pxi":1184
 *         c_field = field.sp_field
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.schema.AddField(i, c_field, &new_schema))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/types.pxi":1187
 *             check_status(self.schema.AddField(i, c_field, &new_schema))
 * 
 *         return pyarrow_wrap_schema(new_schema)             # <<<<<<<<<<<<<<
 * 
 *     def remove(self, int i):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(__pyx_v_new_schema); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1165
 *         return self.insert(self.schema.num_fields(), field)
 * 
 *     def insert(self, int i, Field field):             # <<<<<<<<<<<<<<
 *         """
 *         Add a field at position i to the schema.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Schema.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1189
 *         return pyarrow_wrap_schema(new_schema)
 * 
 *     def remove(self, int i):             # <<<<<<<<<<<<<<
 *         """
 *         Remove the field at index i from the schema.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_38remove(PyObject *__pyx_v_self, PyObject *__pyx_arg_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_37remove[] = "Schema.remove(self, int i)\n\n        Remove the field at index i from the schema.\n\n        Parameters\n        ----------\n        i: int\n\n        Returns\n        -------\n        schema: Schema\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_38remove(PyObject *__pyx_v_self, PyObject *__pyx_arg_i) {
  int __pyx_v_i;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("remove (wrapper)", 0);
  assert(__pyx_arg_i); {
    __pyx_v_i = __Pyx_PyInt_As_int(__pyx_arg_i); if (unlikely((__pyx_v_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 1189, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Schema.remove", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_37remove(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self), ((int)__pyx_v_i));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_37remove(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, int __pyx_v_i) {
  std::shared_ptr< arrow::Schema>  __pyx_v_new_schema;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("remove", 0);

  /* "pyarrow/types.pxi":1203
 *         cdef shared_ptr[CSchema] new_schema
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.schema.RemoveField(i, &new_schema))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/types.pxi":1204
 * 
 *         with nogil:
 *             check_status(self.schema.RemoveField(i, &new_schema))             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_schema(new_schema)
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->schema->RemoveField(__pyx_v_i, (&__pyx_v_new_schema))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 1204, __pyx_L4_error)
      }

      /* "pyarrow/types.pxi":1203
 *         cdef shared_ptr[CSchema] new_schema
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.schema.RemoveField(i, &new_schema))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/types.pxi":1206
 *             check_status(self.schema.RemoveField(i, &new_schema))
 * 
 *         return pyarrow_wrap_schema(new_schema)             # <<<<<<<<<<<<<<
 * 
 *     def set(self, int i, Field field):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(__pyx_v_new_schema); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1189
 *         return pyarrow_wrap_schema(new_schema)
 * 
 *     def remove(self, int i):             # <<<<<<<<<<<<<<
 *         """
 *         Remove the field at index i from the schema.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Schema.remove", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1208
 *         return pyarrow_wrap_schema(new_schema)
 * 
 *     def set(self, int i, Field field):             # <<<<<<<<<<<<<<
 *         """
 *         Replace a field at position i in the schema.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_40set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_39set[] = "Schema.set(self, int i, Field field)\n\n        Replace a field at position i in the schema.\n\n        Parameters\n        ----------\n        i: int\n        field: Field\n\n        Returns\n        -------\n        schema: Schema\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_40set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_i;
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_field = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_i,&__pyx_n_s_field,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, 1); __PYX_ERR(4, 1208, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set") < 0)) __PYX_ERR(4, 1208, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_i = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 1208, __pyx_L3_error)
    __pyx_v_field = ((struct __pyx_obj_7pyarrow_3lib_Field *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 1208, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Schema.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field), __pyx_ptype_7pyarrow_3lib_Field, 1, "field", 0))) __PYX_ERR(4, 1208, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_39set(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self), __pyx_v_i, __pyx_v_field);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_39set(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, int __pyx_v_i, struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_field) {
  std::shared_ptr< arrow::Schema>  __pyx_v_new_schema;
  std::shared_ptr< arrow::Field>  __pyx_v_c_field;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr< arrow::Field>  __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("set", 0);

  /* "pyarrow/types.pxi":1225
 *             shared_ptr[CField] c_field
 * 
 *         c_field = field.sp_field             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_t_1 = __pyx_v_field->sp_field;
  __pyx_v_c_field = __pyx_t_1;

  /* "pyarrow/types.pxi":1227
 *         c_field = field.sp_field
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.schema.SetField(i, c_field, &new_schema))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/types.pxi":1228
 * 
 *         with nogil:
 *             check_status(self.schema.SetField(i, c_field, &new_schema))             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_schema(new_schema)
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->schema->SetField(__pyx_v_i, __pyx_v_c_field, (&__pyx_v_new_schema))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(4, 1228, __pyx_L4_error)
      }

      /* "pyarrow/types.pxi":1227
 *         c_field = field.sp_field
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.schema.SetField(i, c_field, &new_schema))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/types.pxi":1230
 *             check_status(self.schema.SetField(i, c_field, &new_schema))
 * 
 *         return pyarrow_wrap_schema(new_schema)             # <<<<<<<<<<<<<<
 * 
 *     def add_metadata(self, metadata):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(__pyx_v_new_schema); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1208
 *         return pyarrow_wrap_schema(new_schema)
 * 
 *     def set(self, int i, Field field):             # <<<<<<<<<<<<<<
 *         """
 *         Replace a field at position i in the schema.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Schema.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1232
 *         return pyarrow_wrap_schema(new_schema)
 * 
 *     def add_metadata(self, metadata):             # <<<<<<<<<<<<<<
 *         warnings.warn("The 'add_metadata' method is deprecated, use "
 *                       "'with_metadata' instead", FutureWarning, stacklevel=2)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_42add_metadata(PyObject *__pyx_v_self, PyObject *__pyx_v_metadata); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_41add_metadata[] = "Schema.add_metadata(self, metadata)";
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_42add_metadata(PyObject *__pyx_v_self, PyObject *__pyx_v_metadata) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_metadata (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_41add_metadata(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self), ((PyObject *)__pyx_v_metadata));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_41add_metadata(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, PyObject *__pyx_v_metadata) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("add_metadata", 0);

  /* "pyarrow/types.pxi":1233
 * 
 *     def add_metadata(self, metadata):
 *         warnings.warn("The 'add_metadata' method is deprecated, use "             # <<<<<<<<<<<<<<
 *                       "'with_metadata' instead", FutureWarning, stacklevel=2)
 *         return self.with_metadata(metadata)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_warnings); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_warn); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":1234
 *     def add_metadata(self, metadata):
 *         warnings.warn("The 'add_metadata' method is deprecated, use "
 *                       "'with_metadata' instead", FutureWarning, stacklevel=2)             # <<<<<<<<<<<<<<
 *         return self.with_metadata(metadata)
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_stacklevel, __pyx_int_2) < 0) __PYX_ERR(4, 1234, __pyx_L1_error)

  /* "pyarrow/types.pxi":1233
 * 
 *     def add_metadata(self, metadata):
 *         warnings.warn("The 'add_metadata' method is deprecated, use "             # <<<<<<<<<<<<<<
 *                       "'with_metadata' instead", FutureWarning, stacklevel=2)
 *         return self.with_metadata(metadata)
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__26, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/types.pxi":1235
 *         warnings.warn("The 'add_metadata' method is deprecated, use "
 *                       "'with_metadata' instead", FutureWarning, stacklevel=2)
 *         return self.with_metadata(metadata)             # <<<<<<<<<<<<<<
 * 
 *     def with_metadata(self, metadata):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_with_metadata); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_v_metadata) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_metadata);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1232
 *         return pyarrow_wrap_schema(new_schema)
 * 
 *     def add_metadata(self, metadata):             # <<<<<<<<<<<<<<
 *         warnings.warn("The 'add_metadata' method is deprecated, use "
 *                       "'with_metadata' instead", FutureWarning, stacklevel=2)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Schema.add_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1237
 *         return self.with_metadata(metadata)
 * 
 *     def with_metadata(self, metadata):             # <<<<<<<<<<<<<<
 *         """
 *         Add metadata as dict of string keys and values to Schema
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_44with_metadata(PyObject *__pyx_v_self, PyObject *__pyx_v_metadata); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_43with_metadata[] = "Schema.with_metadata(self, metadata)\n\n        Add metadata as dict of string keys and values to Schema\n\n        Parameters\n        ----------\n        metadata : dict\n            Keys and values must be string-like / coercible to bytes\n\n        Returns\n        -------\n        schema : pyarrow.Schema\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_44with_metadata(PyObject *__pyx_v_self, PyObject *__pyx_v_metadata) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("with_metadata (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_43with_metadata(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self), ((PyObject *)__pyx_v_metadata));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_43with_metadata(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, PyObject *__pyx_v_metadata) {
  std::shared_ptr< arrow::KeyValueMetadata>  __pyx_v_c_meta;
  std::shared_ptr< arrow::Schema>  __pyx_v_c_schema;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("with_metadata", 0);

  /* "pyarrow/types.pxi":1254
 *             shared_ptr[CSchema] c_schema
 * 
 *         if not isinstance(metadata, dict):             # <<<<<<<<<<<<<<
 *             raise TypeError('Metadata must be an instance of dict')
 * 
 */
  __pyx_t_1 = PyDict_Check(__pyx_v_metadata); 
  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/types.pxi":1255
 * 
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')             # <<<<<<<<<<<<<<
 * 
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1255, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(4, 1255, __pyx_L1_error)

    /* "pyarrow/types.pxi":1254
 *             shared_ptr[CSchema] c_schema
 * 
 *         if not isinstance(metadata, dict):             # <<<<<<<<<<<<<<
 *             raise TypeError('Metadata must be an instance of dict')
 * 
 */
  }

  /* "pyarrow/types.pxi":1257
 *             raise TypeError('Metadata must be an instance of dict')
 * 
 *         c_meta = pyarrow_unwrap_metadata(metadata)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             c_schema = self.schema.WithMetadata(c_meta)
 */
  __pyx_v_c_meta = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_metadata(__pyx_v_metadata);

  /* "pyarrow/types.pxi":1258
 * 
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             c_schema = self.schema.WithMetadata(c_meta)
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/types.pxi":1259
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 *         with nogil:
 *             c_schema = self.schema.WithMetadata(c_meta)             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_schema(c_schema)
 */
        __pyx_v_c_schema = __pyx_v_self->schema->WithMetadata(__pyx_v_c_meta);
      }

      /* "pyarrow/types.pxi":1258
 * 
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             c_schema = self.schema.WithMetadata(c_meta)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L6;
        }
        __pyx_L6:;
      }
  }

  /* "pyarrow/types.pxi":1261
 *             c_schema = self.schema.WithMetadata(c_meta)
 * 
 *         return pyarrow_wrap_schema(c_schema)             # <<<<<<<<<<<<<<
 * 
 *     def serialize(self, DictionaryMemo dictionary_memo=None, memory_pool=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(__pyx_v_c_schema); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1237
 *         return self.with_metadata(metadata)
 * 
 *     def with_metadata(self, metadata):             # <<<<<<<<<<<<<<
 *         """
 *         Add metadata as dict of string keys and values to Schema
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Schema.with_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1263
 *         return pyarrow_wrap_schema(c_schema)
 * 
 *     def serialize(self, DictionaryMemo dictionary_memo=None, memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Write Schema to Buffer as encapsulated IPC message
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_46serialize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_45serialize[] = "Schema.serialize(self, DictionaryMemo dictionary_memo=None, memory_pool=None)\n\n        Write Schema to Buffer as encapsulated IPC message\n\n        Parameters\n        ----------\n        memory_pool : MemoryPool, default None\n            Uses default memory pool if not specified\n        dictionary_memo : DictionaryMemo, optional\n            If schema contains dictionaries, must pass a\n            DictionaryMemo to be able to deserialize RecordBatch\n            objects\n\n        Returns\n        -------\n        serialized : Buffer\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_46serialize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *__pyx_v_dictionary_memo = 0;
  PyObject *__pyx_v_memory_pool = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("serialize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dictionary_memo,&__pyx_n_s_memory_pool,0};
    PyObject* values[2] = {0,0};
    values[0] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *)Py_None);
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dictionary_memo);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "serialize") < 0)) __PYX_ERR(4, 1263, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_dictionary_memo = ((struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *)values[0]);
    __pyx_v_memory_pool = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("serialize", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 1263, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Schema.serialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dictionary_memo), __pyx_ptype_7pyarrow_3lib_DictionaryMemo, 1, "dictionary_memo", 0))) __PYX_ERR(4, 1263, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_45serialize(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self), __pyx_v_dictionary_memo, __pyx_v_memory_pool);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_45serialize(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *__pyx_v_dictionary_memo, PyObject *__pyx_v_memory_pool) {
  std::shared_ptr< arrow::Buffer>  __pyx_v_buffer;
   arrow::MemoryPool *__pyx_v_pool;
   arrow::ipc::DictionaryMemo __pyx_v_temp_memo;
   arrow::ipc::DictionaryMemo *__pyx_v_arg_dict_memo;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
   arrow::ipc::DictionaryMemo *__pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("serialize", 0);

  /* "pyarrow/types.pxi":1282
 *         cdef:
 *             shared_ptr[CBuffer] buffer
 *             CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)             # <<<<<<<<<<<<<<
 *             CDictionaryMemo temp_memo
 *             CDictionaryMemo* arg_dict_memo
 */
  if (!(likely(((__pyx_v_memory_pool) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_memory_pool, __pyx_ptype_7pyarrow_3lib_MemoryPool))))) __PYX_ERR(4, 1282, __pyx_L1_error)
  __pyx_v_pool = __pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_v_memory_pool));

  /* "pyarrow/types.pxi":1286
 *             CDictionaryMemo* arg_dict_memo
 * 
 *         if dictionary_memo is not None:             # <<<<<<<<<<<<<<
 *             arg_dict_memo = dictionary_memo.memo
 *         else:
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_dictionary_memo) != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/types.pxi":1287
 * 
 *         if dictionary_memo is not None:
 *             arg_dict_memo = dictionary_memo.memo             # <<<<<<<<<<<<<<
 *         else:
 *             arg_dict_memo = &temp_memo
 */
    __pyx_t_3 = __pyx_v_dictionary_memo->memo;
    __pyx_v_arg_dict_memo = __pyx_t_3;

    /* "pyarrow/types.pxi":1286
 *             CDictionaryMemo* arg_dict_memo
 * 
 *         if dictionary_memo is not None:             # <<<<<<<<<<<<<<
 *             arg_dict_memo = dictionary_memo.memo
 *         else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":1289
 *             arg_dict_memo = dictionary_memo.memo
 *         else:
 *             arg_dict_memo = &temp_memo             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  /*else*/ {
    __pyx_v_arg_dict_memo = (&__pyx_v_temp_memo);
  }
  __pyx_L3:;

  /* "pyarrow/types.pxi":1291
 *             arg_dict_memo = &temp_memo
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(SerializeSchema(deref(self.schema), arg_dict_memo,
 *                                          pool, &buffer))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/types.pxi":1292
 * 
 *         with nogil:
 *             check_status(SerializeSchema(deref(self.schema), arg_dict_memo,             # <<<<<<<<<<<<<<
 *                                          pool, &buffer))
 *         return pyarrow_wrap_buffer(buffer)
 */
        __pyx_t_4 = __pyx_f_7pyarrow_3lib_check_status(arrow::ipc::SerializeSchema((*__pyx_v_self->schema), __pyx_v_arg_dict_memo, __pyx_v_pool, (&__pyx_v_buffer))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(4, 1292, __pyx_L5_error)
      }

      /* "pyarrow/types.pxi":1291
 *             arg_dict_memo = &temp_memo
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(SerializeSchema(deref(self.schema), arg_dict_memo,
 *                                          pool, &buffer))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L6;
        }
        __pyx_L5_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L6:;
      }
  }

  /* "pyarrow/types.pxi":1294
 *             check_status(SerializeSchema(deref(self.schema), arg_dict_memo,
 *                                          pool, &buffer))
 *         return pyarrow_wrap_buffer(buffer)             # <<<<<<<<<<<<<<
 * 
 *     def remove_metadata(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_buffer); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1263
 *         return pyarrow_wrap_schema(c_schema)
 * 
 *     def serialize(self, DictionaryMemo dictionary_memo=None, memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Write Schema to Buffer as encapsulated IPC message
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.Schema.serialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1296
 *         return pyarrow_wrap_buffer(buffer)
 * 
 *     def remove_metadata(self):             # <<<<<<<<<<<<<<
 *         """
 *         Create new schema without metadata, if any
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_48remove_metadata(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_47remove_metadata[] = "Schema.remove_metadata(self)\n\n        Create new schema without metadata, if any\n\n        Returns\n        -------\n        schema : pyarrow.Schema\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_48remove_metadata(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("remove_metadata (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_47remove_metadata(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_47remove_metadata(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self) {
  std::shared_ptr< arrow::Schema>  __pyx_v_new_schema;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("remove_metadata", 0);

  /* "pyarrow/types.pxi":1305
 *         """
 *         cdef shared_ptr[CSchema] new_schema
 *         with nogil:             # <<<<<<<<<<<<<<
 *             new_schema = self.schema.RemoveMetadata()
 *         return pyarrow_wrap_schema(new_schema)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/types.pxi":1306
 *         cdef shared_ptr[CSchema] new_schema
 *         with nogil:
 *             new_schema = self.schema.RemoveMetadata()             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_schema(new_schema)
 * 
 */
        __pyx_v_new_schema = __pyx_v_self->schema->RemoveMetadata();
      }

      /* "pyarrow/types.pxi":1305
 *         """
 *         cdef shared_ptr[CSchema] new_schema
 *         with nogil:             # <<<<<<<<<<<<<<
 *             new_schema = self.schema.RemoveMetadata()
 *         return pyarrow_wrap_schema(new_schema)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/types.pxi":1307
 *         with nogil:
 *             new_schema = self.schema.RemoveMetadata()
 *         return pyarrow_wrap_schema(new_schema)             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(__pyx_v_new_schema); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1296
 *         return pyarrow_wrap_buffer(buffer)
 * 
 *     def remove_metadata(self):             # <<<<<<<<<<<<<<
 *         """
 *         Create new schema without metadata, if any
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Schema.remove_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1309
 *         return pyarrow_wrap_schema(new_schema)
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             c_string result
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_50__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_50__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_49__str__(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_49__str__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self) {
  std::string __pyx_v_result;
  PyObject *__pyx_v_printed = NULL;
  PyObject *__pyx_v_pprint = NULL;
  PyObject *__pyx_v_metadata_formatted = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "pyarrow/types.pxi":1313
 *             c_string result
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(
 *                 PrettyPrint(
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/types.pxi":1314
 * 
 *         with nogil:
 *             check_status(             # <<<<<<<<<<<<<<
 *                 PrettyPrint(
 *                     deref(self.schema),
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::PrettyPrint((*__pyx_v_self->schema), arrow::PrettyPrintOptions(0), (&__pyx_v_result))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 1314, __pyx_L4_error)
      }

      /* "pyarrow/types.pxi":1313
 *             c_string result
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(
 *                 PrettyPrint(
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/types.pxi":1322
 *             )
 * 
 *         printed = frombytes(result)             # <<<<<<<<<<<<<<
 *         if self.metadata is not None:
 *             import pprint
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_printed = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":1323
 * 
 *         printed = frombytes(result)
 *         if self.metadata is not None:             # <<<<<<<<<<<<<<
 *             import pprint
 *             metadata_formatted = pprint.pformat(self.metadata)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_metadata); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = (__pyx_t_2 != Py_None);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "pyarrow/types.pxi":1324
 *         printed = frombytes(result)
 *         if self.metadata is not None:
 *             import pprint             # <<<<<<<<<<<<<<
 *             metadata_formatted = pprint.pformat(self.metadata)
 *             printed += '\nmetadata\n--------\n' + metadata_formatted
 */
    __pyx_t_2 = __Pyx_Import(__pyx_n_s_pprint, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_pprint = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pyarrow/types.pxi":1325
 *         if self.metadata is not None:
 *             import pprint
 *             metadata_formatted = pprint.pformat(self.metadata)             # <<<<<<<<<<<<<<
 *             printed += '\nmetadata\n--------\n' + metadata_formatted
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_pprint, __pyx_n_s_pformat); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_metadata); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_metadata_formatted = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pyarrow/types.pxi":1326
 *             import pprint
 *             metadata_formatted = pprint.pformat(self.metadata)
 *             printed += '\nmetadata\n--------\n' + metadata_formatted             # <<<<<<<<<<<<<<
 * 
 *         return printed
 */
    __pyx_t_2 = PyNumber_Add(__pyx_kp_u_metadata_2, __pyx_v_metadata_formatted); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1326, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_printed, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1326, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_printed, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/types.pxi":1323
 * 
 *         printed = frombytes(result)
 *         if self.metadata is not None:             # <<<<<<<<<<<<<<
 *             import pprint
 *             metadata_formatted = pprint.pformat(self.metadata)
 */
  }

  /* "pyarrow/types.pxi":1328
 *             printed += '\nmetadata\n--------\n' + metadata_formatted
 * 
 *         return printed             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_printed);
  __pyx_r = __pyx_v_printed;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1309
 *         return pyarrow_wrap_schema(new_schema)
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             c_string result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.Schema.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_printed);
  __Pyx_XDECREF(__pyx_v_pprint);
  __Pyx_XDECREF(__pyx_v_metadata_formatted);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1330
 *         return printed
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return self.__str__()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_52__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_52__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_51__repr__(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_51__repr__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pyarrow/types.pxi":1331
 * 
 *     def __repr__(self):
 *         return self.__str__()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_str); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1330
 *         return printed
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return self.__str__()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Schema.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1337
 * 
 * 
 * cdef DataType primitive_type(Type type):             # <<<<<<<<<<<<<<
 *     if type in _type_cache:
 *         return _type_cache[type]
 */

static struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_f_7pyarrow_3lib_primitive_type(enum  arrow::Type::type __pyx_v_type) {
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_out = 0;
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("primitive_type", 0);

  /* "pyarrow/types.pxi":1338
 * 
 * cdef DataType primitive_type(Type type):
 *     if type in _type_cache:             # <<<<<<<<<<<<<<
 *         return _type_cache[type]
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type(__pyx_v_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(__pyx_v_7pyarrow_3lib__type_cache == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(4, 1338, __pyx_L1_error)
  }
  __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_t_1, __pyx_v_7pyarrow_3lib__type_cache, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 1338, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/types.pxi":1339
 * cdef DataType primitive_type(Type type):
 *     if type in _type_cache:
 *         return _type_cache[type]             # <<<<<<<<<<<<<<
 * 
 *     cdef DataType out = DataType.__new__(DataType)
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    if (unlikely(__pyx_v_7pyarrow_3lib__type_cache == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(4, 1339, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type(__pyx_v_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1339, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_7pyarrow_3lib__type_cache, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1339, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(4, 1339, __pyx_L1_error)
    __pyx_r = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":1338
 * 
 * cdef DataType primitive_type(Type type):
 *     if type in _type_cache:             # <<<<<<<<<<<<<<
 *         return _type_cache[type]
 * 
 */
  }

  /* "pyarrow/types.pxi":1341
 *         return _type_cache[type]
 * 
 *     cdef DataType out = DataType.__new__(DataType)             # <<<<<<<<<<<<<<
 *     out.init(GetPrimitiveType(type))
 * 
 */
  __pyx_t_4 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_DataType(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_DataType), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1341, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyarrow/types.pxi":1342
 * 
 *     cdef DataType out = DataType.__new__(DataType)
 *     out.init(GetPrimitiveType(type))             # <<<<<<<<<<<<<<
 * 
 *     _type_cache[type] = out
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_DataType *)__pyx_v_out->__pyx_vtab)->init(__pyx_v_out, arrow::py::GetPrimitiveType(__pyx_v_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1342, __pyx_L1_error)

  /* "pyarrow/types.pxi":1344
 *     out.init(GetPrimitiveType(type))
 * 
 *     _type_cache[type] = out             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
  if (unlikely(__pyx_v_7pyarrow_3lib__type_cache == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 1344, __pyx_L1_error)
  }
  __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type(__pyx_v_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (unlikely(PyDict_SetItem(__pyx_v_7pyarrow_3lib__type_cache, __pyx_t_4, ((PyObject *)__pyx_v_out)) < 0)) __PYX_ERR(4, 1344, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/types.pxi":1345
 * 
 *     _type_cache[type] = out
 *     return out             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1337
 * 
 * 
 * cdef DataType primitive_type(Type type):             # <<<<<<<<<<<<<<
 *     if type in _type_cache:
 *         return _type_cache[type]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.primitive_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1352
 * 
 * 
 * def field(name, type, bint nullable=True, metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create a pyarrow.Field instance
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_25field(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_24field[] = "field(name, type, bool nullable=True, metadata=None)\n\n    Create a pyarrow.Field instance\n\n    Parameters\n    ----------\n    name : string or bytes\n    type : pyarrow.DataType\n    nullable : boolean, default True\n    metadata : dict, default None\n        Keys and values must be coercible to bytes\n\n    Returns\n    -------\n    field : pyarrow.Field\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_25field = {"field", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_25field, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_24field};
static PyObject *__pyx_pw_7pyarrow_3lib_25field(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_type = 0;
  int __pyx_v_nullable;
  PyObject *__pyx_v_metadata = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("field (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_type,&__pyx_n_s_nullable,&__pyx_n_s_metadata,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("field", 0, 2, 4, 1); __PYX_ERR(4, 1352, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nullable);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_metadata);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "field") < 0)) __PYX_ERR(4, 1352, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_name = values[0];
    __pyx_v_type = values[1];
    if (values[2]) {
      __pyx_v_nullable = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_nullable == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 1352, __pyx_L3_error)
    } else {
      __pyx_v_nullable = ((int)1);
    }
    __pyx_v_metadata = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("field", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 1352, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.field", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_24field(__pyx_self, __pyx_v_name, __pyx_v_type, __pyx_v_nullable, __pyx_v_metadata);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_24field(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name, PyObject *__pyx_v_type, int __pyx_v_nullable, PyObject *__pyx_v_metadata) {
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_result = 0;
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v__type = 0;
  std::shared_ptr< arrow::KeyValueMetadata>  __pyx_v_c_meta;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7pyarrow_3lib_ensure_type __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  std::string __pyx_t_7;
  __Pyx_RefNannySetupContext("field", 0);

  /* "pyarrow/types.pxi":1369
 *     """
 *     cdef:
 *         Field result = Field.__new__(Field)             # <<<<<<<<<<<<<<
 *         DataType _type = ensure_type(type, allow_none=False)
 *         shared_ptr[CKeyValueMetadata] c_meta
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_Field(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_Field), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1369, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":1370
 *     cdef:
 *         Field result = Field.__new__(Field)
 *         DataType _type = ensure_type(type, allow_none=False)             # <<<<<<<<<<<<<<
 *         shared_ptr[CKeyValueMetadata] c_meta
 * 
 */
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.allow_none = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_ensure_type(__pyx_v_type, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":1373
 *         shared_ptr[CKeyValueMetadata] c_meta
 * 
 *     if metadata is not None:             # <<<<<<<<<<<<<<
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')
 */
  __pyx_t_3 = (__pyx_v_metadata != Py_None);
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "pyarrow/types.pxi":1374
 * 
 *     if metadata is not None:
 *         if not isinstance(metadata, dict):             # <<<<<<<<<<<<<<
 *             raise TypeError('Metadata must be an instance of dict')
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 */
    __pyx_t_4 = PyDict_Check(__pyx_v_metadata); 
    __pyx_t_3 = ((!(__pyx_t_4 != 0)) != 0);
    if (unlikely(__pyx_t_3)) {

      /* "pyarrow/types.pxi":1375
 *     if metadata is not None:
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')             # <<<<<<<<<<<<<<
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 * 
 */
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1375, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(4, 1375, __pyx_L1_error)

      /* "pyarrow/types.pxi":1374
 * 
 *     if metadata is not None:
 *         if not isinstance(metadata, dict):             # <<<<<<<<<<<<<<
 *             raise TypeError('Metadata must be an instance of dict')
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 */
    }

    /* "pyarrow/types.pxi":1376
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')
 *         c_meta = pyarrow_unwrap_metadata(metadata)             # <<<<<<<<<<<<<<
 * 
 *     result.sp_field.reset(
 */
    __pyx_v_c_meta = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_metadata(__pyx_v_metadata);

    /* "pyarrow/types.pxi":1373
 *         shared_ptr[CKeyValueMetadata] c_meta
 * 
 *     if metadata is not None:             # <<<<<<<<<<<<<<
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')
 */
  }

  /* "pyarrow/types.pxi":1379
 * 
 *     result.sp_field.reset(
 *         new CField(tobytes(name), _type.sp_type, nullable, c_meta)             # <<<<<<<<<<<<<<
 *     )
 *     result.field = result.sp_field.get()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_name);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1379, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":1378
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 * 
 *     result.sp_field.reset(             # <<<<<<<<<<<<<<
 *         new CField(tobytes(name), _type.sp_type, nullable, c_meta)
 *     )
 */
  __pyx_v_result->sp_field.reset(new  arrow::Field(__pyx_t_7, __pyx_v__type->sp_type, __pyx_v_nullable, __pyx_v_c_meta));

  /* "pyarrow/types.pxi":1381
 *         new CField(tobytes(name), _type.sp_type, nullable, c_meta)
 *     )
 *     result.field = result.sp_field.get()             # <<<<<<<<<<<<<<
 *     result.type = _type
 * 
 */
  __pyx_v_result->field = __pyx_v_result->sp_field.get();

  /* "pyarrow/types.pxi":1382
 *     )
 *     result.field = result.sp_field.get()
 *     result.type = _type             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __Pyx_INCREF(((PyObject *)__pyx_v__type));
  __Pyx_GIVEREF(((PyObject *)__pyx_v__type));
  __Pyx_GOTREF(__pyx_v_result->type);
  __Pyx_DECREF(((PyObject *)__pyx_v_result->type));
  __pyx_v_result->type = __pyx_v__type;

  /* "pyarrow/types.pxi":1384
 *     result.type = _type
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1352
 * 
 * 
 * def field(name, type, bint nullable=True, metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create a pyarrow.Field instance
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.field", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF((PyObject *)__pyx_v__type);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1401
 * 
 * 
 * def null():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of null type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_27null(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_26null[] = "null()\n\n    Create instance of null type\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_27null = {"null", (PyCFunction)__pyx_pw_7pyarrow_3lib_27null, METH_NOARGS, __pyx_doc_7pyarrow_3lib_26null};
static PyObject *__pyx_pw_7pyarrow_3lib_27null(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("null (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_26null(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_26null(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("null", 0);

  /* "pyarrow/types.pxi":1405
 *     Create instance of null type
 *     """
 *     return primitive_type(_Type_NA)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::NA)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1401
 * 
 * 
 * def null():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of null type
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.null", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1408
 * 
 * 
 * def bool_():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of boolean type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_29bool_(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_28bool_[] = "bool_()\n\n    Create instance of boolean type\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_29bool_ = {"bool_", (PyCFunction)__pyx_pw_7pyarrow_3lib_29bool_, METH_NOARGS, __pyx_doc_7pyarrow_3lib_28bool_};
static PyObject *__pyx_pw_7pyarrow_3lib_29bool_(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bool_ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_28bool_(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_28bool_(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("bool_", 0);

  /* "pyarrow/types.pxi":1412
 *     Create instance of boolean type
 *     """
 *     return primitive_type(_Type_BOOL)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::BOOL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1408
 * 
 * 
 * def bool_():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of boolean type
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.bool_", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1415
 * 
 * 
 * def uint8():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned int8 type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_31uint8(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_30uint8[] = "uint8()\n\n    Create instance of unsigned int8 type\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_31uint8 = {"uint8", (PyCFunction)__pyx_pw_7pyarrow_3lib_31uint8, METH_NOARGS, __pyx_doc_7pyarrow_3lib_30uint8};
static PyObject *__pyx_pw_7pyarrow_3lib_31uint8(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("uint8 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_30uint8(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_30uint8(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("uint8", 0);

  /* "pyarrow/types.pxi":1419
 *     Create instance of unsigned int8 type
 *     """
 *     return primitive_type(_Type_UINT8)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::UINT8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1415
 * 
 * 
 * def uint8():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned int8 type
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.uint8", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1422
 * 
 * 
 * def int8():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int8 type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_33int8(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_32int8[] = "int8()\n\n    Create instance of signed int8 type\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_33int8 = {"int8", (PyCFunction)__pyx_pw_7pyarrow_3lib_33int8, METH_NOARGS, __pyx_doc_7pyarrow_3lib_32int8};
static PyObject *__pyx_pw_7pyarrow_3lib_33int8(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("int8 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_32int8(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_32int8(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("int8", 0);

  /* "pyarrow/types.pxi":1426
 *     Create instance of signed int8 type
 *     """
 *     return primitive_type(_Type_INT8)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::INT8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1422
 * 
 * 
 * def int8():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int8 type
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.int8", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1429
 * 
 * 
 * def uint16():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned uint16 type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_35uint16(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_34uint16[] = "uint16()\n\n    Create instance of unsigned uint16 type\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_35uint16 = {"uint16", (PyCFunction)__pyx_pw_7pyarrow_3lib_35uint16, METH_NOARGS, __pyx_doc_7pyarrow_3lib_34uint16};
static PyObject *__pyx_pw_7pyarrow_3lib_35uint16(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("uint16 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_34uint16(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_34uint16(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("uint16", 0);

  /* "pyarrow/types.pxi":1433
 *     Create instance of unsigned uint16 type
 *     """
 *     return primitive_type(_Type_UINT16)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::UINT16)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1429
 * 
 * 
 * def uint16():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned uint16 type
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.uint16", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1436
 * 
 * 
 * def int16():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int16 type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_37int16(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_36int16[] = "int16()\n\n    Create instance of signed int16 type\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_37int16 = {"int16", (PyCFunction)__pyx_pw_7pyarrow_3lib_37int16, METH_NOARGS, __pyx_doc_7pyarrow_3lib_36int16};
static PyObject *__pyx_pw_7pyarrow_3lib_37int16(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("int16 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_36int16(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_36int16(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("int16", 0);

  /* "pyarrow/types.pxi":1440
 *     Create instance of signed int16 type
 *     """
 *     return primitive_type(_Type_INT16)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::INT16)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1440, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1436
 * 
 * 
 * def int16():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int16 type
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.int16", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1443
 * 
 * 
 * def uint32():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned uint32 type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_39uint32(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_38uint32[] = "uint32()\n\n    Create instance of unsigned uint32 type\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_39uint32 = {"uint32", (PyCFunction)__pyx_pw_7pyarrow_3lib_39uint32, METH_NOARGS, __pyx_doc_7pyarrow_3lib_38uint32};
static PyObject *__pyx_pw_7pyarrow_3lib_39uint32(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("uint32 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_38uint32(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_38uint32(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("uint32", 0);

  /* "pyarrow/types.pxi":1447
 *     Create instance of unsigned uint32 type
 *     """
 *     return primitive_type(_Type_UINT32)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::UINT32)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1443
 * 
 * 
 * def uint32():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned uint32 type
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.uint32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1450
 * 
 * 
 * def int32():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int32 type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_41int32(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_40int32[] = "int32()\n\n    Create instance of signed int32 type\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_41int32 = {"int32", (PyCFunction)__pyx_pw_7pyarrow_3lib_41int32, METH_NOARGS, __pyx_doc_7pyarrow_3lib_40int32};
static PyObject *__pyx_pw_7pyarrow_3lib_41int32(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("int32 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_40int32(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_40int32(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("int32", 0);

  /* "pyarrow/types.pxi":1454
 *     Create instance of signed int32 type
 *     """
 *     return primitive_type(_Type_INT32)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::INT32)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1454, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1450
 * 
 * 
 * def int32():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int32 type
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1457
 * 
 * 
 * def uint64():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned uint64 type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_43uint64(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_42uint64[] = "uint64()\n\n    Create instance of unsigned uint64 type\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_43uint64 = {"uint64", (PyCFunction)__pyx_pw_7pyarrow_3lib_43uint64, METH_NOARGS, __pyx_doc_7pyarrow_3lib_42uint64};
static PyObject *__pyx_pw_7pyarrow_3lib_43uint64(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("uint64 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_42uint64(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_42uint64(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("uint64", 0);

  /* "pyarrow/types.pxi":1461
 *     Create instance of unsigned uint64 type
 *     """
 *     return primitive_type(_Type_UINT64)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::UINT64)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1457
 * 
 * 
 * def uint64():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned uint64 type
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.uint64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1464
 * 
 * 
 * def int64():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int64 type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_45int64(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_44int64[] = "int64()\n\n    Create instance of signed int64 type\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_45int64 = {"int64", (PyCFunction)__pyx_pw_7pyarrow_3lib_45int64, METH_NOARGS, __pyx_doc_7pyarrow_3lib_44int64};
static PyObject *__pyx_pw_7pyarrow_3lib_45int64(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("int64 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_44int64(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_44int64(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("int64", 0);

  /* "pyarrow/types.pxi":1468
 *     Create instance of signed int64 type
 *     """
 *     return primitive_type(_Type_INT64)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::INT64)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1464
 * 
 * 
 * def int64():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int64 type
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1476
 * 
 * 
 * cdef timeunit_to_string(TimeUnit unit):             # <<<<<<<<<<<<<<
 *     if unit == TimeUnit_SECOND:
 *         return 's'
 */

static PyObject *__pyx_f_7pyarrow_3lib_timeunit_to_string(enum  arrow::TimeUnit::type __pyx_v_unit) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("timeunit_to_string", 0);

  /* "pyarrow/types.pxi":1477
 * 
 * cdef timeunit_to_string(TimeUnit unit):
 *     if unit == TimeUnit_SECOND:             # <<<<<<<<<<<<<<
 *         return 's'
 *     elif unit == TimeUnit_MILLI:
 */
  switch (__pyx_v_unit) {
    case  arrow::TimeUnit::SECOND:

    /* "pyarrow/types.pxi":1478
 * cdef timeunit_to_string(TimeUnit unit):
 *     if unit == TimeUnit_SECOND:
 *         return 's'             # <<<<<<<<<<<<<<
 *     elif unit == TimeUnit_MILLI:
 *         return 'ms'
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_s);
    __pyx_r = __pyx_n_u_s;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":1477
 * 
 * cdef timeunit_to_string(TimeUnit unit):
 *     if unit == TimeUnit_SECOND:             # <<<<<<<<<<<<<<
 *         return 's'
 *     elif unit == TimeUnit_MILLI:
 */
    break;
    case  arrow::TimeUnit::MILLI:

    /* "pyarrow/types.pxi":1480
 *         return 's'
 *     elif unit == TimeUnit_MILLI:
 *         return 'ms'             # <<<<<<<<<<<<<<
 *     elif unit == TimeUnit_MICRO:
 *         return 'us'
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_ms);
    __pyx_r = __pyx_n_u_ms;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":1479
 *     if unit == TimeUnit_SECOND:
 *         return 's'
 *     elif unit == TimeUnit_MILLI:             # <<<<<<<<<<<<<<
 *         return 'ms'
 *     elif unit == TimeUnit_MICRO:
 */
    break;
    case  arrow::TimeUnit::MICRO:

    /* "pyarrow/types.pxi":1482
 *         return 'ms'
 *     elif unit == TimeUnit_MICRO:
 *         return 'us'             # <<<<<<<<<<<<<<
 *     elif unit == TimeUnit_NANO:
 *         return 'ns'
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_us);
    __pyx_r = __pyx_n_u_us;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":1481
 *     elif unit == TimeUnit_MILLI:
 *         return 'ms'
 *     elif unit == TimeUnit_MICRO:             # <<<<<<<<<<<<<<
 *         return 'us'
 *     elif unit == TimeUnit_NANO:
 */
    break;
    case  arrow::TimeUnit::NANO:

    /* "pyarrow/types.pxi":1484
 *         return 'us'
 *     elif unit == TimeUnit_NANO:
 *         return 'ns'             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_ns);
    __pyx_r = __pyx_n_u_ns;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":1483
 *     elif unit == TimeUnit_MICRO:
 *         return 'us'
 *     elif unit == TimeUnit_NANO:             # <<<<<<<<<<<<<<
 *         return 'ns'
 * 
 */
    break;
    default: break;
  }

  /* "pyarrow/types.pxi":1476
 * 
 * 
 * cdef timeunit_to_string(TimeUnit unit):             # <<<<<<<<<<<<<<
 *     if unit == TimeUnit_SECOND:
 *         return 's'
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1490
 * 
 * 
 * def tzinfo_to_string(tz):             # <<<<<<<<<<<<<<
 *     """
 *     Converts a time zone object into a string indicating the name of a time
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_47tzinfo_to_string(PyObject *__pyx_self, PyObject *__pyx_v_tz); /*proto*/
static char __pyx_doc_7pyarrow_3lib_46tzinfo_to_string[] = "tzinfo_to_string(tz)\n\n    Converts a time zone object into a string indicating the name of a time\n    zone, one of:\n    * As used in the Olson time zone database (the \"tz database\" or\n      \"tzdata\"), such as \"America/New_York\"\n    * An absolute time zone offset of the form +XX:XX or -XX:XX, such as +07:30\n\n    Parameters\n    ----------\n      tz : datetime.tzinfo\n        Time zone object\n\n    Returns\n    -------\n      name : string\n        Time zone name\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_47tzinfo_to_string = {"tzinfo_to_string", (PyCFunction)__pyx_pw_7pyarrow_3lib_47tzinfo_to_string, METH_O, __pyx_doc_7pyarrow_3lib_46tzinfo_to_string};
static PyObject *__pyx_pw_7pyarrow_3lib_47tzinfo_to_string(PyObject *__pyx_self, PyObject *__pyx_v_tz) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tzinfo_to_string (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_46tzinfo_to_string(__pyx_self, ((PyObject *)__pyx_v_tz));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1511
 *     import datetime
 * 
 *     def fixed_offset_to_string(offset):             # <<<<<<<<<<<<<<
 *         seconds = int(offset.utcoffset(None).total_seconds())
 *         sign = '+' if seconds >= 0 else '-'
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16tzinfo_to_string_1fixed_offset_to_string(PyObject *__pyx_self, PyObject *__pyx_v_offset); /*proto*/
static PyMethodDef __pyx_mdef_7pyarrow_3lib_16tzinfo_to_string_1fixed_offset_to_string = {"fixed_offset_to_string", (PyCFunction)__pyx_pw_7pyarrow_3lib_16tzinfo_to_string_1fixed_offset_to_string, METH_O, 0};
static PyObject *__pyx_pw_7pyarrow_3lib_16tzinfo_to_string_1fixed_offset_to_string(PyObject *__pyx_self, PyObject *__pyx_v_offset) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fixed_offset_to_string (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16tzinfo_to_string_fixed_offset_to_string(__pyx_self, ((PyObject *)__pyx_v_offset));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16tzinfo_to_string_fixed_offset_to_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_offset) {
  PyObject *__pyx_v_seconds = NULL;
  PyObject *__pyx_v_sign = NULL;
  PyObject *__pyx_v_minutes = NULL;
  PyObject *__pyx_v_hours = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("fixed_offset_to_string", 0);

  /* "pyarrow/types.pxi":1512
 * 
 *     def fixed_offset_to_string(offset):
 *         seconds = int(offset.utcoffset(None).total_seconds())             # <<<<<<<<<<<<<<
 *         sign = '+' if seconds >= 0 else '-'
 *         minutes, seconds = divmod(abs(seconds), 60)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_offset, __pyx_n_s_utcoffset); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, Py_None) : __Pyx_PyObject_CallOneArg(__pyx_t_3, Py_None);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_total_seconds); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_seconds = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyarrow/types.pxi":1513
 *     def fixed_offset_to_string(offset):
 *         seconds = int(offset.utcoffset(None).total_seconds())
 *         sign = '+' if seconds >= 0 else '-'             # <<<<<<<<<<<<<<
 *         minutes, seconds = divmod(abs(seconds), 60)
 *         hours, minutes = divmod(minutes, 60)
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_seconds, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1513, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(4, 1513, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_5) {
    __Pyx_INCREF(__pyx_kp_u__27);
    __pyx_t_3 = __pyx_kp_u__27;
  } else {
    __Pyx_INCREF(__pyx_kp_u__28);
    __pyx_t_3 = __pyx_kp_u__28;
  }
  __pyx_v_sign = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyarrow/types.pxi":1514
 *         seconds = int(offset.utcoffset(None).total_seconds())
 *         sign = '+' if seconds >= 0 else '-'
 *         minutes, seconds = divmod(abs(seconds), 60)             # <<<<<<<<<<<<<<
 *         hours, minutes = divmod(minutes, 60)
 *         if seconds > 0:
 */
  __pyx_t_3 = __Pyx_PyNumber_Absolute(__pyx_v_seconds); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyNumber_Divmod(__pyx_t_3, __pyx_int_60); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(4, 1514, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1514, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1514, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1514, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_2 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_4), 2) < 0) __PYX_ERR(4, 1514, __pyx_L1_error)
    __pyx_t_6 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(4, 1514, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_minutes = __pyx_t_3;
  __pyx_t_3 = 0;
  __Pyx_DECREF_SET(__pyx_v_seconds, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":1515
 *         sign = '+' if seconds >= 0 else '-'
 *         minutes, seconds = divmod(abs(seconds), 60)
 *         hours, minutes = divmod(minutes, 60)             # <<<<<<<<<<<<<<
 *         if seconds > 0:
 *             raise ValueError('Offset must represent whole number of minutes')
 */
  __pyx_t_1 = PyNumber_Divmod(__pyx_v_minutes, __pyx_int_60); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(4, 1515, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1515, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1515, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1515, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_4), 2) < 0) __PYX_ERR(4, 1515, __pyx_L1_error)
    __pyx_t_6 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L6_unpacking_done;
    __pyx_L5_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(4, 1515, __pyx_L1_error)
    __pyx_L6_unpacking_done:;
  }
  __pyx_v_hours = __pyx_t_2;
  __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_minutes, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyarrow/types.pxi":1516
 *         minutes, seconds = divmod(abs(seconds), 60)
 *         hours, minutes = divmod(minutes, 60)
 *         if seconds > 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Offset must represent whole number of minutes')
 *         return '{}{:02d}:{:02d}'.format(sign, hours, minutes)
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_seconds, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1516, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(4, 1516, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_5)) {

    /* "pyarrow/types.pxi":1517
 *         hours, minutes = divmod(minutes, 60)
 *         if seconds > 0:
 *             raise ValueError('Offset must represent whole number of minutes')             # <<<<<<<<<<<<<<
 *         return '{}{:02d}:{:02d}'.format(sign, hours, minutes)
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1517, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 1517, __pyx_L1_error)

    /* "pyarrow/types.pxi":1516
 *         minutes, seconds = divmod(abs(seconds), 60)
 *         hours, minutes = divmod(minutes, 60)
 *         if seconds > 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Offset must represent whole number of minutes')
 *         return '{}{:02d}:{:02d}'.format(sign, hours, minutes)
 */
  }

  /* "pyarrow/types.pxi":1518
 *         if seconds > 0:
 *             raise ValueError('Offset must represent whole number of minutes')
 *         return '{}{:02d}:{:02d}'.format(sign, hours, minutes)             # <<<<<<<<<<<<<<
 * 
 *     if tz is pytz.utc:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_02d_02d, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_sign, __pyx_v_hours, __pyx_v_minutes};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1518, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_sign, __pyx_v_hours, __pyx_v_minutes};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1518, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_4 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1518, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_sign);
    __Pyx_GIVEREF(__pyx_v_sign);
    PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_7, __pyx_v_sign);
    __Pyx_INCREF(__pyx_v_hours);
    __Pyx_GIVEREF(__pyx_v_hours);
    PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_7, __pyx_v_hours);
    __Pyx_INCREF(__pyx_v_minutes);
    __Pyx_GIVEREF(__pyx_v_minutes);
    PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_7, __pyx_v_minutes);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1518, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1511
 *     import datetime
 * 
 *     def fixed_offset_to_string(offset):             # <<<<<<<<<<<<<<
 *         seconds = int(offset.utcoffset(None).total_seconds())
 *         sign = '+' if seconds >= 0 else '-'
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.tzinfo_to_string.fixed_offset_to_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_seconds);
  __Pyx_XDECREF(__pyx_v_sign);
  __Pyx_XDECREF(__pyx_v_minutes);
  __Pyx_XDECREF(__pyx_v_hours);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1490
 * 
 * 
 * def tzinfo_to_string(tz):             # <<<<<<<<<<<<<<
 *     """
 *     Converts a time zone object into a string indicating the name of a time
 */

static PyObject *__pyx_pf_7pyarrow_3lib_46tzinfo_to_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_tz) {
  PyObject *__pyx_v_pytz = NULL;
  PyObject *__pyx_v_datetime = NULL;
  PyObject *__pyx_v_fixed_offset_to_string = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("tzinfo_to_string", 0);

  /* "pyarrow/types.pxi":1508
 *         Time zone name
 *     """
 *     import pytz             # <<<<<<<<<<<<<<
 *     import datetime
 * 
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_pytz, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_pytz = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":1509
 *     """
 *     import pytz
 *     import datetime             # <<<<<<<<<<<<<<
 * 
 *     def fixed_offset_to_string(offset):
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_datetime, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_datetime = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":1511
 *     import datetime
 * 
 *     def fixed_offset_to_string(offset):             # <<<<<<<<<<<<<<
 *         seconds = int(offset.utcoffset(None).total_seconds())
 *         sign = '+' if seconds >= 0 else '-'
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_16tzinfo_to_string_1fixed_offset_to_string, 0, __pyx_n_s_tzinfo_to_string_locals_fixed_of, NULL, __pyx_n_s_pyarrow_lib, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_fixed_offset_to_string = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":1520
 *         return '{}{:02d}:{:02d}'.format(sign, hours, minutes)
 * 
 *     if tz is pytz.utc:             # <<<<<<<<<<<<<<
 *         return tz.zone  # ARROW-4055
 *     elif isinstance(tz, pytz.tzinfo.BaseTzInfo):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pytz, __pyx_n_s_utc); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_v_tz == __pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/types.pxi":1521
 * 
 *     if tz is pytz.utc:
 *         return tz.zone  # ARROW-4055             # <<<<<<<<<<<<<<
 *     elif isinstance(tz, pytz.tzinfo.BaseTzInfo):
 *         return tz.zone
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_zone); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1521, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":1520
 *         return '{}{:02d}:{:02d}'.format(sign, hours, minutes)
 * 
 *     if tz is pytz.utc:             # <<<<<<<<<<<<<<
 *         return tz.zone  # ARROW-4055
 *     elif isinstance(tz, pytz.tzinfo.BaseTzInfo):
 */
  }

  /* "pyarrow/types.pxi":1522
 *     if tz is pytz.utc:
 *         return tz.zone  # ARROW-4055
 *     elif isinstance(tz, pytz.tzinfo.BaseTzInfo):             # <<<<<<<<<<<<<<
 *         return tz.zone
 *     elif isinstance(tz, pytz._FixedOffset):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pytz, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_BaseTzInfo); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_tz, __pyx_t_4); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(4, 1522, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/types.pxi":1523
 *         return tz.zone  # ARROW-4055
 *     elif isinstance(tz, pytz.tzinfo.BaseTzInfo):
 *         return tz.zone             # <<<<<<<<<<<<<<
 *     elif isinstance(tz, pytz._FixedOffset):
 *         return fixed_offset_to_string(tz)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_zone); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1523, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":1522
 *     if tz is pytz.utc:
 *         return tz.zone  # ARROW-4055
 *     elif isinstance(tz, pytz.tzinfo.BaseTzInfo):             # <<<<<<<<<<<<<<
 *         return tz.zone
 *     elif isinstance(tz, pytz._FixedOffset):
 */
  }

  /* "pyarrow/types.pxi":1524
 *     elif isinstance(tz, pytz.tzinfo.BaseTzInfo):
 *         return tz.zone
 *     elif isinstance(tz, pytz._FixedOffset):             # <<<<<<<<<<<<<<
 *         return fixed_offset_to_string(tz)
 *     elif isinstance(tz, datetime.tzinfo):
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_pytz, __pyx_n_s_FixedOffset); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_tz, __pyx_t_4); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(4, 1524, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/types.pxi":1525
 *         return tz.zone
 *     elif isinstance(tz, pytz._FixedOffset):
 *         return fixed_offset_to_string(tz)             # <<<<<<<<<<<<<<
 *     elif isinstance(tz, datetime.tzinfo):
 *         if six.PY3 and isinstance(tz, datetime.timezone):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __pyx_pf_7pyarrow_3lib_16tzinfo_to_string_fixed_offset_to_string(__pyx_v_fixed_offset_to_string, __pyx_v_tz); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1525, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":1524
 *     elif isinstance(tz, pytz.tzinfo.BaseTzInfo):
 *         return tz.zone
 *     elif isinstance(tz, pytz._FixedOffset):             # <<<<<<<<<<<<<<
 *         return fixed_offset_to_string(tz)
 *     elif isinstance(tz, datetime.tzinfo):
 */
  }

  /* "pyarrow/types.pxi":1526
 *     elif isinstance(tz, pytz._FixedOffset):
 *         return fixed_offset_to_string(tz)
 *     elif isinstance(tz, datetime.tzinfo):             # <<<<<<<<<<<<<<
 *         if six.PY3 and isinstance(tz, datetime.timezone):
 *             return fixed_offset_to_string(tz)
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1526, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_tz, __pyx_t_4); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(4, 1526, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (likely(__pyx_t_2)) {

    /* "pyarrow/types.pxi":1527
 *         return fixed_offset_to_string(tz)
 *     elif isinstance(tz, datetime.tzinfo):
 *         if six.PY3 and isinstance(tz, datetime.timezone):             # <<<<<<<<<<<<<<
 *             return fixed_offset_to_string(tz)
 *         else:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_six); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_PY3); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(4, 1527, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_3) {
    } else {
      __pyx_t_2 = __pyx_t_3;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_timezone); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_IsInstance(__pyx_v_tz, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(4, 1527, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = (__pyx_t_3 != 0);
    __pyx_t_2 = __pyx_t_5;
    __pyx_L5_bool_binop_done:;
    if (likely(__pyx_t_2)) {

      /* "pyarrow/types.pxi":1528
 *     elif isinstance(tz, datetime.tzinfo):
 *         if six.PY3 and isinstance(tz, datetime.timezone):
 *             return fixed_offset_to_string(tz)             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError('Unable to convert timezone `{}` to string'
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __pyx_pf_7pyarrow_3lib_16tzinfo_to_string_fixed_offset_to_string(__pyx_v_fixed_offset_to_string, __pyx_v_tz); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1528, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* "pyarrow/types.pxi":1527
 *         return fixed_offset_to_string(tz)
 *     elif isinstance(tz, datetime.tzinfo):
 *         if six.PY3 and isinstance(tz, datetime.timezone):             # <<<<<<<<<<<<<<
 *             return fixed_offset_to_string(tz)
 *         else:
 */
    }

    /* "pyarrow/types.pxi":1530
 *             return fixed_offset_to_string(tz)
 *         else:
 *             raise ValueError('Unable to convert timezone `{}` to string'             # <<<<<<<<<<<<<<
 *                              .format(tz))
 *     else:
 */
    /*else*/ {

      /* "pyarrow/types.pxi":1531
 *         else:
 *             raise ValueError('Unable to convert timezone `{}` to string'
 *                              .format(tz))             # <<<<<<<<<<<<<<
 *     else:
 *         raise TypeError('Must be an instance of `datetime.tzinfo`')
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Unable_to_convert_timezone_to_st, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1531, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_v_tz) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_tz);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1531, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "pyarrow/types.pxi":1530
 *             return fixed_offset_to_string(tz)
 *         else:
 *             raise ValueError('Unable to convert timezone `{}` to string'             # <<<<<<<<<<<<<<
 *                              .format(tz))
 *     else:
 */
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1530, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(4, 1530, __pyx_L1_error)
    }

    /* "pyarrow/types.pxi":1526
 *     elif isinstance(tz, pytz._FixedOffset):
 *         return fixed_offset_to_string(tz)
 *     elif isinstance(tz, datetime.tzinfo):             # <<<<<<<<<<<<<<
 *         if six.PY3 and isinstance(tz, datetime.timezone):
 *             return fixed_offset_to_string(tz)
 */
  }

  /* "pyarrow/types.pxi":1533
 *                              .format(tz))
 *     else:
 *         raise TypeError('Must be an instance of `datetime.tzinfo`')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1533, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(4, 1533, __pyx_L1_error)
  }

  /* "pyarrow/types.pxi":1490
 * 
 * 
 * def tzinfo_to_string(tz):             # <<<<<<<<<<<<<<
 *     """
 *     Converts a time zone object into a string indicating the name of a time
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.tzinfo_to_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pytz);
  __Pyx_XDECREF(__pyx_v_datetime);
  __Pyx_XDECREF(__pyx_v_fixed_offset_to_string);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1536
 * 
 * 
 * def string_to_tzinfo(name):             # <<<<<<<<<<<<<<
 *     """
 *     Converts a string indicating the name of a time zone into a time zone
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_49string_to_tzinfo(PyObject *__pyx_self, PyObject *__pyx_v_name); /*proto*/
static char __pyx_doc_7pyarrow_3lib_48string_to_tzinfo[] = "string_to_tzinfo(name)\n\n    Converts a string indicating the name of a time zone into a time zone\n    object, one of:\n    * As used in the Olson time zone database (the \"tz database\" or\n      \"tzdata\"), such as \"America/New_York\"\n    * An absolute time zone offset of the form +XX:XX or -XX:XX, such as +07:30\n\n    Parameters\n    ----------\n      name: string\n        Time zone name\n\n    Returns\n    -------\n      tz : datetime.tzinfo\n        Time zone object\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_49string_to_tzinfo = {"string_to_tzinfo", (PyCFunction)__pyx_pw_7pyarrow_3lib_49string_to_tzinfo, METH_O, __pyx_doc_7pyarrow_3lib_48string_to_tzinfo};
static PyObject *__pyx_pw_7pyarrow_3lib_49string_to_tzinfo(PyObject *__pyx_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("string_to_tzinfo (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_48string_to_tzinfo(__pyx_self, ((PyObject *)__pyx_v_name));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_48string_to_tzinfo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_v_pytz = NULL;
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_v_sign = NULL;
  PyObject *__pyx_v_hours = NULL;
  PyObject *__pyx_v_minutes = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  __Pyx_RefNannySetupContext("string_to_tzinfo", 0);

  /* "pyarrow/types.pxi":1554
 *         Time zone object
 *     """
 *     import pytz             # <<<<<<<<<<<<<<
 *     m = _FIXED_OFFSET_RE.match(name)
 *     if m:
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_pytz, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1554, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_pytz = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":1555
 *     """
 *     import pytz
 *     m = _FIXED_OFFSET_RE.match(name)             # <<<<<<<<<<<<<<
 *     if m:
 *         sign = 1 if m.group(1) == '+' else -1
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FIXED_OFFSET_RE); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_match); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_name);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_m = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":1556
 *     import pytz
 *     m = _FIXED_OFFSET_RE.match(name)
 *     if m:             # <<<<<<<<<<<<<<
 *         sign = 1 if m.group(1) == '+' else -1
 *         hours, minutes = map(int, m.group(2, 3))
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_m); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(4, 1556, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "pyarrow/types.pxi":1557
 *     m = _FIXED_OFFSET_RE.match(name)
 *     if m:
 *         sign = 1 if m.group(1) == '+' else -1             # <<<<<<<<<<<<<<
 *         hours, minutes = map(int, m.group(2, 3))
 *         return pytz.FixedOffset(sign * (hours * 60 + minutes))
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_n_s_group); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1557, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_int_1);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1557, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_kp_u__27, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(4, 1557, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_4) {
      __Pyx_INCREF(__pyx_int_1);
      __pyx_t_1 = __pyx_int_1;
    } else {
      __Pyx_INCREF(__pyx_int_neg_1);
      __pyx_t_1 = __pyx_int_neg_1;
    }
    __pyx_v_sign = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "pyarrow/types.pxi":1558
 *     if m:
 *         sign = 1 if m.group(1) == '+' else -1
 *         hours, minutes = map(int, m.group(2, 3))             # <<<<<<<<<<<<<<
 *         return pytz.FixedOffset(sign * (hours * 60 + minutes))
 *     else:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_n_s_group); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1558, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1558, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1558, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
    __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)(&PyInt_Type)));
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1558, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
      PyObject* sequence = __pyx_t_3;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(4, 1558, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      #else
      __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1558, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1558, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1558, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
      index = 0; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 1; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(4, 1558, __pyx_L1_error)
      __pyx_t_6 = NULL;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L5_unpacking_done;
      __pyx_L4_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(4, 1558, __pyx_L1_error)
      __pyx_L5_unpacking_done:;
    }
    __pyx_v_hours = __pyx_t_1;
    __pyx_t_1 = 0;
    __pyx_v_minutes = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pyarrow/types.pxi":1559
 *         sign = 1 if m.group(1) == '+' else -1
 *         hours, minutes = map(int, m.group(2, 3))
 *         return pytz.FixedOffset(sign * (hours * 60 + minutes))             # <<<<<<<<<<<<<<
 *     else:
 *         return pytz.timezone(name)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_pytz, __pyx_n_s_FixedOffset_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1559, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyNumber_Multiply(__pyx_v_hours, __pyx_int_60); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1559, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_v_minutes); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1559, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Multiply(__pyx_v_sign, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1559, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1559, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":1556
 *     import pytz
 *     m = _FIXED_OFFSET_RE.match(name)
 *     if m:             # <<<<<<<<<<<<<<
 *         sign = 1 if m.group(1) == '+' else -1
 *         hours, minutes = map(int, m.group(2, 3))
 */
  }

  /* "pyarrow/types.pxi":1561
 *         return pytz.FixedOffset(sign * (hours * 60 + minutes))
 *     else:
 *         return pytz.timezone(name)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_pytz, __pyx_n_s_timezone); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1561, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_name);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1561, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/types.pxi":1536
 * 
 * 
 * def string_to_tzinfo(name):             # <<<<<<<<<<<<<<
 *     """
 *     Converts a string indicating the name of a time zone into a time zone
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.string_to_tzinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pytz);
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XDECREF(__pyx_v_sign);
  __Pyx_XDECREF(__pyx_v_hours);
  __Pyx_XDECREF(__pyx_v_minutes);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1564
 * 
 * 
 * def timestamp(unit, tz=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of timestamp type with resolution and optional time zone
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_51timestamp(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_50timestamp[] = "timestamp(unit, tz=None)\n\n    Create instance of timestamp type with resolution and optional time zone\n\n    Parameters\n    ----------\n    unit : string\n        one of 's' [second], 'ms' [millisecond], 'us' [microsecond], or 'ns'\n        [nanosecond]\n    tz : string, default None\n        Time zone name. None indicates time zone naive\n\n    Examples\n    --------\n    ::\n\n        t1 = pa.timestamp('us')\n        t2 = pa.timestamp('s', tz='America/New_York')\n\n    Returns\n    -------\n    timestamp_type : TimestampType\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_51timestamp = {"timestamp", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_51timestamp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_50timestamp};
static PyObject *__pyx_pw_7pyarrow_3lib_51timestamp(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_unit = 0;
  PyObject *__pyx_v_tz = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("timestamp (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_unit,&__pyx_n_s_tz,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_unit)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tz);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timestamp") < 0)) __PYX_ERR(4, 1564, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_unit = values[0];
    __pyx_v_tz = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("timestamp", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 1564, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.timestamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_50timestamp(__pyx_self, __pyx_v_unit, __pyx_v_tz);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_50timestamp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_unit, PyObject *__pyx_v_tz) {
  enum  arrow::TimeUnit::type __pyx_v_unit_code;
  std::string __pyx_v_c_timezone;
  struct __pyx_obj_7pyarrow_3lib_TimestampType *__pyx_v_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  __Pyx_RefNannySetupContext("timestamp", 0);
  __Pyx_INCREF(__pyx_v_tz);

  /* "pyarrow/types.pxi":1591
 *         c_string c_timezone
 * 
 *     if unit == "s":             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_SECOND
 *     elif unit == 'ms':
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_s, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1591, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/types.pxi":1592
 * 
 *     if unit == "s":
 *         unit_code = TimeUnit_SECOND             # <<<<<<<<<<<<<<
 *     elif unit == 'ms':
 *         unit_code = TimeUnit_MILLI
 */
    __pyx_v_unit_code =  arrow::TimeUnit::SECOND;

    /* "pyarrow/types.pxi":1591
 *         c_string c_timezone
 * 
 *     if unit == "s":             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_SECOND
 *     elif unit == 'ms':
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":1593
 *     if unit == "s":
 *         unit_code = TimeUnit_SECOND
 *     elif unit == 'ms':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_MILLI
 *     elif unit == 'us':
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_ms, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1593, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/types.pxi":1594
 *         unit_code = TimeUnit_SECOND
 *     elif unit == 'ms':
 *         unit_code = TimeUnit_MILLI             # <<<<<<<<<<<<<<
 *     elif unit == 'us':
 *         unit_code = TimeUnit_MICRO
 */
    __pyx_v_unit_code =  arrow::TimeUnit::MILLI;

    /* "pyarrow/types.pxi":1593
 *     if unit == "s":
 *         unit_code = TimeUnit_SECOND
 *     elif unit == 'ms':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_MILLI
 *     elif unit == 'us':
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":1595
 *     elif unit == 'ms':
 *         unit_code = TimeUnit_MILLI
 *     elif unit == 'us':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_MICRO
 *     elif unit == 'ns':
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_us, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1595, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/types.pxi":1596
 *         unit_code = TimeUnit_MILLI
 *     elif unit == 'us':
 *         unit_code = TimeUnit_MICRO             # <<<<<<<<<<<<<<
 *     elif unit == 'ns':
 *         unit_code = TimeUnit_NANO
 */
    __pyx_v_unit_code =  arrow::TimeUnit::MICRO;

    /* "pyarrow/types.pxi":1595
 *     elif unit == 'ms':
 *         unit_code = TimeUnit_MILLI
 *     elif unit == 'us':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_MICRO
 *     elif unit == 'ns':
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":1597
 *     elif unit == 'us':
 *         unit_code = TimeUnit_MICRO
 *     elif unit == 'ns':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_NANO
 *     else:
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_ns, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1597, __pyx_L1_error)
  if (likely(__pyx_t_1)) {

    /* "pyarrow/types.pxi":1598
 *         unit_code = TimeUnit_MICRO
 *     elif unit == 'ns':
 *         unit_code = TimeUnit_NANO             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError('Invalid TimeUnit string')
 */
    __pyx_v_unit_code =  arrow::TimeUnit::NANO;

    /* "pyarrow/types.pxi":1597
 *     elif unit == 'us':
 *         unit_code = TimeUnit_MICRO
 *     elif unit == 'ns':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_NANO
 *     else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":1600
 *         unit_code = TimeUnit_NANO
 *     else:
 *         raise ValueError('Invalid TimeUnit string')             # <<<<<<<<<<<<<<
 * 
 *     cdef TimestampType out = TimestampType.__new__(TimestampType)
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1600, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 1600, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "pyarrow/types.pxi":1602
 *         raise ValueError('Invalid TimeUnit string')
 * 
 *     cdef TimestampType out = TimestampType.__new__(TimestampType)             # <<<<<<<<<<<<<<
 * 
 *     if tz is None:
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_TimestampType(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_TimestampType), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1602, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_TimestampType *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":1604
 *     cdef TimestampType out = TimestampType.__new__(TimestampType)
 * 
 *     if tz is None:             # <<<<<<<<<<<<<<
 *         out.init(ctimestamp(unit_code))
 *         if unit_code in _timestamp_type_cache:
 */
  __pyx_t_1 = (__pyx_v_tz == Py_None);
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/types.pxi":1605
 * 
 *     if tz is None:
 *         out.init(ctimestamp(unit_code))             # <<<<<<<<<<<<<<
 *         if unit_code in _timestamp_type_cache:
 *             return _timestamp_type_cache[unit_code]
 */
    ((struct __pyx_vtabstruct_7pyarrow_3lib_TimestampType *)__pyx_v_out->__pyx_base.__pyx_vtab)->__pyx_base.init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_out),  arrow::timestamp(__pyx_v_unit_code)); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1605, __pyx_L1_error)

    /* "pyarrow/types.pxi":1606
 *     if tz is None:
 *         out.init(ctimestamp(unit_code))
 *         if unit_code in _timestamp_type_cache:             # <<<<<<<<<<<<<<
 *             return _timestamp_type_cache[unit_code]
 *         _timestamp_type_cache[unit_code] = out
 */
    __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type(__pyx_v_unit_code); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1606, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(__pyx_v_7pyarrow_3lib__timestamp_type_cache == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(4, 1606, __pyx_L1_error)
    }
    __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_t_2, __pyx_v_7pyarrow_3lib__timestamp_type_cache, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(4, 1606, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_1 = (__pyx_t_3 != 0);
    if (__pyx_t_1) {

      /* "pyarrow/types.pxi":1607
 *         out.init(ctimestamp(unit_code))
 *         if unit_code in _timestamp_type_cache:
 *             return _timestamp_type_cache[unit_code]             # <<<<<<<<<<<<<<
 *         _timestamp_type_cache[unit_code] = out
 *     else:
 */
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(__pyx_v_7pyarrow_3lib__timestamp_type_cache == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(4, 1607, __pyx_L1_error)
      }
      __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type(__pyx_v_unit_code); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1607, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_7pyarrow_3lib__timestamp_type_cache, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1607, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;

      /* "pyarrow/types.pxi":1606
 *     if tz is None:
 *         out.init(ctimestamp(unit_code))
 *         if unit_code in _timestamp_type_cache:             # <<<<<<<<<<<<<<
 *             return _timestamp_type_cache[unit_code]
 *         _timestamp_type_cache[unit_code] = out
 */
    }

    /* "pyarrow/types.pxi":1608
 *         if unit_code in _timestamp_type_cache:
 *             return _timestamp_type_cache[unit_code]
 *         _timestamp_type_cache[unit_code] = out             # <<<<<<<<<<<<<<
 *     else:
 *         if not isinstance(tz, six.string_types):
 */
    if (unlikely(__pyx_v_7pyarrow_3lib__timestamp_type_cache == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(4, 1608, __pyx_L1_error)
    }
    __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type(__pyx_v_unit_code); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1608, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(PyDict_SetItem(__pyx_v_7pyarrow_3lib__timestamp_type_cache, __pyx_t_4, ((PyObject *)__pyx_v_out)) < 0)) __PYX_ERR(4, 1608, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/types.pxi":1604
 *     cdef TimestampType out = TimestampType.__new__(TimestampType)
 * 
 *     if tz is None:             # <<<<<<<<<<<<<<
 *         out.init(ctimestamp(unit_code))
 *         if unit_code in _timestamp_type_cache:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/types.pxi":1610
 *         _timestamp_type_cache[unit_code] = out
 *     else:
 *         if not isinstance(tz, six.string_types):             # <<<<<<<<<<<<<<
 *             tz = tzinfo_to_string(tz)
 * 
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_six); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1610, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_string_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1610, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = PyObject_IsInstance(__pyx_v_tz, __pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 1610, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_3 = ((!(__pyx_t_1 != 0)) != 0);
    if (__pyx_t_3) {

      /* "pyarrow/types.pxi":1611
 *     else:
 *         if not isinstance(tz, six.string_types):
 *             tz = tzinfo_to_string(tz)             # <<<<<<<<<<<<<<
 * 
 *         c_timezone = tobytes(tz)
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_tzinfo_to_string); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1611, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_tz) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_tz);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1611, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_tz, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "pyarrow/types.pxi":1610
 *         _timestamp_type_cache[unit_code] = out
 *     else:
 *         if not isinstance(tz, six.string_types):             # <<<<<<<<<<<<<<
 *             tz = tzinfo_to_string(tz)
 * 
 */
    }

    /* "pyarrow/types.pxi":1613
 *             tz = tzinfo_to_string(tz)
 * 
 *         c_timezone = tobytes(tz)             # <<<<<<<<<<<<<<
 *         out.init(ctimestamp(unit_code, c_timezone))
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1613, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_tz) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_tz);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1613, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1613, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_c_timezone = __pyx_t_6;

    /* "pyarrow/types.pxi":1614
 * 
 *         c_timezone = tobytes(tz)
 *         out.init(ctimestamp(unit_code, c_timezone))             # <<<<<<<<<<<<<<
 * 
 *     return out
 */
    ((struct __pyx_vtabstruct_7pyarrow_3lib_TimestampType *)__pyx_v_out->__pyx_base.__pyx_vtab)->__pyx_base.init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_out),  arrow::timestamp(__pyx_v_unit_code, __pyx_v_c_timezone)); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1614, __pyx_L1_error)
  }
  __pyx_L4:;

  /* "pyarrow/types.pxi":1616
 *         out.init(ctimestamp(unit_code, c_timezone))
 * 
 *     return out             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = ((PyObject *)__pyx_v_out);
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1564
 * 
 * 
 * def timestamp(unit, tz=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of timestamp type with resolution and optional time zone
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.timestamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XDECREF(__pyx_v_tz);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1619
 * 
 * 
 * def time32(unit):             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 32-bit time (time of day) type with unit resolution
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_53time32(PyObject *__pyx_self, PyObject *__pyx_v_unit); /*proto*/
static char __pyx_doc_7pyarrow_3lib_52time32[] = "time32(unit)\n\n    Create instance of 32-bit time (time of day) type with unit resolution\n\n    Parameters\n    ----------\n    unit : string\n        one of 's' [second], or 'ms' [millisecond]\n\n    Examples\n    --------\n    ::\n\n        t1 = pa.time32('s')\n        t2 = pa.time32('ms')\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_53time32 = {"time32", (PyCFunction)__pyx_pw_7pyarrow_3lib_53time32, METH_O, __pyx_doc_7pyarrow_3lib_52time32};
static PyObject *__pyx_pw_7pyarrow_3lib_53time32(PyObject *__pyx_self, PyObject *__pyx_v_unit) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("time32 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_52time32(__pyx_self, ((PyObject *)__pyx_v_unit));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_52time32(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_unit) {
  enum  arrow::TimeUnit::type __pyx_v_unit_code;
  struct __pyx_obj_7pyarrow_3lib_Time32Type *__pyx_v_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("time32", 0);

  /* "pyarrow/types.pxi":1639
 *         c_string c_timezone
 * 
 *     if unit == 's':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_SECOND
 *     elif unit == 'ms':
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_s, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1639, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/types.pxi":1640
 * 
 *     if unit == 's':
 *         unit_code = TimeUnit_SECOND             # <<<<<<<<<<<<<<
 *     elif unit == 'ms':
 *         unit_code = TimeUnit_MILLI
 */
    __pyx_v_unit_code =  arrow::TimeUnit::SECOND;

    /* "pyarrow/types.pxi":1639
 *         c_string c_timezone
 * 
 *     if unit == 's':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_SECOND
 *     elif unit == 'ms':
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":1641
 *     if unit == 's':
 *         unit_code = TimeUnit_SECOND
 *     elif unit == 'ms':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_MILLI
 *     else:
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_ms, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1641, __pyx_L1_error)
  if (likely(__pyx_t_1)) {

    /* "pyarrow/types.pxi":1642
 *         unit_code = TimeUnit_SECOND
 *     elif unit == 'ms':
 *         unit_code = TimeUnit_MILLI             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError('Invalid TimeUnit for time32: {}'.format(unit))
 */
    __pyx_v_unit_code =  arrow::TimeUnit::MILLI;

    /* "pyarrow/types.pxi":1641
 *     if unit == 's':
 *         unit_code = TimeUnit_SECOND
 *     elif unit == 'ms':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_MILLI
 *     else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":1644
 *         unit_code = TimeUnit_MILLI
 *     else:
 *         raise ValueError('Invalid TimeUnit for time32: {}'.format(unit))             # <<<<<<<<<<<<<<
 * 
 *     if unit_code in _time_type_cache:
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Invalid_TimeUnit_for_time32, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1644, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_unit) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_unit);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1644, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1644, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(4, 1644, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "pyarrow/types.pxi":1646
 *         raise ValueError('Invalid TimeUnit for time32: {}'.format(unit))
 * 
 *     if unit_code in _time_type_cache:             # <<<<<<<<<<<<<<
 *         return _time_type_cache[unit_code]
 * 
 */
  __pyx_t_3 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type(__pyx_v_unit_code); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1646, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (unlikely(__pyx_v_7pyarrow_3lib__time_type_cache == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(4, 1646, __pyx_L1_error)
  }
  __pyx_t_1 = (__Pyx_PyDict_ContainsTF(__pyx_t_3, __pyx_v_7pyarrow_3lib__time_type_cache, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1646, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = (__pyx_t_1 != 0);
  if (__pyx_t_5) {

    /* "pyarrow/types.pxi":1647
 * 
 *     if unit_code in _time_type_cache:
 *         return _time_type_cache[unit_code]             # <<<<<<<<<<<<<<
 * 
 *     cdef Time32Type out = Time32Type.__new__(Time32Type)
 */
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(__pyx_v_7pyarrow_3lib__time_type_cache == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(4, 1647, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type(__pyx_v_unit_code); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1647, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_7pyarrow_3lib__time_type_cache, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1647, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":1646
 *         raise ValueError('Invalid TimeUnit for time32: {}'.format(unit))
 * 
 *     if unit_code in _time_type_cache:             # <<<<<<<<<<<<<<
 *         return _time_type_cache[unit_code]
 * 
 */
  }

  /* "pyarrow/types.pxi":1649
 *         return _time_type_cache[unit_code]
 * 
 *     cdef Time32Type out = Time32Type.__new__(Time32Type)             # <<<<<<<<<<<<<<
 * 
 *     out.init(ctime32(unit_code))
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_Time32Type(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_Time32Type), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1649, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_Time32Type *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":1651
 *     cdef Time32Type out = Time32Type.__new__(Time32Type)
 * 
 *     out.init(ctime32(unit_code))             # <<<<<<<<<<<<<<
 *     _time_type_cache[unit_code] = out
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_Time32Type *)__pyx_v_out->__pyx_base.__pyx_vtab)->__pyx_base.init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_out),  arrow::time32(__pyx_v_unit_code)); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1651, __pyx_L1_error)

  /* "pyarrow/types.pxi":1652
 * 
 *     out.init(ctime32(unit_code))
 *     _time_type_cache[unit_code] = out             # <<<<<<<<<<<<<<
 * 
 *     return out
 */
  if (unlikely(__pyx_v_7pyarrow_3lib__time_type_cache == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 1652, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type(__pyx_v_unit_code); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1652, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(PyDict_SetItem(__pyx_v_7pyarrow_3lib__time_type_cache, __pyx_t_2, ((PyObject *)__pyx_v_out)) < 0)) __PYX_ERR(4, 1652, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":1654
 *     _time_type_cache[unit_code] = out
 * 
 *     return out             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = ((PyObject *)__pyx_v_out);
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1619
 * 
 * 
 * def time32(unit):             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 32-bit time (time of day) type with unit resolution
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.time32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1657
 * 
 * 
 * def time64(unit):             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 64-bit time (time of day) type with unit resolution
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_55time64(PyObject *__pyx_self, PyObject *__pyx_v_unit); /*proto*/
static char __pyx_doc_7pyarrow_3lib_54time64[] = "time64(unit)\n\n    Create instance of 64-bit time (time of day) type with unit resolution\n\n    Parameters\n    ----------\n    unit : string\n        one of 'us' [microsecond], or 'ns' [nanosecond]\n\n    Examples\n    --------\n    ::\n\n        t1 = pa.time64('us')\n        t2 = pa.time64('ns')\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_55time64 = {"time64", (PyCFunction)__pyx_pw_7pyarrow_3lib_55time64, METH_O, __pyx_doc_7pyarrow_3lib_54time64};
static PyObject *__pyx_pw_7pyarrow_3lib_55time64(PyObject *__pyx_self, PyObject *__pyx_v_unit) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("time64 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_54time64(__pyx_self, ((PyObject *)__pyx_v_unit));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_54time64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_unit) {
  enum  arrow::TimeUnit::type __pyx_v_unit_code;
  struct __pyx_obj_7pyarrow_3lib_Time64Type *__pyx_v_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("time64", 0);

  /* "pyarrow/types.pxi":1677
 *         c_string c_timezone
 * 
 *     if unit == 'us':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_MICRO
 *     elif unit == 'ns':
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_us, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1677, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/types.pxi":1678
 * 
 *     if unit == 'us':
 *         unit_code = TimeUnit_MICRO             # <<<<<<<<<<<<<<
 *     elif unit == 'ns':
 *         unit_code = TimeUnit_NANO
 */
    __pyx_v_unit_code =  arrow::TimeUnit::MICRO;

    /* "pyarrow/types.pxi":1677
 *         c_string c_timezone
 * 
 *     if unit == 'us':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_MICRO
 *     elif unit == 'ns':
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":1679
 *     if unit == 'us':
 *         unit_code = TimeUnit_MICRO
 *     elif unit == 'ns':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_NANO
 *     else:
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_ns, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1679, __pyx_L1_error)
  if (likely(__pyx_t_1)) {

    /* "pyarrow/types.pxi":1680
 *         unit_code = TimeUnit_MICRO
 *     elif unit == 'ns':
 *         unit_code = TimeUnit_NANO             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError('Invalid TimeUnit for time64: {}'.format(unit))
 */
    __pyx_v_unit_code =  arrow::TimeUnit::NANO;

    /* "pyarrow/types.pxi":1679
 *     if unit == 'us':
 *         unit_code = TimeUnit_MICRO
 *     elif unit == 'ns':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_NANO
 *     else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":1682
 *         unit_code = TimeUnit_NANO
 *     else:
 *         raise ValueError('Invalid TimeUnit for time64: {}'.format(unit))             # <<<<<<<<<<<<<<
 * 
 *     if unit_code in _time_type_cache:
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Invalid_TimeUnit_for_time64, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1682, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_unit) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_unit);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1682, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1682, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(4, 1682, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "pyarrow/types.pxi":1684
 *         raise ValueError('Invalid TimeUnit for time64: {}'.format(unit))
 * 
 *     if unit_code in _time_type_cache:             # <<<<<<<<<<<<<<
 *         return _time_type_cache[unit_code]
 * 
 */
  __pyx_t_3 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type(__pyx_v_unit_code); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (unlikely(__pyx_v_7pyarrow_3lib__time_type_cache == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(4, 1684, __pyx_L1_error)
  }
  __pyx_t_1 = (__Pyx_PyDict_ContainsTF(__pyx_t_3, __pyx_v_7pyarrow_3lib__time_type_cache, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1684, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = (__pyx_t_1 != 0);
  if (__pyx_t_5) {

    /* "pyarrow/types.pxi":1685
 * 
 *     if unit_code in _time_type_cache:
 *         return _time_type_cache[unit_code]             # <<<<<<<<<<<<<<
 * 
 *     cdef Time64Type out = Time64Type.__new__(Time64Type)
 */
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(__pyx_v_7pyarrow_3lib__time_type_cache == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(4, 1685, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type(__pyx_v_unit_code); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1685, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_7pyarrow_3lib__time_type_cache, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1685, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":1684
 *         raise ValueError('Invalid TimeUnit for time64: {}'.format(unit))
 * 
 *     if unit_code in _time_type_cache:             # <<<<<<<<<<<<<<
 *         return _time_type_cache[unit_code]
 * 
 */
  }

  /* "pyarrow/types.pxi":1687
 *         return _time_type_cache[unit_code]
 * 
 *     cdef Time64Type out = Time64Type.__new__(Time64Type)             # <<<<<<<<<<<<<<
 * 
 *     out.init(ctime64(unit_code))
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_Time64Type(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_Time64Type), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1687, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_Time64Type *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":1689
 *     cdef Time64Type out = Time64Type.__new__(Time64Type)
 * 
 *     out.init(ctime64(unit_code))             # <<<<<<<<<<<<<<
 *     _time_type_cache[unit_code] = out
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_Time64Type *)__pyx_v_out->__pyx_base.__pyx_vtab)->__pyx_base.init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_out),  arrow::time64(__pyx_v_unit_code)); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1689, __pyx_L1_error)

  /* "pyarrow/types.pxi":1690
 * 
 *     out.init(ctime64(unit_code))
 *     _time_type_cache[unit_code] = out             # <<<<<<<<<<<<<<
 * 
 *     return out
 */
  if (unlikely(__pyx_v_7pyarrow_3lib__time_type_cache == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 1690, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type(__pyx_v_unit_code); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1690, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(PyDict_SetItem(__pyx_v_7pyarrow_3lib__time_type_cache, __pyx_t_2, ((PyObject *)__pyx_v_out)) < 0)) __PYX_ERR(4, 1690, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":1692
 *     _time_type_cache[unit_code] = out
 * 
 *     return out             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = ((PyObject *)__pyx_v_out);
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1657
 * 
 * 
 * def time64(unit):             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 64-bit time (time of day) type with unit resolution
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.time64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1695
 * 
 * 
 * def duration(unit):             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of a duration type with unit resolution.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_57duration(PyObject *__pyx_self, PyObject *__pyx_v_unit); /*proto*/
static char __pyx_doc_7pyarrow_3lib_56duration[] = "duration(unit)\n\n    Create instance of a duration type with unit resolution.\n\n    Parameters\n    ----------\n    unit : string\n        one of 's' [second], 'ms' [millisecond], 'us' [microsecond], or 'ns'\n        [nanosecond]\n\n    Examples\n    --------\n    ::\n\n        t1 = pa.duration('us')\n        t2 = pa.duration('s')\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_57duration = {"duration", (PyCFunction)__pyx_pw_7pyarrow_3lib_57duration, METH_O, __pyx_doc_7pyarrow_3lib_56duration};
static PyObject *__pyx_pw_7pyarrow_3lib_57duration(PyObject *__pyx_self, PyObject *__pyx_v_unit) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("duration (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_56duration(__pyx_self, ((PyObject *)__pyx_v_unit));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_56duration(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_unit) {
  enum  arrow::TimeUnit::type __pyx_v_unit_code;
  struct __pyx_obj_7pyarrow_3lib_DurationType *__pyx_v_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("duration", 0);

  /* "pyarrow/types.pxi":1715
 *         TimeUnit unit_code
 * 
 *     if unit == "s":             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_SECOND
 *     elif unit == 'ms':
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_s, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1715, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/types.pxi":1716
 * 
 *     if unit == "s":
 *         unit_code = TimeUnit_SECOND             # <<<<<<<<<<<<<<
 *     elif unit == 'ms':
 *         unit_code = TimeUnit_MILLI
 */
    __pyx_v_unit_code =  arrow::TimeUnit::SECOND;

    /* "pyarrow/types.pxi":1715
 *         TimeUnit unit_code
 * 
 *     if unit == "s":             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_SECOND
 *     elif unit == 'ms':
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":1717
 *     if unit == "s":
 *         unit_code = TimeUnit_SECOND
 *     elif unit == 'ms':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_MILLI
 *     elif unit == 'us':
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_ms, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1717, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/types.pxi":1718
 *         unit_code = TimeUnit_SECOND
 *     elif unit == 'ms':
 *         unit_code = TimeUnit_MILLI             # <<<<<<<<<<<<<<
 *     elif unit == 'us':
 *         unit_code = TimeUnit_MICRO
 */
    __pyx_v_unit_code =  arrow::TimeUnit::MILLI;

    /* "pyarrow/types.pxi":1717
 *     if unit == "s":
 *         unit_code = TimeUnit_SECOND
 *     elif unit == 'ms':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_MILLI
 *     elif unit == 'us':
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":1719
 *     elif unit == 'ms':
 *         unit_code = TimeUnit_MILLI
 *     elif unit == 'us':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_MICRO
 *     elif unit == 'ns':
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_us, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1719, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/types.pxi":1720
 *         unit_code = TimeUnit_MILLI
 *     elif unit == 'us':
 *         unit_code = TimeUnit_MICRO             # <<<<<<<<<<<<<<
 *     elif unit == 'ns':
 *         unit_code = TimeUnit_NANO
 */
    __pyx_v_unit_code =  arrow::TimeUnit::MICRO;

    /* "pyarrow/types.pxi":1719
 *     elif unit == 'ms':
 *         unit_code = TimeUnit_MILLI
 *     elif unit == 'us':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_MICRO
 *     elif unit == 'ns':
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":1721
 *     elif unit == 'us':
 *         unit_code = TimeUnit_MICRO
 *     elif unit == 'ns':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_NANO
 *     else:
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_ns, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1721, __pyx_L1_error)
  if (likely(__pyx_t_1)) {

    /* "pyarrow/types.pxi":1722
 *         unit_code = TimeUnit_MICRO
 *     elif unit == 'ns':
 *         unit_code = TimeUnit_NANO             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError('Invalid TimeUnit string')
 */
    __pyx_v_unit_code =  arrow::TimeUnit::NANO;

    /* "pyarrow/types.pxi":1721
 *     elif unit == 'us':
 *         unit_code = TimeUnit_MICRO
 *     elif unit == 'ns':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_NANO
 *     else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":1724
 *         unit_code = TimeUnit_NANO
 *     else:
 *         raise ValueError('Invalid TimeUnit string')             # <<<<<<<<<<<<<<
 * 
 *     if unit_code in _duration_type_cache:
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1724, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 1724, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "pyarrow/types.pxi":1726
 *         raise ValueError('Invalid TimeUnit string')
 * 
 *     if unit_code in _duration_type_cache:             # <<<<<<<<<<<<<<
 *         return _duration_type_cache[unit_code]
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type(__pyx_v_unit_code); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1726, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(__pyx_v_7pyarrow_3lib__duration_type_cache == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(4, 1726, __pyx_L1_error)
  }
  __pyx_t_1 = (__Pyx_PyDict_ContainsTF(__pyx_t_2, __pyx_v_7pyarrow_3lib__duration_type_cache, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1726, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/types.pxi":1727
 * 
 *     if unit_code in _duration_type_cache:
 *         return _duration_type_cache[unit_code]             # <<<<<<<<<<<<<<
 * 
 *     cdef DurationType out = DurationType.__new__(DurationType)
 */
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(__pyx_v_7pyarrow_3lib__duration_type_cache == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(4, 1727, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type(__pyx_v_unit_code); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1727, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_7pyarrow_3lib__duration_type_cache, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1727, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":1726
 *         raise ValueError('Invalid TimeUnit string')
 * 
 *     if unit_code in _duration_type_cache:             # <<<<<<<<<<<<<<
 *         return _duration_type_cache[unit_code]
 * 
 */
  }

  /* "pyarrow/types.pxi":1729
 *         return _duration_type_cache[unit_code]
 * 
 *     cdef DurationType out = DurationType.__new__(DurationType)             # <<<<<<<<<<<<<<
 * 
 *     out.init(cduration(unit_code))
 */
  __pyx_t_4 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_DurationType(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_DurationType), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1729, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_DurationType *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyarrow/types.pxi":1731
 *     cdef DurationType out = DurationType.__new__(DurationType)
 * 
 *     out.init(cduration(unit_code))             # <<<<<<<<<<<<<<
 *     _duration_type_cache[unit_code] = out
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_DurationType *)__pyx_v_out->__pyx_base.__pyx_vtab)->__pyx_base.init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_out),  arrow::duration(__pyx_v_unit_code)); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1731, __pyx_L1_error)

  /* "pyarrow/types.pxi":1732
 * 
 *     out.init(cduration(unit_code))
 *     _duration_type_cache[unit_code] = out             # <<<<<<<<<<<<<<
 * 
 *     return out
 */
  if (unlikely(__pyx_v_7pyarrow_3lib__duration_type_cache == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(4, 1732, __pyx_L1_error)
  }
  __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type(__pyx_v_unit_code); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (unlikely(PyDict_SetItem(__pyx_v_7pyarrow_3lib__duration_type_cache, __pyx_t_4, ((PyObject *)__pyx_v_out)) < 0)) __PYX_ERR(4, 1732, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/types.pxi":1734
 *     _duration_type_cache[unit_code] = out
 * 
 *     return out             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = ((PyObject *)__pyx_v_out);
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1695
 * 
 * 
 * def duration(unit):             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of a duration type with unit resolution.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.duration", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1737
 * 
 * 
 * def date32():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 32-bit date (days since UNIX epoch 1970-01-01)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_59date32(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_58date32[] = "date32()\n\n    Create instance of 32-bit date (days since UNIX epoch 1970-01-01)\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_59date32 = {"date32", (PyCFunction)__pyx_pw_7pyarrow_3lib_59date32, METH_NOARGS, __pyx_doc_7pyarrow_3lib_58date32};
static PyObject *__pyx_pw_7pyarrow_3lib_59date32(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("date32 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_58date32(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_58date32(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("date32", 0);

  /* "pyarrow/types.pxi":1741
 *     Create instance of 32-bit date (days since UNIX epoch 1970-01-01)
 *     """
 *     return primitive_type(_Type_DATE32)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::DATE32)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1741, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1737
 * 
 * 
 * def date32():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 32-bit date (days since UNIX epoch 1970-01-01)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.date32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1744
 * 
 * 
 * def date64():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 64-bit date (milliseconds since UNIX epoch 1970-01-01)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_61date64(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_60date64[] = "date64()\n\n    Create instance of 64-bit date (milliseconds since UNIX epoch 1970-01-01)\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_61date64 = {"date64", (PyCFunction)__pyx_pw_7pyarrow_3lib_61date64, METH_NOARGS, __pyx_doc_7pyarrow_3lib_60date64};
static PyObject *__pyx_pw_7pyarrow_3lib_61date64(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("date64 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_60date64(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_60date64(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("date64", 0);

  /* "pyarrow/types.pxi":1748
 *     Create instance of 64-bit date (milliseconds since UNIX epoch 1970-01-01)
 *     """
 *     return primitive_type(_Type_DATE64)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::DATE64)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1748, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1744
 * 
 * 
 * def date64():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 64-bit date (milliseconds since UNIX epoch 1970-01-01)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.date64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1751
 * 
 * 
 * def float16():             # <<<<<<<<<<<<<<
 *     """
 *     Create half-precision floating point type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_63float16(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_62float16[] = "float16()\n\n    Create half-precision floating point type\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_63float16 = {"float16", (PyCFunction)__pyx_pw_7pyarrow_3lib_63float16, METH_NOARGS, __pyx_doc_7pyarrow_3lib_62float16};
static PyObject *__pyx_pw_7pyarrow_3lib_63float16(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("float16 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_62float16(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_62float16(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("float16", 0);

  /* "pyarrow/types.pxi":1755
 *     Create half-precision floating point type
 *     """
 *     return primitive_type(_Type_HALF_FLOAT)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::HALF_FLOAT)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1751
 * 
 * 
 * def float16():             # <<<<<<<<<<<<<<
 *     """
 *     Create half-precision floating point type
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.float16", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1758
 * 
 * 
 * def float32():             # <<<<<<<<<<<<<<
 *     """
 *     Create single-precision floating point type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_65float32(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_64float32[] = "float32()\n\n    Create single-precision floating point type\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_65float32 = {"float32", (PyCFunction)__pyx_pw_7pyarrow_3lib_65float32, METH_NOARGS, __pyx_doc_7pyarrow_3lib_64float32};
static PyObject *__pyx_pw_7pyarrow_3lib_65float32(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("float32 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_64float32(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_64float32(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("float32", 0);

  /* "pyarrow/types.pxi":1762
 *     Create single-precision floating point type
 *     """
 *     return primitive_type(_Type_FLOAT)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::FLOAT)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1762, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1758
 * 
 * 
 * def float32():             # <<<<<<<<<<<<<<
 *     """
 *     Create single-precision floating point type
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1765
 * 
 * 
 * def float64():             # <<<<<<<<<<<<<<
 *     """
 *     Create double-precision floating point type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_67float64(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_66float64[] = "float64()\n\n    Create double-precision floating point type\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_67float64 = {"float64", (PyCFunction)__pyx_pw_7pyarrow_3lib_67float64, METH_NOARGS, __pyx_doc_7pyarrow_3lib_66float64};
static PyObject *__pyx_pw_7pyarrow_3lib_67float64(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("float64 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_66float64(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_66float64(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("float64", 0);

  /* "pyarrow/types.pxi":1769
 *     Create double-precision floating point type
 *     """
 *     return primitive_type(_Type_DOUBLE)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::DOUBLE)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1769, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1765
 * 
 * 
 * def float64():             # <<<<<<<<<<<<<<
 *     """
 *     Create double-precision floating point type
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1772
 * 
 * 
 * cpdef DataType decimal128(int precision, int scale=0):             # <<<<<<<<<<<<<<
 *     """
 *     Create decimal type with precision and scale and 128bit width
 */

static PyObject *__pyx_pw_7pyarrow_3lib_69decimal128(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_f_7pyarrow_3lib_decimal128(int __pyx_v_precision, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_7pyarrow_3lib_decimal128 *__pyx_optional_args) {
  int __pyx_v_scale = ((int)0);
  std::shared_ptr< arrow::DataType>  __pyx_v_decimal_type;
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("decimal128", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_scale = __pyx_optional_args->scale;
    }
  }

  /* "pyarrow/types.pxi":1786
 *     """
 *     cdef shared_ptr[CDataType] decimal_type
 *     if precision < 1 or precision > 38:             # <<<<<<<<<<<<<<
 *         raise ValueError("precision should be between 1 and 38")
 *     decimal_type.reset(new CDecimal128Type(precision, scale))
 */
  __pyx_t_2 = ((__pyx_v_precision < 1) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_precision > 38) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/types.pxi":1787
 *     cdef shared_ptr[CDataType] decimal_type
 *     if precision < 1 or precision > 38:
 *         raise ValueError("precision should be between 1 and 38")             # <<<<<<<<<<<<<<
 *     decimal_type.reset(new CDecimal128Type(precision, scale))
 *     return pyarrow_wrap_data_type(decimal_type)
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1787, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(4, 1787, __pyx_L1_error)

    /* "pyarrow/types.pxi":1786
 *     """
 *     cdef shared_ptr[CDataType] decimal_type
 *     if precision < 1 or precision > 38:             # <<<<<<<<<<<<<<
 *         raise ValueError("precision should be between 1 and 38")
 *     decimal_type.reset(new CDecimal128Type(precision, scale))
 */
  }

  /* "pyarrow/types.pxi":1788
 *     if precision < 1 or precision > 38:
 *         raise ValueError("precision should be between 1 and 38")
 *     decimal_type.reset(new CDecimal128Type(precision, scale))             # <<<<<<<<<<<<<<
 *     return pyarrow_wrap_data_type(decimal_type)
 * 
 */
  __pyx_v_decimal_type.reset(new  arrow::Decimal128Type(__pyx_v_precision, __pyx_v_scale));

  /* "pyarrow/types.pxi":1789
 *         raise ValueError("precision should be between 1 and 38")
 *     decimal_type.reset(new CDecimal128Type(precision, scale))
 *     return pyarrow_wrap_data_type(decimal_type)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_decimal_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1789, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(4, 1789, __pyx_L1_error)
  __pyx_r = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1772
 * 
 * 
 * cpdef DataType decimal128(int precision, int scale=0):             # <<<<<<<<<<<<<<
 *     """
 *     Create decimal type with precision and scale and 128bit width
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.decimal128", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_69decimal128(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_68decimal128[] = "decimal128(int precision, int scale=0) -> DataType\n\n    Create decimal type with precision and scale and 128bit width\n\n    Parameters\n    ----------\n    precision : int\n    scale : int\n\n    Returns\n    -------\n    decimal_type : Decimal128Type\n    ";
static PyObject *__pyx_pw_7pyarrow_3lib_69decimal128(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_precision;
  int __pyx_v_scale;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("decimal128 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_precision,&__pyx_n_s_scale,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_precision)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_scale);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "decimal128") < 0)) __PYX_ERR(4, 1772, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_precision = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_precision == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 1772, __pyx_L3_error)
    if (values[1]) {
      __pyx_v_scale = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_scale == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 1772, __pyx_L3_error)
    } else {
      __pyx_v_scale = ((int)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("decimal128", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 1772, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.decimal128", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_68decimal128(__pyx_self, __pyx_v_precision, __pyx_v_scale);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_68decimal128(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_precision, int __pyx_v_scale) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7pyarrow_3lib_decimal128 __pyx_t_2;
  __Pyx_RefNannySetupContext("decimal128", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.scale = __pyx_v_scale;
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_decimal128(__pyx_v_precision, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1772, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.decimal128", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1792
 * 
 * 
 * def string():             # <<<<<<<<<<<<<<
 *     """
 *     Create UTF8 variable-length string type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_71string(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_70string[] = "string()\n\n    Create UTF8 variable-length string type\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_71string = {"string", (PyCFunction)__pyx_pw_7pyarrow_3lib_71string, METH_NOARGS, __pyx_doc_7pyarrow_3lib_70string};
static PyObject *__pyx_pw_7pyarrow_3lib_71string(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("string (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_70string(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_70string(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("string", 0);

  /* "pyarrow/types.pxi":1796
 *     Create UTF8 variable-length string type
 *     """
 *     return primitive_type(_Type_STRING)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::STRING)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1796, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1792
 * 
 * 
 * def string():             # <<<<<<<<<<<<<<
 *     """
 *     Create UTF8 variable-length string type
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1799
 * 
 * 
 * def utf8():             # <<<<<<<<<<<<<<
 *     """
 *     Alias for string()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_73utf8(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_72utf8[] = "utf8()\n\n    Alias for string()\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_73utf8 = {"utf8", (PyCFunction)__pyx_pw_7pyarrow_3lib_73utf8, METH_NOARGS, __pyx_doc_7pyarrow_3lib_72utf8};
static PyObject *__pyx_pw_7pyarrow_3lib_73utf8(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("utf8 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_72utf8(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_72utf8(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("utf8", 0);

  /* "pyarrow/types.pxi":1803
 *     Alias for string()
 *     """
 *     return string()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_string); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1803, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1803, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1799
 * 
 * 
 * def utf8():             # <<<<<<<<<<<<<<
 *     """
 *     Alias for string()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.utf8", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1806
 * 
 * 
 * def binary(int length=-1):             # <<<<<<<<<<<<<<
 *     """
 *     Create variable-length binary type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_75binary(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_74binary[] = "binary(int length=-1)\n\n    Create variable-length binary type\n\n    Parameters\n    ----------\n    length : int, optional, default -1\n        If length == -1 then return a variable length binary type. If length is\n        greater than or equal to 0 then return a fixed size binary type of\n        width `length`.\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_75binary = {"binary", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_75binary, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_74binary};
static PyObject *__pyx_pw_7pyarrow_3lib_75binary(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_length;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("binary (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_length,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_length);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "binary") < 0)) __PYX_ERR(4, 1806, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_length = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_length == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 1806, __pyx_L3_error)
    } else {
      __pyx_v_length = ((int)-1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("binary", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 1806, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.binary", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_74binary(__pyx_self, __pyx_v_length);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_74binary(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_length) {
  std::shared_ptr< arrow::DataType>  __pyx_v_fixed_size_binary_type;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("binary", 0);

  /* "pyarrow/types.pxi":1817
 *         width `length`.
 *     """
 *     if length == -1:             # <<<<<<<<<<<<<<
 *         return primitive_type(_Type_BINARY)
 * 
 */
  __pyx_t_1 = ((__pyx_v_length == -1L) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/types.pxi":1818
 *     """
 *     if length == -1:
 *         return primitive_type(_Type_BINARY)             # <<<<<<<<<<<<<<
 * 
 *     cdef shared_ptr[CDataType] fixed_size_binary_type
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::BINARY)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1818, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":1817
 *         width `length`.
 *     """
 *     if length == -1:             # <<<<<<<<<<<<<<
 *         return primitive_type(_Type_BINARY)
 * 
 */
  }

  /* "pyarrow/types.pxi":1821
 * 
 *     cdef shared_ptr[CDataType] fixed_size_binary_type
 *     fixed_size_binary_type.reset(new CFixedSizeBinaryType(length))             # <<<<<<<<<<<<<<
 *     return pyarrow_wrap_data_type(fixed_size_binary_type)
 * 
 */
  __pyx_v_fixed_size_binary_type.reset(new  arrow::FixedSizeBinaryType(__pyx_v_length));

  /* "pyarrow/types.pxi":1822
 *     cdef shared_ptr[CDataType] fixed_size_binary_type
 *     fixed_size_binary_type.reset(new CFixedSizeBinaryType(length))
 *     return pyarrow_wrap_data_type(fixed_size_binary_type)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_fixed_size_binary_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1822, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1806
 * 
 * 
 * def binary(int length=-1):             # <<<<<<<<<<<<<<
 *     """
 *     Create variable-length binary type
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.binary", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1825
 * 
 * 
 * def large_binary():             # <<<<<<<<<<<<<<
 *     """
 *     Create large variable-length binary type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_77large_binary(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_76large_binary[] = "large_binary()\n\n    Create large variable-length binary type\n\n    This data type may not be supported by all Arrow implementations.  Unless\n    you need to represent data larger than 2GB, you should prefer binary().\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_77large_binary = {"large_binary", (PyCFunction)__pyx_pw_7pyarrow_3lib_77large_binary, METH_NOARGS, __pyx_doc_7pyarrow_3lib_76large_binary};
static PyObject *__pyx_pw_7pyarrow_3lib_77large_binary(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("large_binary (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_76large_binary(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_76large_binary(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("large_binary", 0);

  /* "pyarrow/types.pxi":1832
 *     you need to represent data larger than 2GB, you should prefer binary().
 *     """
 *     return primitive_type(_Type_LARGE_BINARY)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::LARGE_BINARY)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1832, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1825
 * 
 * 
 * def large_binary():             # <<<<<<<<<<<<<<
 *     """
 *     Create large variable-length binary type
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.large_binary", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1835
 * 
 * 
 * def large_string():             # <<<<<<<<<<<<<<
 *     """
 *     Create large UTF8 variable-length string type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_79large_string(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_78large_string[] = "large_string()\n\n    Create large UTF8 variable-length string type\n\n    This data type may not be supported by all Arrow implementations.  Unless\n    you need to represent data larger than 2GB, you should prefer string().\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_79large_string = {"large_string", (PyCFunction)__pyx_pw_7pyarrow_3lib_79large_string, METH_NOARGS, __pyx_doc_7pyarrow_3lib_78large_string};
static PyObject *__pyx_pw_7pyarrow_3lib_79large_string(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("large_string (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_78large_string(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_78large_string(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("large_string", 0);

  /* "pyarrow/types.pxi":1842
 *     you need to represent data larger than 2GB, you should prefer string().
 *     """
 *     return primitive_type(_Type_LARGE_STRING)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_primitive_type( arrow::Type::LARGE_STRING)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1842, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1835
 * 
 * 
 * def large_string():             # <<<<<<<<<<<<<<
 *     """
 *     Create large UTF8 variable-length string type
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.large_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1845
 * 
 * 
 * def large_utf8():             # <<<<<<<<<<<<<<
 *     """
 *     Alias for large_string()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_81large_utf8(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_80large_utf8[] = "large_utf8()\n\n    Alias for large_string()\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_81large_utf8 = {"large_utf8", (PyCFunction)__pyx_pw_7pyarrow_3lib_81large_utf8, METH_NOARGS, __pyx_doc_7pyarrow_3lib_80large_utf8};
static PyObject *__pyx_pw_7pyarrow_3lib_81large_utf8(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("large_utf8 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_80large_utf8(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_80large_utf8(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("large_utf8", 0);

  /* "pyarrow/types.pxi":1849
 *     Alias for large_string()
 *     """
 *     return large_string()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_large_string); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1845
 * 
 * 
 * def large_utf8():             # <<<<<<<<<<<<<<
 *     """
 *     Alias for large_string()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.large_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1852
 * 
 * 
 * def list_(value_type, int list_size=-1):             # <<<<<<<<<<<<<<
 *     """
 *     Create ListType instance from child data type or field
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_83list_(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_82list_[] = "list_(value_type, int list_size=-1)\n\n    Create ListType instance from child data type or field\n\n    Parameters\n    ----------\n    value_type : DataType or Field\n    list_size : int, optional, default -1\n        If length == -1 then return a variable length list type. If length is\n        greater than or equal to 0 then return a fixed size list type.\n\n    Returns\n    -------\n    list_type : DataType\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_83list_ = {"list_", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_83list_, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_82list_};
static PyObject *__pyx_pw_7pyarrow_3lib_83list_(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_value_type = 0;
  int __pyx_v_list_size;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("list_ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value_type,&__pyx_n_s_list_size,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_list_size);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "list_") < 0)) __PYX_ERR(4, 1852, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_value_type = values[0];
    if (values[1]) {
      __pyx_v_list_size = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_list_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 1852, __pyx_L3_error)
    } else {
      __pyx_v_list_size = ((int)-1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("list_", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 1852, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.list_", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_82list_(__pyx_self, __pyx_v_value_type, __pyx_v_list_size);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_82list_(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value_type, int __pyx_v_list_size) {
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v__field = 0;
  std::shared_ptr< arrow::DataType>  __pyx_v_list_type;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("list_", 0);

  /* "pyarrow/types.pxi":1871
 *         shared_ptr[CDataType] list_type
 * 
 *     if isinstance(value_type, DataType):             # <<<<<<<<<<<<<<
 *         _field = field('item', value_type)
 *     elif isinstance(value_type, Field):
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_value_type, __pyx_ptype_7pyarrow_3lib_DataType); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/types.pxi":1872
 * 
 *     if isinstance(value_type, DataType):
 *         _field = field('item', value_type)             # <<<<<<<<<<<<<<
 *     elif isinstance(value_type, Field):
 *         _field = value_type
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_field); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1872, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_item, __pyx_v_value_type};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1872, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_item, __pyx_v_value_type};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1872, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 1872, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(__pyx_n_u_item);
      __Pyx_GIVEREF(__pyx_n_u_item);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_n_u_item);
      __Pyx_INCREF(__pyx_v_value_type);
      __Pyx_GIVEREF(__pyx_v_value_type);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_value_type);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1872, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(4, 1872, __pyx_L1_error)
    __pyx_v__field = ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/types.pxi":1871
 *         shared_ptr[CDataType] list_type
 * 
 *     if isinstance(value_type, DataType):             # <<<<<<<<<<<<<<
 *         _field = field('item', value_type)
 *     elif isinstance(value_type, Field):
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":1873
 *     if isinstance(value_type, DataType):
 *         _field = field('item', value_type)
 *     elif isinstance(value_type, Field):             # <<<<<<<<<<<<<<
 *         _field = value_type
 *     else:
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_value_type, __pyx_ptype_7pyarrow_3lib_Field); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (likely(__pyx_t_1)) {

    /* "pyarrow/types.pxi":1874
 *         _field = field('item', value_type)
 *     elif isinstance(value_type, Field):
 *         _field = value_type             # <<<<<<<<<<<<<<
 *     else:
 *         raise TypeError('List requires DataType or Field')
 */
    if (!(likely(((__pyx_v_value_type) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value_type, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(4, 1874, __pyx_L1_error)
    __pyx_t_3 = __pyx_v_value_type;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v__field = ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/types.pxi":1873
 *     if isinstance(value_type, DataType):
 *         _field = field('item', value_type)
 *     elif isinstance(value_type, Field):             # <<<<<<<<<<<<<<
 *         _field = value_type
 *     else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":1876
 *         _field = value_type
 *     else:
 *         raise TypeError('List requires DataType or Field')             # <<<<<<<<<<<<<<
 * 
 *     if list_size == -1:
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1876, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(4, 1876, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "pyarrow/types.pxi":1878
 *         raise TypeError('List requires DataType or Field')
 * 
 *     if list_size == -1:             # <<<<<<<<<<<<<<
 *         list_type.reset(new CListType(_field.sp_field))
 *     else:
 */
  __pyx_t_1 = ((__pyx_v_list_size == -1L) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/types.pxi":1879
 * 
 *     if list_size == -1:
 *         list_type.reset(new CListType(_field.sp_field))             # <<<<<<<<<<<<<<
 *     else:
 *         if list_size < 0:
 */
    __pyx_v_list_type.reset(new  arrow::ListType(__pyx_v__field->sp_field));

    /* "pyarrow/types.pxi":1878
 *         raise TypeError('List requires DataType or Field')
 * 
 *     if list_size == -1:             # <<<<<<<<<<<<<<
 *         list_type.reset(new CListType(_field.sp_field))
 *     else:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/types.pxi":1881
 *         list_type.reset(new CListType(_field.sp_field))
 *     else:
 *         if list_size < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("list_size should be a positive integer")
 *         list_type.reset(new CFixedSizeListType(_field.sp_field, list_size))
 */
  /*else*/ {
    __pyx_t_1 = ((__pyx_v_list_size < 0) != 0);
    if (unlikely(__pyx_t_1)) {

      /* "pyarrow/types.pxi":1882
 *     else:
 *         if list_size < 0:
 *             raise ValueError("list_size should be a positive integer")             # <<<<<<<<<<<<<<
 *         list_type.reset(new CFixedSizeListType(_field.sp_field, list_size))
 * 
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1882, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(4, 1882, __pyx_L1_error)

      /* "pyarrow/types.pxi":1881
 *         list_type.reset(new CListType(_field.sp_field))
 *     else:
 *         if list_size < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("list_size should be a positive integer")
 *         list_type.reset(new CFixedSizeListType(_field.sp_field, list_size))
 */
    }

    /* "pyarrow/types.pxi":1883
 *         if list_size < 0:
 *             raise ValueError("list_size should be a positive integer")
 *         list_type.reset(new CFixedSizeListType(_field.sp_field, list_size))             # <<<<<<<<<<<<<<
 * 
 *     return pyarrow_wrap_data_type(list_type)
 */
    __pyx_v_list_type.reset(new  arrow::FixedSizeListType(__pyx_v__field->sp_field, __pyx_v_list_size));
  }
  __pyx_L4:;

  /* "pyarrow/types.pxi":1885
 *         list_type.reset(new CFixedSizeListType(_field.sp_field, list_size))
 * 
 *     return pyarrow_wrap_data_type(list_type)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_list_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1885, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1852
 * 
 * 
 * def list_(value_type, int list_size=-1):             # <<<<<<<<<<<<<<
 *     """
 *     Create ListType instance from child data type or field
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.list_", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__field);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1888
 * 
 * 
 * cpdef LargeListType large_list(value_type):             # <<<<<<<<<<<<<<
 *     """
 *     Create LargeListType instance from child data type or field
 */

static PyObject *__pyx_pw_7pyarrow_3lib_85large_list(PyObject *__pyx_self, PyObject *__pyx_v_value_type); /*proto*/
static struct __pyx_obj_7pyarrow_3lib_LargeListType *__pyx_f_7pyarrow_3lib_large_list(PyObject *__pyx_v_value_type, CYTHON_UNUSED int __pyx_skip_dispatch) {
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v__field = 0;
  std::shared_ptr< arrow::DataType>  __pyx_v_list_type;
  struct __pyx_obj_7pyarrow_3lib_LargeListType *__pyx_v_out = 0;
  struct __pyx_obj_7pyarrow_3lib_LargeListType *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("large_list", 0);

  /* "pyarrow/types.pxi":1908
 *         Field _field
 *         shared_ptr[CDataType] list_type
 *         LargeListType out = LargeListType.__new__(LargeListType)             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(value_type, DataType):
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_LargeListType(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_LargeListType), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1908, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_LargeListType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":1910
 *         LargeListType out = LargeListType.__new__(LargeListType)
 * 
 *     if isinstance(value_type, DataType):             # <<<<<<<<<<<<<<
 *         _field = field('item', value_type)
 *     elif isinstance(value_type, Field):
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_value_type, __pyx_ptype_7pyarrow_3lib_DataType); 
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/types.pxi":1911
 * 
 *     if isinstance(value_type, DataType):
 *         _field = field('item', value_type)             # <<<<<<<<<<<<<<
 *     elif isinstance(value_type, Field):
 *         _field = value_type
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_field); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1911, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_item, __pyx_v_value_type};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1911, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_item, __pyx_v_value_type};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1911, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 1911, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(__pyx_n_u_item);
      __Pyx_GIVEREF(__pyx_n_u_item);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_n_u_item);
      __Pyx_INCREF(__pyx_v_value_type);
      __Pyx_GIVEREF(__pyx_v_value_type);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_value_type);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1911, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(4, 1911, __pyx_L1_error)
    __pyx_v__field = ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/types.pxi":1910
 *         LargeListType out = LargeListType.__new__(LargeListType)
 * 
 *     if isinstance(value_type, DataType):             # <<<<<<<<<<<<<<
 *         _field = field('item', value_type)
 *     elif isinstance(value_type, Field):
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":1912
 *     if isinstance(value_type, DataType):
 *         _field = field('item', value_type)
 *     elif isinstance(value_type, Field):             # <<<<<<<<<<<<<<
 *         _field = value_type
 *     else:
 */
  __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_value_type, __pyx_ptype_7pyarrow_3lib_Field); 
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (likely(__pyx_t_2)) {

    /* "pyarrow/types.pxi":1913
 *         _field = field('item', value_type)
 *     elif isinstance(value_type, Field):
 *         _field = value_type             # <<<<<<<<<<<<<<
 *     else:
 *         raise TypeError('List requires DataType or Field')
 */
    if (!(likely(((__pyx_v_value_type) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value_type, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(4, 1913, __pyx_L1_error)
    __pyx_t_1 = __pyx_v_value_type;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_v__field = ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/types.pxi":1912
 *     if isinstance(value_type, DataType):
 *         _field = field('item', value_type)
 *     elif isinstance(value_type, Field):             # <<<<<<<<<<<<<<
 *         _field = value_type
 *     else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":1915
 *         _field = value_type
 *     else:
 *         raise TypeError('List requires DataType or Field')             # <<<<<<<<<<<<<<
 * 
 *     list_type.reset(new CLargeListType(_field.sp_field))
 */
  /*else*/ {
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1915, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 1915, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "pyarrow/types.pxi":1917
 *         raise TypeError('List requires DataType or Field')
 * 
 *     list_type.reset(new CLargeListType(_field.sp_field))             # <<<<<<<<<<<<<<
 *     out.init(list_type)
 *     return out
 */
  __pyx_v_list_type.reset(new  arrow::LargeListType(__pyx_v__field->sp_field));

  /* "pyarrow/types.pxi":1918
 * 
 *     list_type.reset(new CLargeListType(_field.sp_field))
 *     out.init(list_type)             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_LargeListType *)__pyx_v_out->__pyx_base.__pyx_vtab)->__pyx_base.init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_out), __pyx_v_list_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1918, __pyx_L1_error)

  /* "pyarrow/types.pxi":1919
 *     list_type.reset(new CLargeListType(_field.sp_field))
 *     out.init(list_type)
 *     return out             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1888
 * 
 * 
 * cpdef LargeListType large_list(value_type):             # <<<<<<<<<<<<<<
 *     """
 *     Create LargeListType instance from child data type or field
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.large_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__field);
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_85large_list(PyObject *__pyx_self, PyObject *__pyx_v_value_type); /*proto*/
static char __pyx_doc_7pyarrow_3lib_84large_list[] = "large_list(value_type) -> LargeListType\n\n    Create LargeListType instance from child data type or field\n\n    This data type may not be supported by all Arrow implementations.\n    Unless you need to represent data larger than 2**31 elements, you should\n    prefer list_().\n\n    Parameters\n    ----------\n    value_type : DataType or Field\n\n    Returns\n    -------\n    list_type : DataType\n    ";
static PyObject *__pyx_pw_7pyarrow_3lib_85large_list(PyObject *__pyx_self, PyObject *__pyx_v_value_type) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("large_list (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_84large_list(__pyx_self, ((PyObject *)__pyx_v_value_type));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_84large_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("large_list", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_large_list(__pyx_v_value_type, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1888, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.large_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1922
 * 
 * 
 * cpdef MapType map_(key_type, item_type, keys_sorted=False):             # <<<<<<<<<<<<<<
 *     """
 *     Create MapType instance from key and item data types
 */

static PyObject *__pyx_pw_7pyarrow_3lib_87map_(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7pyarrow_3lib_MapType *__pyx_f_7pyarrow_3lib_map_(PyObject *__pyx_v_key_type, PyObject *__pyx_v_item_type, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_7pyarrow_3lib_map_ *__pyx_optional_args) {
  PyObject *__pyx_v_keys_sorted = ((PyObject *)Py_False);
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v__key_type = 0;
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v__item_type = 0;
  std::shared_ptr< arrow::DataType>  __pyx_v_map_type;
  struct __pyx_obj_7pyarrow_3lib_MapType *__pyx_v_out = 0;
  struct __pyx_obj_7pyarrow_3lib_MapType *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7pyarrow_3lib_ensure_type __pyx_t_2;
  bool __pyx_t_3;
  __Pyx_RefNannySetupContext("map_", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_keys_sorted = __pyx_optional_args->keys_sorted;
    }
  }

  /* "pyarrow/types.pxi":1937
 *     """
 *     cdef:
 *         DataType _key_type = ensure_type(key_type, allow_none=False)             # <<<<<<<<<<<<<<
 *         DataType _item_type = ensure_type(item_type, allow_none=False)
 *         shared_ptr[CDataType] map_type
 */
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.allow_none = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_ensure_type(__pyx_v_key_type, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1937, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__key_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":1938
 *     cdef:
 *         DataType _key_type = ensure_type(key_type, allow_none=False)
 *         DataType _item_type = ensure_type(item_type, allow_none=False)             # <<<<<<<<<<<<<<
 *         shared_ptr[CDataType] map_type
 *         MapType out = MapType.__new__(MapType)
 */
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.allow_none = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_ensure_type(__pyx_v_item_type, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1938, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__item_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":1940
 *         DataType _item_type = ensure_type(item_type, allow_none=False)
 *         shared_ptr[CDataType] map_type
 *         MapType out = MapType.__new__(MapType)             # <<<<<<<<<<<<<<
 * 
 *     map_type.reset(new CMapType(_key_type.sp_type, _item_type.sp_type,
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_MapType(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_MapType), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1940, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_MapType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":1943
 * 
 *     map_type.reset(new CMapType(_key_type.sp_type, _item_type.sp_type,
 *                                 keys_sorted))             # <<<<<<<<<<<<<<
 *     out.init(map_type)
 *     return out
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_keys_sorted); if (unlikely((__pyx_t_3 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(4, 1943, __pyx_L1_error)

  /* "pyarrow/types.pxi":1942
 *         MapType out = MapType.__new__(MapType)
 * 
 *     map_type.reset(new CMapType(_key_type.sp_type, _item_type.sp_type,             # <<<<<<<<<<<<<<
 *                                 keys_sorted))
 *     out.init(map_type)
 */
  __pyx_v_map_type.reset(new  arrow::MapType(__pyx_v__key_type->sp_type, __pyx_v__item_type->sp_type, __pyx_t_3));

  /* "pyarrow/types.pxi":1944
 *     map_type.reset(new CMapType(_key_type.sp_type, _item_type.sp_type,
 *                                 keys_sorted))
 *     out.init(map_type)             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_MapType *)__pyx_v_out->__pyx_base.__pyx_vtab)->__pyx_base.init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_out), __pyx_v_map_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1944, __pyx_L1_error)

  /* "pyarrow/types.pxi":1945
 *                                 keys_sorted))
 *     out.init(map_type)
 *     return out             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1922
 * 
 * 
 * cpdef MapType map_(key_type, item_type, keys_sorted=False):             # <<<<<<<<<<<<<<
 *     """
 *     Create MapType instance from key and item data types
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.map_", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__key_type);
  __Pyx_XDECREF((PyObject *)__pyx_v__item_type);
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_87map_(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_86map_[] = "map_(key_type, item_type, keys_sorted=False) -> MapType\n\n    Create MapType instance from key and item data types\n\n    Parameters\n    ----------\n    key_type : DataType\n    item_type : DataType\n    keys_sorted : boolean\n\n    Returns\n    -------\n    map_type : DataType\n    ";
static PyObject *__pyx_pw_7pyarrow_3lib_87map_(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_key_type = 0;
  PyObject *__pyx_v_item_type = 0;
  PyObject *__pyx_v_keys_sorted = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map_ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key_type,&__pyx_n_s_item_type,&__pyx_n_s_keys_sorted,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_item_type)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("map_", 0, 2, 3, 1); __PYX_ERR(4, 1922, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_keys_sorted);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map_") < 0)) __PYX_ERR(4, 1922, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_key_type = values[0];
    __pyx_v_item_type = values[1];
    __pyx_v_keys_sorted = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map_", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 1922, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.map_", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_86map_(__pyx_self, __pyx_v_key_type, __pyx_v_item_type, __pyx_v_keys_sorted);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_86map_(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_key_type, PyObject *__pyx_v_item_type, PyObject *__pyx_v_keys_sorted) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7pyarrow_3lib_map_ __pyx_t_2;
  __Pyx_RefNannySetupContext("map_", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.keys_sorted = __pyx_v_keys_sorted;
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_map_(__pyx_v_key_type, __pyx_v_item_type, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1922, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.map_", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1948
 * 
 * 
 * cpdef DictionaryType dictionary(index_type, value_type, bint ordered=False):             # <<<<<<<<<<<<<<
 *     """
 *     Dictionary (categorical, or simply encoded) type
 */

static PyObject *__pyx_pw_7pyarrow_3lib_89dictionary(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7pyarrow_3lib_DictionaryType *__pyx_f_7pyarrow_3lib_dictionary(PyObject *__pyx_v_index_type, PyObject *__pyx_v_value_type, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_7pyarrow_3lib_dictionary *__pyx_optional_args) {
  int __pyx_v_ordered = ((int)0);
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v__index_type = 0;
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v__value_type = 0;
  struct __pyx_obj_7pyarrow_3lib_DictionaryType *__pyx_v_out = 0;
  std::shared_ptr< arrow::DataType>  __pyx_v_dict_type;
  struct __pyx_obj_7pyarrow_3lib_DictionaryType *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7pyarrow_3lib_ensure_type __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("dictionary", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_ordered = __pyx_optional_args->ordered;
    }
  }

  /* "pyarrow/types.pxi":1963
 *     """
 *     cdef:
 *         DataType _index_type = ensure_type(index_type, allow_none=False)             # <<<<<<<<<<<<<<
 *         DataType _value_type = ensure_type(value_type, allow_none=False)
 *         DictionaryType out = DictionaryType.__new__(DictionaryType)
 */
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.allow_none = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_ensure_type(__pyx_v_index_type, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1963, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__index_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":1964
 *     cdef:
 *         DataType _index_type = ensure_type(index_type, allow_none=False)
 *         DataType _value_type = ensure_type(value_type, allow_none=False)             # <<<<<<<<<<<<<<
 *         DictionaryType out = DictionaryType.__new__(DictionaryType)
 *         shared_ptr[CDataType] dict_type
 */
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.allow_none = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_ensure_type(__pyx_v_value_type, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1964, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__value_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":1965
 *         DataType _index_type = ensure_type(index_type, allow_none=False)
 *         DataType _value_type = ensure_type(value_type, allow_none=False)
 *         DictionaryType out = DictionaryType.__new__(DictionaryType)             # <<<<<<<<<<<<<<
 *         shared_ptr[CDataType] dict_type
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_DictionaryType(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_DictionaryType), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1965, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_DictionaryType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":1968
 *         shared_ptr[CDataType] dict_type
 * 
 *     if _index_type.id not in {Type_INT8, Type_INT16, Type_INT32, Type_INT64}:             # <<<<<<<<<<<<<<
 *         raise TypeError("The dictionary index type should be signed integer.")
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v__index_type), __pyx_n_s_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Type_INT8); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1968, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 1968, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_6) {
  } else {
    __pyx_t_3 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Type_INT16); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1968, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 1968, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_6) {
  } else {
    __pyx_t_3 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Type_INT32); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1968, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 1968, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_6) {
  } else {
    __pyx_t_3 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Type_INT64); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1968, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 1968, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = (__pyx_t_3 != 0);
  if (unlikely(__pyx_t_6)) {

    /* "pyarrow/types.pxi":1969
 * 
 *     if _index_type.id not in {Type_INT8, Type_INT16, Type_INT32, Type_INT64}:
 *         raise TypeError("The dictionary index type should be signed integer.")             # <<<<<<<<<<<<<<
 * 
 *     dict_type.reset(new CDictionaryType(_index_type.sp_type,
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1969, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 1969, __pyx_L1_error)

    /* "pyarrow/types.pxi":1968
 *         shared_ptr[CDataType] dict_type
 * 
 *     if _index_type.id not in {Type_INT8, Type_INT16, Type_INT32, Type_INT64}:             # <<<<<<<<<<<<<<
 *         raise TypeError("The dictionary index type should be signed integer.")
 * 
 */
  }

  /* "pyarrow/types.pxi":1971
 *         raise TypeError("The dictionary index type should be signed integer.")
 * 
 *     dict_type.reset(new CDictionaryType(_index_type.sp_type,             # <<<<<<<<<<<<<<
 *                                         _value_type.sp_type, ordered == 1))
 *     out.init(dict_type)
 */
  __pyx_v_dict_type.reset(new  arrow::DictionaryType(__pyx_v__index_type->sp_type, __pyx_v__value_type->sp_type, (__pyx_v_ordered == 1)));

  /* "pyarrow/types.pxi":1973
 *     dict_type.reset(new CDictionaryType(_index_type.sp_type,
 *                                         _value_type.sp_type, ordered == 1))
 *     out.init(dict_type)             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_DictionaryType *)__pyx_v_out->__pyx_base.__pyx_vtab)->__pyx_base.init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_out), __pyx_v_dict_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 1973, __pyx_L1_error)

  /* "pyarrow/types.pxi":1974
 *                                         _value_type.sp_type, ordered == 1))
 *     out.init(dict_type)
 *     return out             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1948
 * 
 * 
 * cpdef DictionaryType dictionary(index_type, value_type, bint ordered=False):             # <<<<<<<<<<<<<<
 *     """
 *     Dictionary (categorical, or simply encoded) type
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.dictionary", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__index_type);
  __Pyx_XDECREF((PyObject *)__pyx_v__value_type);
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_89dictionary(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_88dictionary[] = "dictionary(index_type, value_type, bool ordered=False) -> DictionaryType\n\n    Dictionary (categorical, or simply encoded) type\n\n    Parameters\n    ----------\n    index_type : DataType\n    value_type : DataType\n    ordered : boolean\n\n    Returns\n    -------\n    type : DictionaryType\n    ";
static PyObject *__pyx_pw_7pyarrow_3lib_89dictionary(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_index_type = 0;
  PyObject *__pyx_v_value_type = 0;
  int __pyx_v_ordered;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dictionary (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index_type,&__pyx_n_s_value_type,&__pyx_n_s_ordered,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value_type)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dictionary", 0, 2, 3, 1); __PYX_ERR(4, 1948, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ordered);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dictionary") < 0)) __PYX_ERR(4, 1948, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_index_type = values[0];
    __pyx_v_value_type = values[1];
    if (values[2]) {
      __pyx_v_ordered = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_ordered == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 1948, __pyx_L3_error)
    } else {
      __pyx_v_ordered = ((int)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dictionary", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 1948, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.dictionary", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_88dictionary(__pyx_self, __pyx_v_index_type, __pyx_v_value_type, __pyx_v_ordered);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_88dictionary(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_index_type, PyObject *__pyx_v_value_type, int __pyx_v_ordered) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7pyarrow_3lib_dictionary __pyx_t_2;
  __Pyx_RefNannySetupContext("dictionary", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.ordered = __pyx_v_ordered;
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_dictionary(__pyx_v_index_type, __pyx_v_value_type, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1948, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.dictionary", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1977
 * 
 * 
 * def struct(fields):             # <<<<<<<<<<<<<<
 *     """
 *     Create StructType instance from fields
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_91struct(PyObject *__pyx_self, PyObject *__pyx_v_fields); /*proto*/
static char __pyx_doc_7pyarrow_3lib_90struct[] = "struct(fields)\n\n    Create StructType instance from fields\n\n    Parameters\n    ----------\n    fields : iterable of Fields or tuples, or mapping of strings to DataTypes\n\n    Examples\n    --------\n    ::\n\n        import pyarrow as pa\n        fields = [\n            ('f1', pa.int32()),\n            ('f2', pa.string()),\n        ]\n        struct_type = pa.struct(fields)\n\n        fields = [\n            pa.field('f1', pa.int32()),\n            pa.field('f2', pa.string(), nullable=false),\n        ]\n        struct_type = pa.struct(fields)\n\n    Returns\n    -------\n    type : DataType\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_91struct = {"struct", (PyCFunction)__pyx_pw_7pyarrow_3lib_91struct, METH_O, __pyx_doc_7pyarrow_3lib_90struct};
static PyObject *__pyx_pw_7pyarrow_3lib_91struct(PyObject *__pyx_self, PyObject *__pyx_v_fields) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("struct (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_90struct(__pyx_self, ((PyObject *)__pyx_v_fields));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_90struct(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fields) {
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_py_field = 0;
  std::vector<std::shared_ptr< arrow::Field> >  __pyx_v_c_fields;
  std::shared_ptr< arrow::DataType>  __pyx_v_struct_type;
  PyObject *__pyx_v_item = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("struct", 0);
  __Pyx_INCREF(__pyx_v_fields);

  /* "pyarrow/types.pxi":2011
 *         cdef shared_ptr[CDataType] struct_type
 * 
 *     if isinstance(fields, compat.Mapping):             # <<<<<<<<<<<<<<
 *         fields = fields.items()
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_compat); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2011, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Mapping); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2011, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_fields, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(4, 2011, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "pyarrow/types.pxi":2012
 * 
 *     if isinstance(fields, compat.Mapping):
 *         fields = fields.items()             # <<<<<<<<<<<<<<
 * 
 *     for item in fields:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fields, __pyx_n_s_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2012, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2012, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_fields, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/types.pxi":2011
 *         cdef shared_ptr[CDataType] struct_type
 * 
 *     if isinstance(fields, compat.Mapping):             # <<<<<<<<<<<<<<
 *         fields = fields.items()
 * 
 */
  }

  /* "pyarrow/types.pxi":2014
 *         fields = fields.items()
 * 
 *     for item in fields:             # <<<<<<<<<<<<<<
 *         if isinstance(item, tuple):
 *             py_field = field(*item)
 */
  if (likely(PyList_CheckExact(__pyx_v_fields)) || PyTuple_CheckExact(__pyx_v_fields)) {
    __pyx_t_2 = __pyx_v_fields; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_fields); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2014, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2014, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(4, 2014, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2014, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(4, 2014, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2014, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_7(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(4, 2014, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/types.pxi":2015
 * 
 *     for item in fields:
 *         if isinstance(item, tuple):             # <<<<<<<<<<<<<<
 *             py_field = field(*item)
 *         else:
 */
    __pyx_t_4 = PyTuple_Check(__pyx_v_item); 
    __pyx_t_3 = (__pyx_t_4 != 0);
    if (__pyx_t_3) {

      /* "pyarrow/types.pxi":2016
 *     for item in fields:
 *         if isinstance(item, tuple):
 *             py_field = field(*item)             # <<<<<<<<<<<<<<
 *         else:
 *             py_field = item
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_field); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2016, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_item); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2016, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 2016, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(4, 2016, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_py_field, ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_8));
      __pyx_t_8 = 0;

      /* "pyarrow/types.pxi":2015
 * 
 *     for item in fields:
 *         if isinstance(item, tuple):             # <<<<<<<<<<<<<<
 *             py_field = field(*item)
 *         else:
 */
      goto __pyx_L6;
    }

    /* "pyarrow/types.pxi":2018
 *             py_field = field(*item)
 *         else:
 *             py_field = item             # <<<<<<<<<<<<<<
 *         c_fields.push_back(py_field.sp_field)
 * 
 */
    /*else*/ {
      if (!(likely(((__pyx_v_item) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_item, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(4, 2018, __pyx_L1_error)
      __pyx_t_8 = __pyx_v_item;
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_XDECREF_SET(__pyx_v_py_field, ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_8));
      __pyx_t_8 = 0;
    }
    __pyx_L6:;

    /* "pyarrow/types.pxi":2019
 *         else:
 *             py_field = item
 *         c_fields.push_back(py_field.sp_field)             # <<<<<<<<<<<<<<
 * 
 *     struct_type.reset(new CStructType(c_fields))
 */
    try {
      __pyx_v_c_fields.push_back(__pyx_v_py_field->sp_field);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(4, 2019, __pyx_L1_error)
    }

    /* "pyarrow/types.pxi":2014
 *         fields = fields.items()
 * 
 *     for item in fields:             # <<<<<<<<<<<<<<
 *         if isinstance(item, tuple):
 *             py_field = field(*item)
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":2021
 *         c_fields.push_back(py_field.sp_field)
 * 
 *     struct_type.reset(new CStructType(c_fields))             # <<<<<<<<<<<<<<
 *     return pyarrow_wrap_data_type(struct_type)
 * 
 */
  __pyx_v_struct_type.reset(new  arrow::StructType(__pyx_v_c_fields));

  /* "pyarrow/types.pxi":2022
 * 
 *     struct_type.reset(new CStructType(c_fields))
 *     return pyarrow_wrap_data_type(struct_type)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_struct_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2022, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1977
 * 
 * 
 * def struct(fields):             # <<<<<<<<<<<<<<
 *     """
 *     Create StructType instance from fields
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow.lib.struct", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_py_field);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XDECREF(__pyx_v_fields);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":2025
 * 
 * 
 * def union(children_fields, mode, type_codes=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create UnionType from children fields.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_93union(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_92union[] = "union(children_fields, mode, type_codes=None)\n\n    Create UnionType from children fields.\n\n    Parameters\n    ----------\n    fields : sequence of Field values\n    mode : str\n        'dense' or 'sparse'\n    type_codes : list of integers, default None\n\n    Returns\n    -------\n    type : DataType\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_93union = {"union", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_93union, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_92union};
static PyObject *__pyx_pw_7pyarrow_3lib_93union(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_children_fields = 0;
  PyObject *__pyx_v_mode = 0;
  PyObject *__pyx_v_type_codes = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("union (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_children_fields,&__pyx_n_s_mode,&__pyx_n_s_type_codes,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children_fields)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("union", 0, 2, 3, 1); __PYX_ERR(4, 2025, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type_codes);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "union") < 0)) __PYX_ERR(4, 2025, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_children_fields = values[0];
    __pyx_v_mode = values[1];
    __pyx_v_type_codes = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("union", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 2025, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.union", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_92union(__pyx_self, __pyx_v_children_fields, __pyx_v_mode, __pyx_v_type_codes);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_92union(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_children_fields, PyObject *__pyx_v_mode, PyObject *__pyx_v_type_codes) {
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_child_field = 0;
  std::vector<std::shared_ptr< arrow::Field> >  __pyx_v_c_fields;
  std::vector<int8_t>  __pyx_v_c_type_codes;
  std::shared_ptr< arrow::DataType>  __pyx_v_union_type;
  PyObject *__pyx_v_code = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  int8_t __pyx_t_8;
  std::vector<int8_t>  __pyx_t_9;
  __Pyx_RefNannySetupContext("union", 0);
  __Pyx_INCREF(__pyx_v_mode);

  /* "pyarrow/types.pxi":2047
 *         int i
 * 
 *     if isinstance(mode, int):             # <<<<<<<<<<<<<<
 *         if mode not in (_UnionMode_SPARSE, _UnionMode_DENSE):
 *             raise ValueError("Invalid union mode {0!r}".format(mode))
 */
  __pyx_t_1 = PyInt_Check(__pyx_v_mode); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/types.pxi":2048
 * 
 *     if isinstance(mode, int):
 *         if mode not in (_UnionMode_SPARSE, _UnionMode_DENSE):             # <<<<<<<<<<<<<<
 *             raise ValueError("Invalid union mode {0!r}".format(mode))
 *     else:
 */
    __Pyx_INCREF(__pyx_v_mode);
    __pyx_t_3 = __pyx_v_mode;
    __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_UnionMode_3a__3a_type( arrow::UnionMode::SPARSE); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2048, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2048, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 2048, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_1) {
    } else {
      __pyx_t_2 = __pyx_t_1;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_UnionMode_3a__3a_type( arrow::UnionMode::DENSE); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2048, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2048, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 2048, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_2 = __pyx_t_1;
    __pyx_L5_bool_binop_done:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (unlikely(__pyx_t_1)) {

      /* "pyarrow/types.pxi":2049
 *     if isinstance(mode, int):
 *         if mode not in (_UnionMode_SPARSE, _UnionMode_DENSE):
 *             raise ValueError("Invalid union mode {0!r}".format(mode))             # <<<<<<<<<<<<<<
 *     else:
 *         if mode == 'sparse':
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Invalid_union_mode_0_r, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2049, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_mode) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_mode);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2049, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2049, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(4, 2049, __pyx_L1_error)

      /* "pyarrow/types.pxi":2048
 * 
 *     if isinstance(mode, int):
 *         if mode not in (_UnionMode_SPARSE, _UnionMode_DENSE):             # <<<<<<<<<<<<<<
 *             raise ValueError("Invalid union mode {0!r}".format(mode))
 *     else:
 */
    }

    /* "pyarrow/types.pxi":2047
 *         int i
 * 
 *     if isinstance(mode, int):             # <<<<<<<<<<<<<<
 *         if mode not in (_UnionMode_SPARSE, _UnionMode_DENSE):
 *             raise ValueError("Invalid union mode {0!r}".format(mode))
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":2051
 *             raise ValueError("Invalid union mode {0!r}".format(mode))
 *     else:
 *         if mode == 'sparse':             # <<<<<<<<<<<<<<
 *             mode = _UnionMode_SPARSE
 *         elif mode == 'dense':
 */
  /*else*/ {
    __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_mode, __pyx_n_u_sparse, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 2051, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "pyarrow/types.pxi":2052
 *     else:
 *         if mode == 'sparse':
 *             mode = _UnionMode_SPARSE             # <<<<<<<<<<<<<<
 *         elif mode == 'dense':
 *             mode = _UnionMode_DENSE
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_UnionMode_3a__3a_type( arrow::UnionMode::SPARSE); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2052, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_mode, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "pyarrow/types.pxi":2051
 *             raise ValueError("Invalid union mode {0!r}".format(mode))
 *     else:
 *         if mode == 'sparse':             # <<<<<<<<<<<<<<
 *             mode = _UnionMode_SPARSE
 *         elif mode == 'dense':
 */
      goto __pyx_L7;
    }

    /* "pyarrow/types.pxi":2053
 *         if mode == 'sparse':
 *             mode = _UnionMode_SPARSE
 *         elif mode == 'dense':             # <<<<<<<<<<<<<<
 *             mode = _UnionMode_DENSE
 *         else:
 */
    __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_mode, __pyx_n_u_dense, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 2053, __pyx_L1_error)
    if (likely(__pyx_t_1)) {

      /* "pyarrow/types.pxi":2054
 *             mode = _UnionMode_SPARSE
 *         elif mode == 'dense':
 *             mode = _UnionMode_DENSE             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError("Invalid union mode {0!r}".format(mode))
 */
      __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_UnionMode_3a__3a_type( arrow::UnionMode::DENSE); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2054, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_mode, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "pyarrow/types.pxi":2053
 *         if mode == 'sparse':
 *             mode = _UnionMode_SPARSE
 *         elif mode == 'dense':             # <<<<<<<<<<<<<<
 *             mode = _UnionMode_DENSE
 *         else:
 */
      goto __pyx_L7;
    }

    /* "pyarrow/types.pxi":2056
 *             mode = _UnionMode_DENSE
 *         else:
 *             raise ValueError("Invalid union mode {0!r}".format(mode))             # <<<<<<<<<<<<<<
 * 
 *     for child_field in children_fields:
 */
    /*else*/ {
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Invalid_union_mode_0_r, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2056, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_mode) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_mode);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2056, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2056, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(4, 2056, __pyx_L1_error)
    }
    __pyx_L7:;
  }
  __pyx_L3:;

  /* "pyarrow/types.pxi":2058
 *             raise ValueError("Invalid union mode {0!r}".format(mode))
 * 
 *     for child_field in children_fields:             # <<<<<<<<<<<<<<
 *         c_fields.push_back(child_field.sp_field)
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_children_fields)) || PyTuple_CheckExact(__pyx_v_children_fields)) {
    __pyx_t_3 = __pyx_v_children_fields; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_children_fields); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2058, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2058, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(4, 2058, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2058, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(4, 2058, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2058, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_7(__pyx_t_3);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(4, 2058, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(4, 2058, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_child_field, ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "pyarrow/types.pxi":2059
 * 
 *     for child_field in children_fields:
 *         c_fields.push_back(child_field.sp_field)             # <<<<<<<<<<<<<<
 * 
 *     if type_codes is not None:
 */
    try {
      __pyx_v_c_fields.push_back(__pyx_v_child_field->sp_field);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(4, 2059, __pyx_L1_error)
    }

    /* "pyarrow/types.pxi":2058
 *             raise ValueError("Invalid union mode {0!r}".format(mode))
 * 
 *     for child_field in children_fields:             # <<<<<<<<<<<<<<
 *         c_fields.push_back(child_field.sp_field)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/types.pxi":2061
 *         c_fields.push_back(child_field.sp_field)
 * 
 *     if type_codes is not None:             # <<<<<<<<<<<<<<
 *         if len(type_codes) != <Py_ssize_t>(c_fields.size()):
 *             raise ValueError("type_codes should have the same length "
 */
  __pyx_t_1 = (__pyx_v_type_codes != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/types.pxi":2062
 * 
 *     if type_codes is not None:
 *         if len(type_codes) != <Py_ssize_t>(c_fields.size()):             # <<<<<<<<<<<<<<
 *             raise ValueError("type_codes should have the same length "
 *                              "as fields")
 */
    __pyx_t_6 = PyObject_Length(__pyx_v_type_codes); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(4, 2062, __pyx_L1_error)
    __pyx_t_2 = ((__pyx_t_6 != ((Py_ssize_t)__pyx_v_c_fields.size())) != 0);
    if (unlikely(__pyx_t_2)) {

      /* "pyarrow/types.pxi":2063
 *     if type_codes is not None:
 *         if len(type_codes) != <Py_ssize_t>(c_fields.size()):
 *             raise ValueError("type_codes should have the same length "             # <<<<<<<<<<<<<<
 *                              "as fields")
 *         for code in type_codes:
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2063, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(4, 2063, __pyx_L1_error)

      /* "pyarrow/types.pxi":2062
 * 
 *     if type_codes is not None:
 *         if len(type_codes) != <Py_ssize_t>(c_fields.size()):             # <<<<<<<<<<<<<<
 *             raise ValueError("type_codes should have the same length "
 *                              "as fields")
 */
    }

    /* "pyarrow/types.pxi":2065
 *             raise ValueError("type_codes should have the same length "
 *                              "as fields")
 *         for code in type_codes:             # <<<<<<<<<<<<<<
 *             c_type_codes.push_back(code)
 *     else:
 */
    if (likely(PyList_CheckExact(__pyx_v_type_codes)) || PyTuple_CheckExact(__pyx_v_type_codes)) {
      __pyx_t_3 = __pyx_v_type_codes; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_type_codes); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2065, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2065, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(4, 2065, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2065, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(4, 2065, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2065, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        }
      } else {
        __pyx_t_4 = __pyx_t_7(__pyx_t_3);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(4, 2065, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_XDECREF_SET(__pyx_v_code, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "pyarrow/types.pxi":2066
 *                              "as fields")
 *         for code in type_codes:
 *             c_type_codes.push_back(code)             # <<<<<<<<<<<<<<
 *     else:
 *         c_type_codes = range(c_fields.size())
 */
      __pyx_t_8 = __Pyx_PyInt_As_int8_t(__pyx_v_code); if (unlikely((__pyx_t_8 == ((int8_t)-1)) && PyErr_Occurred())) __PYX_ERR(4, 2066, __pyx_L1_error)
      try {
        __pyx_v_c_type_codes.push_back(__pyx_t_8);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(4, 2066, __pyx_L1_error)
      }

      /* "pyarrow/types.pxi":2065
 *             raise ValueError("type_codes should have the same length "
 *                              "as fields")
 *         for code in type_codes:             # <<<<<<<<<<<<<<
 *             c_type_codes.push_back(code)
 *     else:
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "pyarrow/types.pxi":2061
 *         c_fields.push_back(child_field.sp_field)
 * 
 *     if type_codes is not None:             # <<<<<<<<<<<<<<
 *         if len(type_codes) != <Py_ssize_t>(c_fields.size()):
 *             raise ValueError("type_codes should have the same length "
 */
    goto __pyx_L10;
  }

  /* "pyarrow/types.pxi":2068
 *             c_type_codes.push_back(code)
 *     else:
 *         c_type_codes = range(c_fields.size())             # <<<<<<<<<<<<<<
 * 
 *     if mode == UnionMode_SPARSE:
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_c_fields.size()); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2068, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2068, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_9 = __pyx_convert_vector_from_py_int8_t(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 2068, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_c_type_codes = __pyx_t_9;
  }
  __pyx_L10:;

  /* "pyarrow/types.pxi":2070
 *         c_type_codes = range(c_fields.size())
 * 
 *     if mode == UnionMode_SPARSE:             # <<<<<<<<<<<<<<
 *         union_type.reset(new CUnionType(c_fields, c_type_codes,
 *                                         _UnionMode_SPARSE))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_UnionMode_SPARSE); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2070, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_mode, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2070, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 2070, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "pyarrow/types.pxi":2071
 * 
 *     if mode == UnionMode_SPARSE:
 *         union_type.reset(new CUnionType(c_fields, c_type_codes,             # <<<<<<<<<<<<<<
 *                                         _UnionMode_SPARSE))
 *     else:
 */
    __pyx_v_union_type.reset(new  arrow::UnionType(__pyx_v_c_fields, __pyx_v_c_type_codes,  arrow::UnionMode::SPARSE));

    /* "pyarrow/types.pxi":2070
 *         c_type_codes = range(c_fields.size())
 * 
 *     if mode == UnionMode_SPARSE:             # <<<<<<<<<<<<<<
 *         union_type.reset(new CUnionType(c_fields, c_type_codes,
 *                                         _UnionMode_SPARSE))
 */
    goto __pyx_L14;
  }

  /* "pyarrow/types.pxi":2074
 *                                         _UnionMode_SPARSE))
 *     else:
 *         union_type.reset(new CUnionType(c_fields, c_type_codes,             # <<<<<<<<<<<<<<
 *                                         _UnionMode_DENSE))
 * 
 */
  /*else*/ {

    /* "pyarrow/types.pxi":2075
 *     else:
 *         union_type.reset(new CUnionType(c_fields, c_type_codes,
 *                                         _UnionMode_DENSE))             # <<<<<<<<<<<<<<
 * 
 *     return pyarrow_wrap_data_type(union_type)
 */
    __pyx_v_union_type.reset(new  arrow::UnionType(__pyx_v_c_fields, __pyx_v_c_type_codes,  arrow::UnionMode::DENSE));
  }
  __pyx_L14:;

  /* "pyarrow/types.pxi":2077
 *                                         _UnionMode_DENSE))
 * 
 *     return pyarrow_wrap_data_type(union_type)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_union_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2077, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":2025
 * 
 * 
 * def union(children_fields, mode, type_codes=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create UnionType from children fields.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.union", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_child_field);
  __Pyx_XDECREF(__pyx_v_code);
  __Pyx_XDECREF(__pyx_v_mode);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":2136
 * 
 * 
 * def type_for_alias(name):             # <<<<<<<<<<<<<<
 *     """
 *     Return DataType given a string alias if one exists
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_95type_for_alias(PyObject *__pyx_self, PyObject *__pyx_v_name); /*proto*/
static char __pyx_doc_7pyarrow_3lib_94type_for_alias[] = "type_for_alias(name)\n\n    Return DataType given a string alias if one exists\n\n    Returns\n    -------\n    type : DataType\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_95type_for_alias = {"type_for_alias", (PyCFunction)__pyx_pw_7pyarrow_3lib_95type_for_alias, METH_O, __pyx_doc_7pyarrow_3lib_94type_for_alias};
static PyObject *__pyx_pw_7pyarrow_3lib_95type_for_alias(PyObject *__pyx_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("type_for_alias (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_94type_for_alias(__pyx_self, ((PyObject *)__pyx_v_name));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_94type_for_alias(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_v_alias = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  __Pyx_RefNannySetupContext("type_for_alias", 0);
  __Pyx_INCREF(__pyx_v_name);

  /* "pyarrow/types.pxi":2144
 *     type : DataType
 *     """
 *     name = name.lower()             # <<<<<<<<<<<<<<
 *     try:
 *         alias = _type_aliases[name]
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":2145
 *     """
 *     name = name.lower()
 *     try:             # <<<<<<<<<<<<<<
 *         alias = _type_aliases[name]
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_6);
    /*try:*/ {

      /* "pyarrow/types.pxi":2146
 *     name = name.lower()
 *     try:
 *         alias = _type_aliases[name]             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError('No type alias for {0}'.format(name))
 */
      if (unlikely(__pyx_v_7pyarrow_3lib__type_aliases == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(4, 2146, __pyx_L3_error)
      }
      __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_7pyarrow_3lib__type_aliases, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2146, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_alias = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "pyarrow/types.pxi":2145
 *     """
 *     name = name.lower()
 *     try:             # <<<<<<<<<<<<<<
 *         alias = _type_aliases[name]
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "pyarrow/types.pxi":2147
 *     try:
 *         alias = _type_aliases[name]
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError('No type alias for {0}'.format(name))
 * 
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("pyarrow.lib.type_for_alias", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(4, 2147, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_3);

      /* "pyarrow/types.pxi":2148
 *         alias = _type_aliases[name]
 *     except KeyError:
 *         raise ValueError('No type alias for {0}'.format(name))             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(alias, DataType):
 */
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_No_type_alias_for_0, __pyx_n_s_format); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 2148, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
        }
      }
      __pyx_t_8 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_name);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 2148, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 2148, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(4, 2148, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/types.pxi":2145
 *     """
 *     name = name.lower()
 *     try:             # <<<<<<<<<<<<<<
 *         alias = _type_aliases[name]
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
    goto __pyx_L1_error;
    __pyx_L8_try_end:;
  }

  /* "pyarrow/types.pxi":2150
 *         raise ValueError('No type alias for {0}'.format(name))
 * 
 *     if isinstance(alias, DataType):             # <<<<<<<<<<<<<<
 *         return alias
 *     return alias()
 */
  __pyx_t_11 = __Pyx_TypeCheck(__pyx_v_alias, __pyx_ptype_7pyarrow_3lib_DataType); 
  __pyx_t_12 = (__pyx_t_11 != 0);
  if (__pyx_t_12) {

    /* "pyarrow/types.pxi":2151
 * 
 *     if isinstance(alias, DataType):
 *         return alias             # <<<<<<<<<<<<<<
 *     return alias()
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_alias);
    __pyx_r = __pyx_v_alias;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":2150
 *         raise ValueError('No type alias for {0}'.format(name))
 * 
 *     if isinstance(alias, DataType):             # <<<<<<<<<<<<<<
 *         return alias
 *     return alias()
 */
  }

  /* "pyarrow/types.pxi":2152
 *     if isinstance(alias, DataType):
 *         return alias
 *     return alias()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_alias);
  __pyx_t_2 = __pyx_v_alias; __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":2136
 * 
 * 
 * def type_for_alias(name):             # <<<<<<<<<<<<<<
 *     """
 *     Return DataType given a string alias if one exists
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("pyarrow.lib.type_for_alias", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_alias);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":2155
 * 
 * 
 * cdef DataType ensure_type(object ty, c_bool allow_none=False):             # <<<<<<<<<<<<<<
 *     if allow_none and ty is None:
 *         return None
 */

static struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_f_7pyarrow_3lib_ensure_type(PyObject *__pyx_v_ty, struct __pyx_opt_args_7pyarrow_3lib_ensure_type *__pyx_optional_args) {
  bool __pyx_v_allow_none = ((bool)0);
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("ensure_type", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_allow_none = __pyx_optional_args->allow_none;
    }
  }

  /* "pyarrow/types.pxi":2156
 * 
 * cdef DataType ensure_type(object ty, c_bool allow_none=False):
 *     if allow_none and ty is None:             # <<<<<<<<<<<<<<
 *         return None
 *     elif isinstance(ty, DataType):
 */
  __pyx_t_2 = (__pyx_v_allow_none != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_ty == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "pyarrow/types.pxi":2157
 * cdef DataType ensure_type(object ty, c_bool allow_none=False):
 *     if allow_none and ty is None:
 *         return None             # <<<<<<<<<<<<<<
 *     elif isinstance(ty, DataType):
 *         return ty
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_r = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/types.pxi":2156
 * 
 * cdef DataType ensure_type(object ty, c_bool allow_none=False):
 *     if allow_none and ty is None:             # <<<<<<<<<<<<<<
 *         return None
 *     elif isinstance(ty, DataType):
 */
  }

  /* "pyarrow/types.pxi":2158
 *     if allow_none and ty is None:
 *         return None
 *     elif isinstance(ty, DataType):             # <<<<<<<<<<<<<<
 *         return ty
 *     elif isinstance(ty, six.string_types):
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_ty, __pyx_ptype_7pyarrow_3lib_DataType); 
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/types.pxi":2159
 *         return None
 *     elif isinstance(ty, DataType):
 *         return ty             # <<<<<<<<<<<<<<
 *     elif isinstance(ty, six.string_types):
 *         return type_for_alias(ty)
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    if (!(likely(((__pyx_v_ty) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_ty, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(4, 2159, __pyx_L1_error)
    __Pyx_INCREF(__pyx_v_ty);
    __pyx_r = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_ty);
    goto __pyx_L0;

    /* "pyarrow/types.pxi":2158
 *     if allow_none and ty is None:
 *         return None
 *     elif isinstance(ty, DataType):             # <<<<<<<<<<<<<<
 *         return ty
 *     elif isinstance(ty, six.string_types):
 */
  }

  /* "pyarrow/types.pxi":2160
 *     elif isinstance(ty, DataType):
 *         return ty
 *     elif isinstance(ty, six.string_types):             # <<<<<<<<<<<<<<
 *         return type_for_alias(ty)
 *     else:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_six); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_string_types); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_ty, __pyx_t_5); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(4, 2160, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_1 = (__pyx_t_3 != 0);
  if (likely(__pyx_t_1)) {

    /* "pyarrow/types.pxi":2161
 *         return ty
 *     elif isinstance(ty, six.string_types):
 *         return type_for_alias(ty)             # <<<<<<<<<<<<<<
 *     else:
 *         raise TypeError('DataType expected, got {!r}'.format(type(ty)))
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_type_for_alias); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_v_ty) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_ty);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(4, 2161, __pyx_L1_error)
    __pyx_r = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":2160
 *     elif isinstance(ty, DataType):
 *         return ty
 *     elif isinstance(ty, six.string_types):             # <<<<<<<<<<<<<<
 *         return type_for_alias(ty)
 *     else:
 */
  }

  /* "pyarrow/types.pxi":2163
 *         return type_for_alias(ty)
 *     else:
 *         raise TypeError('DataType expected, got {!r}'.format(type(ty)))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_DataType_expected_got_r, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2163, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, ((PyObject *)Py_TYPE(__pyx_v_ty))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)Py_TYPE(__pyx_v_ty)));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2163, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2163, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(4, 2163, __pyx_L1_error)
  }

  /* "pyarrow/types.pxi":2155
 * 
 * 
 * cdef DataType ensure_type(object ty, c_bool allow_none=False):             # <<<<<<<<<<<<<<
 *     if allow_none and ty is None:
 *         return None
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.ensure_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":2166
 * 
 * 
 * def schema(fields, metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Construct pyarrow.Schema from collection of fields
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_97schema(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_96schema[] = "schema(fields, metadata=None)\n\n    Construct pyarrow.Schema from collection of fields\n\n    Parameters\n    ----------\n    field : iterable of Fields or tuples, or mapping of strings to DataTypes\n    metadata : dict, default None\n        Keys and values must be coercible to bytes\n\n    Examples\n    --------\n    ::\n\n        import pyarrow as pa\n        fields = [\n            ('some_int', pa.int32()),\n            ('some_string', pa.string()),\n        ]\n        schema = pa.schema(fields)\n\n    Returns\n    -------\n    schema : pyarrow.Schema\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_97schema = {"schema", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_97schema, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_96schema};
static PyObject *__pyx_pw_7pyarrow_3lib_97schema(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fields = 0;
  PyObject *__pyx_v_metadata = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("schema (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fields,&__pyx_n_s_metadata,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fields)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_metadata);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "schema") < 0)) __PYX_ERR(4, 2166, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_fields = values[0];
    __pyx_v_metadata = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("schema", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 2166, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.schema", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_96schema(__pyx_self, __pyx_v_fields, __pyx_v_metadata);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_96schema(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fields, PyObject *__pyx_v_metadata) {
  std::shared_ptr< arrow::KeyValueMetadata>  __pyx_v_c_meta;
  std::shared_ptr< arrow::Schema>  __pyx_v_c_schema;
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_result = 0;
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_py_field = 0;
  std::vector<std::shared_ptr< arrow::Field> >  __pyx_v_c_fields;
  PyObject *__pyx_v_item = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("schema", 0);
  __Pyx_INCREF(__pyx_v_fields);

  /* "pyarrow/types.pxi":2198
 *         vector[shared_ptr[CField]] c_fields
 * 
 *     if isinstance(fields, compat.Mapping):             # <<<<<<<<<<<<<<
 *         fields = fields.items()
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_compat); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Mapping); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_fields, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(4, 2198, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "pyarrow/types.pxi":2199
 * 
 *     if isinstance(fields, compat.Mapping):
 *         fields = fields.items()             # <<<<<<<<<<<<<<
 * 
 *     for item in fields:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fields, __pyx_n_s_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2199, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2199, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_fields, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/types.pxi":2198
 *         vector[shared_ptr[CField]] c_fields
 * 
 *     if isinstance(fields, compat.Mapping):             # <<<<<<<<<<<<<<
 *         fields = fields.items()
 * 
 */
  }

  /* "pyarrow/types.pxi":2201
 *         fields = fields.items()
 * 
 *     for item in fields:             # <<<<<<<<<<<<<<
 *         if isinstance(item, tuple):
 *             py_field = field(*item)
 */
  if (likely(PyList_CheckExact(__pyx_v_fields)) || PyTuple_CheckExact(__pyx_v_fields)) {
    __pyx_t_2 = __pyx_v_fields; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_fields); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2201, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2201, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(4, 2201, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2201, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(4, 2201, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2201, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_7(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(4, 2201, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/types.pxi":2202
 * 
 *     for item in fields:
 *         if isinstance(item, tuple):             # <<<<<<<<<<<<<<
 *             py_field = field(*item)
 *         else:
 */
    __pyx_t_4 = PyTuple_Check(__pyx_v_item); 
    __pyx_t_3 = (__pyx_t_4 != 0);
    if (__pyx_t_3) {

      /* "pyarrow/types.pxi":2203
 *     for item in fields:
 *         if isinstance(item, tuple):
 *             py_field = field(*item)             # <<<<<<<<<<<<<<
 *         else:
 *             py_field = item
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_field); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2203, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_item); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2203, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 2203, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(4, 2203, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_py_field, ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_8));
      __pyx_t_8 = 0;

      /* "pyarrow/types.pxi":2202
 * 
 *     for item in fields:
 *         if isinstance(item, tuple):             # <<<<<<<<<<<<<<
 *             py_field = field(*item)
 *         else:
 */
      goto __pyx_L6;
    }

    /* "pyarrow/types.pxi":2205
 *             py_field = field(*item)
 *         else:
 *             py_field = item             # <<<<<<<<<<<<<<
 *         if py_field is None:
 *             raise TypeError("field or tuple expected, got None")
 */
    /*else*/ {
      if (!(likely(((__pyx_v_item) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_item, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(4, 2205, __pyx_L1_error)
      __pyx_t_8 = __pyx_v_item;
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_XDECREF_SET(__pyx_v_py_field, ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_8));
      __pyx_t_8 = 0;
    }
    __pyx_L6:;

    /* "pyarrow/types.pxi":2206
 *         else:
 *             py_field = item
 *         if py_field is None:             # <<<<<<<<<<<<<<
 *             raise TypeError("field or tuple expected, got None")
 *         c_fields.push_back(py_field.sp_field)
 */
    __pyx_t_3 = (((PyObject *)__pyx_v_py_field) == Py_None);
    __pyx_t_4 = (__pyx_t_3 != 0);
    if (unlikely(__pyx_t_4)) {

      /* "pyarrow/types.pxi":2207
 *             py_field = item
 *         if py_field is None:
 *             raise TypeError("field or tuple expected, got None")             # <<<<<<<<<<<<<<
 *         c_fields.push_back(py_field.sp_field)
 * 
 */
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 2207, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(4, 2207, __pyx_L1_error)

      /* "pyarrow/types.pxi":2206
 *         else:
 *             py_field = item
 *         if py_field is None:             # <<<<<<<<<<<<<<
 *             raise TypeError("field or tuple expected, got None")
 *         c_fields.push_back(py_field.sp_field)
 */
    }

    /* "pyarrow/types.pxi":2208
 *         if py_field is None:
 *             raise TypeError("field or tuple expected, got None")
 *         c_fields.push_back(py_field.sp_field)             # <<<<<<<<<<<<<<
 * 
 *     if metadata is not None:
 */
    try {
      __pyx_v_c_fields.push_back(__pyx_v_py_field->sp_field);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(4, 2208, __pyx_L1_error)
    }

    /* "pyarrow/types.pxi":2201
 *         fields = fields.items()
 * 
 *     for item in fields:             # <<<<<<<<<<<<<<
 *         if isinstance(item, tuple):
 *             py_field = field(*item)
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":2210
 *         c_fields.push_back(py_field.sp_field)
 * 
 *     if metadata is not None:             # <<<<<<<<<<<<<<
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')
 */
  __pyx_t_4 = (__pyx_v_metadata != Py_None);
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/types.pxi":2211
 * 
 *     if metadata is not None:
 *         if not isinstance(metadata, dict):             # <<<<<<<<<<<<<<
 *             raise TypeError('Metadata must be an instance of dict')
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 */
    __pyx_t_3 = PyDict_Check(__pyx_v_metadata); 
    __pyx_t_4 = ((!(__pyx_t_3 != 0)) != 0);
    if (unlikely(__pyx_t_4)) {

      /* "pyarrow/types.pxi":2212
 *     if metadata is not None:
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')             # <<<<<<<<<<<<<<
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2212, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(4, 2212, __pyx_L1_error)

      /* "pyarrow/types.pxi":2211
 * 
 *     if metadata is not None:
 *         if not isinstance(metadata, dict):             # <<<<<<<<<<<<<<
 *             raise TypeError('Metadata must be an instance of dict')
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 */
    }

    /* "pyarrow/types.pxi":2213
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')
 *         c_meta = pyarrow_unwrap_metadata(metadata)             # <<<<<<<<<<<<<<
 * 
 *     c_schema.reset(new CSchema(c_fields, c_meta))
 */
    __pyx_v_c_meta = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_metadata(__pyx_v_metadata);

    /* "pyarrow/types.pxi":2210
 *         c_fields.push_back(py_field.sp_field)
 * 
 *     if metadata is not None:             # <<<<<<<<<<<<<<
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')
 */
  }

  /* "pyarrow/types.pxi":2215
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 * 
 *     c_schema.reset(new CSchema(c_fields, c_meta))             # <<<<<<<<<<<<<<
 *     result = Schema.__new__(Schema)
 *     result.init_schema(c_schema)
 */
  __pyx_v_c_schema.reset(new  arrow::Schema(__pyx_v_c_fields, __pyx_v_c_meta));

  /* "pyarrow/types.pxi":2216
 * 
 *     c_schema.reset(new CSchema(c_fields, c_meta))
 *     result = Schema.__new__(Schema)             # <<<<<<<<<<<<<<
 *     result.init_schema(c_schema)
 * 
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_Schema(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_Schema), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2216, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":2217
 *     c_schema.reset(new CSchema(c_fields, c_meta))
 *     result = Schema.__new__(Schema)
 *     result.init_schema(c_schema)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_Schema *)__pyx_v_result->__pyx_vtab)->init_schema(__pyx_v_result, __pyx_v_c_schema);

  /* "pyarrow/types.pxi":2219
 *     result.init_schema(c_schema)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/types.pxi":2166
 * 
 * 
 * def schema(fields, metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Construct pyarrow.Schema from collection of fields
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow.lib.schema", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF((PyObject *)__pyx_v_py_field);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XDECREF(__pyx_v_fields);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":2222
 * 
 * 
 * def from_numpy_dtype(object dtype):             # <<<<<<<<<<<<<<
 *     """
 *     Convert NumPy dtype to pyarrow.DataType
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_99from_numpy_dtype(PyObject *__pyx_self, PyObject *__pyx_v_dtype); /*proto*/
static char __pyx_doc_7pyarrow_3lib_98from_numpy_dtype[] = "from_numpy_dtype(dtype)\n\n    Convert NumPy dtype to pyarrow.DataType\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_99from_numpy_dtype = {"from_numpy_dtype", (PyCFunction)__pyx_pw_7pyarrow_3lib_99from_numpy_dtype, METH_O, __pyx_doc_7pyarrow_3lib_98from_numpy_dtype};
static PyObject *__pyx_pw_7pyarrow_3lib_99from_numpy_dtype(PyObject *__pyx_self, PyObject *__pyx_v_dtype) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_numpy_dtype (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_98from_numpy_dtype(__pyx_self, ((PyObject *)__pyx_v_dtype));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_98from_numpy_dtype(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dtype) {
  std::shared_ptr< arrow::DataType>  __pyx_v_c_type;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("from_numpy_dtype", 0);
  __Pyx_INCREF(__pyx_v_dtype);

  /* "pyarrow/types.pxi":2227
 *     """
 *     cdef shared_ptr[CDataType] c_type
 *     dtype = np.dtype(dtype)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         check_status(NumPyDtypeToArrow(dtype, &c_type))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_dtype) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_dtype);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF_SET(__pyx_v_dtype, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":2228
 *     cdef shared_ptr[CDataType] c_type
 *     dtype = np.dtype(dtype)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(NumPyDtypeToArrow(dtype, &c_type))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/types.pxi":2229
 *     dtype = np.dtype(dtype)
 *     with nogil:
 *         check_status(NumPyDtypeToArrow(dtype, &c_type))             # <<<<<<<<<<<<<<
 * 
 *     return pyarrow_wrap_data_type(c_type)
 */
        __pyx_t_4 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::NumPyDtypeToArrow(__pyx_v_dtype, (&__pyx_v_c_type))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(4, 2229, __pyx_L4_error)
      }

      /* "pyarrow/types.pxi":2228
 *     cdef shared_ptr[CDataType] c_type
 *     dtype = np.dtype(dtype)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(NumPyDtypeToArrow(dtype, &c_type))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/types.pxi":2231
 *         check_status(NumPyDtypeToArrow(dtype, &c_type))
 * 
 *     return pyarrow_wrap_data_type(c_type)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_c_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":2222
 * 
 * 
 * def from_numpy_dtype(object dtype):             # <<<<<<<<<<<<<<
 *     """
 *     Convert NumPy dtype to pyarrow.DataType
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.from_numpy_dtype", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dtype);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":2234
 * 
 * 
 * def is_boolean_value(object obj):             # <<<<<<<<<<<<<<
 *     return IsPyBool(obj)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_101is_boolean_value(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_100is_boolean_value[] = "is_boolean_value(obj)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_101is_boolean_value = {"is_boolean_value", (PyCFunction)__pyx_pw_7pyarrow_3lib_101is_boolean_value, METH_O, __pyx_doc_7pyarrow_3lib_100is_boolean_value};
static PyObject *__pyx_pw_7pyarrow_3lib_101is_boolean_value(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_boolean_value (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_100is_boolean_value(__pyx_self, ((PyObject *)__pyx_v_obj));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_100is_boolean_value(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("is_boolean_value", 0);

  /* "pyarrow/types.pxi":2235
 * 
 * def is_boolean_value(object obj):
 *     return IsPyBool(obj)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(arrow::py::IsPyBool(__pyx_v_obj)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":2234
 * 
 * 
 * def is_boolean_value(object obj):             # <<<<<<<<<<<<<<
 *     return IsPyBool(obj)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.is_boolean_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":2238
 * 
 * 
 * def is_integer_value(object obj):             # <<<<<<<<<<<<<<
 *     return IsPyInt(obj)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_103is_integer_value(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_102is_integer_value[] = "is_integer_value(obj)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_103is_integer_value = {"is_integer_value", (PyCFunction)__pyx_pw_7pyarrow_3lib_103is_integer_value, METH_O, __pyx_doc_7pyarrow_3lib_102is_integer_value};
static PyObject *__pyx_pw_7pyarrow_3lib_103is_integer_value(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_integer_value (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_102is_integer_value(__pyx_self, ((PyObject *)__pyx_v_obj));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_102is_integer_value(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("is_integer_value", 0);

  /* "pyarrow/types.pxi":2239
 * 
 * def is_integer_value(object obj):
 *     return IsPyInt(obj)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(arrow::py::IsPyInt(__pyx_v_obj)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":2238
 * 
 * 
 * def is_integer_value(object obj):             # <<<<<<<<<<<<<<
 *     return IsPyInt(obj)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.is_integer_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":2242
 * 
 * 
 * def is_float_value(object obj):             # <<<<<<<<<<<<<<
 *     return IsPyFloat(obj)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_105is_float_value(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_104is_float_value[] = "is_float_value(obj)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_105is_float_value = {"is_float_value", (PyCFunction)__pyx_pw_7pyarrow_3lib_105is_float_value, METH_O, __pyx_doc_7pyarrow_3lib_104is_float_value};
static PyObject *__pyx_pw_7pyarrow_3lib_105is_float_value(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_float_value (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_104is_float_value(__pyx_self, ((PyObject *)__pyx_v_obj));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_104is_float_value(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("is_float_value", 0);

  /* "pyarrow/types.pxi":2243
 * 
 * def is_float_value(object obj):
 *     return IsPyFloat(obj)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(arrow::py::IsPyFloat(__pyx_v_obj)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":2242
 * 
 * 
 * def is_float_value(object obj):             # <<<<<<<<<<<<<<
 *     return IsPyFloat(obj)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.is_float_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":2251
 *         shared_ptr[CExtensionTypeRegistry] registry
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.registry = CExtensionTypeRegistry.GetGlobalRegistry()
 * 
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_23_ExtensionRegistryNanny_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_23_ExtensionRegistryNanny_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_23_ExtensionRegistryNanny___cinit__(((struct __pyx_obj_7pyarrow_3lib__ExtensionRegistryNanny *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_23_ExtensionRegistryNanny___cinit__(struct __pyx_obj_7pyarrow_3lib__ExtensionRegistryNanny *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/types.pxi":2252
 * 
 *     def __cinit__(self):
 *         self.registry = CExtensionTypeRegistry.GetGlobalRegistry()             # <<<<<<<<<<<<<<
 * 
 *     def release_registry(self):
 */
  __pyx_v_self->registry =  arrow::ExtensionTypeRegistry::GetGlobalRegistry();

  /* "pyarrow/types.pxi":2251
 *         shared_ptr[CExtensionTypeRegistry] registry
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.registry = CExtensionTypeRegistry.GetGlobalRegistry()
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":2254
 *         self.registry = CExtensionTypeRegistry.GetGlobalRegistry()
 * 
 *     def release_registry(self):             # <<<<<<<<<<<<<<
 *         self.registry.reset()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_23_ExtensionRegistryNanny_3release_registry(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_23_ExtensionRegistryNanny_2release_registry[] = "_ExtensionRegistryNanny.release_registry(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_23_ExtensionRegistryNanny_3release_registry(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("release_registry (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_23_ExtensionRegistryNanny_2release_registry(((struct __pyx_obj_7pyarrow_3lib__ExtensionRegistryNanny *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_23_ExtensionRegistryNanny_2release_registry(struct __pyx_obj_7pyarrow_3lib__ExtensionRegistryNanny *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("release_registry", 0);

  /* "pyarrow/types.pxi":2255
 * 
 *     def release_registry(self):
 *         self.registry.reset()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->registry.reset();

  /* "pyarrow/types.pxi":2254
 *         self.registry = CExtensionTypeRegistry.GetGlobalRegistry()
 * 
 *     def release_registry(self):             # <<<<<<<<<<<<<<
 *         self.registry.reset()
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_23_ExtensionRegistryNanny_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_23_ExtensionRegistryNanny_4__reduce_cython__[] = "_ExtensionRegistryNanny.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_23_ExtensionRegistryNanny_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_23_ExtensionRegistryNanny_4__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib__ExtensionRegistryNanny *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_23_ExtensionRegistryNanny_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__ExtensionRegistryNanny *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._ExtensionRegistryNanny.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_23_ExtensionRegistryNanny_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_23_ExtensionRegistryNanny_6__setstate_cython__[] = "_ExtensionRegistryNanny.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_23_ExtensionRegistryNanny_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_23_ExtensionRegistryNanny_6__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib__ExtensionRegistryNanny *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_23_ExtensionRegistryNanny_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__ExtensionRegistryNanny *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._ExtensionRegistryNanny.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":2261
 * 
 * 
 * def _register_py_extension_type():             # <<<<<<<<<<<<<<
 *     cdef:
 *         DataType storage_type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_107_register_py_extension_type(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_106_register_py_extension_type[] = "_register_py_extension_type()";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_107_register_py_extension_type = {"_register_py_extension_type", (PyCFunction)__pyx_pw_7pyarrow_3lib_107_register_py_extension_type, METH_NOARGS, __pyx_doc_7pyarrow_3lib_106_register_py_extension_type};
static PyObject *__pyx_pw_7pyarrow_3lib_107_register_py_extension_type(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_register_py_extension_type (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_106_register_py_extension_type(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_106_register_py_extension_type(CYTHON_UNUSED PyObject *__pyx_self) {
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_storage_type = 0;
  std::shared_ptr< arrow::ExtensionType>  __pyx_v_cpy_ext_type;
  std::string __pyx_v_c_extension_name;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("_register_py_extension_type", 0);

  /* "pyarrow/types.pxi":2265
 *         DataType storage_type
 *         shared_ptr[CExtensionType] cpy_ext_type
 *         c_string c_extension_name = tobytes("arrow.py_extension_type")             # <<<<<<<<<<<<<<
 * 
 *     # Make a dummy C++ ExtensionType
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_arrow_py_extension_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_arrow_py_extension_type);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 2265, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_extension_name = __pyx_t_4;

  /* "pyarrow/types.pxi":2268
 * 
 *     # Make a dummy C++ ExtensionType
 *     storage_type = null()             # <<<<<<<<<<<<<<
 *     check_status(CPyExtensionType.FromClass(
 *         storage_type.sp_type, c_extension_name, PyExtensionType,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_null); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(4, 2268, __pyx_L1_error)
  __pyx_v_storage_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":2269
 *     # Make a dummy C++ ExtensionType
 *     storage_type = null()
 *     check_status(CPyExtensionType.FromClass(             # <<<<<<<<<<<<<<
 *         storage_type.sp_type, c_extension_name, PyExtensionType,
 *         &cpy_ext_type))
 */
  __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status( arrow::py::PyExtensionType::FromClass(__pyx_v_storage_type->sp_type, __pyx_v_c_extension_name, ((PyObject *)__pyx_ptype_7pyarrow_3lib_PyExtensionType), (&__pyx_v_cpy_ext_type))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(4, 2269, __pyx_L1_error)

  /* "pyarrow/types.pxi":2272
 *         storage_type.sp_type, c_extension_name, PyExtensionType,
 *         &cpy_ext_type))
 *     check_status(             # <<<<<<<<<<<<<<
 *         RegisterPyExtensionType(<shared_ptr[CDataType]> cpy_ext_type))
 * 
 */
  __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::RegisterPyExtensionType(((std::shared_ptr< arrow::DataType> )__pyx_v_cpy_ext_type))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(4, 2272, __pyx_L1_error)

  /* "pyarrow/types.pxi":2261
 * 
 * 
 * def _register_py_extension_type():             # <<<<<<<<<<<<<<
 *     cdef:
 *         DataType storage_type
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib._register_py_extension_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_storage_type);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":2276
 * 
 * 
 * def _unregister_py_extension_types():             # <<<<<<<<<<<<<<
 *     # This needs to be done explicitly before the Python interpreter is
 *     # finalized.  If the C++ type is destroyed later in the process
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_109_unregister_py_extension_types(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_108_unregister_py_extension_types[] = "_unregister_py_extension_types()";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_109_unregister_py_extension_types = {"_unregister_py_extension_types", (PyCFunction)__pyx_pw_7pyarrow_3lib_109_unregister_py_extension_types, METH_NOARGS, __pyx_doc_7pyarrow_3lib_108_unregister_py_extension_types};
static PyObject *__pyx_pw_7pyarrow_3lib_109_unregister_py_extension_types(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_unregister_py_extension_types (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_108_unregister_py_extension_types(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_108_unregister_py_extension_types(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_ext_type = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("_unregister_py_extension_types", 0);

  /* "pyarrow/types.pxi":2281
 *     # teardown stage, it will invoke CPython APIs such as Py_DECREF
 *     # with a destroyed interpreter.
 *     unregister_extension_type("arrow.py_extension_type")             # <<<<<<<<<<<<<<
 *     for ext_type in _python_extension_types_registry:
 *         try:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_unregister_extension_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_arrow_py_extension_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_arrow_py_extension_type);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":2282
 *     # with a destroyed interpreter.
 *     unregister_extension_type("arrow.py_extension_type")
 *     for ext_type in _python_extension_types_registry:             # <<<<<<<<<<<<<<
 *         try:
 *             unregister_extension_type(ext_type.extension_name)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_python_extension_types_registry); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2282, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2282, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 2282, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(4, 2282, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2282, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(4, 2282, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2282, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(4, 2282, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_ext_type, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/types.pxi":2283
 *     unregister_extension_type("arrow.py_extension_type")
 *     for ext_type in _python_extension_types_registry:
 *         try:             # <<<<<<<<<<<<<<
 *             unregister_extension_type(ext_type.extension_name)
 *         except KeyError:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);
      /*try:*/ {

        /* "pyarrow/types.pxi":2284
 *     for ext_type in _python_extension_types_registry:
 *         try:
 *             unregister_extension_type(ext_type.extension_name)             # <<<<<<<<<<<<<<
 *         except KeyError:
 *             pass
 */
        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_unregister_extension_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2284, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_ext_type, __pyx_n_s_extension_name); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 2284, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_10)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_1 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_10, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_9);
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2284, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "pyarrow/types.pxi":2283
 *     unregister_extension_type("arrow.py_extension_type")
 *     for ext_type in _python_extension_types_registry:
 *         try:             # <<<<<<<<<<<<<<
 *             unregister_extension_type(ext_type.extension_name)
 *         except KeyError:
 */
      }
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L12_try_end;
      __pyx_L5_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "pyarrow/types.pxi":2285
 *         try:
 *             unregister_extension_type(ext_type.extension_name)
 *         except KeyError:             # <<<<<<<<<<<<<<
 *             pass
 *     _registry_nanny.release_registry()
 */
      __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
      if (__pyx_t_11) {
        __Pyx_ErrRestore(0,0,0);
        goto __pyx_L6_exception_handled;
      }
      goto __pyx_L7_except_error;
      __pyx_L7_except_error:;

      /* "pyarrow/types.pxi":2283
 *     unregister_extension_type("arrow.py_extension_type")
 *     for ext_type in _python_extension_types_registry:
 *         try:             # <<<<<<<<<<<<<<
 *             unregister_extension_type(ext_type.extension_name)
 *         except KeyError:
 */
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      goto __pyx_L1_error;
      __pyx_L6_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      __pyx_L12_try_end:;
    }

    /* "pyarrow/types.pxi":2282
 *     # with a destroyed interpreter.
 *     unregister_extension_type("arrow.py_extension_type")
 *     for ext_type in _python_extension_types_registry:             # <<<<<<<<<<<<<<
 *         try:
 *             unregister_extension_type(ext_type.extension_name)
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":2287
 *         except KeyError:
 *             pass
 *     _registry_nanny.release_registry()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_registry_nanny); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_release_registry); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 2287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":2276
 * 
 * 
 * def _unregister_py_extension_types():             # <<<<<<<<<<<<<<
 *     # This needs to be done explicitly before the Python interpreter is
 *     # finalized.  If the C++ type is destroyed later in the process
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("pyarrow.lib._unregister_py_extension_types", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ext_type);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/lib.pxd":169
 * cdef class Scalar:
 *     cdef readonly:
 *         DataType type             # <<<<<<<<<<<<<<
 * 
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Scalar_4type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Scalar_4type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Scalar_4type___get__(((struct __pyx_obj_7pyarrow_3lib_Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Scalar_4type___get__(struct __pyx_obj_7pyarrow_3lib_Scalar *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->type));
  __pyx_r = ((PyObject *)__pyx_v_self->type);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Scalar_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Scalar___reduce_cython__[] = "Scalar.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_6Scalar_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Scalar___reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Scalar___reduce_cython__(struct __pyx_obj_7pyarrow_3lib_Scalar *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self.type,)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->type));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->type));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self->type));
  __pyx_v_state = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self.type,)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":7
 *     state = (self.type,)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_2 = (__pyx_v__dict != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self.type is not None
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self.type,)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self.type is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_Scalar, (type(self), 0x599dcce, None), state
 */
  /*else*/ {
    __pyx_t_3 = (((PyObject *)__pyx_v_self->type) != Py_None);
    __pyx_v_use_setstate = __pyx_t_3;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.type is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_Scalar, (type(self), 0x599dcce, None), state
 *     else:
 */
  __pyx_t_3 = (__pyx_v_use_setstate != 0);
  if (__pyx_t_3) {

    /* "(tree fragment)":13
 *         use_setstate = self.type is not None
 *     if use_setstate:
 *         return __pyx_unpickle_Scalar, (type(self), 0x599dcce, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_Scalar, (type(self), 0x599dcce, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Scalar); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_93969614);
    __Pyx_GIVEREF(__pyx_int_93969614);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_93969614);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.type is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_Scalar, (type(self), 0x599dcce, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_Scalar, (type(self), 0x599dcce, None), state
 *     else:
 *         return __pyx_unpickle_Scalar, (type(self), 0x599dcce, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_Scalar__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Scalar); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_93969614);
    __Pyx_GIVEREF(__pyx_int_93969614);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_93969614);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.Scalar.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_Scalar, (type(self), 0x599dcce, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Scalar__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Scalar_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Scalar_2__setstate_cython__[] = "Scalar.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_6Scalar_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Scalar_2__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_Scalar *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Scalar_2__setstate_cython__(struct __pyx_obj_7pyarrow_3lib_Scalar *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_Scalar, (type(self), 0x599dcce, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_Scalar__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(10, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_7pyarrow_3lib___pyx_unpickle_Scalar__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_Scalar, (type(self), 0x599dcce, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Scalar__set_state(self, __pyx_state)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Scalar.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":33
 *     """
 *     # TODO rename this NullValue?
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         global NA
 *         if NA is not None:
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_8NullType_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_8NullType_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_8NullType___cinit__(((struct __pyx_obj_7pyarrow_3lib_NullType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_8NullType___cinit__(struct __pyx_obj_7pyarrow_3lib_NullType *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/scalar.pxi":35
 *     def __cinit__(self):
 *         global NA
 *         if NA is not None:             # <<<<<<<<<<<<<<
 *             raise Exception('Cannot create multiple NAType instances')
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NA); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (unlikely(__pyx_t_3)) {

    /* "pyarrow/scalar.pxi":36
 *         global NA
 *         if NA is not None:
 *             raise Exception('Cannot create multiple NAType instances')             # <<<<<<<<<<<<<<
 * 
 *         self.type = null()
 */
    __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 36, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(5, 36, __pyx_L1_error)

    /* "pyarrow/scalar.pxi":35
 *     def __cinit__(self):
 *         global NA
 *         if NA is not None:             # <<<<<<<<<<<<<<
 *             raise Exception('Cannot create multiple NAType instances')
 * 
 */
  }

  /* "pyarrow/scalar.pxi":38
 *             raise Exception('Cannot create multiple NAType instances')
 * 
 *         self.type = null()             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_null); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(5, 38, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.type);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.type));
  __pyx_v_self->__pyx_base.type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":33
 *     """
 *     # TODO rename this NullValue?
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         global NA
 *         if NA is not None:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.NullType.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":40
 *         self.type = null()
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return 'NULL'
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8NullType_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_8NullType_3__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8NullType_2__repr__(((struct __pyx_obj_7pyarrow_3lib_NullType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8NullType_2__repr__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NullType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pyarrow/scalar.pxi":41
 * 
 *     def __repr__(self):
 *         return 'NULL'             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_n_u_NULL);
  __pyx_r = __pyx_n_u_NULL;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":40
 *         self.type = null()
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return 'NULL'
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":43
 *         return 'NULL'
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return None
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8NullType_5as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_8NullType_4as_py[] = "NullType.as_py(self)\n\n        Return None\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_8NullType_5as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8NullType_4as_py(((struct __pyx_obj_7pyarrow_3lib_NullType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8NullType_4as_py(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NullType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":47
 *         Return None
 *         """
 *         return None             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":43
 *         return 'NULL'
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return None
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":49
 *         return None
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         return NA
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8NullType_7__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_8NullType_7__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8NullType_6__eq__(((struct __pyx_obj_7pyarrow_3lib_NullType *)__pyx_v_self), ((PyObject *)__pyx_v_other));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8NullType_6__eq__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NullType *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__eq__", 0);

  /* "pyarrow/scalar.pxi":50
 * 
 *     def __eq__(self, other):
 *         return NA             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NA); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":49
 *         return None
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         return NA
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.NullType.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8NullType_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_8NullType_8__reduce_cython__[] = "NullType.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_8NullType_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8NullType_8__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_NullType *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8NullType_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NullType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.NullType.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8NullType_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_8NullType_10__setstate_cython__[] = "NullType.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_8NullType_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8NullType_10__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_NullType *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8NullType_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NullType *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.NullType.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":61
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly, use array "
 *                         "subscription instead."
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_10ArrayValue___init__(((struct __pyx_obj_7pyarrow_3lib_ArrayValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_10ArrayValue___init__(struct __pyx_obj_7pyarrow_3lib_ArrayValue *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/scalar.pxi":64
 *         raise TypeError("Do not call {}'s constructor directly, use array "
 *                         "subscription instead."
 *                         .format(self.__class__.__name__))             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, DataType type, const shared_ptr[CArray]& sp_array,
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Do_not_call_s_constructor_direct_5, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/scalar.pxi":62
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call {}'s constructor directly, use array "             # <<<<<<<<<<<<<<
 *                         "subscription instead."
 *                         .format(self.__class__.__name__))
 */
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __PYX_ERR(5, 62, __pyx_L1_error)

  /* "pyarrow/scalar.pxi":61
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly, use array "
 *                         "subscription instead."
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.ArrayValue.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":66
 *                         .format(self.__class__.__name__))
 * 
 *     cdef void init(self, DataType type, const shared_ptr[CArray]& sp_array,             # <<<<<<<<<<<<<<
 *                    int64_t index):
 *         self.type = type
 */

static void __pyx_f_7pyarrow_3lib_10ArrayValue_init(struct __pyx_obj_7pyarrow_3lib_ArrayValue *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_type, std::shared_ptr< arrow::Array>  const &__pyx_v_sp_array, int64_t __pyx_v_index) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/scalar.pxi":68
 *     cdef void init(self, DataType type, const shared_ptr[CArray]& sp_array,
 *                    int64_t index):
 *         self.type = type             # <<<<<<<<<<<<<<
 *         self.index = index
 *         self._set_array(sp_array)
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_type));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_type));
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.type);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.type));
  __pyx_v_self->__pyx_base.type = __pyx_v_type;

  /* "pyarrow/scalar.pxi":69
 *                    int64_t index):
 *         self.type = type
 *         self.index = index             # <<<<<<<<<<<<<<
 *         self._set_array(sp_array)
 * 
 */
  __pyx_v_self->index = __pyx_v_index;

  /* "pyarrow/scalar.pxi":70
 *         self.type = type
 *         self.index = index
 *         self._set_array(sp_array)             # <<<<<<<<<<<<<<
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue *)__pyx_v_self->__pyx_vtab)->_set_array(__pyx_v_self, __pyx_v_sp_array);

  /* "pyarrow/scalar.pxi":66
 *                         .format(self.__class__.__name__))
 * 
 *     cdef void init(self, DataType type, const shared_ptr[CArray]& sp_array,             # <<<<<<<<<<<<<<
 *                    int64_t index):
 *         self.type = type
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/scalar.pxi":72
 *         self._set_array(sp_array)
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):             # <<<<<<<<<<<<<<
 *         self.sp_array = sp_array
 * 
 */

static void __pyx_f_7pyarrow_3lib_10ArrayValue__set_array(struct __pyx_obj_7pyarrow_3lib_ArrayValue *__pyx_v_self, std::shared_ptr< arrow::Array>  const &__pyx_v_sp_array) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_set_array", 0);

  /* "pyarrow/scalar.pxi":73
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):
 *         self.sp_array = sp_array             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __pyx_v_self->sp_array = __pyx_v_sp_array;

  /* "pyarrow/scalar.pxi":72
 *         self._set_array(sp_array)
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):             # <<<<<<<<<<<<<<
 *         self.sp_array = sp_array
 * 
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/scalar.pxi":75
 *         self.sp_array = sp_array
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if hasattr(self, 'as_py'):
 *             return repr(self.as_py())
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10ArrayValue_2__repr__(((struct __pyx_obj_7pyarrow_3lib_ArrayValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10ArrayValue_2__repr__(struct __pyx_obj_7pyarrow_3lib_ArrayValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pyarrow/scalar.pxi":76
 * 
 *     def __repr__(self):
 *         if hasattr(self, 'as_py'):             # <<<<<<<<<<<<<<
 *             return repr(self.as_py())
 *         else:
 */
  __pyx_t_1 = __Pyx_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_u_as_py); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 76, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/scalar.pxi":77
 *     def __repr__(self):
 *         if hasattr(self, 'as_py'):
 *             return repr(self.as_py())             # <<<<<<<<<<<<<<
 *         else:
 *             return super(Scalar, self).__repr__()
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_as_py); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 77, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 77, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Repr(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 77, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "pyarrow/scalar.pxi":76
 * 
 *     def __repr__(self):
 *         if hasattr(self, 'as_py'):             # <<<<<<<<<<<<<<
 *             return repr(self.as_py())
 *         else:
 */
  }

  /* "pyarrow/scalar.pxi":79
 *             return repr(self.as_py())
 *         else:
 *             return super(Scalar, self).__repr__()             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 79, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)__pyx_ptype_7pyarrow_3lib_Scalar));
    __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7pyarrow_3lib_Scalar));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Scalar));
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_self));
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 79, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_repr); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 79, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 79, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/scalar.pxi":75
 *         self.sp_array = sp_array
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if hasattr(self, 'as_py'):
 *             return repr(self.as_py())
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.ArrayValue.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":81
 *             return super(Scalar, self).__repr__()
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         if hasattr(self, 'as_py'):
 *             return str(self.as_py())
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10ArrayValue_4__str__(((struct __pyx_obj_7pyarrow_3lib_ArrayValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10ArrayValue_4__str__(struct __pyx_obj_7pyarrow_3lib_ArrayValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "pyarrow/scalar.pxi":82
 * 
 *     def __str__(self):
 *         if hasattr(self, 'as_py'):             # <<<<<<<<<<<<<<
 *             return str(self.as_py())
 *         else:
 */
  __pyx_t_1 = __Pyx_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_u_as_py); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 82, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/scalar.pxi":83
 *     def __str__(self):
 *         if hasattr(self, 'as_py'):
 *             return str(self.as_py())             # <<<<<<<<<<<<<<
 *         else:
 *             return super(Scalar, self).__str__()
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_as_py); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 83, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 83, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 83, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "pyarrow/scalar.pxi":82
 * 
 *     def __str__(self):
 *         if hasattr(self, 'as_py'):             # <<<<<<<<<<<<<<
 *             return str(self.as_py())
 *         else:
 */
  }

  /* "pyarrow/scalar.pxi":85
 *             return str(self.as_py())
 *         else:
 *             return super(Scalar, self).__str__()             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, other):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 85, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)__pyx_ptype_7pyarrow_3lib_Scalar));
    __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7pyarrow_3lib_Scalar));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Scalar));
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_self));
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 85, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_str); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 85, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 85, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/scalar.pxi":81
 *             return super(Scalar, self).__repr__()
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         if hasattr(self, 'as_py'):
 *             return str(self.as_py())
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.ArrayValue.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":87
 *             return super(Scalar, self).__str__()
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         if hasattr(self, 'as_py'):
 *             if isinstance(other, ArrayValue):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10ArrayValue_7__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_10ArrayValue_7__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10ArrayValue_6__eq__(((struct __pyx_obj_7pyarrow_3lib_ArrayValue *)__pyx_v_self), ((PyObject *)__pyx_v_other));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10ArrayValue_6__eq__(struct __pyx_obj_7pyarrow_3lib_ArrayValue *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__eq__", 0);
  __Pyx_INCREF(__pyx_v_other);

  /* "pyarrow/scalar.pxi":88
 * 
 *     def __eq__(self, other):
 *         if hasattr(self, 'as_py'):             # <<<<<<<<<<<<<<
 *             if isinstance(other, ArrayValue):
 *                 other = other.as_py()
 */
  __pyx_t_1 = __Pyx_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_u_as_py); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 88, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (likely(__pyx_t_2)) {

    /* "pyarrow/scalar.pxi":89
 *     def __eq__(self, other):
 *         if hasattr(self, 'as_py'):
 *             if isinstance(other, ArrayValue):             # <<<<<<<<<<<<<<
 *                 other = other.as_py()
 *             return self.as_py() == other
 */
    __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_7pyarrow_3lib_ArrayValue); 
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "pyarrow/scalar.pxi":90
 *         if hasattr(self, 'as_py'):
 *             if isinstance(other, ArrayValue):
 *                 other = other.as_py()             # <<<<<<<<<<<<<<
 *             return self.as_py() == other
 *         else:
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_as_py); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 90, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 90, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "pyarrow/scalar.pxi":89
 *     def __eq__(self, other):
 *         if hasattr(self, 'as_py'):
 *             if isinstance(other, ArrayValue):             # <<<<<<<<<<<<<<
 *                 other = other.as_py()
 *             return self.as_py() == other
 */
    }

    /* "pyarrow/scalar.pxi":91
 *             if isinstance(other, ArrayValue):
 *                 other = other.as_py()
 *             return self.as_py() == other             # <<<<<<<<<<<<<<
 *         else:
 *             raise NotImplementedError(
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_as_py); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 91, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 91, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_other, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 91, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "pyarrow/scalar.pxi":88
 * 
 *     def __eq__(self, other):
 *         if hasattr(self, 'as_py'):             # <<<<<<<<<<<<<<
 *             if isinstance(other, ArrayValue):
 *                 other = other.as_py()
 */
  }

  /* "pyarrow/scalar.pxi":93
 *             return self.as_py() == other
 *         else:
 *             raise NotImplementedError(             # <<<<<<<<<<<<<<
 *                 "Cannot compare Arrow values that don't support as_py()")
 * 
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 93, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(5, 93, __pyx_L1_error)
  }

  /* "pyarrow/scalar.pxi":87
 *             return super(Scalar, self).__str__()
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         if hasattr(self, 'as_py'):
 *             if isinstance(other, ArrayValue):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.ArrayValue.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_other);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":96
 *                 "Cannot compare Arrow values that don't support as_py()")
 * 
 *     def __hash__(self):             # <<<<<<<<<<<<<<
 *         return hash(self.as_py())
 * 
 */

/* Python wrapper */
static Py_hash_t __pyx_pw_7pyarrow_3lib_10ArrayValue_9__hash__(PyObject *__pyx_v_self); /*proto*/
static Py_hash_t __pyx_pw_7pyarrow_3lib_10ArrayValue_9__hash__(PyObject *__pyx_v_self) {
  Py_hash_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10ArrayValue_8__hash__(((struct __pyx_obj_7pyarrow_3lib_ArrayValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static Py_hash_t __pyx_pf_7pyarrow_3lib_10ArrayValue_8__hash__(struct __pyx_obj_7pyarrow_3lib_ArrayValue *__pyx_v_self) {
  Py_hash_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_hash_t __pyx_t_4;
  __Pyx_RefNannySetupContext("__hash__", 0);

  /* "pyarrow/scalar.pxi":97
 * 
 *     def __hash__(self):
 *         return hash(self.as_py())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_as_py); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_4 == ((Py_hash_t)-1))) __PYX_ERR(5, 97, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":96
 *                 "Cannot compare Arrow values that don't support as_py()")
 * 
 *     def __hash__(self):             # <<<<<<<<<<<<<<
 *         return hash(self.as_py())
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.ArrayValue.__hash__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10ArrayValue_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10ArrayValue_10__reduce_cython__[] = "ArrayValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10ArrayValue_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10ArrayValue_10__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_ArrayValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10ArrayValue_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_ArrayValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.ArrayValue.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10ArrayValue_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10ArrayValue_12__setstate_cython__[] = "ArrayValue.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_10ArrayValue_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10ArrayValue_12__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_ArrayValue *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10ArrayValue_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_ArrayValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.ArrayValue.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":105
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python bool.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12BooleanValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12BooleanValue_as_py[] = "BooleanValue.as_py(self)\n\n        Return this value as a Python bool.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_12BooleanValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12BooleanValue_as_py(((struct __pyx_obj_7pyarrow_3lib_BooleanValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12BooleanValue_as_py(struct __pyx_obj_7pyarrow_3lib_BooleanValue *__pyx_v_self) {
   arrow::BooleanArray *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":109
 *         Return this value as a Python bool.
 *         """
 *         cdef CBooleanArray* ap = <CBooleanArray*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return ap.Value(self.index)
 * 
 */
  __pyx_v_ap = (( arrow::BooleanArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":110
 *         """
 *         cdef CBooleanArray* ap = <CBooleanArray*> self.sp_array.get()
 *         return ap.Value(self.index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":105
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python bool.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.BooleanValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12BooleanValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12BooleanValue_2__reduce_cython__[] = "BooleanValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_12BooleanValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12BooleanValue_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_BooleanValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12BooleanValue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BooleanValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.BooleanValue.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12BooleanValue_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12BooleanValue_4__setstate_cython__[] = "BooleanValue.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_12BooleanValue_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12BooleanValue_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_BooleanValue *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12BooleanValue_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BooleanValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.BooleanValue.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":118
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9Int8Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_9Int8Value_as_py[] = "Int8Value.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_9Int8Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9Int8Value_as_py(((struct __pyx_obj_7pyarrow_3lib_Int8Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_9Int8Value_as_py(struct __pyx_obj_7pyarrow_3lib_Int8Value *__pyx_v_self) {
   arrow::Int8Array *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":122
 *         Return this value as a Python int.
 *         """
 *         cdef CInt8Array* ap = <CInt8Array*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return ap.Value(self.index)
 * 
 */
  __pyx_v_ap = (( arrow::Int8Array *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":123
 *         """
 *         cdef CInt8Array* ap = <CInt8Array*> self.sp_array.get()
 *         return ap.Value(self.index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int8_t(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":118
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int8Value.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9Int8Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_9Int8Value_2__reduce_cython__[] = "Int8Value.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_9Int8Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9Int8Value_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_Int8Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_9Int8Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int8Value *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int8Value.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9Int8Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_9Int8Value_4__setstate_cython__[] = "Int8Value.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_9Int8Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9Int8Value_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_Int8Value *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_9Int8Value_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int8Value *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int8Value.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":131
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10UInt8Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10UInt8Value_as_py[] = "UInt8Value.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10UInt8Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10UInt8Value_as_py(((struct __pyx_obj_7pyarrow_3lib_UInt8Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10UInt8Value_as_py(struct __pyx_obj_7pyarrow_3lib_UInt8Value *__pyx_v_self) {
   arrow::UInt8Array *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":135
 *         Return this value as a Python int.
 *         """
 *         cdef CUInt8Array* ap = <CUInt8Array*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return ap.Value(self.index)
 * 
 */
  __pyx_v_ap = (( arrow::UInt8Array *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":136
 *         """
 *         cdef CUInt8Array* ap = <CUInt8Array*> self.sp_array.get()
 *         return ap.Value(self.index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":131
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt8Value.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10UInt8Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10UInt8Value_2__reduce_cython__[] = "UInt8Value.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10UInt8Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10UInt8Value_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt8Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10UInt8Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt8Value *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt8Value.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10UInt8Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10UInt8Value_4__setstate_cython__[] = "UInt8Value.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_10UInt8Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10UInt8Value_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt8Value *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10UInt8Value_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt8Value *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt8Value.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":144
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10Int16Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10Int16Value_as_py[] = "Int16Value.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10Int16Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10Int16Value_as_py(((struct __pyx_obj_7pyarrow_3lib_Int16Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10Int16Value_as_py(struct __pyx_obj_7pyarrow_3lib_Int16Value *__pyx_v_self) {
   arrow::Int16Array *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":148
 *         Return this value as a Python int.
 *         """
 *         cdef CInt16Array* ap = <CInt16Array*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return ap.Value(self.index)
 * 
 */
  __pyx_v_ap = (( arrow::Int16Array *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":149
 *         """
 *         cdef CInt16Array* ap = <CInt16Array*> self.sp_array.get()
 *         return ap.Value(self.index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int16_t(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":144
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int16Value.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10Int16Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10Int16Value_2__reduce_cython__[] = "Int16Value.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10Int16Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10Int16Value_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_Int16Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10Int16Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int16Value *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int16Value.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10Int16Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10Int16Value_4__setstate_cython__[] = "Int16Value.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_10Int16Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10Int16Value_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_Int16Value *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10Int16Value_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int16Value *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int16Value.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":157
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt16Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11UInt16Value_as_py[] = "UInt16Value.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt16Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11UInt16Value_as_py(((struct __pyx_obj_7pyarrow_3lib_UInt16Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11UInt16Value_as_py(struct __pyx_obj_7pyarrow_3lib_UInt16Value *__pyx_v_self) {
   arrow::UInt16Array *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":161
 *         Return this value as a Python int.
 *         """
 *         cdef CUInt16Array* ap = <CUInt16Array*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return ap.Value(self.index)
 * 
 */
  __pyx_v_ap = (( arrow::UInt16Array *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":162
 *         """
 *         cdef CUInt16Array* ap = <CUInt16Array*> self.sp_array.get()
 *         return ap.Value(self.index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_uint16_t(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":157
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt16Value.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt16Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11UInt16Value_2__reduce_cython__[] = "UInt16Value.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt16Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11UInt16Value_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt16Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11UInt16Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt16Value *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt16Value.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt16Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11UInt16Value_4__setstate_cython__[] = "UInt16Value.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt16Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11UInt16Value_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt16Value *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11UInt16Value_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt16Value *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt16Value.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":170
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10Int32Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10Int32Value_as_py[] = "Int32Value.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10Int32Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10Int32Value_as_py(((struct __pyx_obj_7pyarrow_3lib_Int32Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10Int32Value_as_py(struct __pyx_obj_7pyarrow_3lib_Int32Value *__pyx_v_self) {
   arrow::Int32Array *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":174
 *         Return this value as a Python int.
 *         """
 *         cdef CInt32Array* ap = <CInt32Array*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return ap.Value(self.index)
 * 
 */
  __pyx_v_ap = (( arrow::Int32Array *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":175
 *         """
 *         cdef CInt32Array* ap = <CInt32Array*> self.sp_array.get()
 *         return ap.Value(self.index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":170
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int32Value.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10Int32Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10Int32Value_2__reduce_cython__[] = "Int32Value.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10Int32Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10Int32Value_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_Int32Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10Int32Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int32Value *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int32Value.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10Int32Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10Int32Value_4__setstate_cython__[] = "Int32Value.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_10Int32Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10Int32Value_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_Int32Value *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10Int32Value_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int32Value *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int32Value.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":183
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt32Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11UInt32Value_as_py[] = "UInt32Value.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt32Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11UInt32Value_as_py(((struct __pyx_obj_7pyarrow_3lib_UInt32Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11UInt32Value_as_py(struct __pyx_obj_7pyarrow_3lib_UInt32Value *__pyx_v_self) {
   arrow::UInt32Array *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":187
 *         Return this value as a Python int.
 *         """
 *         cdef CUInt32Array* ap = <CUInt32Array*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return ap.Value(self.index)
 * 
 */
  __pyx_v_ap = (( arrow::UInt32Array *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":188
 *         """
 *         cdef CUInt32Array* ap = <CUInt32Array*> self.sp_array.get()
 *         return ap.Value(self.index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":183
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt32Value.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt32Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11UInt32Value_2__reduce_cython__[] = "UInt32Value.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt32Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11UInt32Value_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt32Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11UInt32Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt32Value *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt32Value.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt32Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11UInt32Value_4__setstate_cython__[] = "UInt32Value.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt32Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11UInt32Value_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt32Value *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11UInt32Value_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt32Value *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt32Value.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":196
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10Int64Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10Int64Value_as_py[] = "Int64Value.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10Int64Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10Int64Value_as_py(((struct __pyx_obj_7pyarrow_3lib_Int64Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10Int64Value_as_py(struct __pyx_obj_7pyarrow_3lib_Int64Value *__pyx_v_self) {
   arrow::Int64Array *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":200
 *         Return this value as a Python int.
 *         """
 *         cdef CInt64Array* ap = <CInt64Array*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return ap.Value(self.index)
 * 
 */
  __pyx_v_ap = (( arrow::Int64Array *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":201
 *         """
 *         cdef CInt64Array* ap = <CInt64Array*> self.sp_array.get()
 *         return ap.Value(self.index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":196
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int64Value.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10Int64Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10Int64Value_2__reduce_cython__[] = "Int64Value.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10Int64Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10Int64Value_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_Int64Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10Int64Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int64Value *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int64Value.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10Int64Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10Int64Value_4__setstate_cython__[] = "Int64Value.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_10Int64Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10Int64Value_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_Int64Value *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10Int64Value_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int64Value *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int64Value.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":209
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt64Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11UInt64Value_as_py[] = "UInt64Value.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt64Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11UInt64Value_as_py(((struct __pyx_obj_7pyarrow_3lib_UInt64Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11UInt64Value_as_py(struct __pyx_obj_7pyarrow_3lib_UInt64Value *__pyx_v_self) {
   arrow::UInt64Array *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":213
 *         Return this value as a Python int.
 *         """
 *         cdef CUInt64Array* ap = <CUInt64Array*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return ap.Value(self.index)
 * 
 */
  __pyx_v_ap = (( arrow::UInt64Array *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":214
 *         """
 *         cdef CUInt64Array* ap = <CUInt64Array*> self.sp_array.get()
 *         return ap.Value(self.index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":209
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt64Value.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt64Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11UInt64Value_2__reduce_cython__[] = "UInt64Value.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt64Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11UInt64Value_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt64Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11UInt64Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt64Value *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt64Value.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt64Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11UInt64Value_4__setstate_cython__[] = "UInt64Value.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt64Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11UInt64Value_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt64Value *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11UInt64Value_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt64Value *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt64Value.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":222
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python datetime.datetime instance.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Date32Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Date32Value_as_py[] = "Date32Value.as_py(self)\n\n        Return this value as a Python datetime.datetime instance.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11Date32Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Date32Value_as_py(((struct __pyx_obj_7pyarrow_3lib_Date32Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Date32Value_as_py(struct __pyx_obj_7pyarrow_3lib_Date32Value *__pyx_v_self) {
   arrow::Date32Array *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":226
 *         Return this value as a Python datetime.datetime instance.
 *         """
 *         cdef CDate32Array* ap = <CDate32Array*> self.sp_array.get()             # <<<<<<<<<<<<<<
 * 
 *         # Shift to seconds since epoch
 */
  __pyx_v_ap = (( arrow::Date32Array *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":229
 * 
 *         # Shift to seconds since epoch
 *         return (datetime.date(1970, 1, 1) +             # <<<<<<<<<<<<<<
 *                 datetime.timedelta(days=ap.Value(self.index)))
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_date); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/scalar.pxi":230
 *         # Shift to seconds since epoch
 *         return (datetime.date(1970, 1, 1) +
 *                 datetime.timedelta(days=ap.Value(self.index)))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_days, __pyx_t_4) < 0) __PYX_ERR(5, 230, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/scalar.pxi":229
 * 
 *         # Shift to seconds since epoch
 *         return (datetime.date(1970, 1, 1) +             # <<<<<<<<<<<<<<
 *                 datetime.timedelta(days=ap.Value(self.index)))
 * 
 */
  __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":222
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python datetime.datetime instance.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.Date32Value.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Date32Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Date32Value_2__reduce_cython__[] = "Date32Value.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11Date32Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Date32Value_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_Date32Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Date32Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Date32Value *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Date32Value.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Date32Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Date32Value_4__setstate_cython__[] = "Date32Value.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11Date32Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Date32Value_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_Date32Value *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Date32Value_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Date32Value *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Date32Value.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":238
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python datetime.datetime instance.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Date64Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Date64Value_as_py[] = "Date64Value.as_py(self)\n\n        Return this value as a Python datetime.datetime instance.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11Date64Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Date64Value_as_py(((struct __pyx_obj_7pyarrow_3lib_Date64Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Date64Value_as_py(struct __pyx_obj_7pyarrow_3lib_Date64Value *__pyx_v_self) {
   arrow::Date64Array *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":242
 *         Return this value as a Python datetime.datetime instance.
 *         """
 *         cdef CDate64Array* ap = <CDate64Array*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return (datetime.date(1970, 1, 1) +
 *                 datetime.timedelta(
 */
  __pyx_v_ap = (( arrow::Date64Array *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":243
 *         """
 *         cdef CDate64Array* ap = <CDate64Array*> self.sp_array.get()
 *         return (datetime.date(1970, 1, 1) +             # <<<<<<<<<<<<<<
 *                 datetime.timedelta(
 *                     days=ap.Value(self.index) / 86400000))
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_date); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/scalar.pxi":244
 *         cdef CDate64Array* ap = <CDate64Array*> self.sp_array.get()
 *         return (datetime.date(1970, 1, 1) +
 *                 datetime.timedelta(             # <<<<<<<<<<<<<<
 *                     days=ap.Value(self.index) / 86400000))
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/scalar.pxi":245
 *         return (datetime.date(1970, 1, 1) +
 *                 datetime.timedelta(
 *                     days=ap.Value(self.index) / 86400000))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyFloat_FromDouble((((double)__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)) / 86400000.0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_days, __pyx_t_4) < 0) __PYX_ERR(5, 245, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/scalar.pxi":244
 *         cdef CDate64Array* ap = <CDate64Array*> self.sp_array.get()
 *         return (datetime.date(1970, 1, 1) +
 *                 datetime.timedelta(             # <<<<<<<<<<<<<<
 *                     days=ap.Value(self.index) / 86400000))
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/scalar.pxi":243
 *         """
 *         cdef CDate64Array* ap = <CDate64Array*> self.sp_array.get()
 *         return (datetime.date(1970, 1, 1) +             # <<<<<<<<<<<<<<
 *                 datetime.timedelta(
 *                     days=ap.Value(self.index) / 86400000))
 */
  __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":238
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python datetime.datetime instance.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.Date64Value.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Date64Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Date64Value_2__reduce_cython__[] = "Date64Value.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11Date64Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Date64Value_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_Date64Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Date64Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Date64Value *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Date64Value.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Date64Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Date64Value_4__setstate_cython__[] = "Date64Value.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11Date64Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Date64Value_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_Date64Value *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Date64Value_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Date64Value *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Date64Value.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":253
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python datetime.timedelta instance.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Time32Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Time32Value_as_py[] = "Time32Value.as_py(self)\n\n        Return this value as a Python datetime.timedelta instance.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11Time32Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Time32Value_as_py(((struct __pyx_obj_7pyarrow_3lib_Time32Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Time32Value_as_py(struct __pyx_obj_7pyarrow_3lib_Time32Value *__pyx_v_self) {
   arrow::Time32Array *__pyx_v_ap;
   arrow::Time32Type *__pyx_v_dtype;
  PyObject *__pyx_v_delta = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":258
 *         """
 *         cdef:
 *             CTime32Array* ap = <CTime32Array*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *             CTime32Type* dtype = <CTime32Type*> ap.type().get()
 * 
 */
  __pyx_v_ap = (( arrow::Time32Array *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":259
 *         cdef:
 *             CTime32Array* ap = <CTime32Array*> self.sp_array.get()
 *             CTime32Type* dtype = <CTime32Type*> ap.type().get()             # <<<<<<<<<<<<<<
 * 
 *         if dtype.unit() == TimeUnit_SECOND:
 */
  __pyx_v_dtype = (( arrow::Time32Type *)__pyx_v_ap->type().get());

  /* "pyarrow/scalar.pxi":261
 *             CTime32Type* dtype = <CTime32Type*> ap.type().get()
 * 
 *         if dtype.unit() == TimeUnit_SECOND:             # <<<<<<<<<<<<<<
 *             delta = datetime.timedelta(seconds=ap.Value(self.index))
 *             return (datetime.datetime(1970, 1, 1) + delta).time()
 */
  __pyx_t_1 = ((__pyx_v_dtype->unit() ==  arrow::TimeUnit::SECOND) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/scalar.pxi":262
 * 
 *         if dtype.unit() == TimeUnit_SECOND:
 *             delta = datetime.timedelta(seconds=ap.Value(self.index))             # <<<<<<<<<<<<<<
 *             return (datetime.datetime(1970, 1, 1) + delta).time()
 *         else:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_seconds, __pyx_t_4) < 0) __PYX_ERR(5, 262, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_delta = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "pyarrow/scalar.pxi":263
 *         if dtype.unit() == TimeUnit_SECOND:
 *             delta = datetime.timedelta(seconds=ap.Value(self.index))
 *             return (datetime.datetime(1970, 1, 1) + delta).time()             # <<<<<<<<<<<<<<
 *         else:
 *             return _box_time_milli(ap.Value(self.index))
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_delta); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "pyarrow/scalar.pxi":261
 *             CTime32Type* dtype = <CTime32Type*> ap.type().get()
 * 
 *         if dtype.unit() == TimeUnit_SECOND:             # <<<<<<<<<<<<<<
 *             delta = datetime.timedelta(seconds=ap.Value(self.index))
 *             return (datetime.datetime(1970, 1, 1) + delta).time()
 */
  }

  /* "pyarrow/scalar.pxi":265
 *             return (datetime.datetime(1970, 1, 1) + delta).time()
 *         else:
 *             return _box_time_milli(ap.Value(self.index))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __pyx_f_7pyarrow_3lib__box_time_milli(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index), 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 265, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/scalar.pxi":253
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python datetime.timedelta instance.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.Time32Value.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_delta);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Time32Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Time32Value_2__reduce_cython__[] = "Time32Value.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11Time32Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Time32Value_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_Time32Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Time32Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Time32Value *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__72, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Time32Value.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Time32Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Time32Value_4__setstate_cython__[] = "Time32Value.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11Time32Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Time32Value_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_Time32Value *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Time32Value_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Time32Value *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__73, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Time32Value.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":273
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python datetime.timedelta instance.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Time64Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Time64Value_as_py[] = "Time64Value.as_py(self)\n\n        Return this value as a Python datetime.timedelta instance.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11Time64Value_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Time64Value_as_py(((struct __pyx_obj_7pyarrow_3lib_Time64Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Time64Value_as_py(struct __pyx_obj_7pyarrow_3lib_Time64Value *__pyx_v_self) {
   arrow::Time64Array *__pyx_v_ap;
   arrow::Time64Type *__pyx_v_dtype;
  int64_t __pyx_v_val;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":278
 *         """
 *         cdef:
 *             CTime64Array* ap = <CTime64Array*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *             CTime64Type* dtype = <CTime64Type*> ap.type().get()
 * 
 */
  __pyx_v_ap = (( arrow::Time64Array *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":279
 *         cdef:
 *             CTime64Array* ap = <CTime64Array*> self.sp_array.get()
 *             CTime64Type* dtype = <CTime64Type*> ap.type().get()             # <<<<<<<<<<<<<<
 * 
 *         cdef int64_t val = ap.Value(self.index)
 */
  __pyx_v_dtype = (( arrow::Time64Type *)__pyx_v_ap->type().get());

  /* "pyarrow/scalar.pxi":281
 *             CTime64Type* dtype = <CTime64Type*> ap.type().get()
 * 
 *         cdef int64_t val = ap.Value(self.index)             # <<<<<<<<<<<<<<
 *         if dtype.unit() == TimeUnit_MICRO:
 *             return _box_time_micro(val)
 */
  __pyx_v_val = __pyx_v_ap->Value(__pyx_v_self->__pyx_base.index);

  /* "pyarrow/scalar.pxi":282
 * 
 *         cdef int64_t val = ap.Value(self.index)
 *         if dtype.unit() == TimeUnit_MICRO:             # <<<<<<<<<<<<<<
 *             return _box_time_micro(val)
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_dtype->unit() ==  arrow::TimeUnit::MICRO) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/scalar.pxi":283
 *         cdef int64_t val = ap.Value(self.index)
 *         if dtype.unit() == TimeUnit_MICRO:
 *             return _box_time_micro(val)             # <<<<<<<<<<<<<<
 *         else:
 *             return (datetime.datetime(1970, 1, 1) +
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_7pyarrow_3lib__box_time_micro(__pyx_v_val, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 283, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/scalar.pxi":282
 * 
 *         cdef int64_t val = ap.Value(self.index)
 *         if dtype.unit() == TimeUnit_MICRO:             # <<<<<<<<<<<<<<
 *             return _box_time_micro(val)
 *         else:
 */
  }

  /* "pyarrow/scalar.pxi":285
 *             return _box_time_micro(val)
 *         else:
 *             return (datetime.datetime(1970, 1, 1) +             # <<<<<<<<<<<<<<
 *                     datetime.timedelta(microseconds=val / 1000)).time()
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);

    /* "pyarrow/scalar.pxi":286
 *         else:
 *             return (datetime.datetime(1970, 1, 1) +
 *                     datetime.timedelta(microseconds=val / 1000)).time()             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "pyarrow/scalar.pxi":285
 *             return _box_time_micro(val)
 *         else:
 *             return (datetime.datetime(1970, 1, 1) +             # <<<<<<<<<<<<<<
 *                     datetime.timedelta(microseconds=val / 1000)).time()
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/scalar.pxi":286
 *         else:
 *             return (datetime.datetime(1970, 1, 1) +
 *                     datetime.timedelta(microseconds=val / 1000)).time()             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 286, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 286, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 286, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyFloat_FromDouble((((double)__pyx_v_val) / 1000.0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 286, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_microseconds, __pyx_t_6) < 0) __PYX_ERR(5, 286, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 286, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/scalar.pxi":285
 *             return _box_time_micro(val)
 *         else:
 *             return (datetime.datetime(1970, 1, 1) +             # <<<<<<<<<<<<<<
 *                     datetime.timedelta(microseconds=val / 1000)).time()
 * 
 */
    __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/scalar.pxi":286
 *         else:
 *             return (datetime.datetime(1970, 1, 1) +
 *                     datetime.timedelta(microseconds=val / 1000)).time()             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 286, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 286, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/scalar.pxi":273
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python datetime.timedelta instance.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.Time64Value.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Time64Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Time64Value_2__reduce_cython__[] = "Time64Value.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11Time64Value_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Time64Value_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_Time64Value *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Time64Value_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Time64Value *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__74, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Time64Value.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Time64Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Time64Value_4__setstate_cython__[] = "Time64Value.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11Time64Value_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Time64Value_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_Time64Value *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Time64Value_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Time64Value *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__75, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Time64Value.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":289
 * 
 * 
 * cpdef _box_time_milli(int64_t val):             # <<<<<<<<<<<<<<
 *     delta = datetime.timedelta(milliseconds=val)
 *     return (datetime.datetime(1970, 1, 1) + delta).time()
 */

static PyObject *__pyx_pw_7pyarrow_3lib_111_box_time_milli(PyObject *__pyx_self, PyObject *__pyx_arg_val); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib__box_time_milli(int64_t __pyx_v_val, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_v_delta = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("_box_time_milli", 0);

  /* "pyarrow/scalar.pxi":290
 * 
 * cpdef _box_time_milli(int64_t val):
 *     delta = datetime.timedelta(milliseconds=val)             # <<<<<<<<<<<<<<
 *     return (datetime.datetime(1970, 1, 1) + delta).time()
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_milliseconds, __pyx_t_3) < 0) __PYX_ERR(5, 290, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_delta = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyarrow/scalar.pxi":291
 * cpdef _box_time_milli(int64_t val):
 *     delta = datetime.timedelta(milliseconds=val)
 *     return (datetime.datetime(1970, 1, 1) + delta).time()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_delta); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":289
 * 
 * 
 * cpdef _box_time_milli(int64_t val):             # <<<<<<<<<<<<<<
 *     delta = datetime.timedelta(milliseconds=val)
 *     return (datetime.datetime(1970, 1, 1) + delta).time()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib._box_time_milli", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_delta);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_111_box_time_milli(PyObject *__pyx_self, PyObject *__pyx_arg_val); /*proto*/
static char __pyx_doc_7pyarrow_3lib_110_box_time_milli[] = "_box_time_milli(int64_t val)";
static PyObject *__pyx_pw_7pyarrow_3lib_111_box_time_milli(PyObject *__pyx_self, PyObject *__pyx_arg_val) {
  int64_t __pyx_v_val;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_box_time_milli (wrapper)", 0);
  assert(__pyx_arg_val); {
    __pyx_v_val = __Pyx_PyInt_As_int64_t(__pyx_arg_val); if (unlikely((__pyx_v_val == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(5, 289, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._box_time_milli", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_110_box_time_milli(__pyx_self, ((int64_t)__pyx_v_val));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_110_box_time_milli(CYTHON_UNUSED PyObject *__pyx_self, int64_t __pyx_v_val) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("_box_time_milli", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__box_time_milli(__pyx_v_val, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._box_time_milli", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":294
 * 
 * 
 * cpdef _box_time_micro(int64_t val):             # <<<<<<<<<<<<<<
 *     return (datetime.datetime(1970, 1, 1) +
 *             datetime.timedelta(microseconds=val)).time()
 */

static PyObject *__pyx_pw_7pyarrow_3lib_113_box_time_micro(PyObject *__pyx_self, PyObject *__pyx_arg_val); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib__box_time_micro(int64_t __pyx_v_val, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("_box_time_micro", 0);

  /* "pyarrow/scalar.pxi":295
 * 
 * cpdef _box_time_micro(int64_t val):
 *     return (datetime.datetime(1970, 1, 1) +             # <<<<<<<<<<<<<<
 *             datetime.timedelta(microseconds=val)).time()
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/scalar.pxi":296
 * cpdef _box_time_micro(int64_t val):
 *     return (datetime.datetime(1970, 1, 1) +
 *             datetime.timedelta(microseconds=val)).time()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "pyarrow/scalar.pxi":295
 * 
 * cpdef _box_time_micro(int64_t val):
 *     return (datetime.datetime(1970, 1, 1) +             # <<<<<<<<<<<<<<
 *             datetime.timedelta(microseconds=val)).time()
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/scalar.pxi":296
 * cpdef _box_time_micro(int64_t val):
 *     return (datetime.datetime(1970, 1, 1) +
 *             datetime.timedelta(microseconds=val)).time()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_val); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_microseconds, __pyx_t_5) < 0) __PYX_ERR(5, 296, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/scalar.pxi":295
 * 
 * cpdef _box_time_micro(int64_t val):
 *     return (datetime.datetime(1970, 1, 1) +             # <<<<<<<<<<<<<<
 *             datetime.timedelta(microseconds=val)).time()
 * 
 */
  __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/scalar.pxi":296
 * cpdef _box_time_micro(int64_t val):
 *     return (datetime.datetime(1970, 1, 1) +
 *             datetime.timedelta(microseconds=val)).time()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_time); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":294
 * 
 * 
 * cpdef _box_time_micro(int64_t val):             # <<<<<<<<<<<<<<
 *     return (datetime.datetime(1970, 1, 1) +
 *             datetime.timedelta(microseconds=val)).time()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib._box_time_micro", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_113_box_time_micro(PyObject *__pyx_self, PyObject *__pyx_arg_val); /*proto*/
static char __pyx_doc_7pyarrow_3lib_112_box_time_micro[] = "_box_time_micro(int64_t val)";
static PyObject *__pyx_pw_7pyarrow_3lib_113_box_time_micro(PyObject *__pyx_self, PyObject *__pyx_arg_val) {
  int64_t __pyx_v_val;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_box_time_micro (wrapper)", 0);
  assert(__pyx_arg_val); {
    __pyx_v_val = __Pyx_PyInt_As_int64_t(__pyx_arg_val); if (unlikely((__pyx_v_val == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(5, 294, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._box_time_micro", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_112_box_time_micro(__pyx_self, ((int64_t)__pyx_v_val));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_112_box_time_micro(CYTHON_UNUSED PyObject *__pyx_self, int64_t __pyx_v_val) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("_box_time_micro", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__box_time_micro(__pyx_v_val, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._box_time_micro", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":303
 * 
 * 
 * cdef _add_micros_maybe_localize(dt, micros, tzinfo):             # <<<<<<<<<<<<<<
 *     import pytz
 *     dt = dt.replace(microsecond=micros)
 */

static PyObject *__pyx_f_7pyarrow_3lib__add_micros_maybe_localize(PyObject *__pyx_v_dt, PyObject *__pyx_v_micros, PyObject *__pyx_v_tzinfo) {
  CYTHON_UNUSED PyObject *__pyx_v_pytz = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("_add_micros_maybe_localize", 0);
  __Pyx_INCREF(__pyx_v_dt);
  __Pyx_INCREF(__pyx_v_tzinfo);

  /* "pyarrow/scalar.pxi":304
 * 
 * cdef _add_micros_maybe_localize(dt, micros, tzinfo):
 *     import pytz             # <<<<<<<<<<<<<<
 *     dt = dt.replace(microsecond=micros)
 *     if tzinfo is not None:
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_pytz, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_pytz = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":305
 * cdef _add_micros_maybe_localize(dt, micros, tzinfo):
 *     import pytz
 *     dt = dt.replace(microsecond=micros)             # <<<<<<<<<<<<<<
 *     if tzinfo is not None:
 *         if not isinstance(tzinfo, datetime.tzinfo):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_replace); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_microsecond, __pyx_v_micros) < 0) __PYX_ERR(5, 305, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_dt, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyarrow/scalar.pxi":306
 *     import pytz
 *     dt = dt.replace(microsecond=micros)
 *     if tzinfo is not None:             # <<<<<<<<<<<<<<
 *         if not isinstance(tzinfo, datetime.tzinfo):
 *             tzinfo = string_to_tzinfo(tzinfo)
 */
  __pyx_t_4 = (__pyx_v_tzinfo != Py_None);
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "pyarrow/scalar.pxi":307
 *     dt = dt.replace(microsecond=micros)
 *     if tzinfo is not None:
 *         if not isinstance(tzinfo, datetime.tzinfo):             # <<<<<<<<<<<<<<
 *             tzinfo = string_to_tzinfo(tzinfo)
 *         dt = tzinfo.fromutc(dt)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = PyObject_IsInstance(__pyx_v_tzinfo, __pyx_t_2); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(5, 307, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = ((!(__pyx_t_5 != 0)) != 0);
    if (__pyx_t_4) {

      /* "pyarrow/scalar.pxi":308
 *     if tzinfo is not None:
 *         if not isinstance(tzinfo, datetime.tzinfo):
 *             tzinfo = string_to_tzinfo(tzinfo)             # <<<<<<<<<<<<<<
 *         dt = tzinfo.fromutc(dt)
 *     return dt
 */
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_string_to_tzinfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 308, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_v_tzinfo) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_tzinfo);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 308, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF_SET(__pyx_v_tzinfo, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "pyarrow/scalar.pxi":307
 *     dt = dt.replace(microsecond=micros)
 *     if tzinfo is not None:
 *         if not isinstance(tzinfo, datetime.tzinfo):             # <<<<<<<<<<<<<<
 *             tzinfo = string_to_tzinfo(tzinfo)
 *         dt = tzinfo.fromutc(dt)
 */
    }

    /* "pyarrow/scalar.pxi":309
 *         if not isinstance(tzinfo, datetime.tzinfo):
 *             tzinfo = string_to_tzinfo(tzinfo)
 *         dt = tzinfo.fromutc(dt)             # <<<<<<<<<<<<<<
 *     return dt
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tzinfo, __pyx_n_s_fromutc); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 309, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_v_dt) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_dt);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 309, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_dt, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/scalar.pxi":306
 *     import pytz
 *     dt = dt.replace(microsecond=micros)
 *     if tzinfo is not None:             # <<<<<<<<<<<<<<
 *         if not isinstance(tzinfo, datetime.tzinfo):
 *             tzinfo = string_to_tzinfo(tzinfo)
 */
  }

  /* "pyarrow/scalar.pxi":310
 *             tzinfo = string_to_tzinfo(tzinfo)
 *         dt = tzinfo.fromutc(dt)
 *     return dt             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_dt);
  __pyx_r = __pyx_v_dt;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":303
 * 
 * 
 * cdef _add_micros_maybe_localize(dt, micros, tzinfo):             # <<<<<<<<<<<<<<
 *     import pytz
 *     dt = dt.replace(microsecond=micros)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib._add_micros_maybe_localize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pytz);
  __Pyx_XDECREF(__pyx_v_dt);
  __Pyx_XDECREF(__pyx_v_tzinfo);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":313
 * 
 * 
 * cdef _datetime_from_seconds(int64_t v):             # <<<<<<<<<<<<<<
 *     return datetime.datetime(1970, 1, 1) + datetime.timedelta(seconds=v)
 * 
 */

static PyObject *__pyx_f_7pyarrow_3lib__datetime_from_seconds(int64_t __pyx_v_v) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("_datetime_from_seconds", 0);

  /* "pyarrow/scalar.pxi":314
 * 
 * cdef _datetime_from_seconds(int64_t v):
 *     return datetime.datetime(1970, 1, 1) + datetime.timedelta(seconds=v)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_From_int64_t(__pyx_v_v); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_seconds, __pyx_t_4) < 0) __PYX_ERR(5, 314, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":313
 * 
 * 
 * cdef _datetime_from_seconds(int64_t v):             # <<<<<<<<<<<<<<
 *     return datetime.datetime(1970, 1, 1) + datetime.timedelta(seconds=v)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib._datetime_from_seconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":317
 * 
 * 
 * def _nanoseconds_to_datetime_safe(v, tzinfo):             # <<<<<<<<<<<<<<
 *     if v % 1000 != 0:
 *         raise ValueError("Nanosecond timestamp {} is not safely convertible "
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_115_nanoseconds_to_datetime_safe(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_114_nanoseconds_to_datetime_safe[] = "_nanoseconds_to_datetime_safe(v, tzinfo)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_115_nanoseconds_to_datetime_safe = {"_nanoseconds_to_datetime_safe", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_115_nanoseconds_to_datetime_safe, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_114_nanoseconds_to_datetime_safe};
static PyObject *__pyx_pw_7pyarrow_3lib_115_nanoseconds_to_datetime_safe(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_v = 0;
  PyObject *__pyx_v_tzinfo = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_nanoseconds_to_datetime_safe (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_v,&__pyx_n_s_tzinfo,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tzinfo)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_nanoseconds_to_datetime_safe", 1, 2, 2, 1); __PYX_ERR(5, 317, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_nanoseconds_to_datetime_safe") < 0)) __PYX_ERR(5, 317, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_v = values[0];
    __pyx_v_tzinfo = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_nanoseconds_to_datetime_safe", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(5, 317, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._nanoseconds_to_datetime_safe", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_114_nanoseconds_to_datetime_safe(__pyx_self, __pyx_v_v, __pyx_v_tzinfo);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_114_nanoseconds_to_datetime_safe(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_v, PyObject *__pyx_v_tzinfo) {
  PyObject *__pyx_v_micros = NULL;
  PyObject *__pyx_v_dt = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int64_t __pyx_t_4;
  __Pyx_RefNannySetupContext("_nanoseconds_to_datetime_safe", 0);
  __Pyx_INCREF(__pyx_v_v);

  /* "pyarrow/scalar.pxi":318
 * 
 * def _nanoseconds_to_datetime_safe(v, tzinfo):
 *     if v % 1000 != 0:             # <<<<<<<<<<<<<<
 *         raise ValueError("Nanosecond timestamp {} is not safely convertible "
 *                          " to microseconds to convert to datetime.datetime."
 */
  __pyx_t_1 = __Pyx_PyInt_RemainderObjC(__pyx_v_v, __pyx_int_1000, 0x3E8, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(5, 318, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(__pyx_t_3)) {

    /* "pyarrow/scalar.pxi":319
 * def _nanoseconds_to_datetime_safe(v, tzinfo):
 *     if v % 1000 != 0:
 *         raise ValueError("Nanosecond timestamp {} is not safely convertible "             # <<<<<<<<<<<<<<
 *                          " to microseconds to convert to datetime.datetime."
 *                          " Install pandas to return as Timestamp with "
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__76, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 319, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(5, 319, __pyx_L1_error)

    /* "pyarrow/scalar.pxi":318
 * 
 * def _nanoseconds_to_datetime_safe(v, tzinfo):
 *     if v % 1000 != 0:             # <<<<<<<<<<<<<<
 *         raise ValueError("Nanosecond timestamp {} is not safely convertible "
 *                          " to microseconds to convert to datetime.datetime."
 */
  }

  /* "pyarrow/scalar.pxi":323
 *                          " Install pandas to return as Timestamp with "
 *                          " nanosecond support or access the .value attribute.")
 *     v = v // 1000             # <<<<<<<<<<<<<<
 *     micros = v % 1_000_000
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_FloorDivideObjC(__pyx_v_v, __pyx_int_1000, 0x3E8, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_v, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/scalar.pxi":324
 *                          " nanosecond support or access the .value attribute.")
 *     v = v // 1000
 *     micros = v % 1_000_000             # <<<<<<<<<<<<<<
 * 
 *     dt = _datetime_from_seconds(v // 1_000_000)
 */
  __pyx_t_2 = __Pyx_PyInt_RemainderObjC(__pyx_v_v, __pyx_int_1000000, 0xF4240, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_micros = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/scalar.pxi":326
 *     micros = v % 1_000_000
 * 
 *     dt = _datetime_from_seconds(v // 1_000_000)             # <<<<<<<<<<<<<<
 *     return _add_micros_maybe_localize(dt, micros, tzinfo)
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_FloorDivideObjC(__pyx_v_v, __pyx_int_1000000, 0xF4240, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_4 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(5, 326, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __pyx_f_7pyarrow_3lib__datetime_from_seconds(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_dt = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/scalar.pxi":327
 * 
 *     dt = _datetime_from_seconds(v // 1_000_000)
 *     return _add_micros_maybe_localize(dt, micros, tzinfo)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib__add_micros_maybe_localize(__pyx_v_dt, __pyx_v_micros, __pyx_v_tzinfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":317
 * 
 * 
 * def _nanoseconds_to_datetime_safe(v, tzinfo):             # <<<<<<<<<<<<<<
 *     if v % 1000 != 0:
 *         raise ValueError("Nanosecond timestamp {} is not safely convertible "
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib._nanoseconds_to_datetime_safe", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_micros);
  __Pyx_XDECREF(__pyx_v_dt);
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":330
 * 
 * 
 * def _microseconds_to_datetime(v, tzinfo):             # <<<<<<<<<<<<<<
 *     micros = v % 1_000_000
 *     dt = _datetime_from_seconds(v // 1_000_000)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_117_microseconds_to_datetime(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_116_microseconds_to_datetime[] = "_microseconds_to_datetime(v, tzinfo)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_117_microseconds_to_datetime = {"_microseconds_to_datetime", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_117_microseconds_to_datetime, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_116_microseconds_to_datetime};
static PyObject *__pyx_pw_7pyarrow_3lib_117_microseconds_to_datetime(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_v = 0;
  PyObject *__pyx_v_tzinfo = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_microseconds_to_datetime (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_v,&__pyx_n_s_tzinfo,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tzinfo)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_microseconds_to_datetime", 1, 2, 2, 1); __PYX_ERR(5, 330, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_microseconds_to_datetime") < 0)) __PYX_ERR(5, 330, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_v = values[0];
    __pyx_v_tzinfo = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_microseconds_to_datetime", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(5, 330, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._microseconds_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_116_microseconds_to_datetime(__pyx_self, __pyx_v_v, __pyx_v_tzinfo);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_116_microseconds_to_datetime(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_v, PyObject *__pyx_v_tzinfo) {
  PyObject *__pyx_v_micros = NULL;
  PyObject *__pyx_v_dt = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int64_t __pyx_t_2;
  __Pyx_RefNannySetupContext("_microseconds_to_datetime", 0);

  /* "pyarrow/scalar.pxi":331
 * 
 * def _microseconds_to_datetime(v, tzinfo):
 *     micros = v % 1_000_000             # <<<<<<<<<<<<<<
 *     dt = _datetime_from_seconds(v // 1_000_000)
 *     return _add_micros_maybe_localize(dt, micros, tzinfo)
 */
  __pyx_t_1 = __Pyx_PyInt_RemainderObjC(__pyx_v_v, __pyx_int_1000000, 0xF4240, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_micros = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":332
 * def _microseconds_to_datetime(v, tzinfo):
 *     micros = v % 1_000_000
 *     dt = _datetime_from_seconds(v // 1_000_000)             # <<<<<<<<<<<<<<
 *     return _add_micros_maybe_localize(dt, micros, tzinfo)
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_FloorDivideObjC(__pyx_v_v, __pyx_int_1000000, 0xF4240, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(5, 332, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__datetime_from_seconds(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_dt = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":333
 *     micros = v % 1_000_000
 *     dt = _datetime_from_seconds(v // 1_000_000)
 *     return _add_micros_maybe_localize(dt, micros, tzinfo)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__add_micros_maybe_localize(__pyx_v_dt, __pyx_v_micros, __pyx_v_tzinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":330
 * 
 * 
 * def _microseconds_to_datetime(v, tzinfo):             # <<<<<<<<<<<<<<
 *     micros = v % 1_000_000
 *     dt = _datetime_from_seconds(v // 1_000_000)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._microseconds_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_micros);
  __Pyx_XDECREF(__pyx_v_dt);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":336
 * 
 * 
 * def _millis_to_datetime(v, tzinfo):             # <<<<<<<<<<<<<<
 *     millis = v % 1_000
 *     dt = _datetime_from_seconds(v // 1000)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_119_millis_to_datetime(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_118_millis_to_datetime[] = "_millis_to_datetime(v, tzinfo)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_119_millis_to_datetime = {"_millis_to_datetime", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_119_millis_to_datetime, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_118_millis_to_datetime};
static PyObject *__pyx_pw_7pyarrow_3lib_119_millis_to_datetime(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_v = 0;
  PyObject *__pyx_v_tzinfo = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_millis_to_datetime (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_v,&__pyx_n_s_tzinfo,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tzinfo)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_millis_to_datetime", 1, 2, 2, 1); __PYX_ERR(5, 336, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_millis_to_datetime") < 0)) __PYX_ERR(5, 336, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_v = values[0];
    __pyx_v_tzinfo = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_millis_to_datetime", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(5, 336, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._millis_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_118_millis_to_datetime(__pyx_self, __pyx_v_v, __pyx_v_tzinfo);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_118_millis_to_datetime(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_v, PyObject *__pyx_v_tzinfo) {
  PyObject *__pyx_v_millis = NULL;
  PyObject *__pyx_v_dt = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int64_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("_millis_to_datetime", 0);

  /* "pyarrow/scalar.pxi":337
 * 
 * def _millis_to_datetime(v, tzinfo):
 *     millis = v % 1_000             # <<<<<<<<<<<<<<
 *     dt = _datetime_from_seconds(v // 1000)
 *     return _add_micros_maybe_localize(dt, millis * 1000, tzinfo)
 */
  __pyx_t_1 = __Pyx_PyInt_RemainderObjC(__pyx_v_v, __pyx_int_1000, 0x3E8, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_millis = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":338
 * def _millis_to_datetime(v, tzinfo):
 *     millis = v % 1_000
 *     dt = _datetime_from_seconds(v // 1000)             # <<<<<<<<<<<<<<
 *     return _add_micros_maybe_localize(dt, millis * 1000, tzinfo)
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_FloorDivideObjC(__pyx_v_v, __pyx_int_1000, 0x3E8, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(5, 338, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__datetime_from_seconds(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_dt = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":339
 *     millis = v % 1_000
 *     dt = _datetime_from_seconds(v // 1000)
 *     return _add_micros_maybe_localize(dt, millis * 1000, tzinfo)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyNumber_Multiply(__pyx_v_millis, __pyx_int_1000); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib__add_micros_maybe_localize(__pyx_v_dt, __pyx_t_1, __pyx_v_tzinfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":336
 * 
 * 
 * def _millis_to_datetime(v, tzinfo):             # <<<<<<<<<<<<<<
 *     millis = v % 1_000
 *     dt = _datetime_from_seconds(v // 1000)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib._millis_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_millis);
  __Pyx_XDECREF(__pyx_v_dt);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":342
 * 
 * 
 * def _seconds_to_datetime(v, tzinfo):             # <<<<<<<<<<<<<<
 *     dt = _datetime_from_seconds(v)
 *     return _add_micros_maybe_localize(dt, 0, tzinfo)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_121_seconds_to_datetime(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_120_seconds_to_datetime[] = "_seconds_to_datetime(v, tzinfo)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_121_seconds_to_datetime = {"_seconds_to_datetime", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_121_seconds_to_datetime, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_120_seconds_to_datetime};
static PyObject *__pyx_pw_7pyarrow_3lib_121_seconds_to_datetime(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_v = 0;
  PyObject *__pyx_v_tzinfo = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_seconds_to_datetime (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_v,&__pyx_n_s_tzinfo,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tzinfo)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_seconds_to_datetime", 1, 2, 2, 1); __PYX_ERR(5, 342, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_seconds_to_datetime") < 0)) __PYX_ERR(5, 342, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_v = values[0];
    __pyx_v_tzinfo = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_seconds_to_datetime", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(5, 342, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._seconds_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_120_seconds_to_datetime(__pyx_self, __pyx_v_v, __pyx_v_tzinfo);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_120_seconds_to_datetime(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_v, PyObject *__pyx_v_tzinfo) {
  PyObject *__pyx_v_dt = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int64_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("_seconds_to_datetime", 0);

  /* "pyarrow/scalar.pxi":343
 * 
 * def _seconds_to_datetime(v, tzinfo):
 *     dt = _datetime_from_seconds(v)             # <<<<<<<<<<<<<<
 *     return _add_micros_maybe_localize(dt, 0, tzinfo)
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_As_int64_t(__pyx_v_v); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(5, 343, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7pyarrow_3lib__datetime_from_seconds(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_dt = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/scalar.pxi":344
 * def _seconds_to_datetime(v, tzinfo):
 *     dt = _datetime_from_seconds(v)
 *     return _add_micros_maybe_localize(dt, 0, tzinfo)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib__add_micros_maybe_localize(__pyx_v_dt, __pyx_int_0, __pyx_v_tzinfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":342
 * 
 * 
 * def _seconds_to_datetime(v, tzinfo):             # <<<<<<<<<<<<<<
 *     dt = _datetime_from_seconds(v)
 *     return _add_micros_maybe_localize(dt, 0, tzinfo)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib._seconds_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dt);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":347
 * 
 * 
 * def _datetime_conversion_functions():             # <<<<<<<<<<<<<<
 *     global _datetime_conversion_initialized
 *     if _datetime_conversion_initialized:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_123_datetime_conversion_functions(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_122_datetime_conversion_functions[] = "_datetime_conversion_functions()";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_123_datetime_conversion_functions = {"_datetime_conversion_functions", (PyCFunction)__pyx_pw_7pyarrow_3lib_123_datetime_conversion_functions, METH_NOARGS, __pyx_doc_7pyarrow_3lib_122_datetime_conversion_functions};
static PyObject *__pyx_pw_7pyarrow_3lib_123_datetime_conversion_functions(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_datetime_conversion_functions (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_122_datetime_conversion_functions(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":362
 *         import pandas as pd
 *         _DATETIME_CONVERSION_FUNCTIONS[TimeUnit_NANO] = (
 *             lambda x, tzinfo: pd.Timestamp(             # <<<<<<<<<<<<<<
 *                 x, tz=tzinfo, unit='ns',
 *             )
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_30_datetime_conversion_functions_lambda(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7pyarrow_3lib_30_datetime_conversion_functions_lambda = {"lambda", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_30_datetime_conversion_functions_lambda, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7pyarrow_3lib_30_datetime_conversion_functions_lambda(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_x = 0;
  PyObject *__pyx_v_tzinfo = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_tzinfo,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tzinfo)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("lambda", 1, 2, 2, 1); __PYX_ERR(5, 362, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda") < 0)) __PYX_ERR(5, 362, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_x = values[0];
    __pyx_v_tzinfo = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("lambda", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(5, 362, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._datetime_conversion_functions.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_lambda_funcdef_lambda(__pyx_self, __pyx_v_x, __pyx_v_tzinfo);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_tzinfo) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions *__pyx_cur_scope;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("lambda", 0);
  __pyx_outer_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_pd)) { __Pyx_RaiseClosureNameError("pd"); __PYX_ERR(5, 362, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_pd, __pyx_n_s_Timestamp); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyarrow/scalar.pxi":363
 *         _DATETIME_CONVERSION_FUNCTIONS[TimeUnit_NANO] = (
 *             lambda x, tzinfo: pd.Timestamp(
 *                 x, tz=tzinfo, unit='ns',             # <<<<<<<<<<<<<<
 *             )
 *         )
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_x);
  __Pyx_GIVEREF(__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_x);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_tz, __pyx_v_tzinfo) < 0) __PYX_ERR(5, 363, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_unit, __pyx_n_u_ns) < 0) __PYX_ERR(5, 363, __pyx_L1_error)

  /* "pyarrow/scalar.pxi":362
 *         import pandas as pd
 *         _DATETIME_CONVERSION_FUNCTIONS[TimeUnit_NANO] = (
 *             lambda x, tzinfo: pd.Timestamp(             # <<<<<<<<<<<<<<
 *                 x, tz=tzinfo, unit='ns',
 *             )
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib._datetime_conversion_functions.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":347
 * 
 * 
 * def _datetime_conversion_functions():             # <<<<<<<<<<<<<<
 *     global _datetime_conversion_initialized
 *     if _datetime_conversion_initialized:
 */

static PyObject *__pyx_pf_7pyarrow_3lib_122_datetime_conversion_functions(CYTHON_UNUSED PyObject *__pyx_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("_datetime_conversion_functions", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(5, 347, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }

  /* "pyarrow/scalar.pxi":349
 * def _datetime_conversion_functions():
 *     global _datetime_conversion_initialized
 *     if _datetime_conversion_initialized:             # <<<<<<<<<<<<<<
 *         return _DATETIME_CONVERSION_FUNCTIONS
 * 
 */
  __pyx_t_1 = (__pyx_v_7pyarrow_3lib__datetime_conversion_initialized != 0);
  if (__pyx_t_1) {

    /* "pyarrow/scalar.pxi":350
 *     global _datetime_conversion_initialized
 *     if _datetime_conversion_initialized:
 *         return _DATETIME_CONVERSION_FUNCTIONS             # <<<<<<<<<<<<<<
 * 
 *     _DATETIME_CONVERSION_FUNCTIONS.update({
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_7pyarrow_3lib__DATETIME_CONVERSION_FUNCTIONS);
    __pyx_r = __pyx_v_7pyarrow_3lib__DATETIME_CONVERSION_FUNCTIONS;
    goto __pyx_L0;

    /* "pyarrow/scalar.pxi":349
 * def _datetime_conversion_functions():
 *     global _datetime_conversion_initialized
 *     if _datetime_conversion_initialized:             # <<<<<<<<<<<<<<
 *         return _DATETIME_CONVERSION_FUNCTIONS
 * 
 */
  }

  /* "pyarrow/scalar.pxi":353
 * 
 *     _DATETIME_CONVERSION_FUNCTIONS.update({
 *         TimeUnit_SECOND: _seconds_to_datetime,             # <<<<<<<<<<<<<<
 *         TimeUnit_MILLI: _millis_to_datetime,
 *         TimeUnit_MICRO: _microseconds_to_datetime,
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type( arrow::TimeUnit::SECOND); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_seconds_to_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_t_4) < 0) __PYX_ERR(5, 353, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/scalar.pxi":354
 *     _DATETIME_CONVERSION_FUNCTIONS.update({
 *         TimeUnit_SECOND: _seconds_to_datetime,
 *         TimeUnit_MILLI: _millis_to_datetime,             # <<<<<<<<<<<<<<
 *         TimeUnit_MICRO: _microseconds_to_datetime,
 *         TimeUnit_NANO: _nanoseconds_to_datetime_safe
 */
  __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type( arrow::TimeUnit::MILLI); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_millis_to_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_4, __pyx_t_3) < 0) __PYX_ERR(5, 353, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/scalar.pxi":355
 *         TimeUnit_SECOND: _seconds_to_datetime,
 *         TimeUnit_MILLI: _millis_to_datetime,
 *         TimeUnit_MICRO: _microseconds_to_datetime,             # <<<<<<<<<<<<<<
 *         TimeUnit_NANO: _nanoseconds_to_datetime_safe
 *     })
 */
  __pyx_t_3 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type( arrow::TimeUnit::MICRO); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_microseconds_to_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_t_4) < 0) __PYX_ERR(5, 353, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/scalar.pxi":356
 *         TimeUnit_MILLI: _millis_to_datetime,
 *         TimeUnit_MICRO: _microseconds_to_datetime,
 *         TimeUnit_NANO: _nanoseconds_to_datetime_safe             # <<<<<<<<<<<<<<
 *     })
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type( arrow::TimeUnit::NANO); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_nanoseconds_to_datetime_safe); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_4, __pyx_t_3) < 0) __PYX_ERR(5, 353, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/scalar.pxi":352
 *         return _DATETIME_CONVERSION_FUNCTIONS
 * 
 *     _DATETIME_CONVERSION_FUNCTIONS.update({             # <<<<<<<<<<<<<<
 *         TimeUnit_SECOND: _seconds_to_datetime,
 *         TimeUnit_MILLI: _millis_to_datetime,
 */
  __pyx_t_3 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_update, __pyx_v_7pyarrow_3lib__DATETIME_CONVERSION_FUNCTIONS, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/scalar.pxi":359
 *     })
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         import pandas as pd
 *         _DATETIME_CONVERSION_FUNCTIONS[TimeUnit_NANO] = (
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    /*try:*/ {

      /* "pyarrow/scalar.pxi":360
 * 
 *     try:
 *         import pandas as pd             # <<<<<<<<<<<<<<
 *         _DATETIME_CONVERSION_FUNCTIONS[TimeUnit_NANO] = (
 *             lambda x, tzinfo: pd.Timestamp(
 */
      __pyx_t_3 = __Pyx_Import(__pyx_n_s_pandas, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 360, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_cur_scope->__pyx_v_pd = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "pyarrow/scalar.pxi":362
 *         import pandas as pd
 *         _DATETIME_CONVERSION_FUNCTIONS[TimeUnit_NANO] = (
 *             lambda x, tzinfo: pd.Timestamp(             # <<<<<<<<<<<<<<
 *                 x, tz=tzinfo, unit='ns',
 *             )
 */
      __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_30_datetime_conversion_functions_lambda, 0, __pyx_n_s_datetime_conversion_functions_l, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pyarrow_lib, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 362, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_3);

      /* "pyarrow/scalar.pxi":361
 *     try:
 *         import pandas as pd
 *         _DATETIME_CONVERSION_FUNCTIONS[TimeUnit_NANO] = (             # <<<<<<<<<<<<<<
 *             lambda x, tzinfo: pd.Timestamp(
 *                 x, tz=tzinfo, unit='ns',
 */
      if (unlikely(__pyx_v_7pyarrow_3lib__DATETIME_CONVERSION_FUNCTIONS == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(5, 361, __pyx_L4_error)
      }
      __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type( arrow::TimeUnit::NANO); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 361, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (unlikely(PyDict_SetItem(__pyx_v_7pyarrow_3lib__DATETIME_CONVERSION_FUNCTIONS, __pyx_t_2, __pyx_t_3) < 0)) __PYX_ERR(5, 361, __pyx_L4_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "pyarrow/scalar.pxi":359
 *     })
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         import pandas as pd
 *         _DATETIME_CONVERSION_FUNCTIONS[TimeUnit_NANO] = (
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L9_try_end;
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/scalar.pxi":366
 *             )
 *         )
 *     except ImportError:             # <<<<<<<<<<<<<<
 *         pass
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
    if (__pyx_t_8) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L5_exception_handled;
    }
    goto __pyx_L6_except_error;
    __pyx_L6_except_error:;

    /* "pyarrow/scalar.pxi":359
 *     })
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         import pandas as pd
 *         _DATETIME_CONVERSION_FUNCTIONS[TimeUnit_NANO] = (
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    goto __pyx_L1_error;
    __pyx_L5_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    __pyx_L9_try_end:;
  }

  /* "pyarrow/scalar.pxi":369
 *         pass
 * 
 *     _datetime_conversion_initialized = True             # <<<<<<<<<<<<<<
 *     return _DATETIME_CONVERSION_FUNCTIONS
 * 
 */
  __pyx_v_7pyarrow_3lib__datetime_conversion_initialized = 1;

  /* "pyarrow/scalar.pxi":370
 * 
 *     _datetime_conversion_initialized = True
 *     return _DATETIME_CONVERSION_FUNCTIONS             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_7pyarrow_3lib__DATETIME_CONVERSION_FUNCTIONS);
  __pyx_r = __pyx_v_7pyarrow_3lib__DATETIME_CONVERSION_FUNCTIONS;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":347
 * 
 * 
 * def _datetime_conversion_functions():             # <<<<<<<<<<<<<<
 *     global _datetime_conversion_initialized
 *     if _datetime_conversion_initialized:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib._datetime_conversion_functions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":379
 * 
 *     @property
 *     def value(self):             # <<<<<<<<<<<<<<
 *         cdef CTimestampArray* ap = <CTimestampArray*> self.sp_array.get()
 *         cdef CTimestampType* dtype = <CTimestampType*> ap.type().get()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14TimestampValue_5value_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14TimestampValue_5value_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14TimestampValue_5value___get__(((struct __pyx_obj_7pyarrow_3lib_TimestampValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14TimestampValue_5value___get__(struct __pyx_obj_7pyarrow_3lib_TimestampValue *__pyx_v_self) {
   arrow::TimestampArray *__pyx_v_ap;
  CYTHON_UNUSED  arrow::TimestampType *__pyx_v_dtype;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/scalar.pxi":380
 *     @property
 *     def value(self):
 *         cdef CTimestampArray* ap = <CTimestampArray*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         cdef CTimestampType* dtype = <CTimestampType*> ap.type().get()
 *         return ap.Value(self.index)
 */
  __pyx_v_ap = (( arrow::TimestampArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":381
 *     def value(self):
 *         cdef CTimestampArray* ap = <CTimestampArray*> self.sp_array.get()
 *         cdef CTimestampType* dtype = <CTimestampType*> ap.type().get()             # <<<<<<<<<<<<<<
 *         return ap.Value(self.index)
 * 
 */
  __pyx_v_dtype = (( arrow::TimestampType *)__pyx_v_ap->type().get());

  /* "pyarrow/scalar.pxi":382
 *         cdef CTimestampArray* ap = <CTimestampArray*> self.sp_array.get()
 *         cdef CTimestampType* dtype = <CTimestampType*> ap.type().get()
 *         return ap.Value(self.index)             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":379
 * 
 *     @property
 *     def value(self):             # <<<<<<<<<<<<<<
 *         cdef CTimestampArray* ap = <CTimestampArray*> self.sp_array.get()
 *         cdef CTimestampType* dtype = <CTimestampType*> ap.type().get()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.TimestampValue.value.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":384
 *         return ap.Value(self.index)
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Pandas Timestamp instance (if available),
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14TimestampValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14TimestampValue_as_py[] = "TimestampValue.as_py(self)\n\n        Return this value as a Pandas Timestamp instance (if available),\n        otherwise as a Python datetime.timedelta instance.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_14TimestampValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14TimestampValue_as_py(((struct __pyx_obj_7pyarrow_3lib_TimestampValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14TimestampValue_as_py(struct __pyx_obj_7pyarrow_3lib_TimestampValue *__pyx_v_self) {
   arrow::TimestampArray *__pyx_v_ap;
   arrow::TimestampType *__pyx_v_dtype;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_v_tzinfo = NULL;
  PyObject *__pyx_v_converter = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":389
 *         otherwise as a Python datetime.timedelta instance.
 *         """
 *         cdef CTimestampArray* ap = <CTimestampArray*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         cdef CTimestampType* dtype = <CTimestampType*> ap.type().get()
 * 
 */
  __pyx_v_ap = (( arrow::TimestampArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":390
 *         """
 *         cdef CTimestampArray* ap = <CTimestampArray*> self.sp_array.get()
 *         cdef CTimestampType* dtype = <CTimestampType*> ap.type().get()             # <<<<<<<<<<<<<<
 * 
 *         value = self.value
 */
  __pyx_v_dtype = (( arrow::TimestampType *)__pyx_v_ap->type().get());

  /* "pyarrow/scalar.pxi":392
 *         cdef CTimestampType* dtype = <CTimestampType*> ap.type().get()
 * 
 *         value = self.value             # <<<<<<<<<<<<<<
 * 
 *         if not dtype.timezone().empty():
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_value = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":394
 *         value = self.value
 * 
 *         if not dtype.timezone().empty():             # <<<<<<<<<<<<<<
 *             tzinfo = string_to_tzinfo(frombytes(dtype.timezone()))
 *         else:
 */
  __pyx_t_2 = ((!(__pyx_v_dtype->timezone().empty() != 0)) != 0);
  if (__pyx_t_2) {

    /* "pyarrow/scalar.pxi":395
 * 
 *         if not dtype.timezone().empty():
 *             tzinfo = string_to_tzinfo(frombytes(dtype.timezone()))             # <<<<<<<<<<<<<<
 *         else:
 *             tzinfo = None
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_string_to_tzinfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 395, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 395, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_dtype->timezone()); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 395, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 395, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 395, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_tzinfo = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "pyarrow/scalar.pxi":394
 *         value = self.value
 * 
 *         if not dtype.timezone().empty():             # <<<<<<<<<<<<<<
 *             tzinfo = string_to_tzinfo(frombytes(dtype.timezone()))
 *         else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/scalar.pxi":397
 *             tzinfo = string_to_tzinfo(frombytes(dtype.timezone()))
 *         else:
 *             tzinfo = None             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
  /*else*/ {
    __Pyx_INCREF(Py_None);
    __pyx_v_tzinfo = Py_None;
  }
  __pyx_L3:;

  /* "pyarrow/scalar.pxi":399
 *             tzinfo = None
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             converter = _datetime_conversion_functions()[dtype.unit()]
 *         except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
    __Pyx_XGOTREF(__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_10);
    /*try:*/ {

      /* "pyarrow/scalar.pxi":400
 * 
 *         try:
 *             converter = _datetime_conversion_functions()[dtype.unit()]             # <<<<<<<<<<<<<<
 *         except KeyError:
 *             raise ValueError(
 */
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_datetime_conversion_functions); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 400, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 400, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type(__pyx_v_dtype->unit()); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 400, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 400, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_converter = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "pyarrow/scalar.pxi":399
 *             tzinfo = None
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             converter = _datetime_conversion_functions()[dtype.unit()]
 *         except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    goto __pyx_L9_try_end;
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "pyarrow/scalar.pxi":401
 *         try:
 *             converter = _datetime_conversion_functions()[dtype.unit()]
 *         except KeyError:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 'Cannot convert nanosecond timestamps without pandas'
 */
    __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_11) {
      __Pyx_AddTraceback("pyarrow.lib.TimestampValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_1) < 0) __PYX_ERR(5, 401, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_t_1);

      /* "pyarrow/scalar.pxi":402
 *             converter = _datetime_conversion_functions()[dtype.unit()]
 *         except KeyError:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 'Cannot convert nanosecond timestamps without pandas'
 *             )
 */
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__77, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 402, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __PYX_ERR(5, 402, __pyx_L6_except_error)
    }
    goto __pyx_L6_except_error;
    __pyx_L6_except_error:;

    /* "pyarrow/scalar.pxi":399
 *             tzinfo = None
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             converter = _datetime_conversion_functions()[dtype.unit()]
 *         except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
    goto __pyx_L1_error;
    __pyx_L9_try_end:;
  }

  /* "pyarrow/scalar.pxi":405
 *                 'Cannot convert nanosecond timestamps without pandas'
 *             )
 *         return converter(value, tzinfo=tzinfo)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_value);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_tzinfo, __pyx_v_tzinfo) < 0) __PYX_ERR(5, 405, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_converter, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":384
 *         return ap.Value(self.index)
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Pandas Timestamp instance (if available),
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.TimestampValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_tzinfo);
  __Pyx_XDECREF(__pyx_v_converter);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14TimestampValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14TimestampValue_2__reduce_cython__[] = "TimestampValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_14TimestampValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14TimestampValue_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_TimestampValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14TimestampValue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_TimestampValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__78, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.TimestampValue.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14TimestampValue_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14TimestampValue_4__setstate_cython__[] = "TimestampValue.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_14TimestampValue_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14TimestampValue_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_TimestampValue *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14TimestampValue_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_TimestampValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__79, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.TimestampValue.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":411
 * 
 * 
 * def _nanoseconds_to_timedelta_safe(v):             # <<<<<<<<<<<<<<
 *     if v % 1000 != 0:
 *         raise ValueError(
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_125_nanoseconds_to_timedelta_safe(PyObject *__pyx_self, PyObject *__pyx_v_v); /*proto*/
static char __pyx_doc_7pyarrow_3lib_124_nanoseconds_to_timedelta_safe[] = "_nanoseconds_to_timedelta_safe(v)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_125_nanoseconds_to_timedelta_safe = {"_nanoseconds_to_timedelta_safe", (PyCFunction)__pyx_pw_7pyarrow_3lib_125_nanoseconds_to_timedelta_safe, METH_O, __pyx_doc_7pyarrow_3lib_124_nanoseconds_to_timedelta_safe};
static PyObject *__pyx_pw_7pyarrow_3lib_125_nanoseconds_to_timedelta_safe(PyObject *__pyx_self, PyObject *__pyx_v_v) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_nanoseconds_to_timedelta_safe (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_124_nanoseconds_to_timedelta_safe(__pyx_self, ((PyObject *)__pyx_v_v));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_124_nanoseconds_to_timedelta_safe(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_v) {
  PyObject *__pyx_v_micros = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("_nanoseconds_to_timedelta_safe", 0);

  /* "pyarrow/scalar.pxi":412
 * 
 * def _nanoseconds_to_timedelta_safe(v):
 *     if v % 1000 != 0:             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             "Nanosecond duration {} is not safely convertible to microseconds "
 */
  __pyx_t_1 = __Pyx_PyInt_RemainderObjC(__pyx_v_v, __pyx_int_1000, 0x3E8, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(5, 412, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(__pyx_t_3)) {

    /* "pyarrow/scalar.pxi":417
 *             "to convert to datetime.timedelta. Install pandas to return as "
 *             "Timedelta with nanosecond support or access the .value "
 *             "attribute.".format(v))             # <<<<<<<<<<<<<<
 *     micros = v // 1000
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Nanosecond_duration_is_not_safel, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 417, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_v_v) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_v);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 417, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/scalar.pxi":413
 * def _nanoseconds_to_timedelta_safe(v):
 *     if v % 1000 != 0:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "Nanosecond duration {} is not safely convertible to microseconds "
 *             "to convert to datetime.timedelta. Install pandas to return as "
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 413, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(5, 413, __pyx_L1_error)

    /* "pyarrow/scalar.pxi":412
 * 
 * def _nanoseconds_to_timedelta_safe(v):
 *     if v % 1000 != 0:             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             "Nanosecond duration {} is not safely convertible to microseconds "
 */
  }

  /* "pyarrow/scalar.pxi":418
 *             "Timedelta with nanosecond support or access the .value "
 *             "attribute.".format(v))
 *     micros = v // 1000             # <<<<<<<<<<<<<<
 * 
 *     return datetime.timedelta(microseconds=micros)
 */
  __pyx_t_1 = __Pyx_PyInt_FloorDivideObjC(__pyx_v_v, __pyx_int_1000, 0x3E8, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_micros = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":420
 *     micros = v // 1000
 * 
 *     return datetime.timedelta(microseconds=micros)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_microseconds, __pyx_v_micros) < 0) __PYX_ERR(5, 420, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":411
 * 
 * 
 * def _nanoseconds_to_timedelta_safe(v):             # <<<<<<<<<<<<<<
 *     if v % 1000 != 0:
 *         raise ValueError(
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib._nanoseconds_to_timedelta_safe", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_micros);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":423
 * 
 * 
 * def _timedelta_conversion_functions():             # <<<<<<<<<<<<<<
 *     if _TIMEDELTA_CONVERSION_FUNCTIONS:
 *         return _TIMEDELTA_CONVERSION_FUNCTIONS
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_127_timedelta_conversion_functions(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_126_timedelta_conversion_functions[] = "_timedelta_conversion_functions()";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_127_timedelta_conversion_functions = {"_timedelta_conversion_functions", (PyCFunction)__pyx_pw_7pyarrow_3lib_127_timedelta_conversion_functions, METH_NOARGS, __pyx_doc_7pyarrow_3lib_126_timedelta_conversion_functions};
static PyObject *__pyx_pw_7pyarrow_3lib_127_timedelta_conversion_functions(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_timedelta_conversion_functions (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_126_timedelta_conversion_functions(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":428
 * 
 *     _TIMEDELTA_CONVERSION_FUNCTIONS.update({
 *         TimeUnit_SECOND: lambda v: datetime.timedelta(seconds=v),             # <<<<<<<<<<<<<<
 *         TimeUnit_MILLI: lambda v: datetime.timedelta(milliseconds=v),
 *         TimeUnit_MICRO: lambda v: datetime.timedelta(microseconds=v),
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_31_timedelta_conversion_functions_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_v); /*proto*/
static PyMethodDef __pyx_mdef_7pyarrow_3lib_31_timedelta_conversion_functions_lambda1 = {"lambda1", (PyCFunction)__pyx_pw_7pyarrow_3lib_31_timedelta_conversion_functions_lambda1, METH_O, 0};
static PyObject *__pyx_pw_7pyarrow_3lib_31_timedelta_conversion_functions_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_v) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda1 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda1(__pyx_self, ((PyObject *)__pyx_v_v));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_lambda_funcdef_lambda1(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_v) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("lambda1", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_seconds, __pyx_v_v) < 0) __PYX_ERR(5, 428, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib._timedelta_conversion_functions.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":429
 *     _TIMEDELTA_CONVERSION_FUNCTIONS.update({
 *         TimeUnit_SECOND: lambda v: datetime.timedelta(seconds=v),
 *         TimeUnit_MILLI: lambda v: datetime.timedelta(milliseconds=v),             # <<<<<<<<<<<<<<
 *         TimeUnit_MICRO: lambda v: datetime.timedelta(microseconds=v),
 *         TimeUnit_NANO: _nanoseconds_to_timedelta_safe
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_31_timedelta_conversion_functions_1lambda2(PyObject *__pyx_self, PyObject *__pyx_v_v); /*proto*/
static PyMethodDef __pyx_mdef_7pyarrow_3lib_31_timedelta_conversion_functions_1lambda2 = {"lambda2", (PyCFunction)__pyx_pw_7pyarrow_3lib_31_timedelta_conversion_functions_1lambda2, METH_O, 0};
static PyObject *__pyx_pw_7pyarrow_3lib_31_timedelta_conversion_functions_1lambda2(PyObject *__pyx_self, PyObject *__pyx_v_v) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda2 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda2(__pyx_self, ((PyObject *)__pyx_v_v));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_lambda_funcdef_lambda2(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_v) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("lambda2", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_milliseconds, __pyx_v_v) < 0) __PYX_ERR(5, 429, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib._timedelta_conversion_functions.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":430
 *         TimeUnit_SECOND: lambda v: datetime.timedelta(seconds=v),
 *         TimeUnit_MILLI: lambda v: datetime.timedelta(milliseconds=v),
 *         TimeUnit_MICRO: lambda v: datetime.timedelta(microseconds=v),             # <<<<<<<<<<<<<<
 *         TimeUnit_NANO: _nanoseconds_to_timedelta_safe
 *     })
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_31_timedelta_conversion_functions_2lambda3(PyObject *__pyx_self, PyObject *__pyx_v_v); /*proto*/
static PyMethodDef __pyx_mdef_7pyarrow_3lib_31_timedelta_conversion_functions_2lambda3 = {"lambda3", (PyCFunction)__pyx_pw_7pyarrow_3lib_31_timedelta_conversion_functions_2lambda3, METH_O, 0};
static PyObject *__pyx_pw_7pyarrow_3lib_31_timedelta_conversion_functions_2lambda3(PyObject *__pyx_self, PyObject *__pyx_v_v) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda3 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda3(__pyx_self, ((PyObject *)__pyx_v_v));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_lambda_funcdef_lambda3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_v) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("lambda3", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_microseconds, __pyx_v_v) < 0) __PYX_ERR(5, 430, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib._timedelta_conversion_functions.lambda3", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":437
 *         import pandas as pd
 *         _TIMEDELTA_CONVERSION_FUNCTIONS[TimeUnit_NANO] = (
 *             lambda v: pd.Timedelta(v, unit='ns')             # <<<<<<<<<<<<<<
 *         )
 *     except ImportError:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_31_timedelta_conversion_functions_3lambda4(PyObject *__pyx_self, PyObject *__pyx_v_v); /*proto*/
static PyMethodDef __pyx_mdef_7pyarrow_3lib_31_timedelta_conversion_functions_3lambda4 = {"lambda4", (PyCFunction)__pyx_pw_7pyarrow_3lib_31_timedelta_conversion_functions_3lambda4, METH_O, 0};
static PyObject *__pyx_pw_7pyarrow_3lib_31_timedelta_conversion_functions_3lambda4(PyObject *__pyx_self, PyObject *__pyx_v_v) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda4 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda4(__pyx_self, ((PyObject *)__pyx_v_v));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_lambda_funcdef_lambda4(PyObject *__pyx_self, PyObject *__pyx_v_v) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions *__pyx_cur_scope;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("lambda4", 0);
  __pyx_outer_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_pd)) { __Pyx_RaiseClosureNameError("pd"); __PYX_ERR(5, 437, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_pd, __pyx_n_s_Timedelta); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 437, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 437, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_v);
  __Pyx_GIVEREF(__pyx_v_v);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_v);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 437, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_unit, __pyx_n_u_ns) < 0) __PYX_ERR(5, 437, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 437, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib._timedelta_conversion_functions.lambda4", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":423
 * 
 * 
 * def _timedelta_conversion_functions():             # <<<<<<<<<<<<<<
 *     if _TIMEDELTA_CONVERSION_FUNCTIONS:
 *         return _TIMEDELTA_CONVERSION_FUNCTIONS
 */

static PyObject *__pyx_pf_7pyarrow_3lib_126_timedelta_conversion_functions(CYTHON_UNUSED PyObject *__pyx_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("_timedelta_conversion_functions", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(5, 423, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }

  /* "pyarrow/scalar.pxi":424
 * 
 * def _timedelta_conversion_functions():
 *     if _TIMEDELTA_CONVERSION_FUNCTIONS:             # <<<<<<<<<<<<<<
 *         return _TIMEDELTA_CONVERSION_FUNCTIONS
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_7pyarrow_3lib__TIMEDELTA_CONVERSION_FUNCTIONS); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 424, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/scalar.pxi":425
 * def _timedelta_conversion_functions():
 *     if _TIMEDELTA_CONVERSION_FUNCTIONS:
 *         return _TIMEDELTA_CONVERSION_FUNCTIONS             # <<<<<<<<<<<<<<
 * 
 *     _TIMEDELTA_CONVERSION_FUNCTIONS.update({
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_7pyarrow_3lib__TIMEDELTA_CONVERSION_FUNCTIONS);
    __pyx_r = __pyx_v_7pyarrow_3lib__TIMEDELTA_CONVERSION_FUNCTIONS;
    goto __pyx_L0;

    /* "pyarrow/scalar.pxi":424
 * 
 * def _timedelta_conversion_functions():
 *     if _TIMEDELTA_CONVERSION_FUNCTIONS:             # <<<<<<<<<<<<<<
 *         return _TIMEDELTA_CONVERSION_FUNCTIONS
 * 
 */
  }

  /* "pyarrow/scalar.pxi":428
 * 
 *     _TIMEDELTA_CONVERSION_FUNCTIONS.update({
 *         TimeUnit_SECOND: lambda v: datetime.timedelta(seconds=v),             # <<<<<<<<<<<<<<
 *         TimeUnit_MILLI: lambda v: datetime.timedelta(milliseconds=v),
 *         TimeUnit_MICRO: lambda v: datetime.timedelta(microseconds=v),
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type( arrow::TimeUnit::SECOND); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_31_timedelta_conversion_functions_lambda1, 0, __pyx_n_s_timedelta_conversion_functions, NULL, __pyx_n_s_pyarrow_lib, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_t_4) < 0) __PYX_ERR(5, 428, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/scalar.pxi":429
 *     _TIMEDELTA_CONVERSION_FUNCTIONS.update({
 *         TimeUnit_SECOND: lambda v: datetime.timedelta(seconds=v),
 *         TimeUnit_MILLI: lambda v: datetime.timedelta(milliseconds=v),             # <<<<<<<<<<<<<<
 *         TimeUnit_MICRO: lambda v: datetime.timedelta(microseconds=v),
 *         TimeUnit_NANO: _nanoseconds_to_timedelta_safe
 */
  __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type( arrow::TimeUnit::MILLI); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_31_timedelta_conversion_functions_1lambda2, 0, __pyx_n_s_timedelta_conversion_functions, NULL, __pyx_n_s_pyarrow_lib, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_4, __pyx_t_3) < 0) __PYX_ERR(5, 428, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/scalar.pxi":430
 *         TimeUnit_SECOND: lambda v: datetime.timedelta(seconds=v),
 *         TimeUnit_MILLI: lambda v: datetime.timedelta(milliseconds=v),
 *         TimeUnit_MICRO: lambda v: datetime.timedelta(microseconds=v),             # <<<<<<<<<<<<<<
 *         TimeUnit_NANO: _nanoseconds_to_timedelta_safe
 *     })
 */
  __pyx_t_3 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type( arrow::TimeUnit::MICRO); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_31_timedelta_conversion_functions_2lambda3, 0, __pyx_n_s_timedelta_conversion_functions, NULL, __pyx_n_s_pyarrow_lib, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_t_4) < 0) __PYX_ERR(5, 428, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/scalar.pxi":431
 *         TimeUnit_MILLI: lambda v: datetime.timedelta(milliseconds=v),
 *         TimeUnit_MICRO: lambda v: datetime.timedelta(microseconds=v),
 *         TimeUnit_NANO: _nanoseconds_to_timedelta_safe             # <<<<<<<<<<<<<<
 *     })
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type( arrow::TimeUnit::NANO); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_nanoseconds_to_timedelta_safe); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_4, __pyx_t_3) < 0) __PYX_ERR(5, 428, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/scalar.pxi":427
 *         return _TIMEDELTA_CONVERSION_FUNCTIONS
 * 
 *     _TIMEDELTA_CONVERSION_FUNCTIONS.update({             # <<<<<<<<<<<<<<
 *         TimeUnit_SECOND: lambda v: datetime.timedelta(seconds=v),
 *         TimeUnit_MILLI: lambda v: datetime.timedelta(milliseconds=v),
 */
  __pyx_t_3 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_update, __pyx_v_7pyarrow_3lib__TIMEDELTA_CONVERSION_FUNCTIONS, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 427, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/scalar.pxi":434
 *     })
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         import pandas as pd
 *         _TIMEDELTA_CONVERSION_FUNCTIONS[TimeUnit_NANO] = (
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    /*try:*/ {

      /* "pyarrow/scalar.pxi":435
 * 
 *     try:
 *         import pandas as pd             # <<<<<<<<<<<<<<
 *         _TIMEDELTA_CONVERSION_FUNCTIONS[TimeUnit_NANO] = (
 *             lambda v: pd.Timedelta(v, unit='ns')
 */
      __pyx_t_3 = __Pyx_Import(__pyx_n_s_pandas, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 435, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_cur_scope->__pyx_v_pd = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "pyarrow/scalar.pxi":437
 *         import pandas as pd
 *         _TIMEDELTA_CONVERSION_FUNCTIONS[TimeUnit_NANO] = (
 *             lambda v: pd.Timedelta(v, unit='ns')             # <<<<<<<<<<<<<<
 *         )
 *     except ImportError:
 */
      __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_31_timedelta_conversion_functions_3lambda4, 0, __pyx_n_s_timedelta_conversion_functions, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pyarrow_lib, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 437, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_3);

      /* "pyarrow/scalar.pxi":436
 *     try:
 *         import pandas as pd
 *         _TIMEDELTA_CONVERSION_FUNCTIONS[TimeUnit_NANO] = (             # <<<<<<<<<<<<<<
 *             lambda v: pd.Timedelta(v, unit='ns')
 *         )
 */
      if (unlikely(__pyx_v_7pyarrow_3lib__TIMEDELTA_CONVERSION_FUNCTIONS == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(5, 436, __pyx_L4_error)
      }
      __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type( arrow::TimeUnit::NANO); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 436, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (unlikely(PyDict_SetItem(__pyx_v_7pyarrow_3lib__TIMEDELTA_CONVERSION_FUNCTIONS, __pyx_t_2, __pyx_t_3) < 0)) __PYX_ERR(5, 436, __pyx_L4_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "pyarrow/scalar.pxi":434
 *     })
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         import pandas as pd
 *         _TIMEDELTA_CONVERSION_FUNCTIONS[TimeUnit_NANO] = (
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L9_try_end;
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/scalar.pxi":439
 *             lambda v: pd.Timedelta(v, unit='ns')
 *         )
 *     except ImportError:             # <<<<<<<<<<<<<<
 *         pass
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
    if (__pyx_t_8) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L5_exception_handled;
    }
    goto __pyx_L6_except_error;
    __pyx_L6_except_error:;

    /* "pyarrow/scalar.pxi":434
 *     })
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         import pandas as pd
 *         _TIMEDELTA_CONVERSION_FUNCTIONS[TimeUnit_NANO] = (
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    goto __pyx_L1_error;
    __pyx_L5_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    __pyx_L9_try_end:;
  }

  /* "pyarrow/scalar.pxi":442
 *         pass
 * 
 *     return _TIMEDELTA_CONVERSION_FUNCTIONS             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_7pyarrow_3lib__TIMEDELTA_CONVERSION_FUNCTIONS);
  __pyx_r = __pyx_v_7pyarrow_3lib__TIMEDELTA_CONVERSION_FUNCTIONS;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":423
 * 
 * 
 * def _timedelta_conversion_functions():             # <<<<<<<<<<<<<<
 *     if _TIMEDELTA_CONVERSION_FUNCTIONS:
 *         return _TIMEDELTA_CONVERSION_FUNCTIONS
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib._timedelta_conversion_functions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":451
 * 
 *     @property
 *     def value(self):             # <<<<<<<<<<<<<<
 *         cdef CDurationArray* ap = <CDurationArray*> self.sp_array.get()
 *         return ap.Value(self.index)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13DurationValue_5value_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_13DurationValue_5value_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13DurationValue_5value___get__(((struct __pyx_obj_7pyarrow_3lib_DurationValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13DurationValue_5value___get__(struct __pyx_obj_7pyarrow_3lib_DurationValue *__pyx_v_self) {
   arrow::DurationArray *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/scalar.pxi":452
 *     @property
 *     def value(self):
 *         cdef CDurationArray* ap = <CDurationArray*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return ap.Value(self.index)
 * 
 */
  __pyx_v_ap = (( arrow::DurationArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":453
 *     def value(self):
 *         cdef CDurationArray* ap = <CDurationArray*> self.sp_array.get()
 *         return ap.Value(self.index)             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":451
 * 
 *     @property
 *     def value(self):             # <<<<<<<<<<<<<<
 *         cdef CDurationArray* ap = <CDurationArray*> self.sp_array.get()
 *         return ap.Value(self.index)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DurationValue.value.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":455
 *         return ap.Value(self.index)
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Pandas Timestamp instance (if available),
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13DurationValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13DurationValue_as_py[] = "DurationValue.as_py(self)\n\n        Return this value as a Pandas Timestamp instance (if available),\n        otherwise as a Python datetime.timedelta instance.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_13DurationValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13DurationValue_as_py(((struct __pyx_obj_7pyarrow_3lib_DurationValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13DurationValue_as_py(struct __pyx_obj_7pyarrow_3lib_DurationValue *__pyx_v_self) {
   arrow::DurationArray *__pyx_v_ap;
   arrow::DurationType *__pyx_v_dtype;
  int64_t __pyx_v_value;
  PyObject *__pyx_v_converter = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":460
 *         otherwise as a Python datetime.timedelta instance.
 *         """
 *         cdef CDurationArray* ap = <CDurationArray*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         cdef CDurationType* dtype = <CDurationType*> ap.type().get()
 * 
 */
  __pyx_v_ap = (( arrow::DurationArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":461
 *         """
 *         cdef CDurationArray* ap = <CDurationArray*> self.sp_array.get()
 *         cdef CDurationType* dtype = <CDurationType*> ap.type().get()             # <<<<<<<<<<<<<<
 * 
 *         cdef int64_t value = ap.Value(self.index)
 */
  __pyx_v_dtype = (( arrow::DurationType *)__pyx_v_ap->type().get());

  /* "pyarrow/scalar.pxi":463
 *         cdef CDurationType* dtype = <CDurationType*> ap.type().get()
 * 
 *         cdef int64_t value = ap.Value(self.index)             # <<<<<<<<<<<<<<
 *         converter = _timedelta_conversion_functions()[dtype.unit()]
 *         return converter(value)
 */
  __pyx_v_value = __pyx_v_ap->Value(__pyx_v_self->__pyx_base.index);

  /* "pyarrow/scalar.pxi":464
 * 
 *         cdef int64_t value = ap.Value(self.index)
 *         converter = _timedelta_conversion_functions()[dtype.unit()]             # <<<<<<<<<<<<<<
 *         return converter(value)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_timedelta_conversion_functions_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type(__pyx_v_dtype->unit()); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_converter = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyarrow/scalar.pxi":465
 *         cdef int64_t value = ap.Value(self.index)
 *         converter = _timedelta_conversion_functions()[dtype.unit()]
 *         return converter(value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_converter);
  __pyx_t_1 = __pyx_v_converter; __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":455
 *         return ap.Value(self.index)
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Pandas Timestamp instance (if available),
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.DurationValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_converter);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13DurationValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13DurationValue_2__reduce_cython__[] = "DurationValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_13DurationValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13DurationValue_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_DurationValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13DurationValue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DurationValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__80, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DurationValue.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13DurationValue_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13DurationValue_4__setstate_cython__[] = "DurationValue.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_13DurationValue_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13DurationValue_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_DurationValue *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13DurationValue_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DurationValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__81, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DurationValue.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":473
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python float.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14HalfFloatValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14HalfFloatValue_as_py[] = "HalfFloatValue.as_py(self)\n\n        Return this value as a Python float.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_14HalfFloatValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14HalfFloatValue_as_py(((struct __pyx_obj_7pyarrow_3lib_HalfFloatValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14HalfFloatValue_as_py(struct __pyx_obj_7pyarrow_3lib_HalfFloatValue *__pyx_v_self) {
   arrow::HalfFloatArray *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":477
 *         Return this value as a Python float.
 *         """
 *         cdef CHalfFloatArray* ap = <CHalfFloatArray*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return PyHalf_FromHalf(ap.Value(self.index))
 * 
 */
  __pyx_v_ap = (( arrow::HalfFloatArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":478
 *         """
 *         cdef CHalfFloatArray* ap = <CHalfFloatArray*> self.sp_array.get()
 *         return PyHalf_FromHalf(ap.Value(self.index))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = arrow::py::PyHalf_FromHalf(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":473
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python float.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.HalfFloatValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14HalfFloatValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14HalfFloatValue_2__reduce_cython__[] = "HalfFloatValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_14HalfFloatValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14HalfFloatValue_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_HalfFloatValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14HalfFloatValue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_HalfFloatValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__82, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.HalfFloatValue.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14HalfFloatValue_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14HalfFloatValue_4__setstate_cython__[] = "HalfFloatValue.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_14HalfFloatValue_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14HalfFloatValue_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_HalfFloatValue *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14HalfFloatValue_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_HalfFloatValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__83, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.HalfFloatValue.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":486
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python float.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10FloatValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10FloatValue_as_py[] = "FloatValue.as_py(self)\n\n        Return this value as a Python float.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10FloatValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10FloatValue_as_py(((struct __pyx_obj_7pyarrow_3lib_FloatValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10FloatValue_as_py(struct __pyx_obj_7pyarrow_3lib_FloatValue *__pyx_v_self) {
   arrow::FloatArray *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":490
 *         Return this value as a Python float.
 *         """
 *         cdef CFloatArray* ap = <CFloatArray*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return ap.Value(self.index)
 * 
 */
  __pyx_v_ap = (( arrow::FloatArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":491
 *         """
 *         cdef CFloatArray* ap = <CFloatArray*> self.sp_array.get()
 *         return ap.Value(self.index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":486
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python float.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FloatValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10FloatValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10FloatValue_2__reduce_cython__[] = "FloatValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10FloatValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10FloatValue_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_FloatValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10FloatValue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FloatValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__84, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FloatValue.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10FloatValue_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10FloatValue_4__setstate_cython__[] = "FloatValue.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_10FloatValue_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10FloatValue_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_FloatValue *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10FloatValue_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FloatValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__85, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FloatValue.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":499
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python float.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11DoubleValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11DoubleValue_as_py[] = "DoubleValue.as_py(self)\n\n        Return this value as a Python float.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11DoubleValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11DoubleValue_as_py(((struct __pyx_obj_7pyarrow_3lib_DoubleValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11DoubleValue_as_py(struct __pyx_obj_7pyarrow_3lib_DoubleValue *__pyx_v_self) {
   arrow::DoubleArray *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":503
 *         Return this value as a Python float.
 *         """
 *         cdef CDoubleArray* ap = <CDoubleArray*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return ap.Value(self.index)
 * 
 */
  __pyx_v_ap = (( arrow::DoubleArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":504
 *         """
 *         cdef CDoubleArray* ap = <CDoubleArray*> self.sp_array.get()
 *         return ap.Value(self.index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":499
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python float.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DoubleValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11DoubleValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11DoubleValue_2__reduce_cython__[] = "DoubleValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11DoubleValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11DoubleValue_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_DoubleValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11DoubleValue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DoubleValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__86, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DoubleValue.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11DoubleValue_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11DoubleValue_4__setstate_cython__[] = "DoubleValue.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11DoubleValue_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11DoubleValue_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_DoubleValue *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11DoubleValue_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DoubleValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__87, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DoubleValue.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":512
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python Decimal.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12DecimalValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12DecimalValue_as_py[] = "DecimalValue.as_py(self)\n\n        Return this value as a Python Decimal.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_12DecimalValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12DecimalValue_as_py(((struct __pyx_obj_7pyarrow_3lib_DecimalValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12DecimalValue_as_py(struct __pyx_obj_7pyarrow_3lib_DecimalValue *__pyx_v_self) {
   arrow::Decimal128Array *__pyx_v_ap;
  std::string __pyx_v_s;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":517
 *         """
 *         cdef:
 *             CDecimal128Array* ap = <CDecimal128Array*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *             c_string s = ap.FormatValue(self.index)
 *         return _pydecimal.Decimal(s.decode('utf8'))
 */
  __pyx_v_ap = (( arrow::Decimal128Array *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":518
 *         cdef:
 *             CDecimal128Array* ap = <CDecimal128Array*> self.sp_array.get()
 *             c_string s = ap.FormatValue(self.index)             # <<<<<<<<<<<<<<
 *         return _pydecimal.Decimal(s.decode('utf8'))
 * 
 */
  __pyx_v_s = __pyx_v_ap->FormatValue(__pyx_v_self->__pyx_base.index);

  /* "pyarrow/scalar.pxi":519
 *             CDecimal128Array* ap = <CDecimal128Array*> self.sp_array.get()
 *             c_string s = ap.FormatValue(self.index)
 *         return _pydecimal.Decimal(s.decode('utf8'))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pydecimal); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Decimal); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_decode_cpp_string(__pyx_v_s, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":512
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python Decimal.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.DecimalValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12DecimalValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12DecimalValue_2__reduce_cython__[] = "DecimalValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_12DecimalValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12DecimalValue_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_DecimalValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12DecimalValue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DecimalValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__88, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DecimalValue.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12DecimalValue_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12DecimalValue_4__setstate_cython__[] = "DecimalValue.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_12DecimalValue_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12DecimalValue_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_DecimalValue *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12DecimalValue_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DecimalValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__89, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DecimalValue.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":527
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python unicode string.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11StringValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11StringValue_as_py[] = "StringValue.as_py(self)\n\n        Return this value as a Python unicode string.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11StringValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11StringValue_as_py(((struct __pyx_obj_7pyarrow_3lib_StringValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11StringValue_as_py(struct __pyx_obj_7pyarrow_3lib_StringValue *__pyx_v_self) {
   arrow::StringArray *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":531
 *         Return this value as a Python unicode string.
 *         """
 *         cdef CStringArray* ap = <CStringArray*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return ap.GetString(self.index).decode('utf-8')
 * 
 */
  __pyx_v_ap = (( arrow::StringArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":532
 *         """
 *         cdef CStringArray* ap = <CStringArray*> self.sp_array.get()
 *         return ap.GetString(self.index).decode('utf-8')             # <<<<<<<<<<<<<<
 * 
 *     def as_buffer(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_decode_cpp_string(__pyx_v_ap->GetString(__pyx_v_self->__pyx_base.index), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 532, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":527
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python unicode string.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.StringValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":534
 *         return ap.GetString(self.index).decode('utf-8')
 * 
 *     def as_buffer(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a view over this value as a Buffer object.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11StringValue_3as_buffer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11StringValue_2as_buffer[] = "StringValue.as_buffer(self)\n\n        Return a view over this value as a Buffer object.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11StringValue_3as_buffer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_buffer (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11StringValue_2as_buffer(((struct __pyx_obj_7pyarrow_3lib_StringValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11StringValue_2as_buffer(struct __pyx_obj_7pyarrow_3lib_StringValue *__pyx_v_self) {
   arrow::StringArray *__pyx_v_ap;
  std::shared_ptr< arrow::Buffer>  __pyx_v_buf;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_buffer", 0);

  /* "pyarrow/scalar.pxi":539
 *         """
 *         cdef:
 *             CStringArray* ap = <CStringArray*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *             shared_ptr[CBuffer] buf
 * 
 */
  __pyx_v_ap = (( arrow::StringArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":542
 *             shared_ptr[CBuffer] buf
 * 
 *         buf = SliceBuffer(ap.value_data(), ap.value_offset(self.index),             # <<<<<<<<<<<<<<
 *                           ap.value_length(self.index))
 *         return pyarrow_wrap_buffer(buf)
 */
  __pyx_v_buf = arrow::SliceBuffer(__pyx_v_ap->value_data(), __pyx_v_ap->value_offset(__pyx_v_self->__pyx_base.index), __pyx_v_ap->value_length(__pyx_v_self->__pyx_base.index));

  /* "pyarrow/scalar.pxi":544
 *         buf = SliceBuffer(ap.value_data(), ap.value_offset(self.index),
 *                           ap.value_length(self.index))
 *         return pyarrow_wrap_buffer(buf)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 544, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":534
 *         return ap.GetString(self.index).decode('utf-8')
 * 
 *     def as_buffer(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a view over this value as a Buffer object.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.StringValue.as_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11StringValue_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11StringValue_4__reduce_cython__[] = "StringValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11StringValue_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11StringValue_4__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_StringValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11StringValue_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_StringValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__90, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.StringValue.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11StringValue_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11StringValue_6__setstate_cython__[] = "StringValue.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11StringValue_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11StringValue_6__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_StringValue *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11StringValue_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_StringValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__91, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.StringValue.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":552
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python unicode string.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16LargeStringValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16LargeStringValue_as_py[] = "LargeStringValue.as_py(self)\n\n        Return this value as a Python unicode string.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16LargeStringValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16LargeStringValue_as_py(((struct __pyx_obj_7pyarrow_3lib_LargeStringValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16LargeStringValue_as_py(struct __pyx_obj_7pyarrow_3lib_LargeStringValue *__pyx_v_self) {
   arrow::LargeStringArray *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":556
 *         Return this value as a Python unicode string.
 *         """
 *         cdef CLargeStringArray* ap = <CLargeStringArray*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return ap.GetString(self.index).decode('utf-8')
 * 
 */
  __pyx_v_ap = (( arrow::LargeStringArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":557
 *         """
 *         cdef CLargeStringArray* ap = <CLargeStringArray*> self.sp_array.get()
 *         return ap.GetString(self.index).decode('utf-8')             # <<<<<<<<<<<<<<
 * 
 *     def as_buffer(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_decode_cpp_string(__pyx_v_ap->GetString(__pyx_v_self->__pyx_base.index), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":552
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python unicode string.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.LargeStringValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":559
 *         return ap.GetString(self.index).decode('utf-8')
 * 
 *     def as_buffer(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a view over this value as a Buffer object.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16LargeStringValue_3as_buffer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16LargeStringValue_2as_buffer[] = "LargeStringValue.as_buffer(self)\n\n        Return a view over this value as a Buffer object.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16LargeStringValue_3as_buffer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_buffer (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16LargeStringValue_2as_buffer(((struct __pyx_obj_7pyarrow_3lib_LargeStringValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16LargeStringValue_2as_buffer(struct __pyx_obj_7pyarrow_3lib_LargeStringValue *__pyx_v_self) {
   arrow::LargeStringArray *__pyx_v_ap;
  std::shared_ptr< arrow::Buffer>  __pyx_v_buf;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_buffer", 0);

  /* "pyarrow/scalar.pxi":564
 *         """
 *         cdef:
 *             CLargeStringArray* ap = <CLargeStringArray*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *             shared_ptr[CBuffer] buf
 * 
 */
  __pyx_v_ap = (( arrow::LargeStringArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":567
 *             shared_ptr[CBuffer] buf
 * 
 *         buf = SliceBuffer(ap.value_data(), ap.value_offset(self.index),             # <<<<<<<<<<<<<<
 *                           ap.value_length(self.index))
 *         return pyarrow_wrap_buffer(buf)
 */
  __pyx_v_buf = arrow::SliceBuffer(__pyx_v_ap->value_data(), __pyx_v_ap->value_offset(__pyx_v_self->__pyx_base.index), __pyx_v_ap->value_length(__pyx_v_self->__pyx_base.index));

  /* "pyarrow/scalar.pxi":569
 *         buf = SliceBuffer(ap.value_data(), ap.value_offset(self.index),
 *                           ap.value_length(self.index))
 *         return pyarrow_wrap_buffer(buf)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 569, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":559
 *         return ap.GetString(self.index).decode('utf-8')
 * 
 *     def as_buffer(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a view over this value as a Buffer object.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.LargeStringValue.as_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16LargeStringValue_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16LargeStringValue_4__reduce_cython__[] = "LargeStringValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_16LargeStringValue_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16LargeStringValue_4__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_LargeStringValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16LargeStringValue_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_LargeStringValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__92, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.LargeStringValue.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16LargeStringValue_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16LargeStringValue_6__setstate_cython__[] = "LargeStringValue.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_16LargeStringValue_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16LargeStringValue_6__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_LargeStringValue *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16LargeStringValue_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_LargeStringValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__93, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.LargeStringValue.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":577
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python bytes object.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11BinaryValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11BinaryValue_as_py[] = "BinaryValue.as_py(self)\n\n        Return this value as a Python bytes object.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11BinaryValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11BinaryValue_as_py(((struct __pyx_obj_7pyarrow_3lib_BinaryValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11BinaryValue_as_py(struct __pyx_obj_7pyarrow_3lib_BinaryValue *__pyx_v_self) {
  uint8_t const *__pyx_v_ptr;
  int32_t __pyx_v_length;
   arrow::BinaryArray *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":584
 *             const uint8_t* ptr
 *             int32_t length
 *             CBinaryArray* ap = <CBinaryArray*> self.sp_array.get()             # <<<<<<<<<<<<<<
 * 
 *         ptr = ap.GetValue(self.index, &length)
 */
  __pyx_v_ap = (( arrow::BinaryArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":586
 *             CBinaryArray* ap = <CBinaryArray*> self.sp_array.get()
 * 
 *         ptr = ap.GetValue(self.index, &length)             # <<<<<<<<<<<<<<
 *         return cp.PyBytes_FromStringAndSize(<const char*>(ptr), length)
 * 
 */
  __pyx_v_ptr = __pyx_v_ap->GetValue(__pyx_v_self->__pyx_base.index, (&__pyx_v_length));

  /* "pyarrow/scalar.pxi":587
 * 
 *         ptr = ap.GetValue(self.index, &length)
 *         return cp.PyBytes_FromStringAndSize(<const char*>(ptr), length)             # <<<<<<<<<<<<<<
 * 
 *     def as_buffer(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_FromStringAndSize(((char const *)__pyx_v_ptr), __pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":577
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python bytes object.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.BinaryValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":589
 *         return cp.PyBytes_FromStringAndSize(<const char*>(ptr), length)
 * 
 *     def as_buffer(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a view over this value as a Buffer object.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11BinaryValue_3as_buffer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11BinaryValue_2as_buffer[] = "BinaryValue.as_buffer(self)\n\n        Return a view over this value as a Buffer object.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11BinaryValue_3as_buffer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_buffer (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11BinaryValue_2as_buffer(((struct __pyx_obj_7pyarrow_3lib_BinaryValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11BinaryValue_2as_buffer(struct __pyx_obj_7pyarrow_3lib_BinaryValue *__pyx_v_self) {
   arrow::BinaryArray *__pyx_v_ap;
  std::shared_ptr< arrow::Buffer>  __pyx_v_buf;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_buffer", 0);

  /* "pyarrow/scalar.pxi":594
 *         """
 *         cdef:
 *             CBinaryArray* ap = <CBinaryArray*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *             shared_ptr[CBuffer] buf
 * 
 */
  __pyx_v_ap = (( arrow::BinaryArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":597
 *             shared_ptr[CBuffer] buf
 * 
 *         buf = SliceBuffer(ap.value_data(), ap.value_offset(self.index),             # <<<<<<<<<<<<<<
 *                           ap.value_length(self.index))
 *         return pyarrow_wrap_buffer(buf)
 */
  __pyx_v_buf = arrow::SliceBuffer(__pyx_v_ap->value_data(), __pyx_v_ap->value_offset(__pyx_v_self->__pyx_base.index), __pyx_v_ap->value_length(__pyx_v_self->__pyx_base.index));

  /* "pyarrow/scalar.pxi":599
 *         buf = SliceBuffer(ap.value_data(), ap.value_offset(self.index),
 *                           ap.value_length(self.index))
 *         return pyarrow_wrap_buffer(buf)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":589
 *         return cp.PyBytes_FromStringAndSize(<const char*>(ptr), length)
 * 
 *     def as_buffer(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a view over this value as a Buffer object.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.BinaryValue.as_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11BinaryValue_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11BinaryValue_4__reduce_cython__[] = "BinaryValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11BinaryValue_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11BinaryValue_4__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_BinaryValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11BinaryValue_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BinaryValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__94, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.BinaryValue.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11BinaryValue_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11BinaryValue_6__setstate_cython__[] = "BinaryValue.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11BinaryValue_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11BinaryValue_6__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_BinaryValue *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11BinaryValue_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BinaryValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__95, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.BinaryValue.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":607
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python bytes object.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16LargeBinaryValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16LargeBinaryValue_as_py[] = "LargeBinaryValue.as_py(self)\n\n        Return this value as a Python bytes object.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16LargeBinaryValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16LargeBinaryValue_as_py(((struct __pyx_obj_7pyarrow_3lib_LargeBinaryValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16LargeBinaryValue_as_py(struct __pyx_obj_7pyarrow_3lib_LargeBinaryValue *__pyx_v_self) {
  uint8_t const *__pyx_v_ptr;
  int64_t __pyx_v_length;
   arrow::LargeBinaryArray *__pyx_v_ap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":614
 *             const uint8_t* ptr
 *             int64_t length
 *             CLargeBinaryArray* ap = <CLargeBinaryArray*> self.sp_array.get()             # <<<<<<<<<<<<<<
 * 
 *         ptr = ap.GetValue(self.index, &length)
 */
  __pyx_v_ap = (( arrow::LargeBinaryArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":616
 *             CLargeBinaryArray* ap = <CLargeBinaryArray*> self.sp_array.get()
 * 
 *         ptr = ap.GetValue(self.index, &length)             # <<<<<<<<<<<<<<
 *         return cp.PyBytes_FromStringAndSize(<const char*>(ptr), length)
 * 
 */
  __pyx_v_ptr = __pyx_v_ap->GetValue(__pyx_v_self->__pyx_base.index, (&__pyx_v_length));

  /* "pyarrow/scalar.pxi":617
 * 
 *         ptr = ap.GetValue(self.index, &length)
 *         return cp.PyBytes_FromStringAndSize(<const char*>(ptr), length)             # <<<<<<<<<<<<<<
 * 
 *     def as_buffer(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_FromStringAndSize(((char const *)__pyx_v_ptr), __pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":607
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python bytes object.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.LargeBinaryValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":619
 *         return cp.PyBytes_FromStringAndSize(<const char*>(ptr), length)
 * 
 *     def as_buffer(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a view over this value as a Buffer object.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16LargeBinaryValue_3as_buffer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16LargeBinaryValue_2as_buffer[] = "LargeBinaryValue.as_buffer(self)\n\n        Return a view over this value as a Buffer object.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16LargeBinaryValue_3as_buffer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_buffer (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16LargeBinaryValue_2as_buffer(((struct __pyx_obj_7pyarrow_3lib_LargeBinaryValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16LargeBinaryValue_2as_buffer(struct __pyx_obj_7pyarrow_3lib_LargeBinaryValue *__pyx_v_self) {
   arrow::LargeBinaryArray *__pyx_v_ap;
  std::shared_ptr< arrow::Buffer>  __pyx_v_buf;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_buffer", 0);

  /* "pyarrow/scalar.pxi":624
 *         """
 *         cdef:
 *             CLargeBinaryArray* ap = <CLargeBinaryArray*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *             shared_ptr[CBuffer] buf
 * 
 */
  __pyx_v_ap = (( arrow::LargeBinaryArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":627
 *             shared_ptr[CBuffer] buf
 * 
 *         buf = SliceBuffer(ap.value_data(), ap.value_offset(self.index),             # <<<<<<<<<<<<<<
 *                           ap.value_length(self.index))
 *         return pyarrow_wrap_buffer(buf)
 */
  __pyx_v_buf = arrow::SliceBuffer(__pyx_v_ap->value_data(), __pyx_v_ap->value_offset(__pyx_v_self->__pyx_base.index), __pyx_v_ap->value_length(__pyx_v_self->__pyx_base.index));

  /* "pyarrow/scalar.pxi":629
 *         buf = SliceBuffer(ap.value_data(), ap.value_offset(self.index),
 *                           ap.value_length(self.index))
 *         return pyarrow_wrap_buffer(buf)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 629, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":619
 *         return cp.PyBytes_FromStringAndSize(<const char*>(ptr), length)
 * 
 *     def as_buffer(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a view over this value as a Buffer object.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.LargeBinaryValue.as_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16LargeBinaryValue_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16LargeBinaryValue_4__reduce_cython__[] = "LargeBinaryValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_16LargeBinaryValue_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16LargeBinaryValue_4__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_LargeBinaryValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16LargeBinaryValue_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_LargeBinaryValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__96, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.LargeBinaryValue.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16LargeBinaryValue_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16LargeBinaryValue_6__setstate_cython__[] = "LargeBinaryValue.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_16LargeBinaryValue_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16LargeBinaryValue_6__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_LargeBinaryValue *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16LargeBinaryValue_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_LargeBinaryValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__97, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.LargeBinaryValue.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":637
 *     """
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of values.
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_7pyarrow_3lib_9ListValue_1__len__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_7pyarrow_3lib_9ListValue___len__[] = "\n        Return the number of values.\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_9ListValue___len__;
#endif
static Py_ssize_t __pyx_pw_7pyarrow_3lib_9ListValue_1__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9ListValue___len__(((struct __pyx_obj_7pyarrow_3lib_ListValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static Py_ssize_t __pyx_pf_7pyarrow_3lib_9ListValue___len__(struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "pyarrow/scalar.pxi":641
 *         Return the number of values.
 *         """
 *         return self.length()             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, i):
 */
  __pyx_r = ((struct __pyx_vtabstruct_7pyarrow_3lib_ListValue *)__pyx_v_self->__pyx_base.__pyx_vtab)->length(__pyx_v_self);
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":637
 *     """
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of values.
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":643
 *         return self.length()
 * 
 *     def __getitem__(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Return the value at the given index.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9ListValue_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_9ListValue_2__getitem__[] = "\n        Return the value at the given index.\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_9ListValue_2__getitem__;
#endif
static PyObject *__pyx_pw_7pyarrow_3lib_9ListValue_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9ListValue_2__getitem__(((struct __pyx_obj_7pyarrow_3lib_ListValue *)__pyx_v_self), ((PyObject *)__pyx_v_i));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_9ListValue_2__getitem__(struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "pyarrow/scalar.pxi":647
 *         Return the value at the given index.
 *         """
 *         return self.getitem(_normalize_index(i, self.length()))             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(5, 647, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7pyarrow_3lib__normalize_index(__pyx_t_1, ((struct __pyx_vtabstruct_7pyarrow_3lib_ListValue *)__pyx_v_self->__pyx_base.__pyx_vtab)->length(__pyx_v_self)); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1L))) __PYX_ERR(5, 647, __pyx_L1_error)
  __pyx_t_3 = ((struct __pyx_vtabstruct_7pyarrow_3lib_ListValue *)__pyx_v_self->__pyx_base.__pyx_vtab)->getitem(__pyx_v_self, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 647, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":643
 *         return self.length()
 * 
 *     def __getitem__(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Return the value at the given index.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.ListValue.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pyarrow_3lib_9ListValue_6generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/scalar.pxi":649
 *         return self.getitem(_normalize_index(i, self.length()))
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterate over this element's values.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9ListValue_5__iter__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_7pyarrow_3lib_9ListValue_4__iter__[] = "\n        Iterate over this element's values.\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_9ListValue_4__iter__;
#endif
static PyObject *__pyx_pw_7pyarrow_3lib_9ListValue_5__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9ListValue_4__iter__(((struct __pyx_obj_7pyarrow_3lib_ListValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_9ListValue_4__iter__(struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__ *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_5___iter__(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_5___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(5, 649, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7pyarrow_3lib_9ListValue_6generator3, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_ListValue___iter, __pyx_n_s_pyarrow_lib); if (unlikely(!gen)) __PYX_ERR(5, 649, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.ListValue.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7pyarrow_3lib_9ListValue_6generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__ *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(5, 649, __pyx_L1_error)

  /* "pyarrow/scalar.pxi":653
 *         Iterate over this element's values.
 *         """
 *         for i in range(len(self)):             # <<<<<<<<<<<<<<
 *             yield self.getitem(i)
 *         raise StopIteration
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(5, 653, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_cur_scope->__pyx_v_i = __pyx_t_3;

    /* "pyarrow/scalar.pxi":654
 *         """
 *         for i in range(len(self)):
 *             yield self.getitem(i)             # <<<<<<<<<<<<<<
 *         raise StopIteration
 * 
 */
    __pyx_t_4 = ((struct __pyx_vtabstruct_7pyarrow_3lib_ListValue *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->getitem(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 654, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(5, 654, __pyx_L1_error)
  }

  /* "pyarrow/scalar.pxi":655
 *         for i in range(len(self)):
 *             yield self.getitem(i)
 *         raise StopIteration             # <<<<<<<<<<<<<<
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):
 */
  __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
  __PYX_ERR(5, 655, __pyx_L1_error)
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "pyarrow/scalar.pxi":649
 *         return self.getitem(_normalize_index(i, self.length()))
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterate over this element's values.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":657
 *         raise StopIteration
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):             # <<<<<<<<<<<<<<
 *         self.sp_array = sp_array
 *         self.ap = <CListArray*> sp_array.get()
 */

static void __pyx_f_7pyarrow_3lib_9ListValue__set_array(struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self, std::shared_ptr< arrow::Array>  const &__pyx_v_sp_array) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("_set_array", 0);

  /* "pyarrow/scalar.pxi":658
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):
 *         self.sp_array = sp_array             # <<<<<<<<<<<<<<
 *         self.ap = <CListArray*> sp_array.get()
 *         self.value_type = pyarrow_wrap_data_type(self.ap.value_type())
 */
  __pyx_v_self->__pyx_base.sp_array = __pyx_v_sp_array;

  /* "pyarrow/scalar.pxi":659
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):
 *         self.sp_array = sp_array
 *         self.ap = <CListArray*> sp_array.get()             # <<<<<<<<<<<<<<
 *         self.value_type = pyarrow_wrap_data_type(self.ap.value_type())
 * 
 */
  __pyx_v_self->ap = (( arrow::ListArray *)__pyx_v_sp_array.get());

  /* "pyarrow/scalar.pxi":660
 *         self.sp_array = sp_array
 *         self.ap = <CListArray*> sp_array.get()
 *         self.value_type = pyarrow_wrap_data_type(self.ap.value_type())             # <<<<<<<<<<<<<<
 * 
 *     cdef getitem(self, int64_t i):
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_self->ap->value_type()); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(5, 660, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->value_type);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->value_type));
  __pyx_v_self->value_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":657
 *         raise StopIteration
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):             # <<<<<<<<<<<<<<
 *         self.sp_array = sp_array
 *         self.ap = <CListArray*> sp_array.get()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("pyarrow.lib.ListValue._set_array", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/scalar.pxi":662
 *         self.value_type = pyarrow_wrap_data_type(self.ap.value_type())
 * 
 *     cdef getitem(self, int64_t i):             # <<<<<<<<<<<<<<
 *         cdef int64_t j = self.ap.value_offset(self.index) + i
 *         return box_scalar(self.value_type, self.ap.values(), j)
 */

static PyObject *__pyx_f_7pyarrow_3lib_9ListValue_getitem(struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self, int64_t __pyx_v_i) {
  int64_t __pyx_v_j;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("getitem", 0);

  /* "pyarrow/scalar.pxi":663
 * 
 *     cdef getitem(self, int64_t i):
 *         cdef int64_t j = self.ap.value_offset(self.index) + i             # <<<<<<<<<<<<<<
 *         return box_scalar(self.value_type, self.ap.values(), j)
 * 
 */
  __pyx_v_j = (__pyx_v_self->ap->value_offset(__pyx_v_self->__pyx_base.index) + __pyx_v_i);

  /* "pyarrow/scalar.pxi":664
 *     cdef getitem(self, int64_t i):
 *         cdef int64_t j = self.ap.value_offset(self.index) + i
 *         return box_scalar(self.value_type, self.ap.values(), j)             # <<<<<<<<<<<<<<
 * 
 *     cdef int64_t length(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_v_self->value_type);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_box_scalar(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1), __pyx_v_self->ap->values(), __pyx_v_j); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 664, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":662
 *         self.value_type = pyarrow_wrap_data_type(self.ap.value_type())
 * 
 *     cdef getitem(self, int64_t i):             # <<<<<<<<<<<<<<
 *         cdef int64_t j = self.ap.value_offset(self.index) + i
 *         return box_scalar(self.value_type, self.ap.values(), j)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.ListValue.getitem", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":666
 *         return box_scalar(self.value_type, self.ap.values(), j)
 * 
 *     cdef int64_t length(self):             # <<<<<<<<<<<<<<
 *         return self.ap.value_length(self.index)
 * 
 */

static int64_t __pyx_f_7pyarrow_3lib_9ListValue_length(struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self) {
  int64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("length", 0);

  /* "pyarrow/scalar.pxi":667
 * 
 *     cdef int64_t length(self):
 *         return self.ap.value_length(self.index)             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */
  __pyx_r = __pyx_v_self->ap->value_length(__pyx_v_self->__pyx_base.index);
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":666
 *         return box_scalar(self.value_type, self.ap.values(), j)
 * 
 *     cdef int64_t length(self):             # <<<<<<<<<<<<<<
 *         return self.ap.value_length(self.index)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":669
 *         return self.ap.value_length(self.index)
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python list.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9ListValue_8as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_9ListValue_7as_py[] = "ListValue.as_py(self)\n\n        Return this value as a Python list.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_9ListValue_8as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9ListValue_7as_py(((struct __pyx_obj_7pyarrow_3lib_ListValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_9ListValue_7as_py(struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self) {
  int64_t __pyx_v_j;
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int64_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":675
 *         cdef:
 *             int64_t j
 *             list result = []             # <<<<<<<<<<<<<<
 * 
 *         for j in range(len(self)):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":677
 *             list result = []
 * 
 *         for j in range(len(self)):             # <<<<<<<<<<<<<<
 *             result.append(self.getitem(j).as_py())
 * 
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(5, 677, __pyx_L1_error)
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_j = __pyx_t_4;

    /* "pyarrow/scalar.pxi":678
 * 
 *         for j in range(len(self)):
 *             result.append(self.getitem(j).as_py())             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_5 = ((struct __pyx_vtabstruct_7pyarrow_3lib_ListValue *)__pyx_v_self->__pyx_base.__pyx_vtab)->getitem(__pyx_v_self, __pyx_v_j); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_as_py); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(5, 678, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyarrow/scalar.pxi":680
 *             result.append(self.getitem(j).as_py())
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":669
 *         return self.ap.value_length(self.index)
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python list.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.ListValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/lib.pxd":202
 * cdef class ListValue(ArrayValue):
 *     cdef readonly:
 *         DataType value_type             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9ListValue_10value_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_9ListValue_10value_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9ListValue_10value_type___get__(((struct __pyx_obj_7pyarrow_3lib_ListValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_9ListValue_10value_type___get__(struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->value_type));
  __pyx_r = ((PyObject *)__pyx_v_self->value_type);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9ListValue_10__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_9ListValue_9__reduce_cython__[] = "ListValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_9ListValue_10__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9ListValue_9__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_ListValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_9ListValue_9__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__98, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.ListValue.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9ListValue_12__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_9ListValue_11__setstate_cython__[] = "ListValue.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_9ListValue_12__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9ListValue_11__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_ListValue *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_9ListValue_11__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_ListValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__99, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.ListValue.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":688
 *     """
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of values.
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_7pyarrow_3lib_14LargeListValue_1__len__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14LargeListValue___len__[] = "\n        Return the number of values.\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_14LargeListValue___len__;
#endif
static Py_ssize_t __pyx_pw_7pyarrow_3lib_14LargeListValue_1__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14LargeListValue___len__(((struct __pyx_obj_7pyarrow_3lib_LargeListValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static Py_ssize_t __pyx_pf_7pyarrow_3lib_14LargeListValue___len__(struct __pyx_obj_7pyarrow_3lib_LargeListValue *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "pyarrow/scalar.pxi":692
 *         Return the number of values.
 *         """
 *         return self.length()             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, i):
 */
  __pyx_r = ((struct __pyx_vtabstruct_7pyarrow_3lib_LargeListValue *)__pyx_v_self->__pyx_base.__pyx_vtab)->length(__pyx_v_self);
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":688
 *     """
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of values.
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":694
 *         return self.length()
 * 
 *     def __getitem__(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Return the value at the given index.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14LargeListValue_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14LargeListValue_2__getitem__[] = "\n        Return the value at the given index.\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_14LargeListValue_2__getitem__;
#endif
static PyObject *__pyx_pw_7pyarrow_3lib_14LargeListValue_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14LargeListValue_2__getitem__(((struct __pyx_obj_7pyarrow_3lib_LargeListValue *)__pyx_v_self), ((PyObject *)__pyx_v_i));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14LargeListValue_2__getitem__(struct __pyx_obj_7pyarrow_3lib_LargeListValue *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "pyarrow/scalar.pxi":698
 *         Return the value at the given index.
 *         """
 *         return self.getitem(_normalize_index(i, self.length()))             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(5, 698, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7pyarrow_3lib__normalize_index(__pyx_t_1, ((struct __pyx_vtabstruct_7pyarrow_3lib_LargeListValue *)__pyx_v_self->__pyx_base.__pyx_vtab)->length(__pyx_v_self)); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1L))) __PYX_ERR(5, 698, __pyx_L1_error)
  __pyx_t_3 = ((struct __pyx_vtabstruct_7pyarrow_3lib_LargeListValue *)__pyx_v_self->__pyx_base.__pyx_vtab)->getitem(__pyx_v_self, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":694
 *         return self.length()
 * 
 *     def __getitem__(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Return the value at the given index.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.LargeListValue.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pyarrow_3lib_14LargeListValue_6generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/scalar.pxi":700
 *         return self.getitem(_normalize_index(i, self.length()))
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterate over this element's values.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14LargeListValue_5__iter__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14LargeListValue_4__iter__[] = "\n        Iterate over this element's values.\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_14LargeListValue_4__iter__;
#endif
static PyObject *__pyx_pw_7pyarrow_3lib_14LargeListValue_5__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14LargeListValue_4__iter__(((struct __pyx_obj_7pyarrow_3lib_LargeListValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14LargeListValue_4__iter__(struct __pyx_obj_7pyarrow_3lib_LargeListValue *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__ *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_6___iter__(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_6___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(5, 700, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7pyarrow_3lib_14LargeListValue_6generator4, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_LargeListValue___iter, __pyx_n_s_pyarrow_lib); if (unlikely(!gen)) __PYX_ERR(5, 700, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.LargeListValue.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7pyarrow_3lib_14LargeListValue_6generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__ *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(5, 700, __pyx_L1_error)

  /* "pyarrow/scalar.pxi":704
 *         Iterate over this element's values.
 *         """
 *         for i in range(len(self)):             # <<<<<<<<<<<<<<
 *             yield self.getitem(i)
 *         raise StopIteration
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(5, 704, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_cur_scope->__pyx_v_i = __pyx_t_3;

    /* "pyarrow/scalar.pxi":705
 *         """
 *         for i in range(len(self)):
 *             yield self.getitem(i)             # <<<<<<<<<<<<<<
 *         raise StopIteration
 * 
 */
    __pyx_t_4 = ((struct __pyx_vtabstruct_7pyarrow_3lib_LargeListValue *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->getitem(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 705, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(5, 705, __pyx_L1_error)
  }

  /* "pyarrow/scalar.pxi":706
 *         for i in range(len(self)):
 *             yield self.getitem(i)
 *         raise StopIteration             # <<<<<<<<<<<<<<
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):
 */
  __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
  __PYX_ERR(5, 706, __pyx_L1_error)
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "pyarrow/scalar.pxi":700
 *         return self.getitem(_normalize_index(i, self.length()))
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterate over this element's values.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":708
 *         raise StopIteration
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):             # <<<<<<<<<<<<<<
 *         self.sp_array = sp_array
 *         self.ap = <CLargeListArray*> sp_array.get()
 */

static void __pyx_f_7pyarrow_3lib_14LargeListValue__set_array(struct __pyx_obj_7pyarrow_3lib_LargeListValue *__pyx_v_self, std::shared_ptr< arrow::Array>  const &__pyx_v_sp_array) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("_set_array", 0);

  /* "pyarrow/scalar.pxi":709
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):
 *         self.sp_array = sp_array             # <<<<<<<<<<<<<<
 *         self.ap = <CLargeListArray*> sp_array.get()
 *         self.value_type = pyarrow_wrap_data_type(self.ap.value_type())
 */
  __pyx_v_self->__pyx_base.sp_array = __pyx_v_sp_array;

  /* "pyarrow/scalar.pxi":710
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):
 *         self.sp_array = sp_array
 *         self.ap = <CLargeListArray*> sp_array.get()             # <<<<<<<<<<<<<<
 *         self.value_type = pyarrow_wrap_data_type(self.ap.value_type())
 * 
 */
  __pyx_v_self->ap = (( arrow::LargeListArray *)__pyx_v_sp_array.get());

  /* "pyarrow/scalar.pxi":711
 *         self.sp_array = sp_array
 *         self.ap = <CLargeListArray*> sp_array.get()
 *         self.value_type = pyarrow_wrap_data_type(self.ap.value_type())             # <<<<<<<<<<<<<<
 * 
 *     cdef getitem(self, int64_t i):
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_self->ap->value_type()); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 711, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(5, 711, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->value_type);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->value_type));
  __pyx_v_self->value_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":708
 *         raise StopIteration
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):             # <<<<<<<<<<<<<<
 *         self.sp_array = sp_array
 *         self.ap = <CLargeListArray*> sp_array.get()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("pyarrow.lib.LargeListValue._set_array", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/scalar.pxi":713
 *         self.value_type = pyarrow_wrap_data_type(self.ap.value_type())
 * 
 *     cdef getitem(self, int64_t i):             # <<<<<<<<<<<<<<
 *         cdef int64_t j = self.ap.value_offset(self.index) + i
 *         return box_scalar(self.value_type, self.ap.values(), j)
 */

static PyObject *__pyx_f_7pyarrow_3lib_14LargeListValue_getitem(struct __pyx_obj_7pyarrow_3lib_LargeListValue *__pyx_v_self, int64_t __pyx_v_i) {
  int64_t __pyx_v_j;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("getitem", 0);

  /* "pyarrow/scalar.pxi":714
 * 
 *     cdef getitem(self, int64_t i):
 *         cdef int64_t j = self.ap.value_offset(self.index) + i             # <<<<<<<<<<<<<<
 *         return box_scalar(self.value_type, self.ap.values(), j)
 * 
 */
  __pyx_v_j = (__pyx_v_self->ap->value_offset(__pyx_v_self->__pyx_base.index) + __pyx_v_i);

  /* "pyarrow/scalar.pxi":715
 *     cdef getitem(self, int64_t i):
 *         cdef int64_t j = self.ap.value_offset(self.index) + i
 *         return box_scalar(self.value_type, self.ap.values(), j)             # <<<<<<<<<<<<<<
 * 
 *     cdef int64_t length(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_v_self->value_type);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_box_scalar(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1), __pyx_v_self->ap->values(), __pyx_v_j); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 715, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":713
 *         self.value_type = pyarrow_wrap_data_type(self.ap.value_type())
 * 
 *     cdef getitem(self, int64_t i):             # <<<<<<<<<<<<<<
 *         cdef int64_t j = self.ap.value_offset(self.index) + i
 *         return box_scalar(self.value_type, self.ap.values(), j)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.LargeListValue.getitem", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":717
 *         return box_scalar(self.value_type, self.ap.values(), j)
 * 
 *     cdef int64_t length(self):             # <<<<<<<<<<<<<<
 *         return self.ap.value_length(self.index)
 * 
 */

static int64_t __pyx_f_7pyarrow_3lib_14LargeListValue_length(struct __pyx_obj_7pyarrow_3lib_LargeListValue *__pyx_v_self) {
  int64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("length", 0);

  /* "pyarrow/scalar.pxi":718
 * 
 *     cdef int64_t length(self):
 *         return self.ap.value_length(self.index)             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */
  __pyx_r = __pyx_v_self->ap->value_length(__pyx_v_self->__pyx_base.index);
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":717
 *         return box_scalar(self.value_type, self.ap.values(), j)
 * 
 *     cdef int64_t length(self):             # <<<<<<<<<<<<<<
 *         return self.ap.value_length(self.index)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":720
 *         return self.ap.value_length(self.index)
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python list.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14LargeListValue_8as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14LargeListValue_7as_py[] = "LargeListValue.as_py(self)\n\n        Return this value as a Python list.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_14LargeListValue_8as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14LargeListValue_7as_py(((struct __pyx_obj_7pyarrow_3lib_LargeListValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14LargeListValue_7as_py(struct __pyx_obj_7pyarrow_3lib_LargeListValue *__pyx_v_self) {
  int64_t __pyx_v_j;
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int64_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":726
 *         cdef:
 *             int64_t j
 *             list result = []             # <<<<<<<<<<<<<<
 * 
 *         for j in range(len(self)):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 726, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":728
 *             list result = []
 * 
 *         for j in range(len(self)):             # <<<<<<<<<<<<<<
 *             result.append(self.getitem(j).as_py())
 * 
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(5, 728, __pyx_L1_error)
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_j = __pyx_t_4;

    /* "pyarrow/scalar.pxi":729
 * 
 *         for j in range(len(self)):
 *             result.append(self.getitem(j).as_py())             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_5 = ((struct __pyx_vtabstruct_7pyarrow_3lib_LargeListValue *)__pyx_v_self->__pyx_base.__pyx_vtab)->getitem(__pyx_v_self, __pyx_v_j); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 729, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_as_py); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 729, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 729, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(5, 729, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyarrow/scalar.pxi":731
 *             result.append(self.getitem(j).as_py())
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":720
 *         return self.ap.value_length(self.index)
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python list.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.LargeListValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/lib.pxd":213
 * cdef class LargeListValue(ArrayValue):
 *     cdef readonly:
 *         DataType value_type             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14LargeListValue_10value_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14LargeListValue_10value_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14LargeListValue_10value_type___get__(((struct __pyx_obj_7pyarrow_3lib_LargeListValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14LargeListValue_10value_type___get__(struct __pyx_obj_7pyarrow_3lib_LargeListValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->value_type));
  __pyx_r = ((PyObject *)__pyx_v_self->value_type);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14LargeListValue_10__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14LargeListValue_9__reduce_cython__[] = "LargeListValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_14LargeListValue_10__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14LargeListValue_9__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_LargeListValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14LargeListValue_9__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_LargeListValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__100, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.LargeListValue.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14LargeListValue_12__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14LargeListValue_11__setstate_cython__[] = "LargeListValue.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_14LargeListValue_12__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14LargeListValue_11__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_LargeListValue *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14LargeListValue_11__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_LargeListValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__101, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.LargeListValue.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":739
 *     """
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of values.
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_7pyarrow_3lib_8MapValue_1__len__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_7pyarrow_3lib_8MapValue___len__[] = "\n        Return the number of values.\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_8MapValue___len__;
#endif
static Py_ssize_t __pyx_pw_7pyarrow_3lib_8MapValue_1__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8MapValue___len__(((struct __pyx_obj_7pyarrow_3lib_MapValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static Py_ssize_t __pyx_pf_7pyarrow_3lib_8MapValue___len__(struct __pyx_obj_7pyarrow_3lib_MapValue *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "pyarrow/scalar.pxi":743
 *         Return the number of values.
 *         """
 *         return self.length()             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, i):
 */
  __pyx_r = ((struct __pyx_vtabstruct_7pyarrow_3lib_MapValue *)__pyx_v_self->__pyx_base.__pyx_vtab)->length(__pyx_v_self);
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":739
 *     """
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of values.
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":745
 *         return self.length()
 * 
 *     def __getitem__(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Return the value at the given index.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8MapValue_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_8MapValue_2__getitem__[] = "\n        Return the value at the given index.\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_8MapValue_2__getitem__;
#endif
static PyObject *__pyx_pw_7pyarrow_3lib_8MapValue_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8MapValue_2__getitem__(((struct __pyx_obj_7pyarrow_3lib_MapValue *)__pyx_v_self), ((PyObject *)__pyx_v_i));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8MapValue_2__getitem__(struct __pyx_obj_7pyarrow_3lib_MapValue *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "pyarrow/scalar.pxi":749
 *         Return the value at the given index.
 *         """
 *         return self.getitem(_normalize_index(i, self.length()))             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(5, 749, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7pyarrow_3lib__normalize_index(__pyx_t_1, ((struct __pyx_vtabstruct_7pyarrow_3lib_MapValue *)__pyx_v_self->__pyx_base.__pyx_vtab)->length(__pyx_v_self)); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1L))) __PYX_ERR(5, 749, __pyx_L1_error)
  __pyx_t_3 = ((struct __pyx_vtabstruct_7pyarrow_3lib_MapValue *)__pyx_v_self->__pyx_base.__pyx_vtab)->getitem(__pyx_v_self, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 749, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":745
 *         return self.length()
 * 
 *     def __getitem__(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Return the value at the given index.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.MapValue.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pyarrow_3lib_8MapValue_6generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/scalar.pxi":751
 *         return self.getitem(_normalize_index(i, self.length()))
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterate over this element's values.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8MapValue_5__iter__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_7pyarrow_3lib_8MapValue_4__iter__[] = "\n        Iterate over this element's values.\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_8MapValue_4__iter__;
#endif
static PyObject *__pyx_pw_7pyarrow_3lib_8MapValue_5__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8MapValue_4__iter__(((struct __pyx_obj_7pyarrow_3lib_MapValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8MapValue_4__iter__(struct __pyx_obj_7pyarrow_3lib_MapValue *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7___iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7___iter__ *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_7___iter__(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_7___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7___iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(5, 751, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7pyarrow_3lib_8MapValue_6generator5, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_MapValue___iter, __pyx_n_s_pyarrow_lib); if (unlikely(!gen)) __PYX_ERR(5, 751, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.MapValue.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7pyarrow_3lib_8MapValue_6generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7___iter__ *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7___iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(5, 751, __pyx_L1_error)

  /* "pyarrow/scalar.pxi":755
 *         Iterate over this element's values.
 *         """
 *         for i in range(len(self)):             # <<<<<<<<<<<<<<
 *             yield self.getitem(i)
 *         raise StopIteration
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(5, 755, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_cur_scope->__pyx_v_i = __pyx_t_3;

    /* "pyarrow/scalar.pxi":756
 *         """
 *         for i in range(len(self)):
 *             yield self.getitem(i)             # <<<<<<<<<<<<<<
 *         raise StopIteration
 * 
 */
    __pyx_t_4 = ((struct __pyx_vtabstruct_7pyarrow_3lib_MapValue *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->getitem(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 756, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(5, 756, __pyx_L1_error)
  }

  /* "pyarrow/scalar.pxi":757
 *         for i in range(len(self)):
 *             yield self.getitem(i)
 *         raise StopIteration             # <<<<<<<<<<<<<<
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):
 */
  __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
  __PYX_ERR(5, 757, __pyx_L1_error)
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "pyarrow/scalar.pxi":751
 *         return self.getitem(_normalize_index(i, self.length()))
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterate over this element's values.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":759
 *         raise StopIteration
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):             # <<<<<<<<<<<<<<
 *         self.sp_array = sp_array
 *         self.ap = <CMapArray*> sp_array.get()
 */

static void __pyx_f_7pyarrow_3lib_8MapValue__set_array(struct __pyx_obj_7pyarrow_3lib_MapValue *__pyx_v_self, std::shared_ptr< arrow::Array>  const &__pyx_v_sp_array) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("_set_array", 0);

  /* "pyarrow/scalar.pxi":760
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):
 *         self.sp_array = sp_array             # <<<<<<<<<<<<<<
 *         self.ap = <CMapArray*> sp_array.get()
 *         self.key_type = pyarrow_wrap_data_type(self.ap.map_type().key_type())
 */
  __pyx_v_self->__pyx_base.sp_array = __pyx_v_sp_array;

  /* "pyarrow/scalar.pxi":761
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):
 *         self.sp_array = sp_array
 *         self.ap = <CMapArray*> sp_array.get()             # <<<<<<<<<<<<<<
 *         self.key_type = pyarrow_wrap_data_type(self.ap.map_type().key_type())
 *         self.item_type = pyarrow_wrap_data_type(self.ap.map_type().item_type())
 */
  __pyx_v_self->ap = (( arrow::MapArray *)__pyx_v_sp_array.get());

  /* "pyarrow/scalar.pxi":762
 *         self.sp_array = sp_array
 *         self.ap = <CMapArray*> sp_array.get()
 *         self.key_type = pyarrow_wrap_data_type(self.ap.map_type().key_type())             # <<<<<<<<<<<<<<
 *         self.item_type = pyarrow_wrap_data_type(self.ap.map_type().item_type())
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_self->ap->map_type()->key_type()); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 762, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(5, 762, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->key_type);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->key_type));
  __pyx_v_self->key_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":763
 *         self.ap = <CMapArray*> sp_array.get()
 *         self.key_type = pyarrow_wrap_data_type(self.ap.map_type().key_type())
 *         self.item_type = pyarrow_wrap_data_type(self.ap.map_type().item_type())             # <<<<<<<<<<<<<<
 * 
 *     cdef getitem(self, int64_t i):
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_self->ap->map_type()->item_type()); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 763, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(5, 763, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->item_type);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->item_type));
  __pyx_v_self->item_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":759
 *         raise StopIteration
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):             # <<<<<<<<<<<<<<
 *         self.sp_array = sp_array
 *         self.ap = <CMapArray*> sp_array.get()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("pyarrow.lib.MapValue._set_array", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/scalar.pxi":765
 *         self.item_type = pyarrow_wrap_data_type(self.ap.map_type().item_type())
 * 
 *     cdef getitem(self, int64_t i):             # <<<<<<<<<<<<<<
 *         cdef int64_t j = self.ap.value_offset(self.index) + i
 *         return (box_scalar(self.key_type, self.ap.keys(), j),
 */

static PyObject *__pyx_f_7pyarrow_3lib_8MapValue_getitem(struct __pyx_obj_7pyarrow_3lib_MapValue *__pyx_v_self, int64_t __pyx_v_i) {
  int64_t __pyx_v_j;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("getitem", 0);

  /* "pyarrow/scalar.pxi":766
 * 
 *     cdef getitem(self, int64_t i):
 *         cdef int64_t j = self.ap.value_offset(self.index) + i             # <<<<<<<<<<<<<<
 *         return (box_scalar(self.key_type, self.ap.keys(), j),
 *                 box_scalar(self.item_type, self.ap.items(), j))
 */
  __pyx_v_j = (__pyx_v_self->ap->value_offset(__pyx_v_self->__pyx_base.index) + __pyx_v_i);

  /* "pyarrow/scalar.pxi":767
 *     cdef getitem(self, int64_t i):
 *         cdef int64_t j = self.ap.value_offset(self.index) + i
 *         return (box_scalar(self.key_type, self.ap.keys(), j),             # <<<<<<<<<<<<<<
 *                 box_scalar(self.item_type, self.ap.items(), j))
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_v_self->key_type);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_box_scalar(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1), __pyx_v_self->ap->keys(), __pyx_v_j); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":768
 *         cdef int64_t j = self.ap.value_offset(self.index) + i
 *         return (box_scalar(self.key_type, self.ap.keys(), j),
 *                 box_scalar(self.item_type, self.ap.items(), j))             # <<<<<<<<<<<<<<
 * 
 *     cdef int64_t length(self):
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->item_type);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_box_scalar(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1), __pyx_v_self->ap->items(), __pyx_v_j); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 768, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":767
 *     cdef getitem(self, int64_t i):
 *         cdef int64_t j = self.ap.value_offset(self.index) + i
 *         return (box_scalar(self.key_type, self.ap.keys(), j),             # <<<<<<<<<<<<<<
 *                 box_scalar(self.item_type, self.ap.items(), j))
 * 
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":765
 *         self.item_type = pyarrow_wrap_data_type(self.ap.map_type().item_type())
 * 
 *     cdef getitem(self, int64_t i):             # <<<<<<<<<<<<<<
 *         cdef int64_t j = self.ap.value_offset(self.index) + i
 *         return (box_scalar(self.key_type, self.ap.keys(), j),
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.MapValue.getitem", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":770
 *                 box_scalar(self.item_type, self.ap.items(), j))
 * 
 *     cdef int64_t length(self):             # <<<<<<<<<<<<<<
 *         return self.ap.value_length(self.index)
 * 
 */

static int64_t __pyx_f_7pyarrow_3lib_8MapValue_length(struct __pyx_obj_7pyarrow_3lib_MapValue *__pyx_v_self) {
  int64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("length", 0);

  /* "pyarrow/scalar.pxi":771
 * 
 *     cdef int64_t length(self):
 *         return self.ap.value_length(self.index)             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */
  __pyx_r = __pyx_v_self->ap->value_length(__pyx_v_self->__pyx_base.index);
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":770
 *                 box_scalar(self.item_type, self.ap.items(), j))
 * 
 *     cdef int64_t length(self):             # <<<<<<<<<<<<<<
 *         return self.ap.value_length(self.index)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":773
 *         return self.ap.value_length(self.index)
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python list of tuples, each containing a
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8MapValue_8as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_8MapValue_7as_py[] = "MapValue.as_py(self)\n\n        Return this value as a Python list of tuples, each containing a\n        key and item.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_8MapValue_8as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8MapValue_7as_py(((struct __pyx_obj_7pyarrow_3lib_MapValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8MapValue_7as_py(struct __pyx_obj_7pyarrow_3lib_MapValue *__pyx_v_self) {
  int64_t __pyx_v_j;
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_item = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int64_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":780
 *         cdef:
 *             int64_t j
 *             list result = []             # <<<<<<<<<<<<<<
 * 
 *         for j in range(len(self)):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":782
 *             list result = []
 * 
 *         for j in range(len(self)):             # <<<<<<<<<<<<<<
 *             key, item = self.getitem(j)
 *             result.append((key.as_py(), item.as_py()))
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(5, 782, __pyx_L1_error)
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_j = __pyx_t_4;

    /* "pyarrow/scalar.pxi":783
 * 
 *         for j in range(len(self)):
 *             key, item = self.getitem(j)             # <<<<<<<<<<<<<<
 *             result.append((key.as_py(), item.as_py()))
 * 
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_MapValue *)__pyx_v_self->__pyx_base.__pyx_vtab)->getitem(__pyx_v_self, __pyx_v_j); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 783, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(5, 783, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 783, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 783, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 783, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(5, 783, __pyx_L1_error)
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(5, 783, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "pyarrow/scalar.pxi":784
 *         for j in range(len(self)):
 *             key, item = self.getitem(j)
 *             result.append((key.as_py(), item.as_py()))             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_as_py); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 784, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 784, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_as_py); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 784, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 784, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 784, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
    __pyx_t_1 = 0;
    __pyx_t_6 = 0;
    __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_5); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(5, 784, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }

  /* "pyarrow/scalar.pxi":786
 *             result.append((key.as_py(), item.as_py()))
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":773
 *         return self.ap.value_length(self.index)
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python list of tuples, each containing a
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.MapValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/lib.pxd":224
 * cdef class MapValue(ArrayValue):
 *     cdef readonly:
 *         DataType key_type             # <<<<<<<<<<<<<<
 *         DataType item_type
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8MapValue_8key_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_8MapValue_8key_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8MapValue_8key_type___get__(((struct __pyx_obj_7pyarrow_3lib_MapValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8MapValue_8key_type___get__(struct __pyx_obj_7pyarrow_3lib_MapValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->key_type));
  __pyx_r = ((PyObject *)__pyx_v_self->key_type);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/lib.pxd":225
 *     cdef readonly:
 *         DataType key_type
 *         DataType item_type             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8MapValue_9item_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_8MapValue_9item_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8MapValue_9item_type___get__(((struct __pyx_obj_7pyarrow_3lib_MapValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8MapValue_9item_type___get__(struct __pyx_obj_7pyarrow_3lib_MapValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->item_type));
  __pyx_r = ((PyObject *)__pyx_v_self->item_type);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8MapValue_10__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_8MapValue_9__reduce_cython__[] = "MapValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_8MapValue_10__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8MapValue_9__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_MapValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8MapValue_9__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MapValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__102, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.MapValue.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8MapValue_12__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_8MapValue_11__setstate_cython__[] = "MapValue.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_8MapValue_12__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8MapValue_11__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_MapValue *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8MapValue_11__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MapValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__103, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.MapValue.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":794
 *     """
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of values.
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_7pyarrow_3lib_18FixedSizeListValue_1__len__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18FixedSizeListValue___len__[] = "\n        Return the number of values.\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_18FixedSizeListValue___len__;
#endif
static Py_ssize_t __pyx_pw_7pyarrow_3lib_18FixedSizeListValue_1__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_18FixedSizeListValue___len__(((struct __pyx_obj_7pyarrow_3lib_FixedSizeListValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static Py_ssize_t __pyx_pf_7pyarrow_3lib_18FixedSizeListValue___len__(struct __pyx_obj_7pyarrow_3lib_FixedSizeListValue *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "pyarrow/scalar.pxi":798
 *         Return the number of values.
 *         """
 *         return self.length()             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, i):
 */
  __pyx_r = ((struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeListValue *)__pyx_v_self->__pyx_base.__pyx_vtab)->length(__pyx_v_self);
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":794
 *     """
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of values.
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":800
 *         return self.length()
 * 
 *     def __getitem__(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Return the value at the given index.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18FixedSizeListValue_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18FixedSizeListValue_2__getitem__[] = "\n        Return the value at the given index.\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_18FixedSizeListValue_2__getitem__;
#endif
static PyObject *__pyx_pw_7pyarrow_3lib_18FixedSizeListValue_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_18FixedSizeListValue_2__getitem__(((struct __pyx_obj_7pyarrow_3lib_FixedSizeListValue *)__pyx_v_self), ((PyObject *)__pyx_v_i));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18FixedSizeListValue_2__getitem__(struct __pyx_obj_7pyarrow_3lib_FixedSizeListValue *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "pyarrow/scalar.pxi":804
 *         Return the value at the given index.
 *         """
 *         return self.getitem(_normalize_index(i, self.length()))             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(5, 804, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7pyarrow_3lib__normalize_index(__pyx_t_1, ((struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeListValue *)__pyx_v_self->__pyx_base.__pyx_vtab)->length(__pyx_v_self)); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1L))) __PYX_ERR(5, 804, __pyx_L1_error)
  __pyx_t_3 = ((struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeListValue *)__pyx_v_self->__pyx_base.__pyx_vtab)->getitem(__pyx_v_self, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":800
 *         return self.length()
 * 
 *     def __getitem__(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Return the value at the given index.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.FixedSizeListValue.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pyarrow_3lib_18FixedSizeListValue_6generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/scalar.pxi":806
 *         return self.getitem(_normalize_index(i, self.length()))
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterate over this element's values.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18FixedSizeListValue_5__iter__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18FixedSizeListValue_4__iter__[] = "\n        Iterate over this element's values.\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_18FixedSizeListValue_4__iter__;
#endif
static PyObject *__pyx_pw_7pyarrow_3lib_18FixedSizeListValue_5__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_18FixedSizeListValue_4__iter__(((struct __pyx_obj_7pyarrow_3lib_FixedSizeListValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18FixedSizeListValue_4__iter__(struct __pyx_obj_7pyarrow_3lib_FixedSizeListValue *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8___iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8___iter__ *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_8___iter__(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_8___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8___iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(5, 806, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7pyarrow_3lib_18FixedSizeListValue_6generator6, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_FixedSizeListValue___iter, __pyx_n_s_pyarrow_lib); if (unlikely(!gen)) __PYX_ERR(5, 806, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.FixedSizeListValue.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7pyarrow_3lib_18FixedSizeListValue_6generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8___iter__ *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8___iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(5, 806, __pyx_L1_error)

  /* "pyarrow/scalar.pxi":810
 *         Iterate over this element's values.
 *         """
 *         for i in range(len(self)):             # <<<<<<<<<<<<<<
 *             yield self.getitem(i)
 *         raise StopIteration
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(5, 810, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_cur_scope->__pyx_v_i = __pyx_t_3;

    /* "pyarrow/scalar.pxi":811
 *         """
 *         for i in range(len(self)):
 *             yield self.getitem(i)             # <<<<<<<<<<<<<<
 *         raise StopIteration
 * 
 */
    __pyx_t_4 = ((struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeListValue *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->getitem(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 811, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(5, 811, __pyx_L1_error)
  }

  /* "pyarrow/scalar.pxi":812
 *         for i in range(len(self)):
 *             yield self.getitem(i)
 *         raise StopIteration             # <<<<<<<<<<<<<<
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):
 */
  __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
  __PYX_ERR(5, 812, __pyx_L1_error)
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "pyarrow/scalar.pxi":806
 *         return self.getitem(_normalize_index(i, self.length()))
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterate over this element's values.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":814
 *         raise StopIteration
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):             # <<<<<<<<<<<<<<
 *         self.sp_array = sp_array
 *         self.ap = <CFixedSizeListArray*> sp_array.get()
 */

static void __pyx_f_7pyarrow_3lib_18FixedSizeListValue__set_array(struct __pyx_obj_7pyarrow_3lib_FixedSizeListValue *__pyx_v_self, std::shared_ptr< arrow::Array>  const &__pyx_v_sp_array) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("_set_array", 0);

  /* "pyarrow/scalar.pxi":815
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):
 *         self.sp_array = sp_array             # <<<<<<<<<<<<<<
 *         self.ap = <CFixedSizeListArray*> sp_array.get()
 *         self.value_type = pyarrow_wrap_data_type(self.ap.value_type())
 */
  __pyx_v_self->__pyx_base.sp_array = __pyx_v_sp_array;

  /* "pyarrow/scalar.pxi":816
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):
 *         self.sp_array = sp_array
 *         self.ap = <CFixedSizeListArray*> sp_array.get()             # <<<<<<<<<<<<<<
 *         self.value_type = pyarrow_wrap_data_type(self.ap.value_type())
 * 
 */
  __pyx_v_self->ap = (( arrow::FixedSizeListArray *)__pyx_v_sp_array.get());

  /* "pyarrow/scalar.pxi":817
 *         self.sp_array = sp_array
 *         self.ap = <CFixedSizeListArray*> sp_array.get()
 *         self.value_type = pyarrow_wrap_data_type(self.ap.value_type())             # <<<<<<<<<<<<<<
 * 
 *     cdef getitem(self, int64_t i):
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_self->ap->value_type()); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 817, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(5, 817, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->value_type);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->value_type));
  __pyx_v_self->value_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":814
 *         raise StopIteration
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):             # <<<<<<<<<<<<<<
 *         self.sp_array = sp_array
 *         self.ap = <CFixedSizeListArray*> sp_array.get()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("pyarrow.lib.FixedSizeListValue._set_array", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/scalar.pxi":819
 *         self.value_type = pyarrow_wrap_data_type(self.ap.value_type())
 * 
 *     cdef getitem(self, int64_t i):             # <<<<<<<<<<<<<<
 *         cdef int64_t j = self.ap.value_offset(self.index) + i
 *         return box_scalar(self.value_type, self.ap.values(), j)
 */

static PyObject *__pyx_f_7pyarrow_3lib_18FixedSizeListValue_getitem(struct __pyx_obj_7pyarrow_3lib_FixedSizeListValue *__pyx_v_self, int64_t __pyx_v_i) {
  int64_t __pyx_v_j;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("getitem", 0);

  /* "pyarrow/scalar.pxi":820
 * 
 *     cdef getitem(self, int64_t i):
 *         cdef int64_t j = self.ap.value_offset(self.index) + i             # <<<<<<<<<<<<<<
 *         return box_scalar(self.value_type, self.ap.values(), j)
 * 
 */
  __pyx_v_j = (__pyx_v_self->ap->value_offset(__pyx_v_self->__pyx_base.index) + __pyx_v_i);

  /* "pyarrow/scalar.pxi":821
 *     cdef getitem(self, int64_t i):
 *         cdef int64_t j = self.ap.value_offset(self.index) + i
 *         return box_scalar(self.value_type, self.ap.values(), j)             # <<<<<<<<<<<<<<
 * 
 *     cdef int64_t length(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_v_self->value_type);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_box_scalar(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1), __pyx_v_self->ap->values(), __pyx_v_j); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":819
 *         self.value_type = pyarrow_wrap_data_type(self.ap.value_type())
 * 
 *     cdef getitem(self, int64_t i):             # <<<<<<<<<<<<<<
 *         cdef int64_t j = self.ap.value_offset(self.index) + i
 *         return box_scalar(self.value_type, self.ap.values(), j)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.FixedSizeListValue.getitem", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":823
 *         return box_scalar(self.value_type, self.ap.values(), j)
 * 
 *     cdef int64_t length(self):             # <<<<<<<<<<<<<<
 *         return self.ap.value_length(self.index)
 * 
 */

static int64_t __pyx_f_7pyarrow_3lib_18FixedSizeListValue_length(struct __pyx_obj_7pyarrow_3lib_FixedSizeListValue *__pyx_v_self) {
  int64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("length", 0);

  /* "pyarrow/scalar.pxi":824
 * 
 *     cdef int64_t length(self):
 *         return self.ap.value_length(self.index)             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */
  __pyx_r = __pyx_v_self->ap->value_length(__pyx_v_self->__pyx_base.index);
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":823
 *         return box_scalar(self.value_type, self.ap.values(), j)
 * 
 *     cdef int64_t length(self):             # <<<<<<<<<<<<<<
 *         return self.ap.value_length(self.index)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":826
 *         return self.ap.value_length(self.index)
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python list.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18FixedSizeListValue_8as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18FixedSizeListValue_7as_py[] = "FixedSizeListValue.as_py(self)\n\n        Return this value as a Python list.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_18FixedSizeListValue_8as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_18FixedSizeListValue_7as_py(((struct __pyx_obj_7pyarrow_3lib_FixedSizeListValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18FixedSizeListValue_7as_py(struct __pyx_obj_7pyarrow_3lib_FixedSizeListValue *__pyx_v_self) {
  int64_t __pyx_v_j;
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int64_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":832
 *         cdef:
 *             int64_t j
 *             list result = []             # <<<<<<<<<<<<<<
 * 
 *         for j in range(len(self)):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 832, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":834
 *             list result = []
 * 
 *         for j in range(len(self)):             # <<<<<<<<<<<<<<
 *             result.append(self.getitem(j).as_py())
 * 
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(5, 834, __pyx_L1_error)
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_j = __pyx_t_4;

    /* "pyarrow/scalar.pxi":835
 * 
 *         for j in range(len(self)):
 *             result.append(self.getitem(j).as_py())             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_5 = ((struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeListValue *)__pyx_v_self->__pyx_base.__pyx_vtab)->getitem(__pyx_v_self, __pyx_v_j); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 835, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_as_py); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 835, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 835, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(5, 835, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyarrow/scalar.pxi":837
 *             result.append(self.getitem(j).as_py())
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":826
 *         return self.ap.value_length(self.index)
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python list.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.FixedSizeListValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/lib.pxd":236
 * cdef class FixedSizeListValue(ArrayValue):
 *     cdef readonly:
 *         DataType value_type             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18FixedSizeListValue_10value_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_18FixedSizeListValue_10value_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_18FixedSizeListValue_10value_type___get__(((struct __pyx_obj_7pyarrow_3lib_FixedSizeListValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18FixedSizeListValue_10value_type___get__(struct __pyx_obj_7pyarrow_3lib_FixedSizeListValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->value_type));
  __pyx_r = ((PyObject *)__pyx_v_self->value_type);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18FixedSizeListValue_10__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18FixedSizeListValue_9__reduce_cython__[] = "FixedSizeListValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_18FixedSizeListValue_10__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_18FixedSizeListValue_9__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_FixedSizeListValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18FixedSizeListValue_9__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FixedSizeListValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__104, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FixedSizeListValue.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18FixedSizeListValue_12__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18FixedSizeListValue_11__setstate_cython__[] = "FixedSizeListValue.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_18FixedSizeListValue_12__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_18FixedSizeListValue_11__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_FixedSizeListValue *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18FixedSizeListValue_11__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FixedSizeListValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__105, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FixedSizeListValue.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":845
 *     """
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):             # <<<<<<<<<<<<<<
 *         self.sp_array = sp_array
 *         self.ap = <CUnionArray*> sp_array.get()
 */

static void __pyx_f_7pyarrow_3lib_10UnionValue__set_array(struct __pyx_obj_7pyarrow_3lib_UnionValue *__pyx_v_self, std::shared_ptr< arrow::Array>  const &__pyx_v_sp_array) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_set_array", 0);

  /* "pyarrow/scalar.pxi":846
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):
 *         self.sp_array = sp_array             # <<<<<<<<<<<<<<
 *         self.ap = <CUnionArray*> sp_array.get()
 * 
 */
  __pyx_v_self->__pyx_base.sp_array = __pyx_v_sp_array;

  /* "pyarrow/scalar.pxi":847
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):
 *         self.sp_array = sp_array
 *         self.ap = <CUnionArray*> sp_array.get()             # <<<<<<<<<<<<<<
 * 
 *     cdef getitem(self, int64_t i):
 */
  __pyx_v_self->ap = (( arrow::UnionArray *)__pyx_v_sp_array.get());

  /* "pyarrow/scalar.pxi":845
 *     """
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):             # <<<<<<<<<<<<<<
 *         self.sp_array = sp_array
 *         self.ap = <CUnionArray*> sp_array.get()
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/scalar.pxi":849
 *         self.ap = <CUnionArray*> sp_array.get()
 * 
 *     cdef getitem(self, int64_t i):             # <<<<<<<<<<<<<<
 *         cdef int child_id = self.ap.child_id(i)
 *         cdef shared_ptr[CArray] child = self.ap.child(child_id)
 */

static PyObject *__pyx_f_7pyarrow_3lib_10UnionValue_getitem(struct __pyx_obj_7pyarrow_3lib_UnionValue *__pyx_v_self, int64_t __pyx_v_i) {
  int __pyx_v_child_id;
  std::shared_ptr< arrow::Array>  __pyx_v_child;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("getitem", 0);

  /* "pyarrow/scalar.pxi":850
 * 
 *     cdef getitem(self, int64_t i):
 *         cdef int child_id = self.ap.child_id(i)             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[CArray] child = self.ap.child(child_id)
 *         if self.ap.mode() == _UnionMode_SPARSE:
 */
  __pyx_v_child_id = __pyx_v_self->ap->child_id(__pyx_v_i);

  /* "pyarrow/scalar.pxi":851
 *     cdef getitem(self, int64_t i):
 *         cdef int child_id = self.ap.child_id(i)
 *         cdef shared_ptr[CArray] child = self.ap.child(child_id)             # <<<<<<<<<<<<<<
 *         if self.ap.mode() == _UnionMode_SPARSE:
 *             return box_scalar(self.type[child_id].type, child, i)
 */
  __pyx_v_child = __pyx_v_self->ap->child(__pyx_v_child_id);

  /* "pyarrow/scalar.pxi":852
 *         cdef int child_id = self.ap.child_id(i)
 *         cdef shared_ptr[CArray] child = self.ap.child(child_id)
 *         if self.ap.mode() == _UnionMode_SPARSE:             # <<<<<<<<<<<<<<
 *             return box_scalar(self.type[child_id].type, child, i)
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_self->ap->mode() ==  arrow::UnionMode::SPARSE) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/scalar.pxi":853
 *         cdef shared_ptr[CArray] child = self.ap.child(child_id)
 *         if self.ap.mode() == _UnionMode_SPARSE:
 *             return box_scalar(self.type[child_id].type, child, i)             # <<<<<<<<<<<<<<
 *         else:
 *             return box_scalar(self.type[child_id].type, child,
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.type), __pyx_v_child_id, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 853, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 853, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(5, 853, __pyx_L1_error)
    __pyx_t_2 = __pyx_f_7pyarrow_3lib_box_scalar(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_3), __pyx_v_child, __pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 853, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/scalar.pxi":852
 *         cdef int child_id = self.ap.child_id(i)
 *         cdef shared_ptr[CArray] child = self.ap.child(child_id)
 *         if self.ap.mode() == _UnionMode_SPARSE:             # <<<<<<<<<<<<<<
 *             return box_scalar(self.type[child_id].type, child, i)
 *         else:
 */
  }

  /* "pyarrow/scalar.pxi":855
 *             return box_scalar(self.type[child_id].type, child, i)
 *         else:
 *             return box_scalar(self.type[child_id].type, child,             # <<<<<<<<<<<<<<
 *                               self.ap.value_offset(i))
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.type), __pyx_v_child_id, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 855, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 855, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(5, 855, __pyx_L1_error)

    /* "pyarrow/scalar.pxi":856
 *         else:
 *             return box_scalar(self.type[child_id].type, child,
 *                               self.ap.value_offset(i))             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */
    __pyx_t_2 = __pyx_f_7pyarrow_3lib_box_scalar(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_3), __pyx_v_child, __pyx_v_self->ap->value_offset(__pyx_v_i)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 855, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/scalar.pxi":849
 *         self.ap = <CUnionArray*> sp_array.get()
 * 
 *     cdef getitem(self, int64_t i):             # <<<<<<<<<<<<<<
 *         cdef int child_id = self.ap.child_id(i)
 *         cdef shared_ptr[CArray] child = self.ap.child(child_id)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.UnionValue.getitem", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":858
 *                               self.ap.value_offset(i))
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python object.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10UnionValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10UnionValue_as_py[] = "UnionValue.as_py(self)\n\n        Return this value as a Python object.\n\n        The exact type depends on the underlying union member.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10UnionValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10UnionValue_as_py(((struct __pyx_obj_7pyarrow_3lib_UnionValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10UnionValue_as_py(struct __pyx_obj_7pyarrow_3lib_UnionValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":864
 *         The exact type depends on the underlying union member.
 *         """
 *         return self.getitem(self.index).as_py()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_3lib_UnionValue *)__pyx_v_self->__pyx_base.__pyx_vtab)->getitem(__pyx_v_self, __pyx_v_self->__pyx_base.index); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 864, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_as_py); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 864, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 864, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":858
 *                               self.ap.value_offset(i))
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python object.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.UnionValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10UnionValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10UnionValue_2__reduce_cython__[] = "UnionValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10UnionValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10UnionValue_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_UnionValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10UnionValue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UnionValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__106, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UnionValue.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10UnionValue_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10UnionValue_4__setstate_cython__[] = "UnionValue.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_10UnionValue_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10UnionValue_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_UnionValue *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10UnionValue_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UnionValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__107, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UnionValue.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":872
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python bytes object.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20FixedSizeBinaryValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20FixedSizeBinaryValue_as_py[] = "FixedSizeBinaryValue.as_py(self)\n\n        Return this value as a Python bytes object.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_20FixedSizeBinaryValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_20FixedSizeBinaryValue_as_py(((struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20FixedSizeBinaryValue_as_py(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryValue *__pyx_v_self) {
   arrow::FixedSizeBinaryArray *__pyx_v_ap;
   arrow::FixedSizeBinaryType *__pyx_v_ap_type;
  int32_t __pyx_v_length;
  char const *__pyx_v_data;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":881
 *             int32_t length
 *             const char* data
 *         ap = <CFixedSizeBinaryArray*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         ap_type = <CFixedSizeBinaryType*> ap.type().get()
 *         length = ap_type.byte_width()
 */
  __pyx_v_ap = (( arrow::FixedSizeBinaryArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":882
 *             const char* data
 *         ap = <CFixedSizeBinaryArray*> self.sp_array.get()
 *         ap_type = <CFixedSizeBinaryType*> ap.type().get()             # <<<<<<<<<<<<<<
 *         length = ap_type.byte_width()
 *         data = <const char*> ap.GetValue(self.index)
 */
  __pyx_v_ap_type = (( arrow::FixedSizeBinaryType *)__pyx_v_ap->type().get());

  /* "pyarrow/scalar.pxi":883
 *         ap = <CFixedSizeBinaryArray*> self.sp_array.get()
 *         ap_type = <CFixedSizeBinaryType*> ap.type().get()
 *         length = ap_type.byte_width()             # <<<<<<<<<<<<<<
 *         data = <const char*> ap.GetValue(self.index)
 *         return cp.PyBytes_FromStringAndSize(data, length)
 */
  __pyx_v_length = __pyx_v_ap_type->byte_width();

  /* "pyarrow/scalar.pxi":884
 *         ap_type = <CFixedSizeBinaryType*> ap.type().get()
 *         length = ap_type.byte_width()
 *         data = <const char*> ap.GetValue(self.index)             # <<<<<<<<<<<<<<
 *         return cp.PyBytes_FromStringAndSize(data, length)
 * 
 */
  __pyx_v_data = ((char const *)__pyx_v_ap->GetValue(__pyx_v_self->__pyx_base.index));

  /* "pyarrow/scalar.pxi":885
 *         length = ap_type.byte_width()
 *         data = <const char*> ap.GetValue(self.index)
 *         return cp.PyBytes_FromStringAndSize(data, length)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_FromStringAndSize(__pyx_v_data, __pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 885, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":872
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python bytes object.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FixedSizeBinaryValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20FixedSizeBinaryValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20FixedSizeBinaryValue_2__reduce_cython__[] = "FixedSizeBinaryValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_20FixedSizeBinaryValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_20FixedSizeBinaryValue_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20FixedSizeBinaryValue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__108, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FixedSizeBinaryValue.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20FixedSizeBinaryValue_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20FixedSizeBinaryValue_4__setstate_cython__[] = "FixedSizeBinaryValue.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_20FixedSizeBinaryValue_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_20FixedSizeBinaryValue_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryValue *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20FixedSizeBinaryValue_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__109, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FixedSizeBinaryValue.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":893
 *     """
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):             # <<<<<<<<<<<<<<
 *         self.sp_array = sp_array
 *         self.ap = <CStructArray*> sp_array.get()
 */

static void __pyx_f_7pyarrow_3lib_11StructValue__set_array(struct __pyx_obj_7pyarrow_3lib_StructValue *__pyx_v_self, std::shared_ptr< arrow::Array>  const &__pyx_v_sp_array) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_set_array", 0);

  /* "pyarrow/scalar.pxi":894
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):
 *         self.sp_array = sp_array             # <<<<<<<<<<<<<<
 *         self.ap = <CStructArray*> sp_array.get()
 * 
 */
  __pyx_v_self->__pyx_base.sp_array = __pyx_v_sp_array;

  /* "pyarrow/scalar.pxi":895
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):
 *         self.sp_array = sp_array
 *         self.ap = <CStructArray*> sp_array.get()             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, key):
 */
  __pyx_v_self->ap = (( arrow::StructArray *)__pyx_v_sp_array.get());

  /* "pyarrow/scalar.pxi":893
 *     """
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):             # <<<<<<<<<<<<<<
 *         self.sp_array = sp_array
 *         self.ap = <CStructArray*> sp_array.get()
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/scalar.pxi":897
 *         self.ap = <CStructArray*> sp_array.get()
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         """
 *         Return the child value for the given field name.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11StructValue_1__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11StructValue___getitem__[] = "\n        Return the child value for the given field name.\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_11StructValue___getitem__;
#endif
static PyObject *__pyx_pw_7pyarrow_3lib_11StructValue_1__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11StructValue___getitem__(((struct __pyx_obj_7pyarrow_3lib_StructValue *)__pyx_v_self), ((PyObject *)__pyx_v_key));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11StructValue___getitem__(struct __pyx_obj_7pyarrow_3lib_StructValue *__pyx_v_self, PyObject *__pyx_v_key) {
   arrow::StructType *__pyx_v_type;
  int __pyx_v_index;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "pyarrow/scalar.pxi":905
 *             int index
 * 
 *         type = <CStructType*> self.type.type             # <<<<<<<<<<<<<<
 *         index = type.GetFieldIndex(tobytes(key))
 * 
 */
  __pyx_v_type = (( arrow::StructType *)__pyx_v_self->__pyx_base.__pyx_base.type->type);

  /* "pyarrow/scalar.pxi":906
 * 
 *         type = <CStructType*> self.type.type
 *         index = type.GetFieldIndex(tobytes(key))             # <<<<<<<<<<<<<<
 * 
 *         if index < 0:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 906, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 906, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 906, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_index = __pyx_v_type->GetFieldIndex(__pyx_t_4);

  /* "pyarrow/scalar.pxi":908
 *         index = type.GetFieldIndex(tobytes(key))
 * 
 *         if index < 0:             # <<<<<<<<<<<<<<
 *             raise KeyError(key)
 * 
 */
  __pyx_t_5 = ((__pyx_v_index < 0) != 0);
  if (unlikely(__pyx_t_5)) {

    /* "pyarrow/scalar.pxi":909
 * 
 *         if index < 0:
 *             raise KeyError(key)             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_array(self.ap.field(index))[self.index]
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 909, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(5, 909, __pyx_L1_error)

    /* "pyarrow/scalar.pxi":908
 *         index = type.GetFieldIndex(tobytes(key))
 * 
 *         if index < 0:             # <<<<<<<<<<<<<<
 *             raise KeyError(key)
 * 
 */
  }

  /* "pyarrow/scalar.pxi":911
 *             raise KeyError(key)
 * 
 *         return pyarrow_wrap_array(self.ap.field(index))[self.index]             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_self->ap->field(__pyx_v_index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_self->__pyx_base.index, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":897
 *         self.ap = <CStructArray*> sp_array.get()
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         """
 *         Return the child value for the given field name.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.StructValue.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":913
 *         return pyarrow_wrap_array(self.ap.field(index))[self.index]
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python dict.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11StructValue_3as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11StructValue_2as_py[] = "StructValue.as_py(self)\n\n        Return this value as a Python dict.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11StructValue_3as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11StructValue_2as_py(((struct __pyx_obj_7pyarrow_3lib_StructValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11StructValue_2as_py(struct __pyx_obj_7pyarrow_3lib_StructValue *__pyx_v_self) {
  std::vector<std::shared_ptr< arrow::Field> >  __pyx_v_child_fields;
  PyObject *__pyx_v_wrapped_arrays = NULL;
  PyObject *__pyx_v_child_names = NULL;
  int __pyx_8genexpr2__pyx_v_i;
  std::shared_ptr< arrow::Field>  __pyx_8genexpr3__pyx_v_child;
  PyObject *__pyx_8genexpr4__pyx_v_name = NULL;
  PyObject *__pyx_8genexpr4__pyx_v_child_array = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  std::vector<std::shared_ptr< arrow::Field> > ::iterator __pyx_t_6;
  std::shared_ptr< arrow::Field>  __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *(*__pyx_t_14)(PyObject *);
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":918
 *         """
 *         cdef:
 *             vector[shared_ptr[CField]] child_fields = self.type.type.children()             # <<<<<<<<<<<<<<
 * 
 *         wrapped_arrays = [pyarrow_wrap_array(self.ap.field(i))
 */
  __pyx_v_child_fields = __pyx_v_self->__pyx_base.__pyx_base.type->type->children();

  /* "pyarrow/scalar.pxi":920
 *             vector[shared_ptr[CField]] child_fields = self.type.type.children()
 * 
 *         wrapped_arrays = [pyarrow_wrap_array(self.ap.field(i))             # <<<<<<<<<<<<<<
 *                           for i in range(self.ap.num_fields())]
 *         child_names = [child.get().name() for child in child_fields]
 */
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 920, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "pyarrow/scalar.pxi":921
 * 
 *         wrapped_arrays = [pyarrow_wrap_array(self.ap.field(i))
 *                           for i in range(self.ap.num_fields())]             # <<<<<<<<<<<<<<
 *         child_names = [child.get().name() for child in child_fields]
 *         # Return the struct as a dict
 */
    __pyx_t_2 = __pyx_v_self->ap->num_fields();
    __pyx_t_3 = __pyx_t_2;
    for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
      __pyx_8genexpr2__pyx_v_i = __pyx_t_4;

      /* "pyarrow/scalar.pxi":920
 *             vector[shared_ptr[CField]] child_fields = self.type.type.children()
 * 
 *         wrapped_arrays = [pyarrow_wrap_array(self.ap.field(i))             # <<<<<<<<<<<<<<
 *                           for i in range(self.ap.num_fields())]
 *         child_names = [child.get().name() for child in child_fields]
 */
      __pyx_t_5 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_self->ap->field(__pyx_8genexpr2__pyx_v_i)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(5, 920, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  } /* exit inner scope */
  __pyx_v_wrapped_arrays = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":922
 *         wrapped_arrays = [pyarrow_wrap_array(self.ap.field(i))
 *                           for i in range(self.ap.num_fields())]
 *         child_names = [child.get().name() for child in child_fields]             # <<<<<<<<<<<<<<
 *         # Return the struct as a dict
 *         return {
 */
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 922, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __pyx_v_child_fields.begin();
    for (;;) {
      if (!(__pyx_t_6 != __pyx_v_child_fields.end())) break;
      __pyx_t_7 = *__pyx_t_6;
      ++__pyx_t_6;
      __pyx_8genexpr3__pyx_v_child = __pyx_t_7;
      __pyx_t_5 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_8genexpr3__pyx_v_child.get()->name()); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 922, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(5, 922, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  } /* exit inner scope */
  __pyx_v_child_names = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":924
 *         child_names = [child.get().name() for child in child_fields]
 *         # Return the struct as a dict
 *         return {             # <<<<<<<<<<<<<<
 *             frombytes(name): child_array[self.index].as_py()
 *             for name, child_array in
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 924, __pyx_L9_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "pyarrow/scalar.pxi":927
 *             frombytes(name): child_array[self.index].as_py()
 *             for name, child_array in
 *             zip(child_names, wrapped_arrays)             # <<<<<<<<<<<<<<
 *         }
 * 
 */
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 927, __pyx_L9_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_child_names);
    __Pyx_GIVEREF(__pyx_v_child_names);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_child_names);
    __Pyx_INCREF(__pyx_v_wrapped_arrays);
    __Pyx_GIVEREF(__pyx_v_wrapped_arrays);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_wrapped_arrays);
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_5, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 927, __pyx_L9_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
      __pyx_t_5 = __pyx_t_8; __Pyx_INCREF(__pyx_t_5); __pyx_t_9 = 0;
      __pyx_t_10 = NULL;
    } else {
      __pyx_t_9 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 927, __pyx_L9_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_10 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 927, __pyx_L9_error)
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    for (;;) {
      if (likely(!__pyx_t_10)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(5, 927, __pyx_L9_error)
          #else
          __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 927, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        } else {
          if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(5, 927, __pyx_L9_error)
          #else
          __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 927, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        }
      } else {
        __pyx_t_8 = __pyx_t_10(__pyx_t_5);
        if (unlikely(!__pyx_t_8)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(5, 927, __pyx_L9_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_8);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) {
        PyObject* sequence = __pyx_t_8;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(5, 926, __pyx_L9_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_11 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_12 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_11 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_12 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_12);
        #else
        __pyx_t_11 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 926, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(5, 926, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_12);
        #endif
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_13 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_13)) __PYX_ERR(5, 926, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext;
        index = 0; __pyx_t_11 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_11)) goto __pyx_L12_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_11);
        index = 1; __pyx_t_12 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_12)) goto __pyx_L12_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_12);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) __PYX_ERR(5, 926, __pyx_L9_error)
        __pyx_t_14 = NULL;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        goto __pyx_L13_unpacking_done;
        __pyx_L12_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_14 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(5, 926, __pyx_L9_error)
        __pyx_L13_unpacking_done:;
      }

      /* "pyarrow/scalar.pxi":926
 *         return {
 *             frombytes(name): child_array[self.index].as_py()
 *             for name, child_array in             # <<<<<<<<<<<<<<
 *             zip(child_names, wrapped_arrays)
 *         }
 */
      __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_name, __pyx_t_11);
      __pyx_t_11 = 0;
      __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_child_array, __pyx_t_12);
      __pyx_t_12 = 0;

      /* "pyarrow/scalar.pxi":925
 *         # Return the struct as a dict
 *         return {
 *             frombytes(name): child_array[self.index].as_py()             # <<<<<<<<<<<<<<
 *             for name, child_array in
 *             zip(child_names, wrapped_arrays)
 */
      __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_12)) __PYX_ERR(5, 925, __pyx_L9_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_11 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_12, function);
        }
      }
      __pyx_t_8 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_11, __pyx_8genexpr4__pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_8genexpr4__pyx_v_name);
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 925, __pyx_L9_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_11 = __Pyx_GetItemInt(__pyx_8genexpr4__pyx_v_child_array, __pyx_v_self->__pyx_base.index, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 925, __pyx_L9_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_as_py); if (unlikely(!__pyx_t_13)) __PYX_ERR(5, 925, __pyx_L9_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_13);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_13, function);
        }
      }
      __pyx_t_12 = (__pyx_t_11) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_11) : __Pyx_PyObject_CallNoArg(__pyx_t_13);
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_12)) __PYX_ERR(5, 925, __pyx_L9_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_t_8, (PyObject*)__pyx_t_12))) __PYX_ERR(5, 925, __pyx_L9_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

      /* "pyarrow/scalar.pxi":926
 *         return {
 *             frombytes(name): child_array[self.index].as_py()
 *             for name, child_array in             # <<<<<<<<<<<<<<
 *             zip(child_names, wrapped_arrays)
 *         }
 */
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_child_array); __pyx_8genexpr4__pyx_v_child_array = 0;
    __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_name); __pyx_8genexpr4__pyx_v_name = 0;
    goto __pyx_L14_exit_scope;
    __pyx_L9_error:;
    __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_child_array); __pyx_8genexpr4__pyx_v_child_array = 0;
    __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_name); __pyx_8genexpr4__pyx_v_name = 0;
    goto __pyx_L1_error;
    __pyx_L14_exit_scope:;
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":913
 *         return pyarrow_wrap_array(self.ap.field(index))[self.index]
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python dict.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("pyarrow.lib.StructValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_wrapped_arrays);
  __Pyx_XDECREF(__pyx_v_child_names);
  __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_name);
  __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_child_array);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11StructValue_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11StructValue_4__reduce_cython__[] = "StructValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11StructValue_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11StructValue_4__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_StructValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11StructValue_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_StructValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__110, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.StructValue.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11StructValue_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11StructValue_6__setstate_cython__[] = "StructValue.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11StructValue_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11StructValue_6__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_StructValue *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11StructValue_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_StructValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__111, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.StructValue.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":936
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python object.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15DictionaryValue_as_py[] = "DictionaryValue.as_py(self)\n\n        Return this value as a Python object.\n\n        The exact type depends on the dictionary value type.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryValue_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15DictionaryValue_as_py(((struct __pyx_obj_7pyarrow_3lib_DictionaryValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15DictionaryValue_as_py(struct __pyx_obj_7pyarrow_3lib_DictionaryValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":942
 *         The exact type depends on the dictionary value type.
 *         """
 *         return self.dictionary_value.as_py()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dictionary_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 942, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_as_py); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 942, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 942, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":936
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python object.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.DictionaryValue.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":945
 * 
 *     @property
 *     def index_value(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value's underlying index as a ArrayValue of the right
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryValue_11index_value_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryValue_11index_value_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15DictionaryValue_11index_value___get__(((struct __pyx_obj_7pyarrow_3lib_DictionaryValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15DictionaryValue_11index_value___get__(struct __pyx_obj_7pyarrow_3lib_DictionaryValue *__pyx_v_self) {
   arrow::DictionaryArray *__pyx_v_darr;
  PyObject *__pyx_v_indices = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/scalar.pxi":950
 *         signed integer type.
 *         """
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.sp_array.get())             # <<<<<<<<<<<<<<
 *         indices = pyarrow_wrap_array(darr.indices())
 *         return indices[self.index]
 */
  __pyx_v_darr = (( arrow::DictionaryArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":951
 *         """
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.sp_array.get())
 *         indices = pyarrow_wrap_array(darr.indices())             # <<<<<<<<<<<<<<
 *         return indices[self.index]
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_darr->indices()); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 951, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_indices = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":952
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.sp_array.get())
 *         indices = pyarrow_wrap_array(darr.indices())
 *         return indices[self.index]             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_indices, __pyx_v_self->__pyx_base.index, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":945
 * 
 *     @property
 *     def index_value(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value's underlying index as a ArrayValue of the right
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DictionaryValue.index_value.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_indices);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":955
 * 
 *     @property
 *     def dictionary_value(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value's underlying dictionary value as a ArrayValue.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryValue_16dictionary_value_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryValue_16dictionary_value_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15DictionaryValue_16dictionary_value___get__(((struct __pyx_obj_7pyarrow_3lib_DictionaryValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15DictionaryValue_16dictionary_value___get__(struct __pyx_obj_7pyarrow_3lib_DictionaryValue *__pyx_v_self) {
   arrow::DictionaryArray *__pyx_v_darr;
  PyObject *__pyx_v_dictionary = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/scalar.pxi":959
 *         Return this value's underlying dictionary value as a ArrayValue.
 *         """
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.sp_array.get())             # <<<<<<<<<<<<<<
 *         dictionary = pyarrow_wrap_array(darr.dictionary())
 *         return dictionary[self.index_value.as_py()]
 */
  __pyx_v_darr = (( arrow::DictionaryArray *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":960
 *         """
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.sp_array.get())
 *         dictionary = pyarrow_wrap_array(darr.dictionary())             # <<<<<<<<<<<<<<
 *         return dictionary[self.index_value.as_py()]
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_darr->dictionary()); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 960, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_dictionary = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":961
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.sp_array.get())
 *         dictionary = pyarrow_wrap_array(darr.dictionary())
 *         return dictionary[self.index_value.as_py()]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_index_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 961, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_as_py); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 961, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 961, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_dictionary, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 961, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":955
 * 
 *     @property
 *     def dictionary_value(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value's underlying dictionary value as a ArrayValue.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.DictionaryValue.dictionary_value.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dictionary);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15DictionaryValue_2__reduce_cython__[] = "DictionaryValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryValue_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15DictionaryValue_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_DictionaryValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15DictionaryValue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DictionaryValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__112, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DictionaryValue.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryValue_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15DictionaryValue_4__setstate_cython__[] = "DictionaryValue.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryValue_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15DictionaryValue_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_DictionaryValue *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15DictionaryValue_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DictionaryValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__113, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DictionaryValue.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":1003
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly."
 *                         .format(self.__class__.__name__))
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_11ScalarValue_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_11ScalarValue_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_11ScalarValue___init__(((struct __pyx_obj_7pyarrow_3lib_ScalarValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_11ScalarValue___init__(struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/scalar.pxi":1005
 *     def __init__(self):
 *         raise TypeError("Do not call {}'s constructor directly."
 *                         .format(self.__class__.__name__))             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CScalar]& sp_scalar):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Do_not_call_s_constructor_direct_6, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1005, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1005, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1005, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1005, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/scalar.pxi":1004
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call {}'s constructor directly."             # <<<<<<<<<<<<<<
 *                         .format(self.__class__.__name__))
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1004, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __PYX_ERR(5, 1004, __pyx_L1_error)

  /* "pyarrow/scalar.pxi":1003
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly."
 *                         .format(self.__class__.__name__))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.ScalarValue.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":1007
 *                         .format(self.__class__.__name__))
 * 
 *     cdef void init(self, const shared_ptr[CScalar]& sp_scalar):             # <<<<<<<<<<<<<<
 *         self.sp_scalar = sp_scalar
 * 
 */

static void __pyx_f_7pyarrow_3lib_11ScalarValue_init(struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self, std::shared_ptr< arrow::Scalar>  const &__pyx_v_sp_scalar) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/scalar.pxi":1008
 * 
 *     cdef void init(self, const shared_ptr[CScalar]& sp_scalar):
 *         self.sp_scalar = sp_scalar             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __pyx_v_self->sp_scalar = __pyx_v_sp_scalar;

  /* "pyarrow/scalar.pxi":1007
 *                         .format(self.__class__.__name__))
 * 
 *     cdef void init(self, const shared_ptr[CScalar]& sp_scalar):             # <<<<<<<<<<<<<<
 *         self.sp_scalar = sp_scalar
 * 
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/scalar.pxi":1010
 *         self.sp_scalar = sp_scalar
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if hasattr(self, 'as_py'):
 *             return repr(self.as_py())
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11ScalarValue_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_11ScalarValue_3__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11ScalarValue_2__repr__(((struct __pyx_obj_7pyarrow_3lib_ScalarValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11ScalarValue_2__repr__(struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pyarrow/scalar.pxi":1011
 * 
 *     def __repr__(self):
 *         if hasattr(self, 'as_py'):             # <<<<<<<<<<<<<<
 *             return repr(self.as_py())
 *         else:
 */
  __pyx_t_1 = __Pyx_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_u_as_py); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 1011, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/scalar.pxi":1012
 *     def __repr__(self):
 *         if hasattr(self, 'as_py'):
 *             return repr(self.as_py())             # <<<<<<<<<<<<<<
 *         else:
 *             return super(Scalar, self).__repr__()
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_as_py); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1012, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1012, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Repr(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1012, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "pyarrow/scalar.pxi":1011
 * 
 *     def __repr__(self):
 *         if hasattr(self, 'as_py'):             # <<<<<<<<<<<<<<
 *             return repr(self.as_py())
 *         else:
 */
  }

  /* "pyarrow/scalar.pxi":1014
 *             return repr(self.as_py())
 *         else:
 *             return super(Scalar, self).__repr__()             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1014, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)__pyx_ptype_7pyarrow_3lib_Scalar));
    __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7pyarrow_3lib_Scalar));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Scalar));
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_self));
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1014, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_repr); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1014, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1014, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/scalar.pxi":1010
 *         self.sp_scalar = sp_scalar
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if hasattr(self, 'as_py'):
 *             return repr(self.as_py())
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.ScalarValue.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":1016
 *             return super(Scalar, self).__repr__()
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         if hasattr(self, 'as_py'):
 *             return str(self.as_py())
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11ScalarValue_5__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_11ScalarValue_5__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11ScalarValue_4__str__(((struct __pyx_obj_7pyarrow_3lib_ScalarValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11ScalarValue_4__str__(struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "pyarrow/scalar.pxi":1017
 * 
 *     def __str__(self):
 *         if hasattr(self, 'as_py'):             # <<<<<<<<<<<<<<
 *             return str(self.as_py())
 *         else:
 */
  __pyx_t_1 = __Pyx_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_u_as_py); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 1017, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/scalar.pxi":1018
 *     def __str__(self):
 *         if hasattr(self, 'as_py'):
 *             return str(self.as_py())             # <<<<<<<<<<<<<<
 *         else:
 *             return super(Scalar, self).__str__()
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_as_py); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1018, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1018, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1018, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "pyarrow/scalar.pxi":1017
 * 
 *     def __str__(self):
 *         if hasattr(self, 'as_py'):             # <<<<<<<<<<<<<<
 *             return str(self.as_py())
 *         else:
 */
  }

  /* "pyarrow/scalar.pxi":1020
 *             return str(self.as_py())
 *         else:
 *             return super(Scalar, self).__str__()             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, other):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1020, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)__pyx_ptype_7pyarrow_3lib_Scalar));
    __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7pyarrow_3lib_Scalar));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Scalar));
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_self));
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1020, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_str); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1020, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1020, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/scalar.pxi":1016
 *             return super(Scalar, self).__repr__()
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         if hasattr(self, 'as_py'):
 *             return str(self.as_py())
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.ScalarValue.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":1022
 *             return super(Scalar, self).__str__()
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         if hasattr(self, 'as_py'):
 *             if isinstance(other, ScalarValue):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11ScalarValue_7__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_11ScalarValue_7__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11ScalarValue_6__eq__(((struct __pyx_obj_7pyarrow_3lib_ScalarValue *)__pyx_v_self), ((PyObject *)__pyx_v_other));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11ScalarValue_6__eq__(struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__eq__", 0);
  __Pyx_INCREF(__pyx_v_other);

  /* "pyarrow/scalar.pxi":1023
 * 
 *     def __eq__(self, other):
 *         if hasattr(self, 'as_py'):             # <<<<<<<<<<<<<<
 *             if isinstance(other, ScalarValue):
 *                 other = other.as_py()
 */
  __pyx_t_1 = __Pyx_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_u_as_py); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 1023, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (likely(__pyx_t_2)) {

    /* "pyarrow/scalar.pxi":1024
 *     def __eq__(self, other):
 *         if hasattr(self, 'as_py'):
 *             if isinstance(other, ScalarValue):             # <<<<<<<<<<<<<<
 *                 other = other.as_py()
 *             return self.as_py() == other
 */
    __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_7pyarrow_3lib_ScalarValue); 
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "pyarrow/scalar.pxi":1025
 *         if hasattr(self, 'as_py'):
 *             if isinstance(other, ScalarValue):
 *                 other = other.as_py()             # <<<<<<<<<<<<<<
 *             return self.as_py() == other
 *         else:
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_as_py); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1025, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1025, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "pyarrow/scalar.pxi":1024
 *     def __eq__(self, other):
 *         if hasattr(self, 'as_py'):
 *             if isinstance(other, ScalarValue):             # <<<<<<<<<<<<<<
 *                 other = other.as_py()
 *             return self.as_py() == other
 */
    }

    /* "pyarrow/scalar.pxi":1026
 *             if isinstance(other, ScalarValue):
 *                 other = other.as_py()
 *             return self.as_py() == other             # <<<<<<<<<<<<<<
 *         else:
 *             raise NotImplemented(
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_as_py); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1026, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1026, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_other, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1026, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "pyarrow/scalar.pxi":1023
 * 
 *     def __eq__(self, other):
 *         if hasattr(self, 'as_py'):             # <<<<<<<<<<<<<<
 *             if isinstance(other, ScalarValue):
 *                 other = other.as_py()
 */
  }

  /* "pyarrow/scalar.pxi":1028
 *             return self.as_py() == other
 *         else:
 *             raise NotImplemented(             # <<<<<<<<<<<<<<
 *                 "Cannot compare scalars that don't support as_py()")
 * 
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_NotImplemented, __pyx_tuple__114, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1028, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(5, 1028, __pyx_L1_error)
  }

  /* "pyarrow/scalar.pxi":1022
 *             return super(Scalar, self).__str__()
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         if hasattr(self, 'as_py'):
 *             if isinstance(other, ScalarValue):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.ScalarValue.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_other);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":1031
 *                 "Cannot compare scalars that don't support as_py()")
 * 
 *     def __hash__(self):             # <<<<<<<<<<<<<<
 *         return hash(self.as_py())
 * 
 */

/* Python wrapper */
static Py_hash_t __pyx_pw_7pyarrow_3lib_11ScalarValue_9__hash__(PyObject *__pyx_v_self); /*proto*/
static Py_hash_t __pyx_pw_7pyarrow_3lib_11ScalarValue_9__hash__(PyObject *__pyx_v_self) {
  Py_hash_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11ScalarValue_8__hash__(((struct __pyx_obj_7pyarrow_3lib_ScalarValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static Py_hash_t __pyx_pf_7pyarrow_3lib_11ScalarValue_8__hash__(struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self) {
  Py_hash_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_hash_t __pyx_t_4;
  __Pyx_RefNannySetupContext("__hash__", 0);

  /* "pyarrow/scalar.pxi":1032
 * 
 *     def __hash__(self):
 *         return hash(self.as_py())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_as_py); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1032, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1032, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_4 == ((Py_hash_t)-1))) __PYX_ERR(5, 1032, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":1031
 *                 "Cannot compare scalars that don't support as_py()")
 * 
 *     def __hash__(self):             # <<<<<<<<<<<<<<
 *         return hash(self.as_py())
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.ScalarValue.__hash__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11ScalarValue_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11ScalarValue_10__reduce_cython__[] = "ScalarValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11ScalarValue_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11ScalarValue_10__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_ScalarValue *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11ScalarValue_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__115, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.ScalarValue.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11ScalarValue_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11ScalarValue_12__setstate_cython__[] = "ScalarValue.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11ScalarValue_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11ScalarValue_12__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_ScalarValue *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11ScalarValue_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__116, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.ScalarValue.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":1040
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt8Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11UInt8Scalar_as_py[] = "UInt8Scalar.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt8Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11UInt8Scalar_as_py(((struct __pyx_obj_7pyarrow_3lib_UInt8Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11UInt8Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_UInt8Scalar *__pyx_v_self) {
   arrow::UInt8Scalar *__pyx_v_sp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":1044
 *         Return this value as a Python int.
 *         """
 *         cdef CUInt8Scalar* sp = <CUInt8Scalar*> self.sp_scalar.get()             # <<<<<<<<<<<<<<
 *         return sp.value if sp.is_valid else None
 * 
 */
  __pyx_v_sp = (( arrow::UInt8Scalar *)__pyx_v_self->__pyx_base.sp_scalar.get());

  /* "pyarrow/scalar.pxi":1045
 *         """
 *         cdef CUInt8Scalar* sp = <CUInt8Scalar*> self.sp_scalar.get()
 *         return sp.value if sp.is_valid else None             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  if ((__pyx_v_sp->is_valid != 0)) {
    __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_sp->value); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1045, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(Py_None);
    __pyx_t_1 = Py_None;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":1040
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.UInt8Scalar.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt8Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11UInt8Scalar_2__reduce_cython__[] = "UInt8Scalar.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt8Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11UInt8Scalar_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt8Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11UInt8Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt8Scalar *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__117, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt8Scalar.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt8Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11UInt8Scalar_4__setstate_cython__[] = "UInt8Scalar.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11UInt8Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11UInt8Scalar_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt8Scalar *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11UInt8Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt8Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__118, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt8Scalar.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":1053
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10Int8Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10Int8Scalar_as_py[] = "Int8Scalar.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10Int8Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10Int8Scalar_as_py(((struct __pyx_obj_7pyarrow_3lib_Int8Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10Int8Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_Int8Scalar *__pyx_v_self) {
   arrow::Int8Scalar *__pyx_v_sp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":1057
 *         Return this value as a Python int.
 *         """
 *         cdef CInt8Scalar* sp = <CInt8Scalar*> self.sp_scalar.get()             # <<<<<<<<<<<<<<
 *         return sp.value if sp.is_valid else None
 * 
 */
  __pyx_v_sp = (( arrow::Int8Scalar *)__pyx_v_self->__pyx_base.sp_scalar.get());

  /* "pyarrow/scalar.pxi":1058
 *         """
 *         cdef CInt8Scalar* sp = <CInt8Scalar*> self.sp_scalar.get()
 *         return sp.value if sp.is_valid else None             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  if ((__pyx_v_sp->is_valid != 0)) {
    __pyx_t_2 = __Pyx_PyInt_From_int8_t(__pyx_v_sp->value); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1058, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(Py_None);
    __pyx_t_1 = Py_None;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":1053
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Int8Scalar.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10Int8Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10Int8Scalar_2__reduce_cython__[] = "Int8Scalar.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10Int8Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10Int8Scalar_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_Int8Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10Int8Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int8Scalar *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__119, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int8Scalar.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10Int8Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10Int8Scalar_4__setstate_cython__[] = "Int8Scalar.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_10Int8Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10Int8Scalar_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_Int8Scalar *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10Int8Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int8Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__120, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int8Scalar.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":1066
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt16Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12UInt16Scalar_as_py[] = "UInt16Scalar.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt16Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12UInt16Scalar_as_py(((struct __pyx_obj_7pyarrow_3lib_UInt16Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12UInt16Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_UInt16Scalar *__pyx_v_self) {
   arrow::UInt16Scalar *__pyx_v_sp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":1070
 *         Return this value as a Python int.
 *         """
 *         cdef CUInt16Scalar* sp = <CUInt16Scalar*> self.sp_scalar.get()             # <<<<<<<<<<<<<<
 *         return sp.value if sp.is_valid else None
 * 
 */
  __pyx_v_sp = (( arrow::UInt16Scalar *)__pyx_v_self->__pyx_base.sp_scalar.get());

  /* "pyarrow/scalar.pxi":1071
 *         """
 *         cdef CUInt16Scalar* sp = <CUInt16Scalar*> self.sp_scalar.get()
 *         return sp.value if sp.is_valid else None             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  if ((__pyx_v_sp->is_valid != 0)) {
    __pyx_t_2 = __Pyx_PyInt_From_uint16_t(__pyx_v_sp->value); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1071, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(Py_None);
    __pyx_t_1 = Py_None;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":1066
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.UInt16Scalar.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt16Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12UInt16Scalar_2__reduce_cython__[] = "UInt16Scalar.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt16Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12UInt16Scalar_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt16Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12UInt16Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt16Scalar *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__121, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt16Scalar.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt16Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12UInt16Scalar_4__setstate_cython__[] = "UInt16Scalar.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt16Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12UInt16Scalar_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt16Scalar *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12UInt16Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt16Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__122, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt16Scalar.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":1079
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Int16Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Int16Scalar_as_py[] = "Int16Scalar.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11Int16Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Int16Scalar_as_py(((struct __pyx_obj_7pyarrow_3lib_Int16Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Int16Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_Int16Scalar *__pyx_v_self) {
   arrow::Int16Scalar *__pyx_v_sp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":1083
 *         Return this value as a Python int.
 *         """
 *         cdef CInt16Scalar* sp = <CInt16Scalar*> self.sp_scalar.get()             # <<<<<<<<<<<<<<
 *         return sp.value if sp.is_valid else None
 * 
 */
  __pyx_v_sp = (( arrow::Int16Scalar *)__pyx_v_self->__pyx_base.sp_scalar.get());

  /* "pyarrow/scalar.pxi":1084
 *         """
 *         cdef CInt16Scalar* sp = <CInt16Scalar*> self.sp_scalar.get()
 *         return sp.value if sp.is_valid else None             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  if ((__pyx_v_sp->is_valid != 0)) {
    __pyx_t_2 = __Pyx_PyInt_From_int16_t(__pyx_v_sp->value); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1084, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(Py_None);
    __pyx_t_1 = Py_None;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":1079
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Int16Scalar.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Int16Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Int16Scalar_2__reduce_cython__[] = "Int16Scalar.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11Int16Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Int16Scalar_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_Int16Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Int16Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int16Scalar *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__123, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int16Scalar.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Int16Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Int16Scalar_4__setstate_cython__[] = "Int16Scalar.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11Int16Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Int16Scalar_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_Int16Scalar *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Int16Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int16Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__124, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int16Scalar.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":1092
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt32Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12UInt32Scalar_as_py[] = "UInt32Scalar.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt32Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12UInt32Scalar_as_py(((struct __pyx_obj_7pyarrow_3lib_UInt32Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12UInt32Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_UInt32Scalar *__pyx_v_self) {
   arrow::UInt32Scalar *__pyx_v_sp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":1096
 *         Return this value as a Python int.
 *         """
 *         cdef CUInt32Scalar* sp = <CUInt32Scalar*> self.sp_scalar.get()             # <<<<<<<<<<<<<<
 *         return sp.value if sp.is_valid else None
 * 
 */
  __pyx_v_sp = (( arrow::UInt32Scalar *)__pyx_v_self->__pyx_base.sp_scalar.get());

  /* "pyarrow/scalar.pxi":1097
 *         """
 *         cdef CUInt32Scalar* sp = <CUInt32Scalar*> self.sp_scalar.get()
 *         return sp.value if sp.is_valid else None             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  if ((__pyx_v_sp->is_valid != 0)) {
    __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_sp->value); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1097, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(Py_None);
    __pyx_t_1 = Py_None;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":1092
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.UInt32Scalar.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt32Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12UInt32Scalar_2__reduce_cython__[] = "UInt32Scalar.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt32Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12UInt32Scalar_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt32Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12UInt32Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt32Scalar *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__125, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt32Scalar.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt32Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12UInt32Scalar_4__setstate_cython__[] = "UInt32Scalar.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt32Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12UInt32Scalar_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt32Scalar *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12UInt32Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt32Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__126, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt32Scalar.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":1105
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Int32Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Int32Scalar_as_py[] = "Int32Scalar.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11Int32Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Int32Scalar_as_py(((struct __pyx_obj_7pyarrow_3lib_Int32Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Int32Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_Int32Scalar *__pyx_v_self) {
   arrow::Int32Scalar *__pyx_v_sp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":1109
 *         Return this value as a Python int.
 *         """
 *         cdef CInt32Scalar* sp = <CInt32Scalar*> self.sp_scalar.get()             # <<<<<<<<<<<<<<
 *         return sp.value if sp.is_valid else None
 * 
 */
  __pyx_v_sp = (( arrow::Int32Scalar *)__pyx_v_self->__pyx_base.sp_scalar.get());

  /* "pyarrow/scalar.pxi":1110
 *         """
 *         cdef CInt32Scalar* sp = <CInt32Scalar*> self.sp_scalar.get()
 *         return sp.value if sp.is_valid else None             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  if ((__pyx_v_sp->is_valid != 0)) {
    __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_sp->value); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1110, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(Py_None);
    __pyx_t_1 = Py_None;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":1105
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Int32Scalar.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Int32Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Int32Scalar_2__reduce_cython__[] = "Int32Scalar.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11Int32Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Int32Scalar_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_Int32Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Int32Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int32Scalar *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__127, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int32Scalar.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Int32Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Int32Scalar_4__setstate_cython__[] = "Int32Scalar.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11Int32Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Int32Scalar_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_Int32Scalar *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Int32Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int32Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__128, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int32Scalar.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":1118
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt64Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12UInt64Scalar_as_py[] = "UInt64Scalar.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt64Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12UInt64Scalar_as_py(((struct __pyx_obj_7pyarrow_3lib_UInt64Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12UInt64Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_UInt64Scalar *__pyx_v_self) {
   arrow::UInt64Scalar *__pyx_v_sp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":1122
 *         Return this value as a Python int.
 *         """
 *         cdef CUInt64Scalar* sp = <CUInt64Scalar*> self.sp_scalar.get()             # <<<<<<<<<<<<<<
 *         return sp.value if sp.is_valid else None
 * 
 */
  __pyx_v_sp = (( arrow::UInt64Scalar *)__pyx_v_self->__pyx_base.sp_scalar.get());

  /* "pyarrow/scalar.pxi":1123
 *         """
 *         cdef CUInt64Scalar* sp = <CUInt64Scalar*> self.sp_scalar.get()
 *         return sp.value if sp.is_valid else None             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  if ((__pyx_v_sp->is_valid != 0)) {
    __pyx_t_2 = __Pyx_PyInt_From_uint64_t(__pyx_v_sp->value); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1123, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(Py_None);
    __pyx_t_1 = Py_None;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":1118
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.UInt64Scalar.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt64Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12UInt64Scalar_2__reduce_cython__[] = "UInt64Scalar.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt64Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12UInt64Scalar_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt64Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12UInt64Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt64Scalar *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__129, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt64Scalar.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt64Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12UInt64Scalar_4__setstate_cython__[] = "UInt64Scalar.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_12UInt64Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12UInt64Scalar_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_UInt64Scalar *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12UInt64Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_UInt64Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__130, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UInt64Scalar.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":1131
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Int64Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Int64Scalar_as_py[] = "Int64Scalar.as_py(self)\n\n        Return this value as a Python int.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11Int64Scalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Int64Scalar_as_py(((struct __pyx_obj_7pyarrow_3lib_Int64Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Int64Scalar_as_py(struct __pyx_obj_7pyarrow_3lib_Int64Scalar *__pyx_v_self) {
   arrow::Int64Scalar *__pyx_v_sp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":1135
 *         Return this value as a Python int.
 *         """
 *         cdef CInt64Scalar* sp = <CInt64Scalar*> self.sp_scalar.get()             # <<<<<<<<<<<<<<
 *         return sp.value if sp.is_valid else None
 * 
 */
  __pyx_v_sp = (( arrow::Int64Scalar *)__pyx_v_self->__pyx_base.sp_scalar.get());

  /* "pyarrow/scalar.pxi":1136
 *         """
 *         cdef CInt64Scalar* sp = <CInt64Scalar*> self.sp_scalar.get()
 *         return sp.value if sp.is_valid else None             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  if ((__pyx_v_sp->is_valid != 0)) {
    __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_sp->value); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1136, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(Py_None);
    __pyx_t_1 = Py_None;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":1131
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Int64Scalar.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Int64Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Int64Scalar_2__reduce_cython__[] = "Int64Scalar.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11Int64Scalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Int64Scalar_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_Int64Scalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Int64Scalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int64Scalar *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__131, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int64Scalar.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11Int64Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11Int64Scalar_4__setstate_cython__[] = "Int64Scalar.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11Int64Scalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11Int64Scalar_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_Int64Scalar *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11Int64Scalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Int64Scalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__132, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Int64Scalar.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":1144
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python float.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11FloatScalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11FloatScalar_as_py[] = "FloatScalar.as_py(self)\n\n        Return this value as a Python float.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11FloatScalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11FloatScalar_as_py(((struct __pyx_obj_7pyarrow_3lib_FloatScalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11FloatScalar_as_py(struct __pyx_obj_7pyarrow_3lib_FloatScalar *__pyx_v_self) {
   arrow::FloatScalar *__pyx_v_sp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":1148
 *         Return this value as a Python float.
 *         """
 *         cdef CFloatScalar* sp = <CFloatScalar*> self.sp_scalar.get()             # <<<<<<<<<<<<<<
 *         return sp.value if sp.is_valid else None
 * 
 */
  __pyx_v_sp = (( arrow::FloatScalar *)__pyx_v_self->__pyx_base.sp_scalar.get());

  /* "pyarrow/scalar.pxi":1149
 *         """
 *         cdef CFloatScalar* sp = <CFloatScalar*> self.sp_scalar.get()
 *         return sp.value if sp.is_valid else None             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  if ((__pyx_v_sp->is_valid != 0)) {
    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_sp->value); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1149, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(Py_None);
    __pyx_t_1 = Py_None;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":1144
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python float.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.FloatScalar.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11FloatScalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11FloatScalar_2__reduce_cython__[] = "FloatScalar.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11FloatScalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11FloatScalar_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_FloatScalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11FloatScalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FloatScalar *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__133, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FloatScalar.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11FloatScalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11FloatScalar_4__setstate_cython__[] = "FloatScalar.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11FloatScalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11FloatScalar_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_FloatScalar *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11FloatScalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FloatScalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__134, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FloatScalar.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":1157
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python float.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12DoubleScalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12DoubleScalar_as_py[] = "DoubleScalar.as_py(self)\n\n        Return this value as a Python float.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_12DoubleScalar_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_py (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12DoubleScalar_as_py(((struct __pyx_obj_7pyarrow_3lib_DoubleScalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12DoubleScalar_as_py(struct __pyx_obj_7pyarrow_3lib_DoubleScalar *__pyx_v_self) {
   arrow::DoubleScalar *__pyx_v_sp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":1161
 *         Return this value as a Python float.
 *         """
 *         cdef CDoubleScalar* sp = <CDoubleScalar*> self.sp_scalar.get()             # <<<<<<<<<<<<<<
 *         return sp.value if sp.is_valid else None
 * 
 */
  __pyx_v_sp = (( arrow::DoubleScalar *)__pyx_v_self->__pyx_base.sp_scalar.get());

  /* "pyarrow/scalar.pxi":1162
 *         """
 *         cdef CDoubleScalar* sp = <CDoubleScalar*> self.sp_scalar.get()
 *         return sp.value if sp.is_valid else None             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  if ((__pyx_v_sp->is_valid != 0)) {
    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_sp->value); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1162, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(Py_None);
    __pyx_t_1 = Py_None;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":1157
 *     """
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this value as a Python float.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.DoubleScalar.as_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12DoubleScalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12DoubleScalar_2__reduce_cython__[] = "DoubleScalar.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_12DoubleScalar_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12DoubleScalar_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_DoubleScalar *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12DoubleScalar_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DoubleScalar *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__135, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DoubleScalar.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12DoubleScalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12DoubleScalar_4__setstate_cython__[] = "DoubleScalar.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_12DoubleScalar_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12DoubleScalar_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_DoubleScalar *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12DoubleScalar_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_DoubleScalar *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__136, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.DoubleScalar.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":1178
 * }
 * 
 * cdef object box_scalar(DataType type, const shared_ptr[CArray]& sp_array,             # <<<<<<<<<<<<<<
 *                        int64_t index):
 *     cdef ArrayValue value
 */

static PyObject *__pyx_f_7pyarrow_3lib_box_scalar(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_type, std::shared_ptr< arrow::Array>  const &__pyx_v_sp_array, int64_t __pyx_v_index) {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue *__pyx_v_value = 0;
  PyObject *__pyx_v_klass = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("box_scalar", 0);

  /* "pyarrow/scalar.pxi":1182
 *     cdef ArrayValue value
 * 
 *     if type.type.id() == _Type_NA:             # <<<<<<<<<<<<<<
 *         return _NULL
 *     elif sp_array.get().IsNull(index):
 */
  __pyx_t_1 = ((__pyx_v_type->type->id() ==  arrow::Type::NA) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/scalar.pxi":1183
 * 
 *     if type.type.id() == _Type_NA:
 *         return _NULL             # <<<<<<<<<<<<<<
 *     elif sp_array.get().IsNull(index):
 *         return _NULL
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_NULL_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1183, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/scalar.pxi":1182
 *     cdef ArrayValue value
 * 
 *     if type.type.id() == _Type_NA:             # <<<<<<<<<<<<<<
 *         return _NULL
 *     elif sp_array.get().IsNull(index):
 */
  }

  /* "pyarrow/scalar.pxi":1184
 *     if type.type.id() == _Type_NA:
 *         return _NULL
 *     elif sp_array.get().IsNull(index):             # <<<<<<<<<<<<<<
 *         return _NULL
 *     else:
 */
  __pyx_t_1 = (__pyx_v_sp_array.get()->IsNull(__pyx_v_index) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/scalar.pxi":1185
 *         return _NULL
 *     elif sp_array.get().IsNull(index):
 *         return _NULL             # <<<<<<<<<<<<<<
 *     else:
 *         klass = _array_value_classes[type.type.id()]
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_NULL_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/scalar.pxi":1184
 *     if type.type.id() == _Type_NA:
 *         return _NULL
 *     elif sp_array.get().IsNull(index):             # <<<<<<<<<<<<<<
 *         return _NULL
 *     else:
 */
  }

  /* "pyarrow/scalar.pxi":1187
 *         return _NULL
 *     else:
 *         klass = _array_value_classes[type.type.id()]             # <<<<<<<<<<<<<<
 *         value = klass.__new__(klass)
 *         value.init(type, sp_array, index)
 */
  /*else*/ {
    if (unlikely(__pyx_v_7pyarrow_3lib__array_value_classes == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(5, 1187, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type(__pyx_v_type->type->id()); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1187, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_7pyarrow_3lib__array_value_classes, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1187, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_klass = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "pyarrow/scalar.pxi":1188
 *     else:
 *         klass = _array_value_classes[type.type.id()]
 *         value = klass.__new__(klass)             # <<<<<<<<<<<<<<
 *         value.init(type, sp_array, index)
 *         return value
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_klass, __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v_klass) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_klass);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_ArrayValue))))) __PYX_ERR(5, 1188, __pyx_L1_error)
    __pyx_v_value = ((struct __pyx_obj_7pyarrow_3lib_ArrayValue *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/scalar.pxi":1189
 *         klass = _array_value_classes[type.type.id()]
 *         value = klass.__new__(klass)
 *         value.init(type, sp_array, index)             # <<<<<<<<<<<<<<
 *         return value
 */
    ((struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue *)__pyx_v_value->__pyx_vtab)->init(__pyx_v_value, __pyx_v_type, __pyx_v_sp_array, __pyx_v_index);

    /* "pyarrow/scalar.pxi":1190
 *         value = klass.__new__(klass)
 *         value.init(type, sp_array, index)
 *         return value             # <<<<<<<<<<<<<<
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_value));
    __pyx_r = ((PyObject *)__pyx_v_value);
    goto __pyx_L0;
  }

  /* "pyarrow/scalar.pxi":1178
 * }
 * 
 * cdef object box_scalar(DataType type, const shared_ptr[CArray]& sp_array,             # <<<<<<<<<<<<<<
 *                        int64_t index):
 *     cdef ArrayValue value
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.box_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_klass);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":21
 * 
 * 
 * cdef _sequence_to_array(object sequence, object mask, object size,             # <<<<<<<<<<<<<<
 *                         DataType type, CMemoryPool* pool, c_bool from_pandas):
 *     cdef int64_t c_size
 */

static PyObject *__pyx_f_7pyarrow_3lib__sequence_to_array(PyObject *__pyx_v_sequence, PyObject *__pyx_v_mask, PyObject *__pyx_v_size, struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_type,  arrow::MemoryPool *__pyx_v_pool, bool __pyx_v_from_pandas) {
  arrow::py::PyConversionOptions __pyx_v_options;
  std::shared_ptr< arrow::ChunkedArray>  __pyx_v_out;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  std::shared_ptr< arrow::DataType>  __pyx_t_3;
  int64_t __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("_sequence_to_array", 0);

  /* "pyarrow/array.pxi":26
 *     cdef PyConversionOptions options
 * 
 *     if type is not None:             # <<<<<<<<<<<<<<
 *         options.type = type.sp_type
 * 
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_type) != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":27
 * 
 *     if type is not None:
 *         options.type = type.sp_type             # <<<<<<<<<<<<<<
 * 
 *     if size is not None:
 */
    __pyx_t_3 = __pyx_v_type->sp_type;
    __pyx_v_options.type = __pyx_t_3;

    /* "pyarrow/array.pxi":26
 *     cdef PyConversionOptions options
 * 
 *     if type is not None:             # <<<<<<<<<<<<<<
 *         options.type = type.sp_type
 * 
 */
  }

  /* "pyarrow/array.pxi":29
 *         options.type = type.sp_type
 * 
 *     if size is not None:             # <<<<<<<<<<<<<<
 *         options.size = size
 * 
 */
  __pyx_t_2 = (__pyx_v_size != Py_None);
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pyarrow/array.pxi":30
 * 
 *     if size is not None:
 *         options.size = size             # <<<<<<<<<<<<<<
 * 
 *     options.pool = pool
 */
    __pyx_t_4 = __Pyx_PyInt_As_int64_t(__pyx_v_size); if (unlikely((__pyx_t_4 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 30, __pyx_L1_error)
    __pyx_v_options.size = __pyx_t_4;

    /* "pyarrow/array.pxi":29
 *         options.type = type.sp_type
 * 
 *     if size is not None:             # <<<<<<<<<<<<<<
 *         options.size = size
 * 
 */
  }

  /* "pyarrow/array.pxi":32
 *         options.size = size
 * 
 *     options.pool = pool             # <<<<<<<<<<<<<<
 *     options.from_pandas = from_pandas
 * 
 */
  __pyx_v_options.pool = __pyx_v_pool;

  /* "pyarrow/array.pxi":33
 * 
 *     options.pool = pool
 *     options.from_pandas = from_pandas             # <<<<<<<<<<<<<<
 * 
 *     cdef shared_ptr[CChunkedArray] out
 */
  __pyx_v_options.from_pandas = __pyx_v_from_pandas;

  /* "pyarrow/array.pxi":37
 *     cdef shared_ptr[CChunkedArray] out
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(ConvertPySequence(sequence, mask, options, &out))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":38
 * 
 *     with nogil:
 *         check_status(ConvertPySequence(sequence, mask, options, &out))             # <<<<<<<<<<<<<<
 * 
 *     if out.get().num_chunks() == 1:
 */
        __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::ConvertPySequence(__pyx_v_sequence, __pyx_v_mask, __pyx_v_options, (&__pyx_v_out))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 38, __pyx_L6_error)
      }

      /* "pyarrow/array.pxi":37
 *     cdef shared_ptr[CChunkedArray] out
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(ConvertPySequence(sequence, mask, options, &out))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L7;
        }
        __pyx_L6_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L7:;
      }
  }

  /* "pyarrow/array.pxi":40
 *         check_status(ConvertPySequence(sequence, mask, options, &out))
 * 
 *     if out.get().num_chunks() == 1:             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_array(out.get().chunk(0))
 *     else:
 */
  __pyx_t_1 = ((__pyx_v_out.get()->num_chunks() == 1) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/array.pxi":41
 * 
 *     if out.get().num_chunks() == 1:
 *         return pyarrow_wrap_array(out.get().chunk(0))             # <<<<<<<<<<<<<<
 *     else:
 *         return pyarrow_wrap_chunked_array(out)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_out.get()->chunk(0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 41, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;

    /* "pyarrow/array.pxi":40
 *         check_status(ConvertPySequence(sequence, mask, options, &out))
 * 
 *     if out.get().num_chunks() == 1:             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_array(out.get().chunk(0))
 *     else:
 */
  }

  /* "pyarrow/array.pxi":43
 *         return pyarrow_wrap_array(out.get().chunk(0))
 *     else:
 *         return pyarrow_wrap_chunked_array(out)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_chunked_array(__pyx_v_out); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 43, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/array.pxi":21
 * 
 * 
 * cdef _sequence_to_array(object sequence, object mask, object size,             # <<<<<<<<<<<<<<
 *                         DataType type, CMemoryPool* pool, c_bool from_pandas):
 *     cdef int64_t c_size
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib._sequence_to_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":46
 * 
 * 
 * cdef inline _is_array_like(obj):             # <<<<<<<<<<<<<<
 *     if isinstance(obj, np.ndarray):
 *         return True
 */

static CYTHON_INLINE PyObject *__pyx_f_7pyarrow_3lib__is_array_like(PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("_is_array_like", 0);

  /* "pyarrow/array.pxi":47
 * 
 * cdef inline _is_array_like(obj):
 *     if isinstance(obj, np.ndarray):             # <<<<<<<<<<<<<<
 *         return True
 *     return pandas_api._have_pandas_internal() and pandas_api.is_array_like(obj)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 47, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "pyarrow/array.pxi":48
 * cdef inline _is_array_like(obj):
 *     if isinstance(obj, np.ndarray):
 *         return True             # <<<<<<<<<<<<<<
 *     return pandas_api._have_pandas_internal() and pandas_api.is_array_like(obj)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;

    /* "pyarrow/array.pxi":47
 * 
 * cdef inline _is_array_like(obj):
 *     if isinstance(obj, np.ndarray):             # <<<<<<<<<<<<<<
 *         return True
 *     return pandas_api._have_pandas_internal() and pandas_api.is_array_like(obj)
 */
  }

  /* "pyarrow/array.pxi":49
 *     if isinstance(obj, np.ndarray):
 *         return True
 *     return pandas_api._have_pandas_internal() and pandas_api.is_array_like(obj)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __pyx_f_7pyarrow_3lib_14_PandasAPIShim__have_pandas_internal(__pyx_v_7pyarrow_3lib_pandas_api);
  if (__pyx_t_4) {
  } else {
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 49, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib__PandasAPIShim *)__pyx_v_7pyarrow_3lib_pandas_api->__pyx_vtab)->is_array_like(__pyx_v_7pyarrow_3lib_pandas_api, __pyx_v_obj, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_L4_bool_binop_done:;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":46
 * 
 * 
 * cdef inline _is_array_like(obj):             # <<<<<<<<<<<<<<
 *     if isinstance(obj, np.ndarray):
 *         return True
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib._is_array_like", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":52
 * 
 * 
 * def _ndarray_to_arrow_type(object values, DataType type):             # <<<<<<<<<<<<<<
 *     return pyarrow_wrap_data_type(_ndarray_to_type(values, type))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_129_ndarray_to_arrow_type(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_128_ndarray_to_arrow_type[] = "_ndarray_to_arrow_type(values, DataType type)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_129_ndarray_to_arrow_type = {"_ndarray_to_arrow_type", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_129_ndarray_to_arrow_type, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_128_ndarray_to_arrow_type};
static PyObject *__pyx_pw_7pyarrow_3lib_129_ndarray_to_arrow_type(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_values = 0;
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_type = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_ndarray_to_arrow_type (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_type,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_ndarray_to_arrow_type", 1, 2, 2, 1); __PYX_ERR(1, 52, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_ndarray_to_arrow_type") < 0)) __PYX_ERR(1, 52, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_values = values[0];
    __pyx_v_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_ndarray_to_arrow_type", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 52, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._ndarray_to_arrow_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_type), __pyx_ptype_7pyarrow_3lib_DataType, 1, "type", 0))) __PYX_ERR(1, 52, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_128_ndarray_to_arrow_type(__pyx_self, __pyx_v_values, __pyx_v_type);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_128_ndarray_to_arrow_type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_values, struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr< arrow::DataType>  __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("_ndarray_to_arrow_type", 0);

  /* "pyarrow/array.pxi":53
 * 
 * def _ndarray_to_arrow_type(object values, DataType type):
 *     return pyarrow_wrap_data_type(_ndarray_to_type(values, type))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__ndarray_to_type(__pyx_v_values, __pyx_v_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 53, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":52
 * 
 * 
 * def _ndarray_to_arrow_type(object values, DataType type):             # <<<<<<<<<<<<<<
 *     return pyarrow_wrap_data_type(_ndarray_to_type(values, type))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib._ndarray_to_arrow_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":56
 * 
 * 
 * cdef shared_ptr[CDataType] _ndarray_to_type(object values,             # <<<<<<<<<<<<<<
 *                                             DataType type) except *:
 *     cdef shared_ptr[CDataType] c_type
 */

static std::shared_ptr< arrow::DataType>  __pyx_f_7pyarrow_3lib__ndarray_to_type(PyObject *__pyx_v_values, struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_type) {
  std::shared_ptr< arrow::DataType>  __pyx_v_c_type;
  PyObject *__pyx_v_dtype = NULL;
  std::shared_ptr< arrow::DataType>  __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  std::shared_ptr< arrow::DataType>  __pyx_t_6;
  __Pyx_RefNannySetupContext("_ndarray_to_type", 0);

  /* "pyarrow/array.pxi":60
 *     cdef shared_ptr[CDataType] c_type
 * 
 *     dtype = values.dtype             # <<<<<<<<<<<<<<
 * 
 *     if type is None and dtype != object:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_dtype = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":62
 *     dtype = values.dtype
 * 
 *     if type is None and dtype != object:             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(NumPyDtypeToArrow(dtype, &c_type))
 */
  __pyx_t_3 = (((PyObject *)__pyx_v_type) == Py_None);
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_dtype, __pyx_builtin_object, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 62, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 62, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":63
 * 
 *     if type is None and dtype != object:
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(NumPyDtypeToArrow(dtype, &c_type))
 * 
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "pyarrow/array.pxi":64
 *     if type is None and dtype != object:
 *         with nogil:
 *             check_status(NumPyDtypeToArrow(dtype, &c_type))             # <<<<<<<<<<<<<<
 * 
 *     if type is not None:
 */
          __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::NumPyDtypeToArrow(__pyx_v_dtype, (&__pyx_v_c_type))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 64, __pyx_L7_error)
        }

        /* "pyarrow/array.pxi":63
 * 
 *     if type is None and dtype != object:
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(NumPyDtypeToArrow(dtype, &c_type))
 * 
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L8;
          }
          __pyx_L7_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L8:;
        }
    }

    /* "pyarrow/array.pxi":62
 *     dtype = values.dtype
 * 
 *     if type is None and dtype != object:             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(NumPyDtypeToArrow(dtype, &c_type))
 */
  }

  /* "pyarrow/array.pxi":66
 *             check_status(NumPyDtypeToArrow(dtype, &c_type))
 * 
 *     if type is not None:             # <<<<<<<<<<<<<<
 *         c_type = type.sp_type
 * 
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_type) != Py_None);
  __pyx_t_4 = (__pyx_t_2 != 0);
  if (__pyx_t_4) {

    /* "pyarrow/array.pxi":67
 * 
 *     if type is not None:
 *         c_type = type.sp_type             # <<<<<<<<<<<<<<
 * 
 *     return c_type
 */
    __pyx_t_6 = __pyx_v_type->sp_type;
    __pyx_v_c_type = __pyx_t_6;

    /* "pyarrow/array.pxi":66
 *             check_status(NumPyDtypeToArrow(dtype, &c_type))
 * 
 *     if type is not None:             # <<<<<<<<<<<<<<
 *         c_type = type.sp_type
 * 
 */
  }

  /* "pyarrow/array.pxi":69
 *         c_type = type.sp_type
 * 
 *     return c_type             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_c_type;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":56
 * 
 * 
 * cdef shared_ptr[CDataType] _ndarray_to_type(object values,             # <<<<<<<<<<<<<<
 *                                             DataType type) except *:
 *     cdef shared_ptr[CDataType] c_type
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._ndarray_to_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dtype);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":72
 * 
 * 
 * cdef _ndarray_to_array(object values, object mask, DataType type,             # <<<<<<<<<<<<<<
 *                        c_bool from_pandas, c_bool safe, CMemoryPool* pool):
 *     cdef:
 */

static PyObject *__pyx_f_7pyarrow_3lib__ndarray_to_array(PyObject *__pyx_v_values, PyObject *__pyx_v_mask, struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_type, bool __pyx_v_from_pandas, bool __pyx_v_safe,  arrow::MemoryPool *__pyx_v_pool) {
  std::shared_ptr< arrow::ChunkedArray>  __pyx_v_chunked_out;
  std::shared_ptr< arrow::DataType>  __pyx_v_c_type;
   arrow::compute::CastOptions __pyx_v_cast_options;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr< arrow::DataType>  __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("_ndarray_to_array", 0);

  /* "pyarrow/array.pxi":76
 *     cdef:
 *         shared_ptr[CChunkedArray] chunked_out
 *         shared_ptr[CDataType] c_type = _ndarray_to_type(values, type)             # <<<<<<<<<<<<<<
 *         CCastOptions cast_options = CCastOptions(safe)
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__ndarray_to_type(__pyx_v_values, __pyx_v_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 76, __pyx_L1_error)
  __pyx_v_c_type = __pyx_t_1;

  /* "pyarrow/array.pxi":77
 *         shared_ptr[CChunkedArray] chunked_out
 *         shared_ptr[CDataType] c_type = _ndarray_to_type(values, type)
 *         CCastOptions cast_options = CCastOptions(safe)             # <<<<<<<<<<<<<<
 * 
 *     with nogil:
 */
  __pyx_v_cast_options =  arrow::compute::CastOptions(__pyx_v_safe);

  /* "pyarrow/array.pxi":79
 *         CCastOptions cast_options = CCastOptions(safe)
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(NdarrayToArrow(pool, values, mask, from_pandas,
 *                                     c_type, cast_options, &chunked_out))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":80
 * 
 *     with nogil:
 *         check_status(NdarrayToArrow(pool, values, mask, from_pandas,             # <<<<<<<<<<<<<<
 *                                     c_type, cast_options, &chunked_out))
 * 
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::NdarrayToArrow(__pyx_v_pool, __pyx_v_values, __pyx_v_mask, __pyx_v_from_pandas, __pyx_v_c_type, __pyx_v_cast_options, (&__pyx_v_chunked_out))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 80, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":79
 *         CCastOptions cast_options = CCastOptions(safe)
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(NdarrayToArrow(pool, values, mask, from_pandas,
 *                                     c_type, cast_options, &chunked_out))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/array.pxi":83
 *                                     c_type, cast_options, &chunked_out))
 * 
 *     if chunked_out.get().num_chunks() > 1:             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_chunked_array(chunked_out)
 *     else:
 */
  __pyx_t_3 = ((__pyx_v_chunked_out.get()->num_chunks() > 1) != 0);
  if (__pyx_t_3) {

    /* "pyarrow/array.pxi":84
 * 
 *     if chunked_out.get().num_chunks() > 1:
 *         return pyarrow_wrap_chunked_array(chunked_out)             # <<<<<<<<<<<<<<
 *     else:
 *         return pyarrow_wrap_array(chunked_out.get().chunk(0))
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_chunked_array(__pyx_v_chunked_out); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 84, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "pyarrow/array.pxi":83
 *                                     c_type, cast_options, &chunked_out))
 * 
 *     if chunked_out.get().num_chunks() > 1:             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_chunked_array(chunked_out)
 *     else:
 */
  }

  /* "pyarrow/array.pxi":86
 *         return pyarrow_wrap_chunked_array(chunked_out)
 *     else:
 *         return pyarrow_wrap_array(chunked_out.get().chunk(0))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_chunked_out.get()->chunk(0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 86, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/array.pxi":72
 * 
 * 
 * cdef _ndarray_to_array(object values, object mask, DataType type,             # <<<<<<<<<<<<<<
 *                        c_bool from_pandas, c_bool safe, CMemoryPool* pool):
 *     cdef:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib._ndarray_to_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":89
 * 
 * 
 * cdef _codes_to_indices(object codes, object mask, DataType type,             # <<<<<<<<<<<<<<
 *                        MemoryPool memory_pool):
 *     """
 */

static PyObject *__pyx_f_7pyarrow_3lib__codes_to_indices(PyObject *__pyx_v_codes, PyObject *__pyx_v_mask, struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_type, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("_codes_to_indices", 0);
  __Pyx_INCREF(__pyx_v_mask);

  /* "pyarrow/array.pxi":95
 *     DictionaryArray, taking into account missing values + mask
 *     """
 *     if mask is None:             # <<<<<<<<<<<<<<
 *         mask = codes == -1
 *     else:
 */
  __pyx_t_1 = (__pyx_v_mask == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":96
 *     """
 *     if mask is None:
 *         mask = codes == -1             # <<<<<<<<<<<<<<
 *     else:
 *         mask = mask | (codes == -1)
 */
    __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_codes, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 96, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_mask, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/array.pxi":95
 *     DictionaryArray, taking into account missing values + mask
 *     """
 *     if mask is None:             # <<<<<<<<<<<<<<
 *         mask = codes == -1
 *     else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/array.pxi":98
 *         mask = codes == -1
 *     else:
 *         mask = mask | (codes == -1)             # <<<<<<<<<<<<<<
 *     return array(codes, mask=mask, type=type, memory_pool=memory_pool)
 * 
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_codes, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 98, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyNumber_Or(__pyx_v_mask, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 98, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_mask, __pyx_t_4);
    __pyx_t_4 = 0;
  }
  __pyx_L3:;

  /* "pyarrow/array.pxi":99
 *     else:
 *         mask = mask | (codes == -1)
 *     return array(codes, mask=mask, type=type, memory_pool=memory_pool)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_codes);
  __Pyx_GIVEREF(__pyx_v_codes);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_codes);
  __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_mask, __pyx_v_mask) < 0) __PYX_ERR(1, 99, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_type, ((PyObject *)__pyx_v_type)) < 0) __PYX_ERR(1, 99, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_memory_pool, ((PyObject *)__pyx_v_memory_pool)) < 0) __PYX_ERR(1, 99, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":89
 * 
 * 
 * cdef _codes_to_indices(object codes, object mask, DataType type,             # <<<<<<<<<<<<<<
 *                        MemoryPool memory_pool):
 *     """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib._codes_to_indices", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_mask);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":102
 * 
 * 
 * def _handle_arrow_array_protocol(obj, type, mask, size):             # <<<<<<<<<<<<<<
 *     if mask is not None or size is not None:
 *         raise ValueError(
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_131_handle_arrow_array_protocol(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_130_handle_arrow_array_protocol[] = "_handle_arrow_array_protocol(obj, type, mask, size)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_131_handle_arrow_array_protocol = {"_handle_arrow_array_protocol", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_131_handle_arrow_array_protocol, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_130_handle_arrow_array_protocol};
static PyObject *__pyx_pw_7pyarrow_3lib_131_handle_arrow_array_protocol(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_obj = 0;
  PyObject *__pyx_v_type = 0;
  PyObject *__pyx_v_mask = 0;
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_handle_arrow_array_protocol (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_type,&__pyx_n_s_mask,&__pyx_n_s_size,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_handle_arrow_array_protocol", 1, 4, 4, 1); __PYX_ERR(1, 102, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_handle_arrow_array_protocol", 1, 4, 4, 2); __PYX_ERR(1, 102, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_handle_arrow_array_protocol", 1, 4, 4, 3); __PYX_ERR(1, 102, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_handle_arrow_array_protocol") < 0)) __PYX_ERR(1, 102, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_obj = values[0];
    __pyx_v_type = values[1];
    __pyx_v_mask = values[2];
    __pyx_v_size = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_handle_arrow_array_protocol", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 102, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._handle_arrow_array_protocol", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_130_handle_arrow_array_protocol(__pyx_self, __pyx_v_obj, __pyx_v_type, __pyx_v_mask, __pyx_v_size);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_130_handle_arrow_array_protocol(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_type, PyObject *__pyx_v_mask, PyObject *__pyx_v_size) {
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("_handle_arrow_array_protocol", 0);

  /* "pyarrow/array.pxi":103
 * 
 * def _handle_arrow_array_protocol(obj, type, mask, size):
 *     if mask is not None or size is not None:             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             "Cannot specify a mask or a size when passing an object that is "
 */
  __pyx_t_2 = (__pyx_v_mask != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_size != Py_None);
  __pyx_t_2 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/array.pxi":104
 * def _handle_arrow_array_protocol(obj, type, mask, size):
 *     if mask is not None or size is not None:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "Cannot specify a mask or a size when passing an object that is "
 *             "converted with the __arrow_array__ protocol.")
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__137, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 104, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(1, 104, __pyx_L1_error)

    /* "pyarrow/array.pxi":103
 * 
 * def _handle_arrow_array_protocol(obj, type, mask, size):
 *     if mask is not None or size is not None:             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             "Cannot specify a mask or a size when passing an object that is "
 */
  }

  /* "pyarrow/array.pxi":107
 *             "Cannot specify a mask or a size when passing an object that is "
 *             "converted with the __arrow_array__ protocol.")
 *     res = obj.__arrow_array__(type=type)             # <<<<<<<<<<<<<<
 *     if not isinstance(res, (Array, ChunkedArray)):
 *         raise TypeError("The object's __arrow_array__ method does not "
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_arrow_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_type, __pyx_v_type) < 0) __PYX_ERR(1, 107, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_res = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "pyarrow/array.pxi":108
 *             "converted with the __arrow_array__ protocol.")
 *     res = obj.__arrow_array__(type=type)
 *     if not isinstance(res, (Array, ChunkedArray)):             # <<<<<<<<<<<<<<
 *         raise TypeError("The object's __arrow_array__ method does not "
 *                         "return a pyarrow Array or ChunkedArray.")
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_res, __pyx_ptype_7pyarrow_3lib_Array); 
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_res, __pyx_ptype_7pyarrow_3lib_ChunkedArray); 
  __pyx_t_2 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L7_bool_binop_done:;
  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/array.pxi":109
 *     res = obj.__arrow_array__(type=type)
 *     if not isinstance(res, (Array, ChunkedArray)):
 *         raise TypeError("The object's __arrow_array__ method does not "             # <<<<<<<<<<<<<<
 *                         "return a pyarrow Array or ChunkedArray.")
 *     return res
 */
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__138, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 109, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __PYX_ERR(1, 109, __pyx_L1_error)

    /* "pyarrow/array.pxi":108
 *             "converted with the __arrow_array__ protocol.")
 *     res = obj.__arrow_array__(type=type)
 *     if not isinstance(res, (Array, ChunkedArray)):             # <<<<<<<<<<<<<<
 *         raise TypeError("The object's __arrow_array__ method does not "
 *                         "return a pyarrow Array or ChunkedArray.")
 */
  }

  /* "pyarrow/array.pxi":111
 *         raise TypeError("The object's __arrow_array__ method does not "
 *                         "return a pyarrow Array or ChunkedArray.")
 *     return res             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":102
 * 
 * 
 * def _handle_arrow_array_protocol(obj, type, mask, size):             # <<<<<<<<<<<<<<
 *     if mask is not None or size is not None:
 *         raise ValueError(
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib._handle_arrow_array_protocol", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":114
 * 
 * 
 * def array(object obj, type=None, mask=None, size=None, from_pandas=None,             # <<<<<<<<<<<<<<
 *           bint safe=True, MemoryPool memory_pool=None):
 *     """
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_133array(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_132array[] = "array(obj, type=None, mask=None, size=None, from_pandas=None, bool safe=True, MemoryPool memory_pool=None)\n\n    Create pyarrow.Array instance from a Python object\n\n    Parameters\n    ----------\n    obj : sequence, iterable, ndarray or Series\n        If both type and size are specified may be a single use iterable. If\n        not strongly-typed, Arrow type will be inferred for resulting array\n    type : pyarrow.DataType\n        Explicit type to attempt to coerce to, otherwise will be inferred from\n        the data\n    mask : array (boolean), optional\n        Indicate which values are null (True) or not null (False).\n    size : int64, optional\n        Size of the elements. If the imput is larger than size bail at this\n        length. For iterators, if size is larger than the input iterator this\n        will be treated as a \"max size\", but will involve an initial allocation\n        of size followed by a resize to the actual size (so if you know the\n        exact size specifying it correctly will give you better performance).\n    from_pandas : boolean, default None\n        Use pandas's semantics for inferring nulls from values in\n        ndarray-like data. If passed, the mask tasks precendence, but\n        if a value is unmasked (not-null), but still null according to\n        pandas semantics, then it is null. Defaults to False if not\n        passed explicitly by user, or True if a pandas object is\n        passed in\n    safe : boolean, default True\n        Check for overflows or other unsafe conversions\n    memory_pool : pyarrow.MemoryPool, optional\n        If not passed, will allocate memory from the currently-set default\n        memory pool\n\n    Notes\n    -----\n    Localized timestamps will currently be returned as UTC (pandas's native\n    representation).  Timezone-naive data will be implicitly interpreted as\n    UTC.\n\n    Examples\n    --------\n    >>> import pandas as pd\n    >>> import pyarrow as pa\n    >>> pa.array(pd.Se""ries([1, 2]))\n    <pyarrow.array.Int64Array object at 0x7f674e4c0e10>\n    [\n      1,\n      2\n    ]\n\n    >>> import numpy as np\n    >>> pa.array(pd.Series([1, 2]), np.array([0, 1],\n    ... dtype=bool))\n    <pyarrow.array.Int64Array object at 0x7f9019e11208>\n    [\n      1,\n      null\n    ]\n\n    Returns\n    -------\n    array : pyarrow.Array or pyarrow.ChunkedArray\n        A ChunkedArray instead of an Array is returned if:\n\n        - the object data overflowed binary storage.\n        - the object's ``__arrow_array__`` protocol method returned a chunked\n          array.\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_133array = {"array", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_133array, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_132array};
static PyObject *__pyx_pw_7pyarrow_3lib_133array(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_obj = 0;
  PyObject *__pyx_v_type = 0;
  PyObject *__pyx_v_mask = 0;
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_v_from_pandas = 0;
  int __pyx_v_safe;
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("array (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_type,&__pyx_n_s_mask,&__pyx_n_s_size,&__pyx_n_s_from_pandas,&__pyx_n_s_safe,&__pyx_n_s_memory_pool,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)Py_None);
    values[4] = ((PyObject *)Py_None);

    /* "pyarrow/array.pxi":115
 * 
 * def array(object obj, type=None, mask=None, size=None, from_pandas=None,
 *           bint safe=True, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create pyarrow.Array instance from a Python object
 */
    values[6] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mask);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_from_pandas);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_safe);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[6] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "array") < 0)) __PYX_ERR(1, 114, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_obj = values[0];
    __pyx_v_type = values[1];
    __pyx_v_mask = values[2];
    __pyx_v_size = values[3];
    __pyx_v_from_pandas = values[4];
    if (values[5]) {
      __pyx_v_safe = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_safe == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 115, __pyx_L3_error)
    } else {
      __pyx_v_safe = ((int)1);
    }
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[6]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("array", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 114, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(1, 115, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_132array(__pyx_self, __pyx_v_obj, __pyx_v_type, __pyx_v_mask, __pyx_v_size, __pyx_v_from_pandas, __pyx_v_safe, __pyx_v_memory_pool);

  /* "pyarrow/array.pxi":114
 * 
 * 
 * def array(object obj, type=None, mask=None, size=None, from_pandas=None,             # <<<<<<<<<<<<<<
 *           bint safe=True, MemoryPool memory_pool=None):
 *     """
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_132array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_type, PyObject *__pyx_v_mask, PyObject *__pyx_v_size, PyObject *__pyx_v_from_pandas, int __pyx_v_safe, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool) {
   arrow::MemoryPool *__pyx_v_pool;
  int __pyx_v_is_pandas_object;
  int __pyx_v_c_from_pandas;
  PyObject *__pyx_v_values = NULL;
  PyObject *__pyx_v_index_type = NULL;
  PyObject *__pyx_v_value_type = NULL;
  PyObject *__pyx_v_indices = NULL;
  PyObject *__pyx_v_dictionary = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7pyarrow_3lib_ensure_type __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *(*__pyx_t_18)(PyObject *);
  __Pyx_RefNannySetupContext("array", 0);
  __Pyx_INCREF(__pyx_v_type);
  __Pyx_INCREF(__pyx_v_mask);

  /* "pyarrow/array.pxi":184
 *     """
 *     cdef:
 *         CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)             # <<<<<<<<<<<<<<
 *         bint is_pandas_object = False
 *         bint c_from_pandas
 */
  __pyx_v_pool = __pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(__pyx_v_memory_pool);

  /* "pyarrow/array.pxi":185
 *     cdef:
 *         CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)
 *         bint is_pandas_object = False             # <<<<<<<<<<<<<<
 *         bint c_from_pandas
 * 
 */
  __pyx_v_is_pandas_object = 0;

  /* "pyarrow/array.pxi":188
 *         bint c_from_pandas
 * 
 *     type = ensure_type(type, allow_none=True)             # <<<<<<<<<<<<<<
 * 
 *     if from_pandas is None:
 */
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.allow_none = 1;
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_ensure_type(__pyx_v_type, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_type, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":190
 *     type = ensure_type(type, allow_none=True)
 * 
 *     if from_pandas is None:             # <<<<<<<<<<<<<<
 *         c_from_pandas = False
 *     else:
 */
  __pyx_t_3 = (__pyx_v_from_pandas == Py_None);
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "pyarrow/array.pxi":191
 * 
 *     if from_pandas is None:
 *         c_from_pandas = False             # <<<<<<<<<<<<<<
 *     else:
 *         c_from_pandas = from_pandas
 */
    __pyx_v_c_from_pandas = 0;

    /* "pyarrow/array.pxi":190
 *     type = ensure_type(type, allow_none=True)
 * 
 *     if from_pandas is None:             # <<<<<<<<<<<<<<
 *         c_from_pandas = False
 *     else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/array.pxi":193
 *         c_from_pandas = False
 *     else:
 *         c_from_pandas = from_pandas             # <<<<<<<<<<<<<<
 * 
 *     if hasattr(obj, '__arrow_array__'):
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_from_pandas); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 193, __pyx_L1_error)
    __pyx_v_c_from_pandas = __pyx_t_4;
  }
  __pyx_L3:;

  /* "pyarrow/array.pxi":195
 *         c_from_pandas = from_pandas
 * 
 *     if hasattr(obj, '__arrow_array__'):             # <<<<<<<<<<<<<<
 *         return _handle_arrow_array_protocol(obj, type, mask, size)
 *     elif _is_array_like(obj):
 */
  __pyx_t_4 = __Pyx_HasAttr(__pyx_v_obj, __pyx_n_u_arrow_array); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 195, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/array.pxi":196
 * 
 *     if hasattr(obj, '__arrow_array__'):
 *         return _handle_arrow_array_protocol(obj, type, mask, size)             # <<<<<<<<<<<<<<
 *     elif _is_array_like(obj):
 *         if mask is not None:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_handle_arrow_array_protocol); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 196, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_v_obj, __pyx_v_type, __pyx_v_mask, __pyx_v_size};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 196, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_v_obj, __pyx_v_type, __pyx_v_mask, __pyx_v_size};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 196, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 196, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_INCREF(__pyx_v_obj);
      __Pyx_GIVEREF(__pyx_v_obj);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_obj);
      __Pyx_INCREF(__pyx_v_type);
      __Pyx_GIVEREF(__pyx_v_type);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_type);
      __Pyx_INCREF(__pyx_v_mask);
      __Pyx_GIVEREF(__pyx_v_mask);
      PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_v_mask);
      __Pyx_INCREF(__pyx_v_size);
      __Pyx_GIVEREF(__pyx_v_size);
      PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_7, __pyx_v_size);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 196, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "pyarrow/array.pxi":195
 *         c_from_pandas = from_pandas
 * 
 *     if hasattr(obj, '__arrow_array__'):             # <<<<<<<<<<<<<<
 *         return _handle_arrow_array_protocol(obj, type, mask, size)
 *     elif _is_array_like(obj):
 */
  }

  /* "pyarrow/array.pxi":197
 *     if hasattr(obj, '__arrow_array__'):
 *         return _handle_arrow_array_protocol(obj, type, mask, size)
 *     elif _is_array_like(obj):             # <<<<<<<<<<<<<<
 *         if mask is not None:
 *             # out argument unused
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__is_array_like(__pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(1, 197, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "pyarrow/array.pxi":198
 *         return _handle_arrow_array_protocol(obj, type, mask, size)
 *     elif _is_array_like(obj):
 *         if mask is not None:             # <<<<<<<<<<<<<<
 *             # out argument unused
 *             mask = get_values(mask, &is_pandas_object)
 */
    __pyx_t_3 = (__pyx_v_mask != Py_None);
    __pyx_t_4 = (__pyx_t_3 != 0);
    if (__pyx_t_4) {

      /* "pyarrow/array.pxi":200
 *         if mask is not None:
 *             # out argument unused
 *             mask = get_values(mask, &is_pandas_object)             # <<<<<<<<<<<<<<
 * 
 *         values = get_values(obj, &is_pandas_object)
 */
      __pyx_t_1 = __pyx_f_7pyarrow_3lib_get_values(__pyx_v_mask, (&__pyx_v_is_pandas_object)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 200, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_mask, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "pyarrow/array.pxi":198
 *         return _handle_arrow_array_protocol(obj, type, mask, size)
 *     elif _is_array_like(obj):
 *         if mask is not None:             # <<<<<<<<<<<<<<
 *             # out argument unused
 *             mask = get_values(mask, &is_pandas_object)
 */
    }

    /* "pyarrow/array.pxi":202
 *             mask = get_values(mask, &is_pandas_object)
 * 
 *         values = get_values(obj, &is_pandas_object)             # <<<<<<<<<<<<<<
 *         if is_pandas_object and from_pandas is None:
 *             c_from_pandas = True
 */
    __pyx_t_1 = __pyx_f_7pyarrow_3lib_get_values(__pyx_v_obj, (&__pyx_v_is_pandas_object)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 202, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_values = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "pyarrow/array.pxi":203
 * 
 *         values = get_values(obj, &is_pandas_object)
 *         if is_pandas_object and from_pandas is None:             # <<<<<<<<<<<<<<
 *             c_from_pandas = True
 * 
 */
    __pyx_t_3 = (__pyx_v_is_pandas_object != 0);
    if (__pyx_t_3) {
    } else {
      __pyx_t_4 = __pyx_t_3;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_3 = (__pyx_v_from_pandas == Py_None);
    __pyx_t_9 = (__pyx_t_3 != 0);
    __pyx_t_4 = __pyx_t_9;
    __pyx_L7_bool_binop_done:;
    if (__pyx_t_4) {

      /* "pyarrow/array.pxi":204
 *         values = get_values(obj, &is_pandas_object)
 *         if is_pandas_object and from_pandas is None:
 *             c_from_pandas = True             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(values, np.ma.MaskedArray):
 */
      __pyx_v_c_from_pandas = 1;

      /* "pyarrow/array.pxi":203
 * 
 *         values = get_values(obj, &is_pandas_object)
 *         if is_pandas_object and from_pandas is None:             # <<<<<<<<<<<<<<
 *             c_from_pandas = True
 * 
 */
    }

    /* "pyarrow/array.pxi":206
 *             c_from_pandas = True
 * 
 *         if isinstance(values, np.ma.MaskedArray):             # <<<<<<<<<<<<<<
 *             if mask is not None:
 *                 raise ValueError("Cannot pass a numpy masked array and "
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ma); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_MaskedArray); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_4 = PyObject_IsInstance(__pyx_v_values, __pyx_t_1); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 206, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_9 = (__pyx_t_4 != 0);
    if (__pyx_t_9) {

      /* "pyarrow/array.pxi":207
 * 
 *         if isinstance(values, np.ma.MaskedArray):
 *             if mask is not None:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Cannot pass a numpy masked array and "
 *                                  "specify a mask at the same time")
 */
      __pyx_t_9 = (__pyx_v_mask != Py_None);
      __pyx_t_4 = (__pyx_t_9 != 0);
      if (unlikely(__pyx_t_4)) {

        /* "pyarrow/array.pxi":208
 *         if isinstance(values, np.ma.MaskedArray):
 *             if mask is not None:
 *                 raise ValueError("Cannot pass a numpy masked array and "             # <<<<<<<<<<<<<<
 *                                  "specify a mask at the same time")
 *             else:
 */
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__139, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 208, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __PYX_ERR(1, 208, __pyx_L1_error)

        /* "pyarrow/array.pxi":207
 * 
 *         if isinstance(values, np.ma.MaskedArray):
 *             if mask is not None:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Cannot pass a numpy masked array and "
 *                                  "specify a mask at the same time")
 */
      }

      /* "pyarrow/array.pxi":211
 *                                  "specify a mask at the same time")
 *             else:
 *                 mask = values.mask             # <<<<<<<<<<<<<<
 *                 values = values.data
 * 
 */
      /*else*/ {
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_mask); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 211, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_mask, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "pyarrow/array.pxi":212
 *             else:
 *                 mask = values.mask
 *                 values = values.data             # <<<<<<<<<<<<<<
 * 
 *         if hasattr(values, '__arrow_array__'):
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 212, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_1);
        __pyx_t_1 = 0;
      }

      /* "pyarrow/array.pxi":206
 *             c_from_pandas = True
 * 
 *         if isinstance(values, np.ma.MaskedArray):             # <<<<<<<<<<<<<<
 *             if mask is not None:
 *                 raise ValueError("Cannot pass a numpy masked array and "
 */
    }

    /* "pyarrow/array.pxi":214
 *                 values = values.data
 * 
 *         if hasattr(values, '__arrow_array__'):             # <<<<<<<<<<<<<<
 *             return _handle_arrow_array_protocol(values, type, mask, size)
 *         elif pandas_api.is_categorical(values):
 */
    __pyx_t_4 = __Pyx_HasAttr(__pyx_v_values, __pyx_n_u_arrow_array); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 214, __pyx_L1_error)
    __pyx_t_9 = (__pyx_t_4 != 0);
    if (__pyx_t_9) {

      /* "pyarrow/array.pxi":215
 * 
 *         if hasattr(values, '__arrow_array__'):
 *             return _handle_arrow_array_protocol(values, type, mask, size)             # <<<<<<<<<<<<<<
 *         elif pandas_api.is_categorical(values):
 *             if type is not None:
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_handle_arrow_array_protocol); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 215, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
          __pyx_t_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[5] = {__pyx_t_8, __pyx_v_values, __pyx_v_type, __pyx_v_mask, __pyx_v_size};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 215, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[5] = {__pyx_t_8, __pyx_v_values, __pyx_v_type, __pyx_v_mask, __pyx_v_size};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 215, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 215, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_8) {
          __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8); __pyx_t_8 = NULL;
        }
        __Pyx_INCREF(__pyx_v_values);
        __Pyx_GIVEREF(__pyx_v_values);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_v_values);
        __Pyx_INCREF(__pyx_v_type);
        __Pyx_GIVEREF(__pyx_v_type);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_v_type);
        __Pyx_INCREF(__pyx_v_mask);
        __Pyx_GIVEREF(__pyx_v_mask);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_7, __pyx_v_mask);
        __Pyx_INCREF(__pyx_v_size);
        __Pyx_GIVEREF(__pyx_v_size);
        PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_7, __pyx_v_size);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 215, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* "pyarrow/array.pxi":214
 *                 values = values.data
 * 
 *         if hasattr(values, '__arrow_array__'):             # <<<<<<<<<<<<<<
 *             return _handle_arrow_array_protocol(values, type, mask, size)
 *         elif pandas_api.is_categorical(values):
 */
    }

    /* "pyarrow/array.pxi":216
 *         if hasattr(values, '__arrow_array__'):
 *             return _handle_arrow_array_protocol(values, type, mask, size)
 *         elif pandas_api.is_categorical(values):             # <<<<<<<<<<<<<<
 *             if type is not None:
 *                 if type.id != Type_DICTIONARY:
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib__PandasAPIShim *)__pyx_v_7pyarrow_3lib_pandas_api->__pyx_vtab)->is_categorical(__pyx_v_7pyarrow_3lib_pandas_api, __pyx_v_values, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 216, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(1, 216, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_9) {

      /* "pyarrow/array.pxi":217
 *             return _handle_arrow_array_protocol(values, type, mask, size)
 *         elif pandas_api.is_categorical(values):
 *             if type is not None:             # <<<<<<<<<<<<<<
 *                 if type.id != Type_DICTIONARY:
 *                     return _ndarray_to_array(
 */
      __pyx_t_9 = (__pyx_v_type != Py_None);
      __pyx_t_4 = (__pyx_t_9 != 0);
      if (__pyx_t_4) {

        /* "pyarrow/array.pxi":218
 *         elif pandas_api.is_categorical(values):
 *             if type is not None:
 *                 if type.id != Type_DICTIONARY:             # <<<<<<<<<<<<<<
 *                     return _ndarray_to_array(
 *                         np.asarray(values), mask, type, c_from_pandas, safe,
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_type, __pyx_n_s_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 218, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Type_DICTIONARY); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 218, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 218, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 218, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (__pyx_t_4) {

          /* "pyarrow/array.pxi":219
 *             if type is not None:
 *                 if type.id != Type_DICTIONARY:
 *                     return _ndarray_to_array(             # <<<<<<<<<<<<<<
 *                         np.asarray(values), mask, type, c_from_pandas, safe,
 *                         pool)
 */
          __Pyx_XDECREF(__pyx_r);

          /* "pyarrow/array.pxi":220
 *                 if type.id != Type_DICTIONARY:
 *                     return _ndarray_to_array(
 *                         np.asarray(values), mask, type, c_from_pandas, safe,             # <<<<<<<<<<<<<<
 *                         pool)
 *                 index_type = type.index_type
 */
          __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 220, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 220, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = NULL;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_5)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_5);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
            }
          }
          __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v_values) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_values);
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 220, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (!(likely(((__pyx_v_type) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_type, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(1, 220, __pyx_L1_error)

          /* "pyarrow/array.pxi":219
 *             if type is not None:
 *                 if type.id != Type_DICTIONARY:
 *                     return _ndarray_to_array(             # <<<<<<<<<<<<<<
 *                         np.asarray(values), mask, type, c_from_pandas, safe,
 *                         pool)
 */
          __pyx_t_1 = __pyx_f_7pyarrow_3lib__ndarray_to_array(__pyx_t_6, __pyx_v_mask, ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_type), __pyx_v_c_from_pandas, __pyx_v_safe, __pyx_v_pool); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 219, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_r = __pyx_t_1;
          __pyx_t_1 = 0;
          goto __pyx_L0;

          /* "pyarrow/array.pxi":218
 *         elif pandas_api.is_categorical(values):
 *             if type is not None:
 *                 if type.id != Type_DICTIONARY:             # <<<<<<<<<<<<<<
 *                     return _ndarray_to_array(
 *                         np.asarray(values), mask, type, c_from_pandas, safe,
 */
        }

        /* "pyarrow/array.pxi":222
 *                         np.asarray(values), mask, type, c_from_pandas, safe,
 *                         pool)
 *                 index_type = type.index_type             # <<<<<<<<<<<<<<
 *                 value_type = type.value_type
 *                 if values.ordered != type.ordered:
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_type, __pyx_n_s_index_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 222, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_v_index_type = __pyx_t_1;
        __pyx_t_1 = 0;

        /* "pyarrow/array.pxi":223
 *                         pool)
 *                 index_type = type.index_type
 *                 value_type = type.value_type             # <<<<<<<<<<<<<<
 *                 if values.ordered != type.ordered:
 *                     warnings.warn(
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_type, __pyx_n_s_value_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 223, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_v_value_type = __pyx_t_1;
        __pyx_t_1 = 0;

        /* "pyarrow/array.pxi":224
 *                 index_type = type.index_type
 *                 value_type = type.value_type
 *                 if values.ordered != type.ordered:             # <<<<<<<<<<<<<<
 *                     warnings.warn(
 *                         "The 'ordered' flag of the passed categorical values "
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_ordered); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 224, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_type, __pyx_n_s_ordered); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 224, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_6, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 224, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 224, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (__pyx_t_4) {

          /* "pyarrow/array.pxi":225
 *                 value_type = type.value_type
 *                 if values.ordered != type.ordered:
 *                     warnings.warn(             # <<<<<<<<<<<<<<
 *                         "The 'ordered' flag of the passed categorical values "
 *                         "does not match the 'ordered' of the specified type. "
 */
          __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_warnings); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 225, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_warn); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 225, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "pyarrow/array.pxi":230
 *                         "Using the flag of the values, but in the future this "
 *                         "mismatch will raise a ValueError.",
 *                         FutureWarning, stacklevel=2)             # <<<<<<<<<<<<<<
 *             else:
 *                 index_type = None
 */
          __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 230, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_stacklevel, __pyx_int_2) < 0) __PYX_ERR(1, 230, __pyx_L1_error)

          /* "pyarrow/array.pxi":225
 *                 value_type = type.value_type
 *                 if values.ordered != type.ordered:
 *                     warnings.warn(             # <<<<<<<<<<<<<<
 *                         "The 'ordered' flag of the passed categorical values "
 *                         "does not match the 'ordered' of the specified type. "
 */
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__140, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 225, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "pyarrow/array.pxi":224
 *                 index_type = type.index_type
 *                 value_type = type.value_type
 *                 if values.ordered != type.ordered:             # <<<<<<<<<<<<<<
 *                     warnings.warn(
 *                         "The 'ordered' flag of the passed categorical values "
 */
        }

        /* "pyarrow/array.pxi":217
 *             return _handle_arrow_array_protocol(values, type, mask, size)
 *         elif pandas_api.is_categorical(values):
 *             if type is not None:             # <<<<<<<<<<<<<<
 *                 if type.id != Type_DICTIONARY:
 *                     return _ndarray_to_array(
 */
        goto __pyx_L12;
      }

      /* "pyarrow/array.pxi":232
 *                         FutureWarning, stacklevel=2)
 *             else:
 *                 index_type = None             # <<<<<<<<<<<<<<
 *                 value_type = None
 * 
 */
      /*else*/ {
        __Pyx_INCREF(Py_None);
        __pyx_v_index_type = Py_None;

        /* "pyarrow/array.pxi":233
 *             else:
 *                 index_type = None
 *                 value_type = None             # <<<<<<<<<<<<<<
 * 
 *             indices = _codes_to_indices(
 */
        __Pyx_INCREF(Py_None);
        __pyx_v_value_type = Py_None;
      }
      __pyx_L12:;

      /* "pyarrow/array.pxi":236
 * 
 *             indices = _codes_to_indices(
 *                 values.codes, mask, index_type, memory_pool)             # <<<<<<<<<<<<<<
 *             try:
 *                 dictionary = array(
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_codes); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 236, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(((__pyx_v_index_type) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_index_type, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(1, 236, __pyx_L1_error)

      /* "pyarrow/array.pxi":235
 *                 value_type = None
 * 
 *             indices = _codes_to_indices(             # <<<<<<<<<<<<<<
 *                 values.codes, mask, index_type, memory_pool)
 *             try:
 */
      __pyx_t_5 = __pyx_f_7pyarrow_3lib__codes_to_indices(__pyx_t_1, __pyx_v_mask, ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_index_type), __pyx_v_memory_pool); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 235, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_indices = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "pyarrow/array.pxi":237
 *             indices = _codes_to_indices(
 *                 values.codes, mask, index_type, memory_pool)
 *             try:             # <<<<<<<<<<<<<<
 *                 dictionary = array(
 *                     values.categories.values, type=value_type,
 */
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_12);
        /*try:*/ {

          /* "pyarrow/array.pxi":238
 *                 values.codes, mask, index_type, memory_pool)
 *             try:
 *                 dictionary = array(             # <<<<<<<<<<<<<<
 *                     values.categories.values, type=value_type,
 *                     memory_pool=memory_pool)
 */
          __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 238, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_5);

          /* "pyarrow/array.pxi":239
 *             try:
 *                 dictionary = array(
 *                     values.categories.values, type=value_type,             # <<<<<<<<<<<<<<
 *                     memory_pool=memory_pool)
 *             except TypeError:
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_categories); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 239, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_values); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 239, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "pyarrow/array.pxi":238
 *                 values.codes, mask, index_type, memory_pool)
 *             try:
 *                 dictionary = array(             # <<<<<<<<<<<<<<
 *                     values.categories.values, type=value_type,
 *                     memory_pool=memory_pool)
 */
          __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 238, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_6);
          PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
          __pyx_t_6 = 0;

          /* "pyarrow/array.pxi":239
 *             try:
 *                 dictionary = array(
 *                     values.categories.values, type=value_type,             # <<<<<<<<<<<<<<
 *                     memory_pool=memory_pool)
 *             except TypeError:
 */
          __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 239, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_6);
          if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_type, __pyx_v_value_type) < 0) __PYX_ERR(1, 239, __pyx_L15_error)

          /* "pyarrow/array.pxi":240
 *                 dictionary = array(
 *                     values.categories.values, type=value_type,
 *                     memory_pool=memory_pool)             # <<<<<<<<<<<<<<
 *             except TypeError:
 *                 # TODO when removing the deprecation warning, this whole
 */
          if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_memory_pool, ((PyObject *)__pyx_v_memory_pool)) < 0) __PYX_ERR(1, 239, __pyx_L15_error)

          /* "pyarrow/array.pxi":238
 *                 values.codes, mask, index_type, memory_pool)
 *             try:
 *                 dictionary = array(             # <<<<<<<<<<<<<<
 *                     values.categories.values, type=value_type,
 *                     memory_pool=memory_pool)
 */
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 238, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_v_dictionary = __pyx_t_8;
          __pyx_t_8 = 0;

          /* "pyarrow/array.pxi":237
 *             indices = _codes_to_indices(
 *                 values.codes, mask, index_type, memory_pool)
 *             try:             # <<<<<<<<<<<<<<
 *                 dictionary = array(
 *                     values.categories.values, type=value_type,
 */
        }
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        goto __pyx_L20_try_end;
        __pyx_L15_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "pyarrow/array.pxi":241
 *                     values.categories.values, type=value_type,
 *                     memory_pool=memory_pool)
 *             except TypeError:             # <<<<<<<<<<<<<<
 *                 # TODO when removing the deprecation warning, this whole
 *                 # try/except can be removed (to bubble the TypeError of
 */
        __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
        if (__pyx_t_7) {
          __Pyx_AddTraceback("pyarrow.lib.array", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_6, &__pyx_t_1) < 0) __PYX_ERR(1, 241, __pyx_L17_except_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GOTREF(__pyx_t_1);

          /* "pyarrow/array.pxi":245
 *                 # try/except can be removed (to bubble the TypeError of
 *                 # the first array(..) call)
 *                 if value_type is not None:             # <<<<<<<<<<<<<<
 *                     warnings.warn(
 *                         "The dtype of the 'categories' of the passed "
 */
          __pyx_t_4 = (__pyx_v_value_type != Py_None);
          __pyx_t_9 = (__pyx_t_4 != 0);
          if (likely(__pyx_t_9)) {

            /* "pyarrow/array.pxi":246
 *                 # the first array(..) call)
 *                 if value_type is not None:
 *                     warnings.warn(             # <<<<<<<<<<<<<<
 *                         "The dtype of the 'categories' of the passed "
 *                         "categorical values ({0}) does not match the "
 */
            __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_warnings); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 246, __pyx_L17_except_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_warn); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 246, __pyx_L17_except_error)
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

            /* "pyarrow/array.pxi":251
 *                         "specified type ({1}). For now ignoring the specified "
 *                         "type, but in the future this mismatch will raise a "
 *                         "TypeError".format(             # <<<<<<<<<<<<<<
 *                             values.categories.dtype, value_type),
 *                         FutureWarning, stacklevel=2)
 */
            __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_The_dtype_of_the_categories_of_t, __pyx_n_s_format); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 251, __pyx_L17_except_error)
            __Pyx_GOTREF(__pyx_t_14);

            /* "pyarrow/array.pxi":252
 *                         "type, but in the future this mismatch will raise a "
 *                         "TypeError".format(
 *                             values.categories.dtype, value_type),             # <<<<<<<<<<<<<<
 *                         FutureWarning, stacklevel=2)
 *                     dictionary = array(
 */
            __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_categories); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 252, __pyx_L17_except_error)
            __Pyx_GOTREF(__pyx_t_15);
            __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_dtype); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 252, __pyx_L17_except_error)
            __Pyx_GOTREF(__pyx_t_16);
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
            __pyx_t_15 = NULL;
            __pyx_t_7 = 0;
            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) {
              __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
              if (likely(__pyx_t_15)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
                __Pyx_INCREF(__pyx_t_15);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_14, function);
                __pyx_t_7 = 1;
              }
            }
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_14)) {
              PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_t_16, __pyx_v_value_type};
              __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L17_except_error)
              __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_14)) {
              PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_t_16, __pyx_v_value_type};
              __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L17_except_error)
              __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            } else
            #endif
            {
              __pyx_t_17 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_17)) __PYX_ERR(1, 251, __pyx_L17_except_error)
              __Pyx_GOTREF(__pyx_t_17);
              if (__pyx_t_15) {
                __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_15); __pyx_t_15 = NULL;
              }
              __Pyx_GIVEREF(__pyx_t_16);
              PyTuple_SET_ITEM(__pyx_t_17, 0+__pyx_t_7, __pyx_t_16);
              __Pyx_INCREF(__pyx_v_value_type);
              __Pyx_GIVEREF(__pyx_v_value_type);
              PyTuple_SET_ITEM(__pyx_t_17, 1+__pyx_t_7, __pyx_v_value_type);
              __pyx_t_16 = 0;
              __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_17, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L17_except_error)
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
            }
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

            /* "pyarrow/array.pxi":246
 *                 # the first array(..) call)
 *                 if value_type is not None:
 *                     warnings.warn(             # <<<<<<<<<<<<<<
 *                         "The dtype of the 'categories' of the passed "
 *                         "categorical values ({0}) does not match the "
 */
            __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 246, __pyx_L17_except_error)
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_GIVEREF(__pyx_t_5);
            PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_5);
            __Pyx_INCREF(__pyx_builtin_FutureWarning);
            __Pyx_GIVEREF(__pyx_builtin_FutureWarning);
            PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_builtin_FutureWarning);
            __pyx_t_5 = 0;

            /* "pyarrow/array.pxi":253
 *                         "TypeError".format(
 *                             values.categories.dtype, value_type),
 *                         FutureWarning, stacklevel=2)             # <<<<<<<<<<<<<<
 *                     dictionary = array(
 *                         values.categories.values, memory_pool=memory_pool)
 */
            __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 253, __pyx_L17_except_error)
            __Pyx_GOTREF(__pyx_t_5);
            if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_stacklevel, __pyx_int_2) < 0) __PYX_ERR(1, 253, __pyx_L17_except_error)

            /* "pyarrow/array.pxi":246
 *                 # the first array(..) call)
 *                 if value_type is not None:
 *                     warnings.warn(             # <<<<<<<<<<<<<<
 *                         "The dtype of the 'categories' of the passed "
 *                         "categorical values ({0}) does not match the "
 */
            __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_14, __pyx_t_5); if (unlikely(!__pyx_t_17)) __PYX_ERR(1, 246, __pyx_L17_except_error)
            __Pyx_GOTREF(__pyx_t_17);
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

            /* "pyarrow/array.pxi":254
 *                             values.categories.dtype, value_type),
 *                         FutureWarning, stacklevel=2)
 *                     dictionary = array(             # <<<<<<<<<<<<<<
 *                         values.categories.values, memory_pool=memory_pool)
 *                 else:
 */
            __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_n_s_array); if (unlikely(!__pyx_t_17)) __PYX_ERR(1, 254, __pyx_L17_except_error)
            __Pyx_GOTREF(__pyx_t_17);

            /* "pyarrow/array.pxi":255
 *                         FutureWarning, stacklevel=2)
 *                     dictionary = array(
 *                         values.categories.values, memory_pool=memory_pool)             # <<<<<<<<<<<<<<
 *                 else:
 *                     raise
 */
            __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_categories); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 255, __pyx_L17_except_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_values); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 255, __pyx_L17_except_error)
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

            /* "pyarrow/array.pxi":254
 *                             values.categories.dtype, value_type),
 *                         FutureWarning, stacklevel=2)
 *                     dictionary = array(             # <<<<<<<<<<<<<<
 *                         values.categories.values, memory_pool=memory_pool)
 *                 else:
 */
            __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 254, __pyx_L17_except_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_14);
            PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_14);
            __pyx_t_14 = 0;

            /* "pyarrow/array.pxi":255
 *                         FutureWarning, stacklevel=2)
 *                     dictionary = array(
 *                         values.categories.values, memory_pool=memory_pool)             # <<<<<<<<<<<<<<
 *                 else:
 *                     raise
 */
            __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 255, __pyx_L17_except_error)
            __Pyx_GOTREF(__pyx_t_14);
            if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_memory_pool, ((PyObject *)__pyx_v_memory_pool)) < 0) __PYX_ERR(1, 255, __pyx_L17_except_error)

            /* "pyarrow/array.pxi":254
 *                             values.categories.dtype, value_type),
 *                         FutureWarning, stacklevel=2)
 *                     dictionary = array(             # <<<<<<<<<<<<<<
 *                         values.categories.values, memory_pool=memory_pool)
 *                 else:
 */
            __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_5, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 254, __pyx_L17_except_error)
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_XDECREF_SET(__pyx_v_dictionary, __pyx_t_13);
            __pyx_t_13 = 0;

            /* "pyarrow/array.pxi":245
 *                 # try/except can be removed (to bubble the TypeError of
 *                 # the first array(..) call)
 *                 if value_type is not None:             # <<<<<<<<<<<<<<
 *                     warnings.warn(
 *                         "The dtype of the 'categories' of the passed "
 */
            goto __pyx_L23;
          }

          /* "pyarrow/array.pxi":257
 *                         values.categories.values, memory_pool=memory_pool)
 *                 else:
 *                     raise             # <<<<<<<<<<<<<<
 * 
 *             return DictionaryArray.from_arrays(
 */
          /*else*/ {
            __Pyx_GIVEREF(__pyx_t_8);
            __Pyx_GIVEREF(__pyx_t_6);
            __Pyx_XGIVEREF(__pyx_t_1);
            __Pyx_ErrRestoreWithState(__pyx_t_8, __pyx_t_6, __pyx_t_1);
            __pyx_t_8 = 0; __pyx_t_6 = 0; __pyx_t_1 = 0; 
            __PYX_ERR(1, 257, __pyx_L17_except_error)
          }
          __pyx_L23:;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L16_exception_handled;
        }
        goto __pyx_L17_except_error;
        __pyx_L17_except_error:;

        /* "pyarrow/array.pxi":237
 *             indices = _codes_to_indices(
 *                 values.codes, mask, index_type, memory_pool)
 *             try:             # <<<<<<<<<<<<<<
 *                 dictionary = array(
 *                     values.categories.values, type=value_type,
 */
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
        goto __pyx_L1_error;
        __pyx_L16_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
        __pyx_L20_try_end:;
      }

      /* "pyarrow/array.pxi":259
 *                     raise
 * 
 *             return DictionaryArray.from_arrays(             # <<<<<<<<<<<<<<
 *                 indices, dictionary, ordered=values.ordered, safe=safe)
 *         else:
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_DictionaryArray), __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 259, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);

      /* "pyarrow/array.pxi":260
 * 
 *             return DictionaryArray.from_arrays(
 *                 indices, dictionary, ordered=values.ordered, safe=safe)             # <<<<<<<<<<<<<<
 *         else:
 *             if pandas_api.have_pandas:
 */
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 259, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_indices);
      __Pyx_GIVEREF(__pyx_v_indices);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_indices);
      __Pyx_INCREF(__pyx_v_dictionary);
      __Pyx_GIVEREF(__pyx_v_dictionary);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_dictionary);
      __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 260, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_ordered); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 260, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_ordered, __pyx_t_13) < 0) __PYX_ERR(1, 260, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_13 = __Pyx_PyBool_FromLong(__pyx_v_safe); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 260, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_safe, __pyx_t_13) < 0) __PYX_ERR(1, 260, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

      /* "pyarrow/array.pxi":259
 *                     raise
 * 
 *             return DictionaryArray.from_arrays(             # <<<<<<<<<<<<<<
 *                 indices, dictionary, ordered=values.ordered, safe=safe)
 *         else:
 */
      __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 259, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_r = __pyx_t_13;
      __pyx_t_13 = 0;
      goto __pyx_L0;

      /* "pyarrow/array.pxi":216
 *         if hasattr(values, '__arrow_array__'):
 *             return _handle_arrow_array_protocol(values, type, mask, size)
 *         elif pandas_api.is_categorical(values):             # <<<<<<<<<<<<<<
 *             if type is not None:
 *                 if type.id != Type_DICTIONARY:
 */
    }

    /* "pyarrow/array.pxi":262
 *                 indices, dictionary, ordered=values.ordered, safe=safe)
 *         else:
 *             if pandas_api.have_pandas:             # <<<<<<<<<<<<<<
 *                 values, type = pandas_api.compat.get_datetimetz_type(
 *                     values, obj.dtype, type)
 */
    /*else*/ {
      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_7pyarrow_3lib_pandas_api), __pyx_n_s_have_pandas); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 262, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(1, 262, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (__pyx_t_9) {

        /* "pyarrow/array.pxi":263
 *         else:
 *             if pandas_api.have_pandas:
 *                 values, type = pandas_api.compat.get_datetimetz_type(             # <<<<<<<<<<<<<<
 *                     values, obj.dtype, type)
 *             return _ndarray_to_array(values, mask, type, c_from_pandas, safe,
 */
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_7pyarrow_3lib_pandas_api), __pyx_n_s_compat); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 263, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_get_datetimetz_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 263, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "pyarrow/array.pxi":264
 *             if pandas_api.have_pandas:
 *                 values, type = pandas_api.compat.get_datetimetz_type(
 *                     values, obj.dtype, type)             # <<<<<<<<<<<<<<
 *             return _ndarray_to_array(values, mask, type, c_from_pandas, safe,
 *                                      pool)
 */
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 264, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_1 = NULL;
        __pyx_t_7 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_1)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_7 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_v_values, __pyx_t_8, __pyx_v_type};
          __pyx_t_13 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 263, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_v_values, __pyx_t_8, __pyx_v_type};
          __pyx_t_13 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 263, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        } else
        #endif
        {
          __pyx_t_14 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 263, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          if (__pyx_t_1) {
            __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_1); __pyx_t_1 = NULL;
          }
          __Pyx_INCREF(__pyx_v_values);
          __Pyx_GIVEREF(__pyx_v_values);
          PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_7, __pyx_v_values);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_7, __pyx_t_8);
          __Pyx_INCREF(__pyx_v_type);
          __Pyx_GIVEREF(__pyx_v_type);
          PyTuple_SET_ITEM(__pyx_t_14, 2+__pyx_t_7, __pyx_v_type);
          __pyx_t_8 = 0;
          __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_14, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 263, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if ((likely(PyTuple_CheckExact(__pyx_t_13))) || (PyList_CheckExact(__pyx_t_13))) {
          PyObject* sequence = __pyx_t_13;
          Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
          if (unlikely(size != 2)) {
            if (size > 2) __Pyx_RaiseTooManyValuesError(2);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            __PYX_ERR(1, 263, __pyx_L1_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
            __pyx_t_14 = PyTuple_GET_ITEM(sequence, 1); 
          } else {
            __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
            __pyx_t_14 = PyList_GET_ITEM(sequence, 1); 
          }
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_14);
          #else
          __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 263, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_14 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 263, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          #endif
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_8 = PyObject_GetIter(__pyx_t_13); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 263, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_t_18 = Py_TYPE(__pyx_t_8)->tp_iternext;
          index = 0; __pyx_t_6 = __pyx_t_18(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L25_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_6);
          index = 1; __pyx_t_14 = __pyx_t_18(__pyx_t_8); if (unlikely(!__pyx_t_14)) goto __pyx_L25_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_14);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_18(__pyx_t_8), 2) < 0) __PYX_ERR(1, 263, __pyx_L1_error)
          __pyx_t_18 = NULL;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          goto __pyx_L26_unpacking_done;
          __pyx_L25_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_18 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(1, 263, __pyx_L1_error)
          __pyx_L26_unpacking_done:;
        }

        /* "pyarrow/array.pxi":263
 *         else:
 *             if pandas_api.have_pandas:
 *                 values, type = pandas_api.compat.get_datetimetz_type(             # <<<<<<<<<<<<<<
 *                     values, obj.dtype, type)
 *             return _ndarray_to_array(values, mask, type, c_from_pandas, safe,
 */
        __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_6);
        __pyx_t_6 = 0;
        __Pyx_DECREF_SET(__pyx_v_type, __pyx_t_14);
        __pyx_t_14 = 0;

        /* "pyarrow/array.pxi":262
 *                 indices, dictionary, ordered=values.ordered, safe=safe)
 *         else:
 *             if pandas_api.have_pandas:             # <<<<<<<<<<<<<<
 *                 values, type = pandas_api.compat.get_datetimetz_type(
 *                     values, obj.dtype, type)
 */
      }

      /* "pyarrow/array.pxi":265
 *                 values, type = pandas_api.compat.get_datetimetz_type(
 *                     values, obj.dtype, type)
 *             return _ndarray_to_array(values, mask, type, c_from_pandas, safe,             # <<<<<<<<<<<<<<
 *                                      pool)
 *     else:
 */
      __Pyx_XDECREF(__pyx_r);
      if (!(likely(((__pyx_v_type) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_type, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(1, 265, __pyx_L1_error)

      /* "pyarrow/array.pxi":266
 *                     values, obj.dtype, type)
 *             return _ndarray_to_array(values, mask, type, c_from_pandas, safe,
 *                                      pool)             # <<<<<<<<<<<<<<
 *     else:
 *         # ConvertPySequence does strict conversion if type is explicitly passed
 */
      __pyx_t_13 = __pyx_f_7pyarrow_3lib__ndarray_to_array(__pyx_v_values, __pyx_v_mask, ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_type), __pyx_v_c_from_pandas, __pyx_v_safe, __pyx_v_pool); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 265, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_r = __pyx_t_13;
      __pyx_t_13 = 0;
      goto __pyx_L0;
    }

    /* "pyarrow/array.pxi":197
 *     if hasattr(obj, '__arrow_array__'):
 *         return _handle_arrow_array_protocol(obj, type, mask, size)
 *     elif _is_array_like(obj):             # <<<<<<<<<<<<<<
 *         if mask is not None:
 *             # out argument unused
 */
  }

  /* "pyarrow/array.pxi":269
 *     else:
 *         # ConvertPySequence does strict conversion if type is explicitly passed
 *         return _sequence_to_array(obj, mask, size, type, pool, c_from_pandas)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    if (!(likely(((__pyx_v_type) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_type, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(1, 269, __pyx_L1_error)
    __pyx_t_13 = __pyx_f_7pyarrow_3lib__sequence_to_array(__pyx_v_obj, __pyx_v_mask, __pyx_v_size, ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_type), __pyx_v_pool, __pyx_v_c_from_pandas); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 269, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_r = __pyx_t_13;
    __pyx_t_13 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/array.pxi":114
 * 
 * 
 * def array(object obj, type=None, mask=None, size=None, from_pandas=None,             # <<<<<<<<<<<<<<
 *           bint safe=True, MemoryPool memory_pool=None):
 *     """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_AddTraceback("pyarrow.lib.array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_values);
  __Pyx_XDECREF(__pyx_v_index_type);
  __Pyx_XDECREF(__pyx_v_value_type);
  __Pyx_XDECREF(__pyx_v_indices);
  __Pyx_XDECREF(__pyx_v_dictionary);
  __Pyx_XDECREF(__pyx_v_type);
  __Pyx_XDECREF(__pyx_v_mask);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":272
 * 
 * 
 * def asarray(values, type=None):             # <<<<<<<<<<<<<<
 *     """
 *     Convert to pyarrow.Array, inferring type if not provided. Attempt to cast
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_135asarray(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_134asarray[] = "asarray(values, type=None)\n\n    Convert to pyarrow.Array, inferring type if not provided. Attempt to cast\n    if indicated type is different\n\n    Parameters\n    ----------\n    values : array-like\n        This can be a sequence, numpy.ndarray, pyarrow.Array or\n        pyarrow.ChunkedArray. If a ChunkedArray is passed, the output will be\n        a ChunkedArray, otherwise the output will be a Array.\n    type : string or DataType\n\n    Returns\n    -------\n    arr : Array or ChunkedArray\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_135asarray = {"asarray", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_135asarray, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_134asarray};
static PyObject *__pyx_pw_7pyarrow_3lib_135asarray(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_values = 0;
  PyObject *__pyx_v_type = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("asarray (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_type,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "asarray") < 0)) __PYX_ERR(1, 272, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_values = values[0];
    __pyx_v_type = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("asarray", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 272, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.asarray", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_134asarray(__pyx_self, __pyx_v_values, __pyx_v_type);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_134asarray(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_values, PyObject *__pyx_v_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("asarray", 0);
  __Pyx_INCREF(__pyx_v_values);

  /* "pyarrow/array.pxi":289
 *     arr : Array or ChunkedArray
 *     """
 *     if isinstance(values, (Array, ChunkedArray)):             # <<<<<<<<<<<<<<
 *         if type is not None and not values.type.equals(type):
 *             values = values.cast(type)
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_values, __pyx_ptype_7pyarrow_3lib_Array); 
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_values, __pyx_ptype_7pyarrow_3lib_ChunkedArray); 
  __pyx_t_2 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":290
 *     """
 *     if isinstance(values, (Array, ChunkedArray)):
 *         if type is not None and not values.type.equals(type):             # <<<<<<<<<<<<<<
 *             values = values.cast(type)
 * 
 */
    __pyx_t_1 = (__pyx_v_type != Py_None);
    __pyx_t_3 = (__pyx_t_1 != 0);
    if (__pyx_t_3) {
    } else {
      __pyx_t_2 = __pyx_t_3;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 290, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_equals); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 290, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_type) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_type);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 290, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(1, 290, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = ((!__pyx_t_3) != 0);
    __pyx_t_2 = __pyx_t_1;
    __pyx_L7_bool_binop_done:;
    if (__pyx_t_2) {

      /* "pyarrow/array.pxi":291
 *     if isinstance(values, (Array, ChunkedArray)):
 *         if type is not None and not values.type.equals(type):
 *             values = values.cast(type)             # <<<<<<<<<<<<<<
 * 
 *         return values
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_cast); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 291, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_type) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_type);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 291, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "pyarrow/array.pxi":290
 *     """
 *     if isinstance(values, (Array, ChunkedArray)):
 *         if type is not None and not values.type.equals(type):             # <<<<<<<<<<<<<<
 *             values = values.cast(type)
 * 
 */
    }

    /* "pyarrow/array.pxi":293
 *             values = values.cast(type)
 * 
 *         return values             # <<<<<<<<<<<<<<
 *     else:
 *         return array(values, type=type)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_values);
    __pyx_r = __pyx_v_values;
    goto __pyx_L0;

    /* "pyarrow/array.pxi":289
 *     arr : Array or ChunkedArray
 *     """
 *     if isinstance(values, (Array, ChunkedArray)):             # <<<<<<<<<<<<<<
 *         if type is not None and not values.type.equals(type):
 *             values = values.cast(type)
 */
  }

  /* "pyarrow/array.pxi":295
 *         return values
 *     else:
 *         return array(values, type=type)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 295, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 295, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_values);
    __Pyx_GIVEREF(__pyx_v_values);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_values);
    __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 295, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_type, __pyx_v_type) < 0) __PYX_ERR(1, 295, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 295, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_7;
    __pyx_t_7 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/array.pxi":272
 * 
 * 
 * def asarray(values, type=None):             # <<<<<<<<<<<<<<
 *     """
 *     Convert to pyarrow.Array, inferring type if not provided. Attempt to cast
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.asarray", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_values);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":298
 * 
 * 
 * def infer_type(values, mask=None, from_pandas=False):             # <<<<<<<<<<<<<<
 *     """
 *     Attempt to infer Arrow data type that can hold the passed Python
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_137infer_type(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_136infer_type[] = "infer_type(values, mask=None, from_pandas=False)\n\n    Attempt to infer Arrow data type that can hold the passed Python\n    sequence type in an Array object\n\n    Parameters\n    ----------\n    values : array-like\n        Sequence to infer type from\n    mask : ndarray (bool type), optional\n        Optional exclusion mask where True marks null, False non-null\n    from_pandas : boolean, default False\n        Use pandas's NA/null sentinel values for type inference\n\n    Returns\n    -------\n    type : DataType\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_137infer_type = {"infer_type", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_137infer_type, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_136infer_type};
static PyObject *__pyx_pw_7pyarrow_3lib_137infer_type(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_values = 0;
  PyObject *__pyx_v_mask = 0;
  PyObject *__pyx_v_from_pandas = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("infer_type (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_mask,&__pyx_n_s_from_pandas,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mask);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_from_pandas);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "infer_type") < 0)) __PYX_ERR(1, 298, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_values = values[0];
    __pyx_v_mask = values[1];
    __pyx_v_from_pandas = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("infer_type", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 298, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.infer_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_136infer_type(__pyx_self, __pyx_v_values, __pyx_v_mask, __pyx_v_from_pandas);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_136infer_type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_values, PyObject *__pyx_v_mask, PyObject *__pyx_v_from_pandas) {
  std::shared_ptr< arrow::DataType>  __pyx_v_out;
  bool __pyx_v_use_pandas_sentinels;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  bool __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("infer_type", 0);
  __Pyx_INCREF(__pyx_v_mask);

  /* "pyarrow/array.pxi":318
 *     cdef:
 *         shared_ptr[CDataType] out
 *         c_bool use_pandas_sentinels = from_pandas             # <<<<<<<<<<<<<<
 * 
 *     if mask is not None and not isinstance(mask, np.ndarray):
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_from_pandas); if (unlikely((__pyx_t_1 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(1, 318, __pyx_L1_error)
  __pyx_v_use_pandas_sentinels = __pyx_t_1;

  /* "pyarrow/array.pxi":320
 *         c_bool use_pandas_sentinels = from_pandas
 * 
 *     if mask is not None and not isinstance(mask, np.ndarray):             # <<<<<<<<<<<<<<
 *         mask = np.array(mask, dtype=bool)
 * 
 */
  __pyx_t_3 = (__pyx_v_mask != Py_None);
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_4 = PyObject_IsInstance(__pyx_v_mask, __pyx_t_6); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 320, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_3 = ((!(__pyx_t_4 != 0)) != 0);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":321
 * 
 *     if mask is not None and not isinstance(mask, np.ndarray):
 *         mask = np.array(mask, dtype=bool)             # <<<<<<<<<<<<<<
 * 
 *     check_status(InferArrowType(values, mask, use_pandas_sentinels, &out))
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 321, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 321, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 321, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_mask);
    __Pyx_GIVEREF(__pyx_v_mask);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_mask);
    __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 321, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) __PYX_ERR(1, 321, __pyx_L1_error)
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 321, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF_SET(__pyx_v_mask, __pyx_t_8);
    __pyx_t_8 = 0;

    /* "pyarrow/array.pxi":320
 *         c_bool use_pandas_sentinels = from_pandas
 * 
 *     if mask is not None and not isinstance(mask, np.ndarray):             # <<<<<<<<<<<<<<
 *         mask = np.array(mask, dtype=bool)
 * 
 */
  }

  /* "pyarrow/array.pxi":323
 *         mask = np.array(mask, dtype=bool)
 * 
 *     check_status(InferArrowType(values, mask, use_pandas_sentinels, &out))             # <<<<<<<<<<<<<<
 *     return pyarrow_wrap_data_type(out)
 * 
 */
  __pyx_t_9 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::InferArrowType(__pyx_v_values, __pyx_v_mask, __pyx_v_use_pandas_sentinels, (&__pyx_v_out))); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 323, __pyx_L1_error)

  /* "pyarrow/array.pxi":324
 * 
 *     check_status(InferArrowType(values, mask, use_pandas_sentinels, &out))
 *     return pyarrow_wrap_data_type(out)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_8 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_out); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_r = __pyx_t_8;
  __pyx_t_8 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":298
 * 
 * 
 * def infer_type(values, mask=None, from_pandas=False):             # <<<<<<<<<<<<<<
 *     """
 *     Attempt to infer Arrow data type that can hold the passed Python
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow.lib.infer_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_mask);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":327
 * 
 * 
 * def _normalize_slice(object arrow_obj, slice key):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t start, stop, step
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_139_normalize_slice(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_138_normalize_slice[] = "_normalize_slice(arrow_obj, slice key)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_139_normalize_slice = {"_normalize_slice", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_139_normalize_slice, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_138_normalize_slice};
static PyObject *__pyx_pw_7pyarrow_3lib_139_normalize_slice(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_arrow_obj = 0;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_normalize_slice (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arrow_obj,&__pyx_n_s_key,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arrow_obj)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_normalize_slice", 1, 2, 2, 1); __PYX_ERR(1, 327, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_normalize_slice") < 0)) __PYX_ERR(1, 327, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_arrow_obj = values[0];
    __pyx_v_key = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_normalize_slice", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 327, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._normalize_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PySlice_Type), 1, "key", 1))) __PYX_ERR(1, 327, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_138_normalize_slice(__pyx_self, __pyx_v_arrow_obj, __pyx_v_key);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_138_normalize_slice(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arrow_obj, PyObject *__pyx_v_key) {
  Py_ssize_t __pyx_v_start;
  Py_ssize_t __pyx_v_stop;
  Py_ssize_t __pyx_v_step;
  Py_ssize_t __pyx_v_n;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_RefNannySetupContext("_normalize_slice", 0);

  /* "pyarrow/array.pxi":330
 *     cdef:
 *         Py_ssize_t start, stop, step
 *         Py_ssize_t n = len(arrow_obj)             # <<<<<<<<<<<<<<
 * 
 *     start = key.start or 0
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_arrow_obj); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 330, __pyx_L1_error)
  __pyx_v_n = __pyx_t_1;

  /* "pyarrow/array.pxi":332
 *         Py_ssize_t n = len(arrow_obj)
 * 
 *     start = key.start or 0             # <<<<<<<<<<<<<<
 *     if start < 0:
 *         start += n
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(((PySliceObject*)__pyx_v_key)->start); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 332, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(((PySliceObject*)__pyx_v_key)->start); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 332, __pyx_L1_error)
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_1 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_v_start = __pyx_t_1;

  /* "pyarrow/array.pxi":333
 * 
 *     start = key.start or 0
 *     if start < 0:             # <<<<<<<<<<<<<<
 *         start += n
 *         if start < 0:
 */
  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":334
 *     start = key.start or 0
 *     if start < 0:
 *         start += n             # <<<<<<<<<<<<<<
 *         if start < 0:
 *             start = 0
 */
    __pyx_v_start = (__pyx_v_start + __pyx_v_n);

    /* "pyarrow/array.pxi":335
 *     if start < 0:
 *         start += n
 *         if start < 0:             # <<<<<<<<<<<<<<
 *             start = 0
 *     elif start >= n:
 */
    __pyx_t_2 = ((__pyx_v_start < 0) != 0);
    if (__pyx_t_2) {

      /* "pyarrow/array.pxi":336
 *         start += n
 *         if start < 0:
 *             start = 0             # <<<<<<<<<<<<<<
 *     elif start >= n:
 *         start = n
 */
      __pyx_v_start = 0;

      /* "pyarrow/array.pxi":335
 *     if start < 0:
 *         start += n
 *         if start < 0:             # <<<<<<<<<<<<<<
 *             start = 0
 *     elif start >= n:
 */
    }

    /* "pyarrow/array.pxi":333
 * 
 *     start = key.start or 0
 *     if start < 0:             # <<<<<<<<<<<<<<
 *         start += n
 *         if start < 0:
 */
    goto __pyx_L5;
  }

  /* "pyarrow/array.pxi":337
 *         if start < 0:
 *             start = 0
 *     elif start >= n:             # <<<<<<<<<<<<<<
 *         start = n
 * 
 */
  __pyx_t_2 = ((__pyx_v_start >= __pyx_v_n) != 0);
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":338
 *             start = 0
 *     elif start >= n:
 *         start = n             # <<<<<<<<<<<<<<
 * 
 *     stop = key.stop if key.stop is not None else n
 */
    __pyx_v_start = __pyx_v_n;

    /* "pyarrow/array.pxi":337
 *         if start < 0:
 *             start = 0
 *     elif start >= n:             # <<<<<<<<<<<<<<
 *         start = n
 * 
 */
  }
  __pyx_L5:;

  /* "pyarrow/array.pxi":340
 *         start = n
 * 
 *     stop = key.stop if key.stop is not None else n             # <<<<<<<<<<<<<<
 *     if stop < 0:
 *         stop += n
 */
  __pyx_t_2 = (((PySliceObject*)__pyx_v_key)->stop != Py_None);
  if ((__pyx_t_2 != 0)) {
    __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(((PySliceObject*)__pyx_v_key)->stop); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 340, __pyx_L1_error)
    __pyx_t_1 = __pyx_t_3;
  } else {
    __pyx_t_1 = __pyx_v_n;
  }
  __pyx_v_stop = __pyx_t_1;

  /* "pyarrow/array.pxi":341
 * 
 *     stop = key.stop if key.stop is not None else n
 *     if stop < 0:             # <<<<<<<<<<<<<<
 *         stop += n
 *         if stop < 0:
 */
  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":342
 *     stop = key.stop if key.stop is not None else n
 *     if stop < 0:
 *         stop += n             # <<<<<<<<<<<<<<
 *         if stop < 0:
 *             stop = 0
 */
    __pyx_v_stop = (__pyx_v_stop + __pyx_v_n);

    /* "pyarrow/array.pxi":343
 *     if stop < 0:
 *         stop += n
 *         if stop < 0:             # <<<<<<<<<<<<<<
 *             stop = 0
 *     elif stop >= n:
 */
    __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
    if (__pyx_t_2) {

      /* "pyarrow/array.pxi":344
 *         stop += n
 *         if stop < 0:
 *             stop = 0             # <<<<<<<<<<<<<<
 *     elif stop >= n:
 *         stop = n
 */
      __pyx_v_stop = 0;

      /* "pyarrow/array.pxi":343
 *     if stop < 0:
 *         stop += n
 *         if stop < 0:             # <<<<<<<<<<<<<<
 *             stop = 0
 *     elif stop >= n:
 */
    }

    /* "pyarrow/array.pxi":341
 * 
 *     stop = key.stop if key.stop is not None else n
 *     if stop < 0:             # <<<<<<<<<<<<<<
 *         stop += n
 *         if stop < 0:
 */
    goto __pyx_L7;
  }

  /* "pyarrow/array.pxi":345
 *         if stop < 0:
 *             stop = 0
 *     elif stop >= n:             # <<<<<<<<<<<<<<
 *         stop = n
 * 
 */
  __pyx_t_2 = ((__pyx_v_stop >= __pyx_v_n) != 0);
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":346
 *             stop = 0
 *     elif stop >= n:
 *         stop = n             # <<<<<<<<<<<<<<
 * 
 *     step = key.step or 1
 */
    __pyx_v_stop = __pyx_v_n;

    /* "pyarrow/array.pxi":345
 *         if stop < 0:
 *             stop = 0
 *     elif stop >= n:             # <<<<<<<<<<<<<<
 *         stop = n
 * 
 */
  }
  __pyx_L7:;

  /* "pyarrow/array.pxi":348
 *         stop = n
 * 
 *     step = key.step or 1             # <<<<<<<<<<<<<<
 *     if step != 1:
 *         raise IndexError('only slices with step 1 supported')
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(((PySliceObject*)__pyx_v_key)->step); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 348, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(((PySliceObject*)__pyx_v_key)->step); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 348, __pyx_L1_error)
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L9_bool_binop_done;
  }
  __pyx_t_1 = 1;
  __pyx_L9_bool_binop_done:;
  __pyx_v_step = __pyx_t_1;

  /* "pyarrow/array.pxi":349
 * 
 *     step = key.step or 1
 *     if step != 1:             # <<<<<<<<<<<<<<
 *         raise IndexError('only slices with step 1 supported')
 *     else:
 */
  __pyx_t_2 = ((__pyx_v_step != 1) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/array.pxi":350
 *     step = key.step or 1
 *     if step != 1:
 *         raise IndexError('only slices with step 1 supported')             # <<<<<<<<<<<<<<
 *     else:
 *         return arrow_obj.slice(start, stop - start)
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__141, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 350, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(1, 350, __pyx_L1_error)

    /* "pyarrow/array.pxi":349
 * 
 *     step = key.step or 1
 *     if step != 1:             # <<<<<<<<<<<<<<
 *         raise IndexError('only slices with step 1 supported')
 *     else:
 */
  }

  /* "pyarrow/array.pxi":352
 *         raise IndexError('only slices with step 1 supported')
 *     else:
 *         return arrow_obj.slice(start, stop - start)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrow_obj, __pyx_n_s_slice); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 352, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_start); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 352, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyInt_FromSsize_t((__pyx_v_stop - __pyx_v_start)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 352, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    __pyx_t_9 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_9 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_7};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 352, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_7};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 352, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    {
      __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 352, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (__pyx_t_8) {
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_7);
      __pyx_t_6 = 0;
      __pyx_t_7 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 352, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/array.pxi":327
 * 
 * 
 * def _normalize_slice(object arrow_obj, slice key):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t start, stop, step
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("pyarrow.lib._normalize_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":355
 * 
 * 
 * cdef Py_ssize_t _normalize_index(Py_ssize_t index,             # <<<<<<<<<<<<<<
 *                                  Py_ssize_t length) except -1:
 *     if index < 0:
 */

static Py_ssize_t __pyx_f_7pyarrow_3lib__normalize_index(Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_length) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("_normalize_index", 0);

  /* "pyarrow/array.pxi":357
 * cdef Py_ssize_t _normalize_index(Py_ssize_t index,
 *                                  Py_ssize_t length) except -1:
 *     if index < 0:             # <<<<<<<<<<<<<<
 *         index += length
 *         if index < 0:
 */
  __pyx_t_1 = ((__pyx_v_index < 0) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/array.pxi":358
 *                                  Py_ssize_t length) except -1:
 *     if index < 0:
 *         index += length             # <<<<<<<<<<<<<<
 *         if index < 0:
 *             raise IndexError("index out of bounds")
 */
    __pyx_v_index = (__pyx_v_index + __pyx_v_length);

    /* "pyarrow/array.pxi":359
 *     if index < 0:
 *         index += length
 *         if index < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError("index out of bounds")
 *     elif index >= length:
 */
    __pyx_t_1 = ((__pyx_v_index < 0) != 0);
    if (unlikely(__pyx_t_1)) {

      /* "pyarrow/array.pxi":360
 *         index += length
 *         if index < 0:
 *             raise IndexError("index out of bounds")             # <<<<<<<<<<<<<<
 *     elif index >= length:
 *         raise IndexError("index out of bounds")
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__142, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 360, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(1, 360, __pyx_L1_error)

      /* "pyarrow/array.pxi":359
 *     if index < 0:
 *         index += length
 *         if index < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError("index out of bounds")
 *     elif index >= length:
 */
    }

    /* "pyarrow/array.pxi":357
 * cdef Py_ssize_t _normalize_index(Py_ssize_t index,
 *                                  Py_ssize_t length) except -1:
 *     if index < 0:             # <<<<<<<<<<<<<<
 *         index += length
 *         if index < 0:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/array.pxi":361
 *         if index < 0:
 *             raise IndexError("index out of bounds")
 *     elif index >= length:             # <<<<<<<<<<<<<<
 *         raise IndexError("index out of bounds")
 *     return index
 */
  __pyx_t_1 = ((__pyx_v_index >= __pyx_v_length) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/array.pxi":362
 *             raise IndexError("index out of bounds")
 *     elif index >= length:
 *         raise IndexError("index out of bounds")             # <<<<<<<<<<<<<<
 *     return index
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__142, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(1, 362, __pyx_L1_error)

    /* "pyarrow/array.pxi":361
 *         if index < 0:
 *             raise IndexError("index out of bounds")
 *     elif index >= length:             # <<<<<<<<<<<<<<
 *         raise IndexError("index out of bounds")
 *     return index
 */
  }
  __pyx_L3:;

  /* "pyarrow/array.pxi":363
 *     elif index >= length:
 *         raise IndexError("index out of bounds")
 *     return index             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_index;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":355
 * 
 * 
 * cdef Py_ssize_t _normalize_index(Py_ssize_t index,             # <<<<<<<<<<<<<<
 *                                  Py_ssize_t length) except -1:
 *     if index < 0:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib._normalize_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":370
 *         unique_ptr[CFunctionContext] ctx
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.ctx.reset(new CFunctionContext(c_default_memory_pool()))
 * 
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_16_FunctionContext_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_16_FunctionContext_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_16_FunctionContext___cinit__(((struct __pyx_obj_7pyarrow_3lib__FunctionContext *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_16_FunctionContext___cinit__(struct __pyx_obj_7pyarrow_3lib__FunctionContext *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/array.pxi":371
 * 
 *     def __cinit__(self):
 *         self.ctx.reset(new CFunctionContext(c_default_memory_pool()))             # <<<<<<<<<<<<<<
 * 
 * cdef _FunctionContext _global_ctx = _FunctionContext()
 */
  __pyx_v_self->ctx.reset(new  arrow::compute::FunctionContext( arrow::default_memory_pool()));

  /* "pyarrow/array.pxi":370
 *         unique_ptr[CFunctionContext] ctx
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.ctx.reset(new CFunctionContext(c_default_memory_pool()))
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16_FunctionContext_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16_FunctionContext_2__reduce_cython__[] = "_FunctionContext.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_16_FunctionContext_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16_FunctionContext_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib__FunctionContext *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16_FunctionContext_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__FunctionContext *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__143, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._FunctionContext.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16_FunctionContext_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16_FunctionContext_4__setstate_cython__[] = "_FunctionContext.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_16_FunctionContext_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16_FunctionContext_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib__FunctionContext *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16_FunctionContext_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__FunctionContext *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__144, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._FunctionContext.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":375
 * cdef _FunctionContext _global_ctx = _FunctionContext()
 * 
 * cdef CFunctionContext* _context() nogil:             # <<<<<<<<<<<<<<
 *     return _global_ctx.ctx.get()
 * 
 */

static  arrow::compute::FunctionContext *__pyx_f_7pyarrow_3lib__context(void) {
   arrow::compute::FunctionContext *__pyx_r;

  /* "pyarrow/array.pxi":376
 * 
 * cdef CFunctionContext* _context() nogil:
 *     return _global_ctx.ctx.get()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_7pyarrow_3lib__global_ctx->ctx.get();
  goto __pyx_L0;

  /* "pyarrow/array.pxi":375
 * cdef _FunctionContext _global_ctx = _FunctionContext()
 * 
 * cdef CFunctionContext* _context() nogil:             # <<<<<<<<<<<<<<
 *     return _global_ctx.ctx.get()
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "pyarrow/array.pxi":379
 * 
 * 
 * cdef wrap_datum(const CDatum& datum):             # <<<<<<<<<<<<<<
 *     if datum.kind() == DatumType_ARRAY:
 *         return pyarrow_wrap_array(MakeArray(datum.array()))
 */

static PyObject *__pyx_f_7pyarrow_3lib_wrap_datum( arrow::compute::Datum const &__pyx_v_datum) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("wrap_datum", 0);

  /* "pyarrow/array.pxi":380
 * 
 * cdef wrap_datum(const CDatum& datum):
 *     if datum.kind() == DatumType_ARRAY:             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_array(MakeArray(datum.array()))
 *     elif datum.kind() == DatumType_CHUNKED_ARRAY:
 */
  __pyx_t_1 = ((__pyx_v_datum.kind() ==  arrow::compute::Datum::ARRAY) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/array.pxi":381
 * cdef wrap_datum(const CDatum& datum):
 *     if datum.kind() == DatumType_ARRAY:
 *         return pyarrow_wrap_array(MakeArray(datum.array()))             # <<<<<<<<<<<<<<
 *     elif datum.kind() == DatumType_CHUNKED_ARRAY:
 *         return pyarrow_wrap_chunked_array(datum.chunked_array())
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(arrow::MakeArray(__pyx_v_datum.array())); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 381, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/array.pxi":380
 * 
 * cdef wrap_datum(const CDatum& datum):
 *     if datum.kind() == DatumType_ARRAY:             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_array(MakeArray(datum.array()))
 *     elif datum.kind() == DatumType_CHUNKED_ARRAY:
 */
  }

  /* "pyarrow/array.pxi":382
 *     if datum.kind() == DatumType_ARRAY:
 *         return pyarrow_wrap_array(MakeArray(datum.array()))
 *     elif datum.kind() == DatumType_CHUNKED_ARRAY:             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_chunked_array(datum.chunked_array())
 *     elif datum.kind() == DatumType_SCALAR:
 */
  __pyx_t_1 = ((__pyx_v_datum.kind() ==  arrow::compute::Datum::CHUNKED_ARRAY) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/array.pxi":383
 *         return pyarrow_wrap_array(MakeArray(datum.array()))
 *     elif datum.kind() == DatumType_CHUNKED_ARRAY:
 *         return pyarrow_wrap_chunked_array(datum.chunked_array())             # <<<<<<<<<<<<<<
 *     elif datum.kind() == DatumType_SCALAR:
 *         return pyarrow_wrap_scalar(datum.scalar())
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_chunked_array(__pyx_v_datum.chunked_array()); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 383, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/array.pxi":382
 *     if datum.kind() == DatumType_ARRAY:
 *         return pyarrow_wrap_array(MakeArray(datum.array()))
 *     elif datum.kind() == DatumType_CHUNKED_ARRAY:             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_chunked_array(datum.chunked_array())
 *     elif datum.kind() == DatumType_SCALAR:
 */
  }

  /* "pyarrow/array.pxi":384
 *     elif datum.kind() == DatumType_CHUNKED_ARRAY:
 *         return pyarrow_wrap_chunked_array(datum.chunked_array())
 *     elif datum.kind() == DatumType_SCALAR:             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_scalar(datum.scalar())
 *     else:
 */
  __pyx_t_1 = ((__pyx_v_datum.kind() ==  arrow::compute::Datum::SCALAR) != 0);
  if (likely(__pyx_t_1)) {

    /* "pyarrow/array.pxi":385
 *         return pyarrow_wrap_chunked_array(datum.chunked_array())
 *     elif datum.kind() == DatumType_SCALAR:
 *         return pyarrow_wrap_scalar(datum.scalar())             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError("Unable to wrap Datum in a Python object")
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_scalar(__pyx_v_datum.scalar()); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 385, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/array.pxi":384
 *     elif datum.kind() == DatumType_CHUNKED_ARRAY:
 *         return pyarrow_wrap_chunked_array(datum.chunked_array())
 *     elif datum.kind() == DatumType_SCALAR:             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_scalar(datum.scalar())
 *     else:
 */
  }

  /* "pyarrow/array.pxi":387
 *         return pyarrow_wrap_scalar(datum.scalar())
 *     else:
 *         raise ValueError("Unable to wrap Datum in a Python object")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__145, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 387, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(1, 387, __pyx_L1_error)
  }

  /* "pyarrow/array.pxi":379
 * 
 * 
 * cdef wrap_datum(const CDatum& datum):             # <<<<<<<<<<<<<<
 *     if datum.kind() == DatumType_ARRAY:
 *         return pyarrow_wrap_array(MakeArray(datum.array()))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.wrap_datum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":390
 * 
 * 
 * cdef _append_array_buffers(const CArrayData* ad, list res):             # <<<<<<<<<<<<<<
 *     """
 *     Recursively append Buffer wrappers from *ad* and its children.
 */

static PyObject *__pyx_f_7pyarrow_3lib__append_array_buffers( arrow::ArrayData const *__pyx_v_ad, PyObject *__pyx_v_res) {
  size_t __pyx_v_i;
  size_t __pyx_v_n;
  std::shared_ptr< arrow::Buffer>  __pyx_v_buf;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  size_t __pyx_t_1;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("_append_array_buffers", 0);

  /* "pyarrow/array.pxi":395
 *     """
 *     cdef size_t i, n
 *     assert ad != NULL             # <<<<<<<<<<<<<<
 *     n = ad.buffers.size()
 *     for i in range(n):
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    if (unlikely(!((__pyx_v_ad != NULL) != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(1, 395, __pyx_L1_error)
    }
  }
  #endif

  /* "pyarrow/array.pxi":396
 *     cdef size_t i, n
 *     assert ad != NULL
 *     n = ad.buffers.size()             # <<<<<<<<<<<<<<
 *     for i in range(n):
 *         buf = ad.buffers[i]
 */
  __pyx_v_n = __pyx_v_ad->buffers.size();

  /* "pyarrow/array.pxi":397
 *     assert ad != NULL
 *     n = ad.buffers.size()
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         buf = ad.buffers[i]
 *         res.append(pyarrow_wrap_buffer(buf)
 */
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "pyarrow/array.pxi":398
 *     n = ad.buffers.size()
 *     for i in range(n):
 *         buf = ad.buffers[i]             # <<<<<<<<<<<<<<
 *         res.append(pyarrow_wrap_buffer(buf)
 *                    if buf.get() != NULL else None)
 */
    __pyx_v_buf = (__pyx_v_ad->buffers[__pyx_v_i]);

    /* "pyarrow/array.pxi":399
 *     for i in range(n):
 *         buf = ad.buffers[i]
 *         res.append(pyarrow_wrap_buffer(buf)             # <<<<<<<<<<<<<<
 *                    if buf.get() != NULL else None)
 *     n = ad.child_data.size()
 */
    if (unlikely(__pyx_v_res == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
      __PYX_ERR(1, 399, __pyx_L1_error)
    }

    /* "pyarrow/array.pxi":400
 *         buf = ad.buffers[i]
 *         res.append(pyarrow_wrap_buffer(buf)
 *                    if buf.get() != NULL else None)             # <<<<<<<<<<<<<<
 *     n = ad.child_data.size()
 *     for i in range(n):
 */
    if (((__pyx_v_buf.get() != NULL) != 0)) {

      /* "pyarrow/array.pxi":399
 *     for i in range(n):
 *         buf = ad.buffers[i]
 *         res.append(pyarrow_wrap_buffer(buf)             # <<<<<<<<<<<<<<
 *                    if buf.get() != NULL else None)
 *     n = ad.child_data.size()
 */
      __pyx_t_5 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_buf); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __pyx_t_5;
      __pyx_t_5 = 0;
    } else {

      /* "pyarrow/array.pxi":400
 *         buf = ad.buffers[i]
 *         res.append(pyarrow_wrap_buffer(buf)
 *                    if buf.get() != NULL else None)             # <<<<<<<<<<<<<<
 *     n = ad.child_data.size()
 *     for i in range(n):
 */
      __Pyx_INCREF(Py_None);
      __pyx_t_4 = Py_None;
    }

    /* "pyarrow/array.pxi":399
 *     for i in range(n):
 *         buf = ad.buffers[i]
 *         res.append(pyarrow_wrap_buffer(buf)             # <<<<<<<<<<<<<<
 *                    if buf.get() != NULL else None)
 *     n = ad.child_data.size()
 */
    __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_4); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 399, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }

  /* "pyarrow/array.pxi":401
 *         res.append(pyarrow_wrap_buffer(buf)
 *                    if buf.get() != NULL else None)
 *     n = ad.child_data.size()             # <<<<<<<<<<<<<<
 *     for i in range(n):
 *         _append_array_buffers(ad.child_data[i].get(), res)
 */
  __pyx_v_n = __pyx_v_ad->child_data.size();

  /* "pyarrow/array.pxi":402
 *                    if buf.get() != NULL else None)
 *     n = ad.child_data.size()
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         _append_array_buffers(ad.child_data[i].get(), res)
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "pyarrow/array.pxi":403
 *     n = ad.child_data.size()
 *     for i in range(n):
 *         _append_array_buffers(ad.child_data[i].get(), res)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __pyx_f_7pyarrow_3lib__append_array_buffers((__pyx_v_ad->child_data[__pyx_v_i]).get(), __pyx_v_res); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 403, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }

  /* "pyarrow/array.pxi":390
 * 
 * 
 * cdef _append_array_buffers(const CArrayData* ad, list res):             # <<<<<<<<<<<<<<
 *     """
 *     Recursively append Buffer wrappers from *ad* and its children.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib._append_array_buffers", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":406
 * 
 * 
 * cdef _reduce_array_data(const CArrayData* ad):             # <<<<<<<<<<<<<<
 *     """
 *     Recursively dissect ArrayData to (pickable) tuples.
 */

static PyObject *__pyx_f_7pyarrow_3lib__reduce_array_data( arrow::ArrayData const *__pyx_v_ad) {
  size_t __pyx_v_i;
  size_t __pyx_v_n;
  PyObject *__pyx_v_buffers = NULL;
  std::shared_ptr< arrow::Buffer>  __pyx_v_buf;
  PyObject *__pyx_v_children = NULL;
  PyObject *__pyx_v_dictionary = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_RefNannySetupContext("_reduce_array_data", 0);

  /* "pyarrow/array.pxi":411
 *     """
 *     cdef size_t i, n
 *     assert ad != NULL             # <<<<<<<<<<<<<<
 * 
 *     n = ad.buffers.size()
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    if (unlikely(!((__pyx_v_ad != NULL) != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(1, 411, __pyx_L1_error)
    }
  }
  #endif

  /* "pyarrow/array.pxi":413
 *     assert ad != NULL
 * 
 *     n = ad.buffers.size()             # <<<<<<<<<<<<<<
 *     buffers = []
 *     for i in range(n):
 */
  __pyx_v_n = __pyx_v_ad->buffers.size();

  /* "pyarrow/array.pxi":414
 * 
 *     n = ad.buffers.size()
 *     buffers = []             # <<<<<<<<<<<<<<
 *     for i in range(n):
 *         buf = ad.buffers[i]
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_buffers = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":415
 *     n = ad.buffers.size()
 *     buffers = []
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         buf = ad.buffers[i]
 *         buffers.append(pyarrow_wrap_buffer(buf)
 */
  __pyx_t_2 = __pyx_v_n;
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "pyarrow/array.pxi":416
 *     buffers = []
 *     for i in range(n):
 *         buf = ad.buffers[i]             # <<<<<<<<<<<<<<
 *         buffers.append(pyarrow_wrap_buffer(buf)
 *                        if buf.get() != NULL else None)
 */
    __pyx_v_buf = (__pyx_v_ad->buffers[__pyx_v_i]);

    /* "pyarrow/array.pxi":418
 *         buf = ad.buffers[i]
 *         buffers.append(pyarrow_wrap_buffer(buf)
 *                        if buf.get() != NULL else None)             # <<<<<<<<<<<<<<
 * 
 *     children = []
 */
    if (((__pyx_v_buf.get() != NULL) != 0)) {

      /* "pyarrow/array.pxi":417
 *     for i in range(n):
 *         buf = ad.buffers[i]
 *         buffers.append(pyarrow_wrap_buffer(buf)             # <<<<<<<<<<<<<<
 *                        if buf.get() != NULL else None)
 * 
 */
      __pyx_t_5 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_buf); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 417, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __pyx_t_5;
      __pyx_t_5 = 0;
    } else {

      /* "pyarrow/array.pxi":418
 *         buf = ad.buffers[i]
 *         buffers.append(pyarrow_wrap_buffer(buf)
 *                        if buf.get() != NULL else None)             # <<<<<<<<<<<<<<
 * 
 *     children = []
 */
      __Pyx_INCREF(Py_None);
      __pyx_t_1 = Py_None;
    }

    /* "pyarrow/array.pxi":417
 *     for i in range(n):
 *         buf = ad.buffers[i]
 *         buffers.append(pyarrow_wrap_buffer(buf)             # <<<<<<<<<<<<<<
 *                        if buf.get() != NULL else None)
 * 
 */
    __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_buffers, __pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 417, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyarrow/array.pxi":420
 *                        if buf.get() != NULL else None)
 * 
 *     children = []             # <<<<<<<<<<<<<<
 *     n = ad.child_data.size()
 *     for i in range(n):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_children = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":421
 * 
 *     children = []
 *     n = ad.child_data.size()             # <<<<<<<<<<<<<<
 *     for i in range(n):
 *         children.append(_reduce_array_data(ad.child_data[i].get()))
 */
  __pyx_v_n = __pyx_v_ad->child_data.size();

  /* "pyarrow/array.pxi":422
 *     children = []
 *     n = ad.child_data.size()
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         children.append(_reduce_array_data(ad.child_data[i].get()))
 * 
 */
  __pyx_t_2 = __pyx_v_n;
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "pyarrow/array.pxi":423
 *     n = ad.child_data.size()
 *     for i in range(n):
 *         children.append(_reduce_array_data(ad.child_data[i].get()))             # <<<<<<<<<<<<<<
 * 
 *     if ad.dictionary.get() != NULL:
 */
    __pyx_t_1 = __pyx_f_7pyarrow_3lib__reduce_array_data((__pyx_v_ad->child_data[__pyx_v_i]).get()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 423, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_children, __pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 423, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyarrow/array.pxi":425
 *         children.append(_reduce_array_data(ad.child_data[i].get()))
 * 
 *     if ad.dictionary.get() != NULL:             # <<<<<<<<<<<<<<
 *         dictionary = _reduce_array_data(ad.dictionary.get().data().get())
 *     else:
 */
  __pyx_t_7 = ((__pyx_v_ad->dictionary.get() != NULL) != 0);
  if (__pyx_t_7) {

    /* "pyarrow/array.pxi":426
 * 
 *     if ad.dictionary.get() != NULL:
 *         dictionary = _reduce_array_data(ad.dictionary.get().data().get())             # <<<<<<<<<<<<<<
 *     else:
 *         dictionary = None
 */
    __pyx_t_1 = __pyx_f_7pyarrow_3lib__reduce_array_data(__pyx_v_ad->dictionary.get()->data().get()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 426, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_dictionary = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "pyarrow/array.pxi":425
 *         children.append(_reduce_array_data(ad.child_data[i].get()))
 * 
 *     if ad.dictionary.get() != NULL:             # <<<<<<<<<<<<<<
 *         dictionary = _reduce_array_data(ad.dictionary.get().data().get())
 *     else:
 */
    goto __pyx_L7;
  }

  /* "pyarrow/array.pxi":428
 *         dictionary = _reduce_array_data(ad.dictionary.get().data().get())
 *     else:
 *         dictionary = None             # <<<<<<<<<<<<<<
 * 
 *     return pyarrow_wrap_data_type(ad.type), ad.length, ad.null_count, \
 */
  /*else*/ {
    __Pyx_INCREF(Py_None);
    __pyx_v_dictionary = Py_None;
  }
  __pyx_L7:;

  /* "pyarrow/array.pxi":430
 *         dictionary = None
 * 
 *     return pyarrow_wrap_data_type(ad.type), ad.length, ad.null_count, \             # <<<<<<<<<<<<<<
 *         ad.offset, buffers, children, dictionary
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_ad->type); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_ad->length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_8 = __Pyx_PyInt_From_int64_t(__pyx_v_ad->null_count); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "pyarrow/array.pxi":431
 * 
 *     return pyarrow_wrap_data_type(ad.type), ad.length, ad.null_count, \
 *         ad.offset, buffers, children, dictionary             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_9 = __Pyx_PyInt_From_int64_t(__pyx_v_ad->offset); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);

  /* "pyarrow/array.pxi":430
 *         dictionary = None
 * 
 *     return pyarrow_wrap_data_type(ad.type), ad.length, ad.null_count, \             # <<<<<<<<<<<<<<
 *         ad.offset, buffers, children, dictionary
 * 
 */
  __pyx_t_10 = PyTuple_New(7); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_9);
  PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_9);
  __Pyx_INCREF(__pyx_v_buffers);
  __Pyx_GIVEREF(__pyx_v_buffers);
  PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_v_buffers);
  __Pyx_INCREF(__pyx_v_children);
  __Pyx_GIVEREF(__pyx_v_children);
  PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_v_children);
  __Pyx_INCREF(__pyx_v_dictionary);
  __Pyx_GIVEREF(__pyx_v_dictionary);
  PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_v_dictionary);
  __pyx_t_1 = 0;
  __pyx_t_5 = 0;
  __pyx_t_8 = 0;
  __pyx_t_9 = 0;
  __pyx_r = __pyx_t_10;
  __pyx_t_10 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":406
 * 
 * 
 * cdef _reduce_array_data(const CArrayData* ad):             # <<<<<<<<<<<<<<
 *     """
 *     Recursively dissect ArrayData to (pickable) tuples.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("pyarrow.lib._reduce_array_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_buffers);
  __Pyx_XDECREF(__pyx_v_children);
  __Pyx_XDECREF(__pyx_v_dictionary);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":434
 * 
 * 
 * cdef shared_ptr[CArrayData] _reconstruct_array_data(data):             # <<<<<<<<<<<<<<
 *     """
 *     Reconstruct CArrayData objects from the tuple structure generated
 */

static std::shared_ptr< arrow::ArrayData>  __pyx_f_7pyarrow_3lib__reconstruct_array_data(PyObject *__pyx_v_data) {
  int64_t __pyx_v_length;
  int64_t __pyx_v_null_count;
  int64_t __pyx_v_offset;
  int64_t __pyx_v_i;
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_dtype = 0;
  struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_buf = 0;
  std::vector<std::shared_ptr< arrow::Buffer> >  __pyx_v_c_buffers;
  std::vector<std::shared_ptr< arrow::ArrayData> >  __pyx_v_c_children;
  std::shared_ptr< arrow::Array>  __pyx_v_c_dictionary;
  PyObject *__pyx_v_buffers = NULL;
  PyObject *__pyx_v_children = NULL;
  PyObject *__pyx_v_dictionary = NULL;
  std::shared_ptr< arrow::ArrayData>  __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  int64_t __pyx_t_10;
  int64_t __pyx_t_11;
  int64_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  int __pyx_t_15;
  int __pyx_t_16;
  __Pyx_RefNannySetupContext("_reconstruct_array_data", 0);

  /* "pyarrow/array.pxi":447
 *         shared_ptr[CArray] c_dictionary
 * 
 *     dtype, length, null_count, offset, buffers, children, dictionary = data             # <<<<<<<<<<<<<<
 * 
 *     for i in range(len(buffers)):
 */
  if ((likely(PyTuple_CheckExact(__pyx_v_data))) || (PyList_CheckExact(__pyx_v_data))) {
    PyObject* sequence = __pyx_v_data;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 7)) {
      if (size > 7) __Pyx_RaiseTooManyValuesError(7);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(1, 447, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 3); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 4); 
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 5); 
      __pyx_t_7 = PyTuple_GET_ITEM(sequence, 6); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 2); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 3); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 4); 
      __pyx_t_6 = PyList_GET_ITEM(sequence, 5); 
      __pyx_t_7 = PyList_GET_ITEM(sequence, 6); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_7);
    #else
    {
      Py_ssize_t i;
      PyObject** temps[7] = {&__pyx_t_1,&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5,&__pyx_t_6,&__pyx_t_7};
      for (i=0; i < 7; i++) {
        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(1, 447, __pyx_L1_error)
        __Pyx_GOTREF(item);
        *(temps[i]) = item;
      }
    }
    #endif
  } else {
    Py_ssize_t index = -1;
    PyObject** temps[7] = {&__pyx_t_1,&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5,&__pyx_t_6,&__pyx_t_7};
    __pyx_t_8 = PyObject_GetIter(__pyx_v_data); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 447, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
    for (index=0; index < 7; index++) {
      PyObject* item = __pyx_t_9(__pyx_t_8); if (unlikely(!item)) goto __pyx_L3_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 7) < 0) __PYX_ERR(1, 447, __pyx_L1_error)
    __pyx_t_9 = NULL;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_9 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(1, 447, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(1, 447, __pyx_L1_error)
  __pyx_t_10 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_10 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_11 = __Pyx_PyInt_As_int64_t(__pyx_t_3); if (unlikely((__pyx_t_11 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_12 = __Pyx_PyInt_As_int64_t(__pyx_t_4); if (unlikely((__pyx_t_12 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_dtype = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_v_length = __pyx_t_10;
  __pyx_v_null_count = __pyx_t_11;
  __pyx_v_offset = __pyx_t_12;
  __pyx_v_buffers = __pyx_t_5;
  __pyx_t_5 = 0;
  __pyx_v_children = __pyx_t_6;
  __pyx_t_6 = 0;
  __pyx_v_dictionary = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "pyarrow/array.pxi":449
 *     dtype, length, null_count, offset, buffers, children, dictionary = data
 * 
 *     for i in range(len(buffers)):             # <<<<<<<<<<<<<<
 *         buf = buffers[i]
 *         if buf is None:
 */
  __pyx_t_13 = PyObject_Length(__pyx_v_buffers); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(1, 449, __pyx_L1_error)
  __pyx_t_14 = __pyx_t_13;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_14; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "pyarrow/array.pxi":450
 * 
 *     for i in range(len(buffers)):
 *         buf = buffers[i]             # <<<<<<<<<<<<<<
 *         if buf is None:
 *             c_buffers.push_back(shared_ptr[CBuffer]())
 */
    __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_buffers, __pyx_v_i, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 450, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_7pyarrow_3lib_Buffer))))) __PYX_ERR(1, 450, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_buf, ((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_t_7));
    __pyx_t_7 = 0;

    /* "pyarrow/array.pxi":451
 *     for i in range(len(buffers)):
 *         buf = buffers[i]
 *         if buf is None:             # <<<<<<<<<<<<<<
 *             c_buffers.push_back(shared_ptr[CBuffer]())
 *         else:
 */
    __pyx_t_15 = (((PyObject *)__pyx_v_buf) == Py_None);
    __pyx_t_16 = (__pyx_t_15 != 0);
    if (__pyx_t_16) {

      /* "pyarrow/array.pxi":452
 *         buf = buffers[i]
 *         if buf is None:
 *             c_buffers.push_back(shared_ptr[CBuffer]())             # <<<<<<<<<<<<<<
 *         else:
 *             c_buffers.push_back(buf.buffer)
 */
      try {
        __pyx_v_c_buffers.push_back(std::shared_ptr< arrow::Buffer> ());
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(1, 452, __pyx_L1_error)
      }

      /* "pyarrow/array.pxi":451
 *     for i in range(len(buffers)):
 *         buf = buffers[i]
 *         if buf is None:             # <<<<<<<<<<<<<<
 *             c_buffers.push_back(shared_ptr[CBuffer]())
 *         else:
 */
      goto __pyx_L7;
    }

    /* "pyarrow/array.pxi":454
 *             c_buffers.push_back(shared_ptr[CBuffer]())
 *         else:
 *             c_buffers.push_back(buf.buffer)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(len(children)):
 */
    /*else*/ {
      try {
        __pyx_v_c_buffers.push_back(__pyx_v_buf->buffer);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(1, 454, __pyx_L1_error)
      }
    }
    __pyx_L7:;
  }

  /* "pyarrow/array.pxi":456
 *             c_buffers.push_back(buf.buffer)
 * 
 *     for i in range(len(children)):             # <<<<<<<<<<<<<<
 *         c_children.push_back(_reconstruct_array_data(children[i]))
 * 
 */
  __pyx_t_13 = PyObject_Length(__pyx_v_children); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(1, 456, __pyx_L1_error)
  __pyx_t_14 = __pyx_t_13;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_14; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "pyarrow/array.pxi":457
 * 
 *     for i in range(len(children)):
 *         c_children.push_back(_reconstruct_array_data(children[i]))             # <<<<<<<<<<<<<<
 * 
 *     if dictionary is not None:
 */
    __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_children, __pyx_v_i, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 457, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    try {
      __pyx_v_c_children.push_back(__pyx_f_7pyarrow_3lib__reconstruct_array_data(__pyx_t_7));
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(1, 457, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }

  /* "pyarrow/array.pxi":459
 *         c_children.push_back(_reconstruct_array_data(children[i]))
 * 
 *     if dictionary is not None:             # <<<<<<<<<<<<<<
 *         c_dictionary = MakeArray(_reconstruct_array_data(dictionary))
 * 
 */
  __pyx_t_16 = (__pyx_v_dictionary != Py_None);
  __pyx_t_15 = (__pyx_t_16 != 0);
  if (__pyx_t_15) {

    /* "pyarrow/array.pxi":460
 * 
 *     if dictionary is not None:
 *         c_dictionary = MakeArray(_reconstruct_array_data(dictionary))             # <<<<<<<<<<<<<<
 * 
 *     return CArrayData.MakeWithChildrenAndDictionary(
 */
    __pyx_v_c_dictionary = arrow::MakeArray(__pyx_f_7pyarrow_3lib__reconstruct_array_data(__pyx_v_dictionary));

    /* "pyarrow/array.pxi":459
 *         c_children.push_back(_reconstruct_array_data(children[i]))
 * 
 *     if dictionary is not None:             # <<<<<<<<<<<<<<
 *         c_dictionary = MakeArray(_reconstruct_array_data(dictionary))
 * 
 */
  }

  /* "pyarrow/array.pxi":462
 *         c_dictionary = MakeArray(_reconstruct_array_data(dictionary))
 * 
 *     return CArrayData.MakeWithChildrenAndDictionary(             # <<<<<<<<<<<<<<
 *         dtype.sp_type,
 *         length,
 */
  __pyx_r =  arrow::ArrayData:: Make(__pyx_v_dtype->sp_type, __pyx_v_length, __pyx_v_c_buffers, __pyx_v_c_children, __pyx_v_c_dictionary, __pyx_v_null_count, __pyx_v_offset);
  goto __pyx_L0;

  /* "pyarrow/array.pxi":434
 * 
 * 
 * cdef shared_ptr[CArrayData] _reconstruct_array_data(data):             # <<<<<<<<<<<<<<
 *     """
 *     Reconstruct CArrayData objects from the tuple structure generated
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_WriteUnraisable("pyarrow.lib._reconstruct_array_data", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_dtype);
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XDECREF(__pyx_v_buffers);
  __Pyx_XDECREF(__pyx_v_children);
  __Pyx_XDECREF(__pyx_v_dictionary);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":472
 * 
 * 
 * def _restore_array(data):             # <<<<<<<<<<<<<<
 *     """
 *     Reconstruct an Array from pickled ArrayData.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_141_restore_array(PyObject *__pyx_self, PyObject *__pyx_v_data); /*proto*/
static char __pyx_doc_7pyarrow_3lib_140_restore_array[] = "_restore_array(data)\n\n    Reconstruct an Array from pickled ArrayData.\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_141_restore_array = {"_restore_array", (PyCFunction)__pyx_pw_7pyarrow_3lib_141_restore_array, METH_O, __pyx_doc_7pyarrow_3lib_140_restore_array};
static PyObject *__pyx_pw_7pyarrow_3lib_141_restore_array(PyObject *__pyx_self, PyObject *__pyx_v_data) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_restore_array (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_140_restore_array(__pyx_self, ((PyObject *)__pyx_v_data));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_140_restore_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data) {
  std::shared_ptr< arrow::ArrayData>  __pyx_v_ad;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("_restore_array", 0);

  /* "pyarrow/array.pxi":476
 *     Reconstruct an Array from pickled ArrayData.
 *     """
 *     cdef shared_ptr[CArrayData] ad = _reconstruct_array_data(data)             # <<<<<<<<<<<<<<
 *     return pyarrow_wrap_array(MakeArray(ad))
 * 
 */
  __pyx_v_ad = __pyx_f_7pyarrow_3lib__reconstruct_array_data(__pyx_v_data);

  /* "pyarrow/array.pxi":477
 *     """
 *     cdef shared_ptr[CArrayData] ad = _reconstruct_array_data(data)
 *     return pyarrow_wrap_array(MakeArray(ad))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(arrow::MakeArray(__pyx_v_ad)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":472
 * 
 * 
 * def _restore_array(data):             # <<<<<<<<<<<<<<
 *     """
 *     Reconstruct an Array from pickled ArrayData.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._restore_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":482
 * cdef class _PandasConvertible:
 * 
 *     def to_pandas(             # <<<<<<<<<<<<<<
 *             self,
 *             memory_pool=None,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18_PandasConvertible_1to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18_PandasConvertible_to_pandas[] = "_PandasConvertible.to_pandas(self, memory_pool=None, categories=None, bool strings_to_categorical=False, bool zero_copy_only=False, bool integer_object_nulls=False, bool date_as_object=True, bool use_threads=True, bool deduplicate_objects=True, bool ignore_metadata=False, bool split_blocks=False, bool self_destruct=False, types_mapper=None)\n\n        Convert to a pandas-compatible NumPy array or DataFrame, as appropriate\n\n        Parameters\n        ----------\n        memory_pool : MemoryPool, default None\n            Arrow MemoryPool to use for allocations. Uses the default memory\n            pool is not passed\n        strings_to_categorical : boolean, default False\n            Encode string (UTF8) and binary types to pandas.Categorical\n        categories: list, default empty\n            List of fields that should be returned as pandas.Categorical. Only\n            applies to table-like data structures\n        zero_copy_only : boolean, default False\n            Raise an ArrowException if this function call would require copying\n            the underlying data\n        integer_object_nulls : boolean, default False\n            Cast integers with nulls to objects\n        date_as_object : boolean, default False\n            Cast dates to objects\n        use_threads: boolean, default True\n            Whether to parallelize the conversion using multiple threads\n        deduplicate_objects : boolean, default False\n            Do not create multiple copies Python objects when created, to save\n            on memory use. Conversion will be slower\n        ignore_metadata : boolean, default False\n            If True, do not use the 'pandas' metadata to reconstruct the\n            DataFrame index, if present\n        split_blocks : boolean, default False\n            If True, generate one internal \"block\" for each column when\n            creating a pandas.DataFrame from a RecordBatch or Table. While this\n            can temporarily reduce memory note"" that various pandas operations\n            can trigger \"consolidation\" which may balloon memory use\n        self_destruct : boolean, default False\n            EXPERIMENTAL: If True, attempt to deallocate the originating Arrow\n            memory while converting the Arrow object to pandas. If you use the\n            object after calling to_pandas with this option it will crash your\n            program\n        types_mapper : function, default None\n            A function mapping a pyarrow DataType to a pandas ExtensionDtype.\n            This can be used to override the default pandas type for conversion\n            of built-in pyarrow types or in absence of pandas_metadata in the\n            Table schema. The function receives a pyarrow DataType and is\n            expected to return a pandas ExtensionDtype or ``None`` if the\n            default conversion should be used for that type. If you have\n            a dictionary mapping, you can pass ``dict.get`` as function.\n\n        Returns\n        -------\n        pandas.Series or pandas.DataFrame depending on type of object\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_18_PandasConvertible_1to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_memory_pool = 0;
  PyObject *__pyx_v_categories = 0;
  int __pyx_v_strings_to_categorical;
  int __pyx_v_zero_copy_only;
  int __pyx_v_integer_object_nulls;
  int __pyx_v_date_as_object;
  int __pyx_v_use_threads;
  int __pyx_v_deduplicate_objects;
  int __pyx_v_ignore_metadata;
  int __pyx_v_split_blocks;
  int __pyx_v_self_destruct;
  PyObject *__pyx_v_types_mapper = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_pandas (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_memory_pool,&__pyx_n_s_categories,&__pyx_n_s_strings_to_categorical,&__pyx_n_s_zero_copy_only,&__pyx_n_s_integer_object_nulls,&__pyx_n_s_date_as_object,&__pyx_n_s_use_threads,&__pyx_n_s_deduplicate_objects,&__pyx_n_s_ignore_metadata,&__pyx_n_s_split_blocks,&__pyx_n_s_self_destruct,&__pyx_n_s_types_mapper,0};
    PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};

    /* "pyarrow/array.pxi":484
 *     def to_pandas(
 *             self,
 *             memory_pool=None,             # <<<<<<<<<<<<<<
 *             categories=None,
 *             bint strings_to_categorical=False,
 */
    values[0] = ((PyObject *)Py_None);

    /* "pyarrow/array.pxi":485
 *             self,
 *             memory_pool=None,
 *             categories=None,             # <<<<<<<<<<<<<<
 *             bint strings_to_categorical=False,
 *             bint zero_copy_only=False,
 */
    values[1] = ((PyObject *)Py_None);

    /* "pyarrow/array.pxi":495
 *             bint split_blocks=False,
 *             bint self_destruct=False,
 *             types_mapper=None             # <<<<<<<<<<<<<<
 *     ):
 *         """
 */
    values[11] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_categories);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_strings_to_categorical);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zero_copy_only);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_integer_object_nulls);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_date_as_object);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_use_threads);
          if (value) { values[6] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_deduplicate_objects);
          if (value) { values[7] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ignore_metadata);
          if (value) { values[8] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_split_blocks);
          if (value) { values[9] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self_destruct);
          if (value) { values[10] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_types_mapper);
          if (value) { values[11] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "to_pandas") < 0)) __PYX_ERR(1, 482, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_memory_pool = values[0];
    __pyx_v_categories = values[1];
    if (values[2]) {
      __pyx_v_strings_to_categorical = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_strings_to_categorical == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 486, __pyx_L3_error)
    } else {

      /* "pyarrow/array.pxi":486
 *             memory_pool=None,
 *             categories=None,
 *             bint strings_to_categorical=False,             # <<<<<<<<<<<<<<
 *             bint zero_copy_only=False,
 *             bint integer_object_nulls=False,
 */
      __pyx_v_strings_to_categorical = ((int)0);
    }
    if (values[3]) {
      __pyx_v_zero_copy_only = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_zero_copy_only == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 487, __pyx_L3_error)
    } else {

      /* "pyarrow/array.pxi":487
 *             categories=None,
 *             bint strings_to_categorical=False,
 *             bint zero_copy_only=False,             # <<<<<<<<<<<<<<
 *             bint integer_object_nulls=False,
 *             bint date_as_object=True,
 */
      __pyx_v_zero_copy_only = ((int)0);
    }
    if (values[4]) {
      __pyx_v_integer_object_nulls = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_integer_object_nulls == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 488, __pyx_L3_error)
    } else {

      /* "pyarrow/array.pxi":488
 *             bint strings_to_categorical=False,
 *             bint zero_copy_only=False,
 *             bint integer_object_nulls=False,             # <<<<<<<<<<<<<<
 *             bint date_as_object=True,
 *             bint use_threads=True,
 */
      __pyx_v_integer_object_nulls = ((int)0);
    }
    if (values[5]) {
      __pyx_v_date_as_object = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_date_as_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 489, __pyx_L3_error)
    } else {

      /* "pyarrow/array.pxi":489
 *             bint zero_copy_only=False,
 *             bint integer_object_nulls=False,
 *             bint date_as_object=True,             # <<<<<<<<<<<<<<
 *             bint use_threads=True,
 *             bint deduplicate_objects=True,
 */
      __pyx_v_date_as_object = ((int)1);
    }
    if (values[6]) {
      __pyx_v_use_threads = __Pyx_PyObject_IsTrue(values[6]); if (unlikely((__pyx_v_use_threads == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 490, __pyx_L3_error)
    } else {

      /* "pyarrow/array.pxi":490
 *             bint integer_object_nulls=False,
 *             bint date_as_object=True,
 *             bint use_threads=True,             # <<<<<<<<<<<<<<
 *             bint deduplicate_objects=True,
 *             bint ignore_metadata=False,
 */
      __pyx_v_use_threads = ((int)1);
    }
    if (values[7]) {
      __pyx_v_deduplicate_objects = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_deduplicate_objects == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 491, __pyx_L3_error)
    } else {

      /* "pyarrow/array.pxi":491
 *             bint date_as_object=True,
 *             bint use_threads=True,
 *             bint deduplicate_objects=True,             # <<<<<<<<<<<<<<
 *             bint ignore_metadata=False,
 *             bint split_blocks=False,
 */
      __pyx_v_deduplicate_objects = ((int)1);
    }
    if (values[8]) {
      __pyx_v_ignore_metadata = __Pyx_PyObject_IsTrue(values[8]); if (unlikely((__pyx_v_ignore_metadata == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 492, __pyx_L3_error)
    } else {

      /* "pyarrow/array.pxi":492
 *             bint use_threads=True,
 *             bint deduplicate_objects=True,
 *             bint ignore_metadata=False,             # <<<<<<<<<<<<<<
 *             bint split_blocks=False,
 *             bint self_destruct=False,
 */
      __pyx_v_ignore_metadata = ((int)0);
    }
    if (values[9]) {
      __pyx_v_split_blocks = __Pyx_PyObject_IsTrue(values[9]); if (unlikely((__pyx_v_split_blocks == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 493, __pyx_L3_error)
    } else {

      /* "pyarrow/array.pxi":493
 *             bint deduplicate_objects=True,
 *             bint ignore_metadata=False,
 *             bint split_blocks=False,             # <<<<<<<<<<<<<<
 *             bint self_destruct=False,
 *             types_mapper=None
 */
      __pyx_v_split_blocks = ((int)0);
    }
    if (values[10]) {
      __pyx_v_self_destruct = __Pyx_PyObject_IsTrue(values[10]); if (unlikely((__pyx_v_self_destruct == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 494, __pyx_L3_error)
    } else {

      /* "pyarrow/array.pxi":494
 *             bint ignore_metadata=False,
 *             bint split_blocks=False,
 *             bint self_destruct=False,             # <<<<<<<<<<<<<<
 *             types_mapper=None
 *     ):
 */
      __pyx_v_self_destruct = ((int)0);
    }
    __pyx_v_types_mapper = values[11];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_pandas", 0, 0, 12, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 482, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._PandasConvertible.to_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_18_PandasConvertible_to_pandas(((struct __pyx_obj_7pyarrow_3lib__PandasConvertible *)__pyx_v_self), __pyx_v_memory_pool, __pyx_v_categories, __pyx_v_strings_to_categorical, __pyx_v_zero_copy_only, __pyx_v_integer_object_nulls, __pyx_v_date_as_object, __pyx_v_use_threads, __pyx_v_deduplicate_objects, __pyx_v_ignore_metadata, __pyx_v_split_blocks, __pyx_v_self_destruct, __pyx_v_types_mapper);

  /* "pyarrow/array.pxi":482
 * cdef class _PandasConvertible:
 * 
 *     def to_pandas(             # <<<<<<<<<<<<<<
 *             self,
 *             memory_pool=None,
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18_PandasConvertible_to_pandas(struct __pyx_obj_7pyarrow_3lib__PandasConvertible *__pyx_v_self, PyObject *__pyx_v_memory_pool, PyObject *__pyx_v_categories, int __pyx_v_strings_to_categorical, int __pyx_v_zero_copy_only, int __pyx_v_integer_object_nulls, int __pyx_v_date_as_object, int __pyx_v_use_threads, int __pyx_v_deduplicate_objects, int __pyx_v_ignore_metadata, int __pyx_v_split_blocks, int __pyx_v_self_destruct, PyObject *__pyx_v_types_mapper) {
  PyObject *__pyx_v_options = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("to_pandas", 0);

  /* "pyarrow/array.pxi":549
 *         """
 *         options = dict(
 *             pool=memory_pool,             # <<<<<<<<<<<<<<
 *             strings_to_categorical=strings_to_categorical,
 *             zero_copy_only=zero_copy_only,
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(9); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 549, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_pool, __pyx_v_memory_pool) < 0) __PYX_ERR(1, 549, __pyx_L1_error)

  /* "pyarrow/array.pxi":550
 *         options = dict(
 *             pool=memory_pool,
 *             strings_to_categorical=strings_to_categorical,             # <<<<<<<<<<<<<<
 *             zero_copy_only=zero_copy_only,
 *             integer_object_nulls=integer_object_nulls,
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_strings_to_categorical); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_strings_to_categorical, __pyx_t_2) < 0) __PYX_ERR(1, 549, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/array.pxi":551
 *             pool=memory_pool,
 *             strings_to_categorical=strings_to_categorical,
 *             zero_copy_only=zero_copy_only,             # <<<<<<<<<<<<<<
 *             integer_object_nulls=integer_object_nulls,
 *             date_as_object=date_as_object,
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_zero_copy_only); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 551, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_zero_copy_only, __pyx_t_2) < 0) __PYX_ERR(1, 549, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/array.pxi":552
 *             strings_to_categorical=strings_to_categorical,
 *             zero_copy_only=zero_copy_only,
 *             integer_object_nulls=integer_object_nulls,             # <<<<<<<<<<<<<<
 *             date_as_object=date_as_object,
 *             use_threads=use_threads,
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_integer_object_nulls); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_integer_object_nulls, __pyx_t_2) < 0) __PYX_ERR(1, 549, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/array.pxi":553
 *             zero_copy_only=zero_copy_only,
 *             integer_object_nulls=integer_object_nulls,
 *             date_as_object=date_as_object,             # <<<<<<<<<<<<<<
 *             use_threads=use_threads,
 *             deduplicate_objects=deduplicate_objects,
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_date_as_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 553, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_date_as_object, __pyx_t_2) < 0) __PYX_ERR(1, 549, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/array.pxi":554
 *             integer_object_nulls=integer_object_nulls,
 *             date_as_object=date_as_object,
 *             use_threads=use_threads,             # <<<<<<<<<<<<<<
 *             deduplicate_objects=deduplicate_objects,
 *             split_blocks=split_blocks,
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_use_threads); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 554, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_use_threads, __pyx_t_2) < 0) __PYX_ERR(1, 549, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/array.pxi":555
 *             date_as_object=date_as_object,
 *             use_threads=use_threads,
 *             deduplicate_objects=deduplicate_objects,             # <<<<<<<<<<<<<<
 *             split_blocks=split_blocks,
 *             self_destruct=self_destruct
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_deduplicate_objects); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_deduplicate_objects, __pyx_t_2) < 0) __PYX_ERR(1, 549, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/array.pxi":556
 *             use_threads=use_threads,
 *             deduplicate_objects=deduplicate_objects,
 *             split_blocks=split_blocks,             # <<<<<<<<<<<<<<
 *             self_destruct=self_destruct
 *         )
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_split_blocks); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_split_blocks, __pyx_t_2) < 0) __PYX_ERR(1, 549, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/array.pxi":557
 *             deduplicate_objects=deduplicate_objects,
 *             split_blocks=split_blocks,
 *             self_destruct=self_destruct             # <<<<<<<<<<<<<<
 *         )
 *         return self._to_pandas(options, categories=categories,
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self_destruct); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_self_destruct, __pyx_t_2) < 0) __PYX_ERR(1, 549, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_options = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":559
 *             self_destruct=self_destruct
 *         )
 *         return self._to_pandas(options, categories=categories,             # <<<<<<<<<<<<<<
 *                                ignore_metadata=ignore_metadata,
 *                                types_mapper=types_mapper)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_to_pandas); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_options);
  __Pyx_GIVEREF(__pyx_v_options);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_options);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_categories, __pyx_v_categories) < 0) __PYX_ERR(1, 559, __pyx_L1_error)

  /* "pyarrow/array.pxi":560
 *         )
 *         return self._to_pandas(options, categories=categories,
 *                                ignore_metadata=ignore_metadata,             # <<<<<<<<<<<<<<
 *                                types_mapper=types_mapper)
 * 
 */
  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_ignore_metadata); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_ignore_metadata, __pyx_t_4) < 0) __PYX_ERR(1, 559, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/array.pxi":561
 *         return self._to_pandas(options, categories=categories,
 *                                ignore_metadata=ignore_metadata,
 *                                types_mapper=types_mapper)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_types_mapper, __pyx_v_types_mapper) < 0) __PYX_ERR(1, 559, __pyx_L1_error)

  /* "pyarrow/array.pxi":559
 *             self_destruct=self_destruct
 *         )
 *         return self._to_pandas(options, categories=categories,             # <<<<<<<<<<<<<<
 *                                ignore_metadata=ignore_metadata,
 *                                types_mapper=types_mapper)
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":482
 * cdef class _PandasConvertible:
 * 
 *     def to_pandas(             # <<<<<<<<<<<<<<
 *             self,
 *             memory_pool=None,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib._PandasConvertible.to_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_options);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18_PandasConvertible_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18_PandasConvertible_2__reduce_cython__[] = "_PandasConvertible.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_18_PandasConvertible_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_18_PandasConvertible_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib__PandasConvertible *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18_PandasConvertible_2__reduce_cython__(struct __pyx_obj_7pyarrow_3lib__PandasConvertible *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = ()             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __Pyx_INCREF(__pyx_empty_tuple);
  __pyx_v_state = __pyx_empty_tuple;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_2 = (__pyx_v__dict != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = False
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = False             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle__PandasConvertible, (type(self), 0xd41d8cd, None), state
 */
  /*else*/ {
    __pyx_v_use_setstate = 0;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle__PandasConvertible, (type(self), 0xd41d8cd, None), state
 *     else:
 */
  __pyx_t_3 = (__pyx_v_use_setstate != 0);
  if (__pyx_t_3) {

    /* "(tree fragment)":13
 *         use_setstate = False
 *     if use_setstate:
 *         return __pyx_unpickle__PandasConvertible, (type(self), 0xd41d8cd, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle__PandasConvertible, (type(self), 0xd41d8cd, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle__PandasConvertibl); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_222419149);
    __Pyx_GIVEREF(__pyx_int_222419149);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_222419149);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle__PandasConvertible, (type(self), 0xd41d8cd, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle__PandasConvertible, (type(self), 0xd41d8cd, None), state
 *     else:
 *         return __pyx_unpickle__PandasConvertible, (type(self), 0xd41d8cd, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle__PandasConvertible__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle__PandasConvertibl); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_222419149);
    __Pyx_GIVEREF(__pyx_int_222419149);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_222419149);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib._PandasConvertible.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle__PandasConvertible, (type(self), 0xd41d8cd, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle__PandasConvertible__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18_PandasConvertible_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18_PandasConvertible_4__setstate_cython__[] = "_PandasConvertible.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_18_PandasConvertible_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_18_PandasConvertible_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib__PandasConvertible *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18_PandasConvertible_4__setstate_cython__(struct __pyx_obj_7pyarrow_3lib__PandasConvertible *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle__PandasConvertible, (type(self), 0xd41d8cd, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle__PandasConvertible__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(10, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_7pyarrow_3lib___pyx_unpickle__PandasConvertible__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle__PandasConvertible, (type(self), 0xd41d8cd, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle__PandasConvertible__set_state(self, __pyx_state)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._PandasConvertible.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":564
 * 
 * 
 * cdef PandasOptions _convert_pandas_options(dict options):             # <<<<<<<<<<<<<<
 *     cdef PandasOptions result
 *     result.pool = maybe_unbox_memory_pool(options['pool'])
 */

static arrow::py::PandasOptions __pyx_f_7pyarrow_3lib__convert_pandas_options(PyObject *__pyx_v_options) {
  arrow::py::PandasOptions __pyx_v_result;
  arrow::py::PandasOptions __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  bool __pyx_t_2;
  __Pyx_RefNannySetupContext("_convert_pandas_options", 0);

  /* "pyarrow/array.pxi":566
 * cdef PandasOptions _convert_pandas_options(dict options):
 *     cdef PandasOptions result
 *     result.pool = maybe_unbox_memory_pool(options['pool'])             # <<<<<<<<<<<<<<
 *     result.strings_to_categorical = options['strings_to_categorical']
 *     result.zero_copy_only = options['zero_copy_only']
 */
  if (unlikely(__pyx_v_options == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 566, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_options, __pyx_n_u_pool); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_MemoryPool))))) __PYX_ERR(1, 566, __pyx_L1_error)
  __pyx_v_result.pool = __pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_t_1));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":567
 *     cdef PandasOptions result
 *     result.pool = maybe_unbox_memory_pool(options['pool'])
 *     result.strings_to_categorical = options['strings_to_categorical']             # <<<<<<<<<<<<<<
 *     result.zero_copy_only = options['zero_copy_only']
 *     result.integer_object_nulls = options['integer_object_nulls']
 */
  if (unlikely(__pyx_v_options == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 567, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_options, __pyx_n_u_strings_to_categorical); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(1, 567, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result.strings_to_categorical = __pyx_t_2;

  /* "pyarrow/array.pxi":568
 *     result.pool = maybe_unbox_memory_pool(options['pool'])
 *     result.strings_to_categorical = options['strings_to_categorical']
 *     result.zero_copy_only = options['zero_copy_only']             # <<<<<<<<<<<<<<
 *     result.integer_object_nulls = options['integer_object_nulls']
 *     result.date_as_object = options['date_as_object']
 */
  if (unlikely(__pyx_v_options == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 568, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_options, __pyx_n_u_zero_copy_only); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(1, 568, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result.zero_copy_only = __pyx_t_2;

  /* "pyarrow/array.pxi":569
 *     result.strings_to_categorical = options['strings_to_categorical']
 *     result.zero_copy_only = options['zero_copy_only']
 *     result.integer_object_nulls = options['integer_object_nulls']             # <<<<<<<<<<<<<<
 *     result.date_as_object = options['date_as_object']
 *     result.use_threads = options['use_threads']
 */
  if (unlikely(__pyx_v_options == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 569, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_options, __pyx_n_u_integer_object_nulls); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 569, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(1, 569, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result.integer_object_nulls = __pyx_t_2;

  /* "pyarrow/array.pxi":570
 *     result.zero_copy_only = options['zero_copy_only']
 *     result.integer_object_nulls = options['integer_object_nulls']
 *     result.date_as_object = options['date_as_object']             # <<<<<<<<<<<<<<
 *     result.use_threads = options['use_threads']
 *     result.deduplicate_objects = options['deduplicate_objects']
 */
  if (unlikely(__pyx_v_options == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 570, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_options, __pyx_n_u_date_as_object); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(1, 570, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result.date_as_object = __pyx_t_2;

  /* "pyarrow/array.pxi":571
 *     result.integer_object_nulls = options['integer_object_nulls']
 *     result.date_as_object = options['date_as_object']
 *     result.use_threads = options['use_threads']             # <<<<<<<<<<<<<<
 *     result.deduplicate_objects = options['deduplicate_objects']
 *     result.split_blocks = options['split_blocks']
 */
  if (unlikely(__pyx_v_options == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 571, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_options, __pyx_n_u_use_threads); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(1, 571, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result.use_threads = __pyx_t_2;

  /* "pyarrow/array.pxi":572
 *     result.date_as_object = options['date_as_object']
 *     result.use_threads = options['use_threads']
 *     result.deduplicate_objects = options['deduplicate_objects']             # <<<<<<<<<<<<<<
 *     result.split_blocks = options['split_blocks']
 *     result.self_destruct = options['self_destruct']
 */
  if (unlikely(__pyx_v_options == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 572, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_options, __pyx_n_u_deduplicate_objects); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(1, 572, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result.deduplicate_objects = __pyx_t_2;

  /* "pyarrow/array.pxi":573
 *     result.use_threads = options['use_threads']
 *     result.deduplicate_objects = options['deduplicate_objects']
 *     result.split_blocks = options['split_blocks']             # <<<<<<<<<<<<<<
 *     result.self_destruct = options['self_destruct']
 *     return result
 */
  if (unlikely(__pyx_v_options == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 573, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_options, __pyx_n_u_split_blocks); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(1, 573, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result.split_blocks = __pyx_t_2;

  /* "pyarrow/array.pxi":574
 *     result.deduplicate_objects = options['deduplicate_objects']
 *     result.split_blocks = options['split_blocks']
 *     result.self_destruct = options['self_destruct']             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  if (unlikely(__pyx_v_options == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 574, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_options, __pyx_n_u_self_destruct); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(1, 574, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result.self_destruct = __pyx_t_2;

  /* "pyarrow/array.pxi":575
 *     result.split_blocks = options['split_blocks']
 *     result.self_destruct = options['self_destruct']
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":564
 * 
 * 
 * cdef PandasOptions _convert_pandas_options(dict options):             # <<<<<<<<<<<<<<
 *     cdef PandasOptions result
 *     result.pool = maybe_unbox_memory_pool(options['pool'])
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("pyarrow.lib._convert_pandas_options", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":583
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly, use one of "
 *                         "the `pyarrow.Array.from_*` functions instead."
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_5Array_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_5Array_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array___init__(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_5Array___init__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/array.pxi":586
 *         raise TypeError("Do not call {}'s constructor directly, use one of "
 *                         "the `pyarrow.Array.from_*` functions instead."
 *                         .format(self.__class__.__name__))             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CArray]& sp_array) except *:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Do_not_call_s_constructor_direct_7, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/array.pxi":584
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call {}'s constructor directly, use one of "             # <<<<<<<<<<<<<<
 *                         "the `pyarrow.Array.from_*` functions instead."
 *                         .format(self.__class__.__name__))
 */
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __PYX_ERR(1, 584, __pyx_L1_error)

  /* "pyarrow/array.pxi":583
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly, use one of "
 *                         "the `pyarrow.Array.from_*` functions instead."
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.Array.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":588
 *                         .format(self.__class__.__name__))
 * 
 *     cdef void init(self, const shared_ptr[CArray]& sp_array) except *:             # <<<<<<<<<<<<<<
 *         self.sp_array = sp_array
 *         self.ap = sp_array.get()
 */

static void __pyx_f_7pyarrow_3lib_5Array_init(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, std::shared_ptr< arrow::Array>  const &__pyx_v_sp_array) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/array.pxi":589
 * 
 *     cdef void init(self, const shared_ptr[CArray]& sp_array) except *:
 *         self.sp_array = sp_array             # <<<<<<<<<<<<<<
 *         self.ap = sp_array.get()
 *         self.type = pyarrow_wrap_data_type(self.sp_array.get().type())
 */
  __pyx_v_self->sp_array = __pyx_v_sp_array;

  /* "pyarrow/array.pxi":590
 *     cdef void init(self, const shared_ptr[CArray]& sp_array) except *:
 *         self.sp_array = sp_array
 *         self.ap = sp_array.get()             # <<<<<<<<<<<<<<
 *         self.type = pyarrow_wrap_data_type(self.sp_array.get().type())
 * 
 */
  __pyx_v_self->ap = __pyx_v_sp_array.get();

  /* "pyarrow/array.pxi":591
 *         self.sp_array = sp_array
 *         self.ap = sp_array.get()
 *         self.type = pyarrow_wrap_data_type(self.sp_array.get().type())             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, other):
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_self->sp_array.get()->type()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(1, 591, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->type);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->type));
  __pyx_v_self->type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":588
 *                         .format(self.__class__.__name__))
 * 
 *     cdef void init(self, const shared_ptr[CArray]& sp_array) except *:             # <<<<<<<<<<<<<<
 *         self.sp_array = sp_array
 *         self.ap = sp_array.get()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Array.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/array.pxi":593
 *         self.type = pyarrow_wrap_data_type(self.sp_array.get().type())
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError('Comparisons with pyarrow.Array are not '
 *                                   'implemented')
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_3__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_3__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_2__eq__(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self), ((PyObject *)__pyx_v_other));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_2__eq__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__eq__", 0);

  /* "pyarrow/array.pxi":594
 * 
 *     def __eq__(self, other):
 *         raise NotImplementedError('Comparisons with pyarrow.Array are not '             # <<<<<<<<<<<<<<
 *                                   'implemented')
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__146, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 594, __pyx_L1_error)

  /* "pyarrow/array.pxi":593
 *         self.type = pyarrow_wrap_data_type(self.sp_array.get().type())
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError('Comparisons with pyarrow.Array are not '
 *                                   'implemented')
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Array.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":597
 *                                   'implemented')
 * 
 *     def _debug_print(self):             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(DebugPrint(deref(self.ap), 0))
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_5_debug_print(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_4_debug_print[] = "Array._debug_print(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_5_debug_print(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_debug_print (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_4_debug_print(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_4_debug_print(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("_debug_print", 0);

  /* "pyarrow/array.pxi":598
 * 
 *     def _debug_print(self):
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(DebugPrint(deref(self.ap), 0))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":599
 *     def _debug_print(self):
 *         with nogil:
 *             check_status(DebugPrint(deref(self.ap), 0))             # <<<<<<<<<<<<<<
 * 
 *     def diff(self, Array other):
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::DebugPrint((*__pyx_v_self->ap), 0)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 599, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":598
 * 
 *     def _debug_print(self):
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(DebugPrint(deref(self.ap), 0))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/array.pxi":597
 *                                   'implemented')
 * 
 *     def _debug_print(self):             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(DebugPrint(deref(self.ap), 0))
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.Array._debug_print", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":601
 *             check_status(DebugPrint(deref(self.ap), 0))
 * 
 *     def diff(self, Array other):             # <<<<<<<<<<<<<<
 *         """
 *         Return string containing the result of arrow::Diff comparing contents
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_7diff(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_6diff[] = "Array.diff(self, Array other)\n\n        Return string containing the result of arrow::Diff comparing contents\n        of this array against the other array\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_7diff(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("diff (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_7pyarrow_3lib_Array, 1, "other", 0))) __PYX_ERR(1, 601, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_6diff(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_6diff(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_other) {
  std::string __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("diff", 0);

  /* "pyarrow/array.pxi":607
 *         """
 *         cdef c_string result
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = self.ap.Diff(deref(other.ap))
 *         return frombytes(result)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":608
 *         cdef c_string result
 *         with nogil:
 *             result = self.ap.Diff(deref(other.ap))             # <<<<<<<<<<<<<<
 *         return frombytes(result)
 * 
 */
        __pyx_v_result = __pyx_v_self->ap->Diff((*__pyx_v_other->ap));
      }

      /* "pyarrow/array.pxi":607
 *         """
 *         cdef c_string result
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = self.ap.Diff(deref(other.ap))
 *         return frombytes(result)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/array.pxi":609
 *         with nogil:
 *             result = self.ap.Diff(deref(other.ap))
 *         return frombytes(result)             # <<<<<<<<<<<<<<
 * 
 *     def cast(self, object target_type, bint safe=True):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_result); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":601
 *             check_status(DebugPrint(deref(self.ap), 0))
 * 
 *     def diff(self, Array other):             # <<<<<<<<<<<<<<
 *         """
 *         Return string containing the result of arrow::Diff comparing contents
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.Array.diff", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":611
 *         return frombytes(result)
 * 
 *     def cast(self, object target_type, bint safe=True):             # <<<<<<<<<<<<<<
 *         """
 *         Cast array values to another data type.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_9cast(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_8cast[] = "Array.cast(self, target_type, bool safe=True)\n\n        Cast array values to another data type.\n\n        Example\n        -------\n\n        >>> from datetime import datetime\n        >>> import pyarrow as pa\n        >>> arr = pa.array([datetime(2010, 1, 1), datetime(2015, 1, 1)])\n        >>> arr.type\n        TimestampType(timestamp[us])\n\n        You can use ``pyarrow.DataType`` objects to specify the target type:\n\n        >>> arr.cast(pa.timestamp('ms'))\n        <pyarrow.lib.TimestampArray object at 0x10420eb88>\n        [\n          1262304000000,\n          1420070400000\n        ]\n        >>> arr.cast(pa.timestamp('ms')).type\n        TimestampType(timestamp[ms])\n\n        Alternatively, it is also supported to use the string aliases for these\n        types:\n\n        >>> arr.cast('timestamp[ms]')\n        <pyarrow.lib.TimestampArray object at 0x10420eb88>\n        [\n          1262304000000,\n          1420070400000\n        ]\n        >>> arr.cast('timestamp[ms]').type\n        TimestampType(timestamp[ms])\n\n        Parameters\n        ----------\n        target_type : DataType\n            Type to cast to\n        safe : boolean, default True\n            Check for overflows or other unsafe conversions\n\n        Returns\n        -------\n        casted : Array\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_9cast(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_target_type = 0;
  int __pyx_v_safe;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cast (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_target_type,&__pyx_n_s_safe,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_target_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_safe);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cast") < 0)) __PYX_ERR(1, 611, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_target_type = values[0];
    if (values[1]) {
      __pyx_v_safe = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_safe == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 611, __pyx_L3_error)
    } else {
      __pyx_v_safe = ((int)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cast", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 611, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Array.cast", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_8cast(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self), __pyx_v_target_type, __pyx_v_safe);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_8cast(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, PyObject *__pyx_v_target_type, int __pyx_v_safe) {
   arrow::compute::CastOptions __pyx_v_options;
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_type = 0;
  std::shared_ptr< arrow::Array>  __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("cast", 0);

  /* "pyarrow/array.pxi":659
 *         """
 *         cdef:
 *             CCastOptions options = CCastOptions(safe)             # <<<<<<<<<<<<<<
 *             DataType type = ensure_type(target_type)
 *             shared_ptr[CArray] result
 */
  __pyx_v_options =  arrow::compute::CastOptions(__pyx_v_safe);

  /* "pyarrow/array.pxi":660
 *         cdef:
 *             CCastOptions options = CCastOptions(safe)
 *             DataType type = ensure_type(target_type)             # <<<<<<<<<<<<<<
 *             shared_ptr[CArray] result
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_ensure_type(__pyx_v_target_type, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":663
 *             shared_ptr[CArray] result
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(Cast(_context(), self.ap[0], type.sp_type,
 *                               options, &result))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":664
 * 
 *         with nogil:
 *             check_status(Cast(_context(), self.ap[0], type.sp_type,             # <<<<<<<<<<<<<<
 *                               options, &result))
 * 
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(arrow::compute::Cast(__pyx_f_7pyarrow_3lib__context(), (__pyx_v_self->ap[0]), __pyx_v_type->sp_type, __pyx_v_options, (&__pyx_v_result))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 664, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":663
 *             shared_ptr[CArray] result
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(Cast(_context(), self.ap[0], type.sp_type,
 *                               options, &result))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/array.pxi":667
 *                               options, &result))
 * 
 *         return pyarrow_wrap_array(result)             # <<<<<<<<<<<<<<
 * 
 *     def view(self, object target_type):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":611
 *         return frombytes(result)
 * 
 *     def cast(self, object target_type, bint safe=True):             # <<<<<<<<<<<<<<
 *         """
 *         Cast array values to another data type.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Array.cast", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_type);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":669
 *         return pyarrow_wrap_array(result)
 * 
 *     def view(self, object target_type):             # <<<<<<<<<<<<<<
 *         """Return zero-copy "view" of array as another data type. The data
 *         types must have compatible columnar buffer layouts
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_11view(PyObject *__pyx_v_self, PyObject *__pyx_v_target_type); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_10view[] = "Array.view(self, target_type)\nReturn zero-copy \"view\" of array as another data type. The data\n        types must have compatible columnar buffer layouts\n\n        Parameters\n        ----------\n        target_type : DataType\n            Type to construct view as\n\n        Returns\n        -------\n        view : Array\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_11view(PyObject *__pyx_v_self, PyObject *__pyx_v_target_type) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("view (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_10view(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self), ((PyObject *)__pyx_v_target_type));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_10view(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, PyObject *__pyx_v_target_type) {
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_type = 0;
  std::shared_ptr< arrow::Array>  __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("view", 0);

  /* "pyarrow/array.pxi":682
 *         view : Array
 *         """
 *         cdef DataType type = ensure_type(target_type)             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[CArray] result
 *         with nogil:
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_ensure_type(__pyx_v_target_type, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 682, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":684
 *         cdef DataType type = ensure_type(target_type)
 *         cdef shared_ptr[CArray] result
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.ap.View(type.sp_type, &result))
 *         return pyarrow_wrap_array(result)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":685
 *         cdef shared_ptr[CArray] result
 *         with nogil:
 *             check_status(self.ap.View(type.sp_type, &result))             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_array(result)
 * 
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->ap->View(__pyx_v_type->sp_type, (&__pyx_v_result))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 685, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":684
 *         cdef DataType type = ensure_type(target_type)
 *         cdef shared_ptr[CArray] result
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.ap.View(type.sp_type, &result))
 *         return pyarrow_wrap_array(result)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/array.pxi":686
 *         with nogil:
 *             check_status(self.ap.View(type.sp_type, &result))
 *         return pyarrow_wrap_array(result)             # <<<<<<<<<<<<<<
 * 
 *     def sum(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":669
 *         return pyarrow_wrap_array(result)
 * 
 *     def view(self, object target_type):             # <<<<<<<<<<<<<<
 *         """Return zero-copy "view" of array as another data type. The data
 *         types must have compatible columnar buffer layouts
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Array.view", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_type);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":688
 *         return pyarrow_wrap_array(result)
 * 
 *     def sum(self):             # <<<<<<<<<<<<<<
 *         """
 *         Sum the values in a numerical array.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_13sum(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_12sum[] = "Array.sum(self)\n\n        Sum the values in a numerical array.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_13sum(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sum (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_12sum(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_12sum(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
   arrow::compute::Datum __pyx_v_out;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("sum", 0);

  /* "pyarrow/array.pxi":694
 *         cdef CDatum out
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(Sum(_context(), CDatum(self.sp_array), &out))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":695
 * 
 *         with nogil:
 *             check_status(Sum(_context(), CDatum(self.sp_array), &out))             # <<<<<<<<<<<<<<
 * 
 *         return wrap_datum(out)
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::compute::Sum(__pyx_f_7pyarrow_3lib__context(),  arrow::compute::Datum(__pyx_v_self->sp_array), (&__pyx_v_out))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 695, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":694
 *         cdef CDatum out
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(Sum(_context(), CDatum(self.sp_array), &out))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/array.pxi":697
 *             check_status(Sum(_context(), CDatum(self.sp_array), &out))
 * 
 *         return wrap_datum(out)             # <<<<<<<<<<<<<<
 * 
 *     def unique(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_wrap_datum(__pyx_v_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":688
 *         return pyarrow_wrap_array(result)
 * 
 *     def sum(self):             # <<<<<<<<<<<<<<
 *         """
 *         Sum the values in a numerical array.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Array.sum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":699
 *         return wrap_datum(out)
 * 
 *     def unique(self):             # <<<<<<<<<<<<<<
 *         """
 *         Compute distinct elements in array
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_15unique(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_14unique[] = "Array.unique(self)\n\n        Compute distinct elements in array\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_15unique(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("unique (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_14unique(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_14unique(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  std::shared_ptr< arrow::Array>  __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("unique", 0);

  /* "pyarrow/array.pxi":705
 *         cdef shared_ptr[CArray] result
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(Unique(_context(), CDatum(self.sp_array), &result))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":706
 * 
 *         with nogil:
 *             check_status(Unique(_context(), CDatum(self.sp_array), &result))             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_array(result)
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::compute::Unique(__pyx_f_7pyarrow_3lib__context(),  arrow::compute::Datum(__pyx_v_self->sp_array), (&__pyx_v_result))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 706, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":705
 *         cdef shared_ptr[CArray] result
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(Unique(_context(), CDatum(self.sp_array), &result))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/array.pxi":708
 *             check_status(Unique(_context(), CDatum(self.sp_array), &result))
 * 
 *         return pyarrow_wrap_array(result)             # <<<<<<<<<<<<<<
 * 
 *     def dictionary_encode(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":699
 *         return wrap_datum(out)
 * 
 *     def unique(self):             # <<<<<<<<<<<<<<
 *         """
 *         Compute distinct elements in array
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Array.unique", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":710
 *         return pyarrow_wrap_array(result)
 * 
 *     def dictionary_encode(self):             # <<<<<<<<<<<<<<
 *         """
 *         Compute dictionary-encoded representation of array
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_17dictionary_encode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_16dictionary_encode[] = "Array.dictionary_encode(self)\n\n        Compute dictionary-encoded representation of array\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_17dictionary_encode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dictionary_encode (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_16dictionary_encode(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_16dictionary_encode(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
   arrow::compute::Datum __pyx_v_out;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("dictionary_encode", 0);

  /* "pyarrow/array.pxi":716
 *         cdef CDatum out
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(DictionaryEncode(_context(), CDatum(self.sp_array),
 *                                           &out))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":717
 * 
 *         with nogil:
 *             check_status(DictionaryEncode(_context(), CDatum(self.sp_array),             # <<<<<<<<<<<<<<
 *                                           &out))
 * 
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::compute::DictionaryEncode(__pyx_f_7pyarrow_3lib__context(),  arrow::compute::Datum(__pyx_v_self->sp_array), (&__pyx_v_out))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 717, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":716
 *         cdef CDatum out
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(DictionaryEncode(_context(), CDatum(self.sp_array),
 *                                           &out))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/array.pxi":720
 *                                           &out))
 * 
 *         return wrap_datum(out)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_wrap_datum(__pyx_v_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 720, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":710
 *         return pyarrow_wrap_array(result)
 * 
 *     def dictionary_encode(self):             # <<<<<<<<<<<<<<
 *         """
 *         Compute dictionary-encoded representation of array
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Array.dictionary_encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":723
 * 
 *     @staticmethod
 *     def from_pandas(obj, mask=None, type=None, bint safe=True,             # <<<<<<<<<<<<<<
 *                     MemoryPool memory_pool=None):
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_19from_pandas(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_18from_pandas[] = "Array.from_pandas(obj, mask=None, type=None, bool safe=True, MemoryPool memory_pool=None)\n\n        Convert pandas.Series to an Arrow Array, using pandas's semantics about\n        what values indicate nulls. See pyarrow.array for more general\n        conversion from arrays or sequences to Arrow arrays.\n\n        Parameters\n        ----------\n        sequence : ndarray, pandas.Series, array-like\n        mask : array (boolean), optional\n            Indicate which values are null (True) or not null (False)\n        type : pyarrow.DataType\n            Explicit type to attempt to coerce to, otherwise will be inferred\n            from the data\n        safe : boolean, default True\n            Check for overflows or other unsafe conversions\n        memory_pool : pyarrow.MemoryPool, optional\n            If not passed, will allocate memory from the currently-set default\n            memory pool\n\n        Notes\n        -----\n        Localized timestamps will currently be returned as UTC (pandas's native\n        representation).  Timezone-naive data will be implicitly interpreted as\n        UTC.\n\n        Returns\n        -------\n        array : pyarrow.Array or pyarrow.ChunkedArray (if object data\n        overflows binary buffer)\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_5Array_19from_pandas = {"from_pandas", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Array_19from_pandas, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Array_18from_pandas};
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_19from_pandas(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_obj = 0;
  PyObject *__pyx_v_mask = 0;
  PyObject *__pyx_v_type = 0;
  int __pyx_v_safe;
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_pandas (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_mask,&__pyx_n_s_type,&__pyx_n_s_safe,&__pyx_n_s_memory_pool,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_None);

    /* "pyarrow/array.pxi":724
 *     @staticmethod
 *     def from_pandas(obj, mask=None, type=None, bint safe=True,
 *                     MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Convert pandas.Series to an Arrow Array, using pandas's semantics about
 */
    values[4] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mask);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_safe);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_pandas") < 0)) __PYX_ERR(1, 723, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_obj = values[0];
    __pyx_v_mask = values[1];
    __pyx_v_type = values[2];
    if (values[3]) {
      __pyx_v_safe = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_safe == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 723, __pyx_L3_error)
    } else {

      /* "pyarrow/array.pxi":723
 * 
 *     @staticmethod
 *     def from_pandas(obj, mask=None, type=None, bint safe=True,             # <<<<<<<<<<<<<<
 *                     MemoryPool memory_pool=None):
 *         """
 */
      __pyx_v_safe = ((int)1);
    }
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[4]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_pandas", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 723, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Array.from_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(1, 724, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_18from_pandas(__pyx_v_obj, __pyx_v_mask, __pyx_v_type, __pyx_v_safe, __pyx_v_memory_pool);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_18from_pandas(PyObject *__pyx_v_obj, PyObject *__pyx_v_mask, PyObject *__pyx_v_type, int __pyx_v_safe, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("from_pandas", 0);

  /* "pyarrow/array.pxi":755
 *         overflows binary buffer)
 *         """
 *         return array(obj, mask=mask, type=type, safe=safe, from_pandas=True,             # <<<<<<<<<<<<<<
 *                      memory_pool=memory_pool)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_obj);
  __Pyx_GIVEREF(__pyx_v_obj);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_mask, __pyx_v_mask) < 0) __PYX_ERR(1, 755, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_type, __pyx_v_type) < 0) __PYX_ERR(1, 755, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_safe); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_safe, __pyx_t_4) < 0) __PYX_ERR(1, 755, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_from_pandas, Py_True) < 0) __PYX_ERR(1, 755, __pyx_L1_error)

  /* "pyarrow/array.pxi":756
 *         """
 *         return array(obj, mask=mask, type=type, safe=safe, from_pandas=True,
 *                      memory_pool=memory_pool)             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_memory_pool, ((PyObject *)__pyx_v_memory_pool)) < 0) __PYX_ERR(1, 755, __pyx_L1_error)

  /* "pyarrow/array.pxi":755
 *         overflows binary buffer)
 *         """
 *         return array(obj, mask=mask, type=type, safe=safe, from_pandas=True,             # <<<<<<<<<<<<<<
 *                      memory_pool=memory_pool)
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":723
 * 
 *     @staticmethod
 *     def from_pandas(obj, mask=None, type=None, bint safe=True,             # <<<<<<<<<<<<<<
 *                     MemoryPool memory_pool=None):
 *         """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.Array.from_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":758
 *                      memory_pool=memory_pool)
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return _restore_array, \
 *             (_reduce_array_data(self.sp_array.get().data().get()),)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_21__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_20__reduce__[] = "Array.__reduce__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_21__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_20__reduce__(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_20__reduce__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pyarrow/array.pxi":759
 * 
 *     def __reduce__(self):
 *         return _restore_array, \             # <<<<<<<<<<<<<<
 *             (_reduce_array_data(self.sp_array.get().data().get()),)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_restore_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 759, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyarrow/array.pxi":760
 *     def __reduce__(self):
 *         return _restore_array, \
 *             (_reduce_array_data(self.sp_array.get().data().get()),)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __pyx_t_2 = __pyx_f_7pyarrow_3lib__reduce_array_data(__pyx_v_self->sp_array.get()->data().get()); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 760, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 760, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/array.pxi":759
 * 
 *     def __reduce__(self):
 *         return _restore_array, \             # <<<<<<<<<<<<<<
 *             (_reduce_array_data(self.sp_array.get().data().get()),)
 * 
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 759, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":758
 *                      memory_pool=memory_pool)
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return _restore_array, \
 *             (_reduce_array_data(self.sp_array.get().data().get()),)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Array.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":763
 * 
 *     @staticmethod
 *     def from_buffers(DataType type, length, buffers, null_count=-1, offset=0,             # <<<<<<<<<<<<<<
 *                      children=None):
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_23from_buffers(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_22from_buffers[] = "Array.from_buffers(DataType type, length, buffers, null_count=-1, offset=0, children=None)\n\n        Construct an Array from a sequence of buffers. The concrete type\n        returned depends on the datatype.\n\n        Parameters\n        ----------\n        type : DataType\n            The value type of the array\n        length : int\n            The number of values in the array\n        buffers: List[Buffer]\n            The buffers backing this array\n        null_count : int, default -1\n        offset : int, default 0\n            The array's logical offset (in values, not in bytes) from the\n            start of each buffer\n        children : List[Array], default None\n            Nested type children with length matching type.num_children\n\n        Returns\n        -------\n        array : Array\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_5Array_23from_buffers = {"from_buffers", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Array_23from_buffers, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Array_22from_buffers};
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_23from_buffers(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_type = 0;
  PyObject *__pyx_v_length = 0;
  PyObject *__pyx_v_buffers = 0;
  PyObject *__pyx_v_null_count = 0;
  PyObject *__pyx_v_offset = 0;
  PyObject *__pyx_v_children = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_buffers (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_type,&__pyx_n_s_length,&__pyx_n_s_buffers,&__pyx_n_s_null_count,&__pyx_n_s_offset,&__pyx_n_s_children,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[3] = ((PyObject *)__pyx_int_neg_1);
    values[4] = ((PyObject *)__pyx_int_0);

    /* "pyarrow/array.pxi":764
 *     @staticmethod
 *     def from_buffers(DataType type, length, buffers, null_count=-1, offset=0,
 *                      children=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct an Array from a sequence of buffers. The concrete type
 */
    values[5] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_length)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_buffers", 0, 3, 6, 1); __PYX_ERR(1, 763, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffers)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_buffers", 0, 3, 6, 2); __PYX_ERR(1, 763, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_null_count);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offset);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_buffers") < 0)) __PYX_ERR(1, 763, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)values[0]);
    __pyx_v_length = values[1];
    __pyx_v_buffers = values[2];
    __pyx_v_null_count = values[3];
    __pyx_v_offset = values[4];
    __pyx_v_children = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_buffers", 0, 3, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 763, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Array.from_buffers", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_type), __pyx_ptype_7pyarrow_3lib_DataType, 1, "type", 0))) __PYX_ERR(1, 763, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_22from_buffers(__pyx_v_type, __pyx_v_length, __pyx_v_buffers, __pyx_v_null_count, __pyx_v_offset, __pyx_v_children);

  /* "pyarrow/array.pxi":763
 * 
 *     @staticmethod
 *     def from_buffers(DataType type, length, buffers, null_count=-1, offset=0,             # <<<<<<<<<<<<<<
 *                      children=None):
 *         """
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_22from_buffers(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_type, PyObject *__pyx_v_length, PyObject *__pyx_v_buffers, PyObject *__pyx_v_null_count, PyObject *__pyx_v_offset, PyObject *__pyx_v_children) {
  struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_buf = 0;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_child = 0;
  std::vector<std::shared_ptr< arrow::Buffer> >  __pyx_v_c_buffers;
  std::vector<std::shared_ptr< arrow::ArrayData> >  __pyx_v_c_child_data;
  std::shared_ptr< arrow::ArrayData>  __pyx_v_array_data;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *(*__pyx_t_10)(PyObject *);
  int64_t __pyx_t_11;
  int64_t __pyx_t_12;
  int64_t __pyx_t_13;
  __Pyx_RefNannySetupContext("from_buffers", 0);
  __Pyx_INCREF(__pyx_v_children);

  /* "pyarrow/array.pxi":795
 *             shared_ptr[CArrayData] array_data
 * 
 *         children = children or []             # <<<<<<<<<<<<<<
 * 
 *         if type.num_children != len(children):
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_children); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 795, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __Pyx_INCREF(__pyx_v_children);
    __pyx_t_1 = __pyx_v_children;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_1 = __pyx_t_3;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_L3_bool_binop_done:;
  __Pyx_DECREF_SET(__pyx_v_children, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":797
 *         children = children or []
 * 
 *         if type.num_children != len(children):             # <<<<<<<<<<<<<<
 *             raise ValueError("Type's expected number of children "
 *                              "({0}) did not match the passed number "
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_type), __pyx_n_s_num_children); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 797, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyObject_Length(__pyx_v_children); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 797, __pyx_L1_error)
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 797, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 797, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 797, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/array.pxi":800
 *             raise ValueError("Type's expected number of children "
 *                              "({0}) did not match the passed number "
 *                              "({1}).".format(type.num_children, len(children)))             # <<<<<<<<<<<<<<
 * 
 *         if type.num_buffers != len(buffers):
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Type_s_expected_number_of_childr, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 800, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_type), __pyx_n_s_num_children); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 800, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyObject_Length(__pyx_v_children); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 800, __pyx_L1_error)
    __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 800, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_8 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_1, __pyx_t_6};
      __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 800, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_1, __pyx_t_6};
      __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 800, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    {
      __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 800, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_6);
      __pyx_t_1 = 0;
      __pyx_t_6 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 800, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "pyarrow/array.pxi":798
 * 
 *         if type.num_children != len(children):
 *             raise ValueError("Type's expected number of children "             # <<<<<<<<<<<<<<
 *                              "({0}) did not match the passed number "
 *                              "({1}).".format(type.num_children, len(children)))
 */
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(1, 798, __pyx_L1_error)

    /* "pyarrow/array.pxi":797
 *         children = children or []
 * 
 *         if type.num_children != len(children):             # <<<<<<<<<<<<<<
 *             raise ValueError("Type's expected number of children "
 *                              "({0}) did not match the passed number "
 */
  }

  /* "pyarrow/array.pxi":802
 *                              "({1}).".format(type.num_children, len(children)))
 * 
 *         if type.num_buffers != len(buffers):             # <<<<<<<<<<<<<<
 *             raise ValueError("Type's expected number of buffers "
 *                              "({0}) did not match the passed number "
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_type), __pyx_n_s_num_buffers); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 802, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_Length(__pyx_v_buffers); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 802, __pyx_L1_error)
  __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 802, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_9 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 802, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 802, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/array.pxi":805
 *             raise ValueError("Type's expected number of buffers "
 *                              "({0}) did not match the passed number "
 *                              "({1}).".format(type.num_buffers, len(buffers)))             # <<<<<<<<<<<<<<
 * 
 *         for buf in buffers:
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Type_s_expected_number_of_buffer, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 805, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_type), __pyx_n_s_num_buffers); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 805, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_Length(__pyx_v_buffers); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 805, __pyx_L1_error)
    __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 805, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_8 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_3, __pyx_t_6};
      __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 805, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_3, __pyx_t_6};
      __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 805, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 805, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_1) {
        __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __pyx_t_1 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_t_6);
      __pyx_t_3 = 0;
      __pyx_t_6 = 0;
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 805, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "pyarrow/array.pxi":803
 * 
 *         if type.num_buffers != len(buffers):
 *             raise ValueError("Type's expected number of buffers "             # <<<<<<<<<<<<<<
 *                              "({0}) did not match the passed number "
 *                              "({1}).".format(type.num_buffers, len(buffers)))
 */
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 803, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(1, 803, __pyx_L1_error)

    /* "pyarrow/array.pxi":802
 *                              "({1}).".format(type.num_children, len(children)))
 * 
 *         if type.num_buffers != len(buffers):             # <<<<<<<<<<<<<<
 *             raise ValueError("Type's expected number of buffers "
 *                              "({0}) did not match the passed number "
 */
  }

  /* "pyarrow/array.pxi":807
 *                              "({1}).".format(type.num_buffers, len(buffers)))
 * 
 *         for buf in buffers:             # <<<<<<<<<<<<<<
 *             # None will produce a null buffer pointer
 *             c_buffers.push_back(pyarrow_unwrap_buffer(buf))
 */
  if (likely(PyList_CheckExact(__pyx_v_buffers)) || PyTuple_CheckExact(__pyx_v_buffers)) {
    __pyx_t_5 = __pyx_v_buffers; __Pyx_INCREF(__pyx_t_5); __pyx_t_4 = 0;
    __pyx_t_10 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_buffers); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 807, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_10 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 807, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_10)) {
      if (likely(PyList_CheckExact(__pyx_t_5))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_9 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_4); __Pyx_INCREF(__pyx_t_9); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(1, 807, __pyx_L1_error)
        #else
        __pyx_t_9 = PySequence_ITEM(__pyx_t_5, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 807, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_4); __Pyx_INCREF(__pyx_t_9); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(1, 807, __pyx_L1_error)
        #else
        __pyx_t_9 = PySequence_ITEM(__pyx_t_5, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 807, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        #endif
      }
    } else {
      __pyx_t_9 = __pyx_t_10(__pyx_t_5);
      if (unlikely(!__pyx_t_9)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(1, 807, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_9);
    }
    if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_7pyarrow_3lib_Buffer))))) __PYX_ERR(1, 807, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_buf, ((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_t_9));
    __pyx_t_9 = 0;

    /* "pyarrow/array.pxi":809
 *         for buf in buffers:
 *             # None will produce a null buffer pointer
 *             c_buffers.push_back(pyarrow_unwrap_buffer(buf))             # <<<<<<<<<<<<<<
 * 
 *         for child in children:
 */
    try {
      __pyx_v_c_buffers.push_back(__pyx_f_7pyarrow_3lib_pyarrow_unwrap_buffer(((PyObject *)__pyx_v_buf)));
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(1, 809, __pyx_L1_error)
    }

    /* "pyarrow/array.pxi":807
 *                              "({1}).".format(type.num_buffers, len(buffers)))
 * 
 *         for buf in buffers:             # <<<<<<<<<<<<<<
 *             # None will produce a null buffer pointer
 *             c_buffers.push_back(pyarrow_unwrap_buffer(buf))
 */
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/array.pxi":811
 *             c_buffers.push_back(pyarrow_unwrap_buffer(buf))
 * 
 *         for child in children:             # <<<<<<<<<<<<<<
 *             c_child_data.push_back(child.ap.data())
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_children)) || PyTuple_CheckExact(__pyx_v_children)) {
    __pyx_t_5 = __pyx_v_children; __Pyx_INCREF(__pyx_t_5); __pyx_t_4 = 0;
    __pyx_t_10 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_children); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 811, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_10 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 811, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_10)) {
      if (likely(PyList_CheckExact(__pyx_t_5))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_9 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_4); __Pyx_INCREF(__pyx_t_9); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(1, 811, __pyx_L1_error)
        #else
        __pyx_t_9 = PySequence_ITEM(__pyx_t_5, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 811, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_4); __Pyx_INCREF(__pyx_t_9); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(1, 811, __pyx_L1_error)
        #else
        __pyx_t_9 = PySequence_ITEM(__pyx_t_5, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 811, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        #endif
      }
    } else {
      __pyx_t_9 = __pyx_t_10(__pyx_t_5);
      if (unlikely(!__pyx_t_9)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(1, 811, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_9);
    }
    if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 811, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_child, ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_9));
    __pyx_t_9 = 0;

    /* "pyarrow/array.pxi":812
 * 
 *         for child in children:
 *             c_child_data.push_back(child.ap.data())             # <<<<<<<<<<<<<<
 * 
 *         array_data = CArrayData.MakeWithChildren(type.sp_type, length,
 */
    try {
      __pyx_v_c_child_data.push_back(__pyx_v_child->ap->data());
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(1, 812, __pyx_L1_error)
    }

    /* "pyarrow/array.pxi":811
 *             c_buffers.push_back(pyarrow_unwrap_buffer(buf))
 * 
 *         for child in children:             # <<<<<<<<<<<<<<
 *             c_child_data.push_back(child.ap.data())
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/array.pxi":814
 *             c_child_data.push_back(child.ap.data())
 * 
 *         array_data = CArrayData.MakeWithChildren(type.sp_type, length,             # <<<<<<<<<<<<<<
 *                                                  c_buffers, c_child_data,
 *                                                  null_count, offset)
 */
  __pyx_t_11 = __Pyx_PyInt_As_int64_t(__pyx_v_length); if (unlikely((__pyx_t_11 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 814, __pyx_L1_error)

  /* "pyarrow/array.pxi":816
 *         array_data = CArrayData.MakeWithChildren(type.sp_type, length,
 *                                                  c_buffers, c_child_data,
 *                                                  null_count, offset)             # <<<<<<<<<<<<<<
 *         cdef Array result = pyarrow_wrap_array(MakeArray(array_data))
 *         result.validate()
 */
  __pyx_t_12 = __Pyx_PyInt_As_int64_t(__pyx_v_null_count); if (unlikely((__pyx_t_12 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 816, __pyx_L1_error)
  __pyx_t_13 = __Pyx_PyInt_As_int64_t(__pyx_v_offset); if (unlikely((__pyx_t_13 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 816, __pyx_L1_error)

  /* "pyarrow/array.pxi":814
 *             c_child_data.push_back(child.ap.data())
 * 
 *         array_data = CArrayData.MakeWithChildren(type.sp_type, length,             # <<<<<<<<<<<<<<
 *                                                  c_buffers, c_child_data,
 *                                                  null_count, offset)
 */
  __pyx_v_array_data =  arrow::ArrayData:: Make(__pyx_v_type->sp_type, __pyx_t_11, __pyx_v_c_buffers, __pyx_v_c_child_data, __pyx_t_12, __pyx_t_13);

  /* "pyarrow/array.pxi":817
 *                                                  c_buffers, c_child_data,
 *                                                  null_count, offset)
 *         cdef Array result = pyarrow_wrap_array(MakeArray(array_data))             # <<<<<<<<<<<<<<
 *         result.validate()
 *         return result
 */
  __pyx_t_5 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(arrow::MakeArray(__pyx_v_array_data)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 817, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 817, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pyarrow/array.pxi":818
 *                                                  null_count, offset)
 *         cdef Array result = pyarrow_wrap_array(MakeArray(array_data))
 *         result.validate()             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_validate); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
    }
  }
  __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/array.pxi":819
 *         cdef Array result = pyarrow_wrap_array(MakeArray(array_data))
 *         result.validate()
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/array.pxi":763
 * 
 *     @staticmethod
 *     def from_buffers(DataType type, length, buffers, null_count=-1, offset=0,             # <<<<<<<<<<<<<<
 *                      children=None):
 *         """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pyarrow.lib.Array.from_buffers", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XDECREF((PyObject *)__pyx_v_child);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_children);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":822
 * 
 *     @property
 *     def null_count(self):             # <<<<<<<<<<<<<<
 *         return self.sp_array.get().null_count()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_10null_count_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_10null_count_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_10null_count___get__(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_10null_count___get__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/array.pxi":823
 *     @property
 *     def null_count(self):
 *         return self.sp_array.get().null_count()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->sp_array.get()->null_count()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":822
 * 
 *     @property
 *     def null_count(self):             # <<<<<<<<<<<<<<
 *         return self.sp_array.get().null_count()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Array.null_count.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":826
 * 
 *     @property
 *     def nbytes(self):             # <<<<<<<<<<<<<<
 *         """Total number of bytes consumed by the elements of the array."""
 *         size = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_6nbytes_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_6nbytes___get__(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_6nbytes___get__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  PyObject *__pyx_v_size = NULL;
  PyObject *__pyx_v_buf = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/array.pxi":828
 *     def nbytes(self):
 *         """Total number of bytes consumed by the elements of the array."""
 *         size = 0             # <<<<<<<<<<<<<<
 *         for buf in self.buffers():
 *             if buf is not None:
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_size = __pyx_int_0;

  /* "pyarrow/array.pxi":829
 *         """Total number of bytes consumed by the elements of the array."""
 *         size = 0
 *         for buf in self.buffers():             # <<<<<<<<<<<<<<
 *             if buf is not None:
 *                 size += buf.size
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_buffers); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 829, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 829, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 829, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 829, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(1, 829, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 829, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(1, 829, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 829, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(1, 829, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_buf, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/array.pxi":830
 *         size = 0
 *         for buf in self.buffers():
 *             if buf is not None:             # <<<<<<<<<<<<<<
 *                 size += buf.size
 *         return size
 */
    __pyx_t_6 = (__pyx_v_buf != Py_None);
    __pyx_t_7 = (__pyx_t_6 != 0);
    if (__pyx_t_7) {

      /* "pyarrow/array.pxi":831
 *         for buf in self.buffers():
 *             if buf is not None:
 *                 size += buf.size             # <<<<<<<<<<<<<<
 *         return size
 * 
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_buf, __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 831, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_size, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 831, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF_SET(__pyx_v_size, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "pyarrow/array.pxi":830
 *         size = 0
 *         for buf in self.buffers():
 *             if buf is not None:             # <<<<<<<<<<<<<<
 *                 size += buf.size
 *         return size
 */
    }

    /* "pyarrow/array.pxi":829
 *         """Total number of bytes consumed by the elements of the array."""
 *         size = 0
 *         for buf in self.buffers():             # <<<<<<<<<<<<<<
 *             if buf is not None:
 *                 size += buf.size
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/array.pxi":832
 *             if buf is not None:
 *                 size += buf.size
 *         return size             # <<<<<<<<<<<<<<
 * 
 *     def __sizeof__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_size);
  __pyx_r = __pyx_v_size;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":826
 * 
 *     @property
 *     def nbytes(self):             # <<<<<<<<<<<<<<
 *         """Total number of bytes consumed by the elements of the array."""
 *         size = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Array.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_size);
  __Pyx_XDECREF(__pyx_v_buf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":834
 *         return size
 * 
 *     def __sizeof__(self):             # <<<<<<<<<<<<<<
 *         return super(Array, self).__sizeof__() + self.nbytes
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_25__sizeof__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_24__sizeof__[] = "Array.__sizeof__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_25__sizeof__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sizeof__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_24__sizeof__(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_24__sizeof__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__sizeof__", 0);

  /* "pyarrow/array.pxi":835
 * 
 *     def __sizeof__(self):
 *         return super(Array, self).__sizeof__() + self.nbytes             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_7pyarrow_3lib_Array));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7pyarrow_3lib_Array));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Array));
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self));
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sizeof); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_nbytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":834
 *         return size
 * 
 *     def __sizeof__(self):             # <<<<<<<<<<<<<<
 *         return super(Array, self).__sizeof__() + self.nbytes
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Array.__sizeof__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pyarrow_3lib_5Array_28generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/array.pxi":837
 *         return super(Array, self).__sizeof__() + self.nbytes
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         for i in range(len(self)):
 *             yield self.getitem(i)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_27__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_27__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_26__iter__(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_26__iter__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9___iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9___iter__ *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_9___iter__(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_9___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9___iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(1, 837, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7pyarrow_3lib_5Array_28generator7, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_Array___iter, __pyx_n_s_pyarrow_lib); if (unlikely(!gen)) __PYX_ERR(1, 837, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.Array.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7pyarrow_3lib_5Array_28generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9___iter__ *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9___iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(1, 837, __pyx_L1_error)

  /* "pyarrow/array.pxi":838
 * 
 *     def __iter__(self):
 *         for i in range(len(self)):             # <<<<<<<<<<<<<<
 *             yield self.getitem(i)
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 838, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_cur_scope->__pyx_v_i = __pyx_t_3;

    /* "pyarrow/array.pxi":839
 *     def __iter__(self):
 *         for i in range(len(self)):
 *             yield self.getitem(i)             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
    __pyx_t_4 = ((struct __pyx_vtabstruct_7pyarrow_3lib_Array *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->getitem(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(1, 839, __pyx_L1_error)
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "pyarrow/array.pxi":837
 *         return super(Array, self).__sizeof__() + self.nbytes
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         for i in range(len(self)):
 *             yield self.getitem(i)
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":841
 *             yield self.getitem(i)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         type_format = object.__repr__(self)
 *         return '{0}\n{1}'.format(type_format, str(self))
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_30__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_30__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_29__repr__(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_29__repr__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  PyObject *__pyx_v_type_format = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pyarrow/array.pxi":842
 * 
 *     def __repr__(self):
 *         type_format = object.__repr__(self)             # <<<<<<<<<<<<<<
 *         return '{0}\n{1}'.format(type_format, str(self))
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_repr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 842, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self));
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 842, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_type_format = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":843
 *     def __repr__(self):
 *         type_format = object.__repr__(self)
 *         return '{0}\n{1}'.format(type_format, str(self))             # <<<<<<<<<<<<<<
 * 
 *     def format(self, int indent=0, int window=10):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_0_1, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 843, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 843, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_type_format, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 843, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_type_format, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 843, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 843, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(__pyx_v_type_format);
    __Pyx_GIVEREF(__pyx_v_type_format);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_type_format);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 843, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":841
 *             yield self.getitem(i)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         type_format = object.__repr__(self)
 *         return '{0}\n{1}'.format(type_format, str(self))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.Array.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_type_format);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":845
 *         return '{0}\n{1}'.format(type_format, str(self))
 * 
 *     def format(self, int indent=0, int window=10):             # <<<<<<<<<<<<<<
 *         cdef:
 *             c_string result
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_32format(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_31format[] = "Array.format(self, int indent=0, int window=10)";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_32format(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_indent;
  int __pyx_v_window;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("format (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indent,&__pyx_n_s_window,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indent);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_window);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "format") < 0)) __PYX_ERR(1, 845, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_indent = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_indent == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 845, __pyx_L3_error)
    } else {
      __pyx_v_indent = ((int)0);
    }
    if (values[1]) {
      __pyx_v_window = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_window == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 845, __pyx_L3_error)
    } else {
      __pyx_v_window = ((int)10);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("format", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 845, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Array.format", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_31format(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self), __pyx_v_indent, __pyx_v_window);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_31format(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, int __pyx_v_indent, int __pyx_v_window) {
  std::string __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("format", 0);

  /* "pyarrow/array.pxi":849
 *             c_string result
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(
 *                 PrettyPrint(
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":850
 * 
 *         with nogil:
 *             check_status(             # <<<<<<<<<<<<<<
 *                 PrettyPrint(
 *                     deref(self.ap),
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::PrettyPrint((*__pyx_v_self->ap), arrow::PrettyPrintOptions(__pyx_v_indent, __pyx_v_window), (&__pyx_v_result))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 850, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":849
 *             c_string result
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(
 *                 PrettyPrint(
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/array.pxi":858
 *             )
 * 
 *         return frombytes(result)             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":845
 *         return '{0}\n{1}'.format(type_format, str(self))
 * 
 *     def format(self, int indent=0, int window=10):             # <<<<<<<<<<<<<<
 *         cdef:
 *             c_string result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.Array.format", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":860
 *         return frombytes(result)
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self.format()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_34__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_34__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_33__str__(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_33__str__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "pyarrow/array.pxi":861
 * 
 *     def __str__(self):
 *         return self.format()             # <<<<<<<<<<<<<<
 * 
 *     def equals(Array self, Array other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 861, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 861, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":860
 *         return frombytes(result)
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self.format()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Array.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":863
 *         return self.format()
 * 
 *     def equals(Array self, Array other):             # <<<<<<<<<<<<<<
 *         return self.ap.Equals(deref(other.ap))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_36equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_35equals[] = "Array.equals(self, Array other)";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_36equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("equals (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_7pyarrow_3lib_Array, 1, "other", 0))) __PYX_ERR(1, 863, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_35equals(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_35equals(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("equals", 0);

  /* "pyarrow/array.pxi":864
 * 
 *     def equals(Array self, Array other):
 *         return self.ap.Equals(deref(other.ap))             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->ap->Equals((*__pyx_v_other->ap))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 864, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":863
 *         return self.format()
 * 
 *     def equals(Array self, Array other):             # <<<<<<<<<<<<<<
 *         return self.ap.Equals(deref(other.ap))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Array.equals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":866
 *         return self.ap.Equals(deref(other.ap))
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.length()
 * 
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_7pyarrow_3lib_5Array_38__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pw_7pyarrow_3lib_5Array_38__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_37__len__(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static Py_ssize_t __pyx_pf_7pyarrow_3lib_5Array_37__len__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "pyarrow/array.pxi":867
 * 
 *     def __len__(self):
 *         return self.length()             # <<<<<<<<<<<<<<
 * 
 *     cdef int64_t length(self):
 */
  __pyx_r = ((struct __pyx_vtabstruct_7pyarrow_3lib_Array *)__pyx_v_self->__pyx_vtab)->length(__pyx_v_self);
  goto __pyx_L0;

  /* "pyarrow/array.pxi":866
 *         return self.ap.Equals(deref(other.ap))
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.length()
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":869
 *         return self.length()
 * 
 *     cdef int64_t length(self):             # <<<<<<<<<<<<<<
 *         if self.sp_array.get():
 *             return self.sp_array.get().length()
 */

static int64_t __pyx_f_7pyarrow_3lib_5Array_length(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  int64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("length", 0);

  /* "pyarrow/array.pxi":870
 * 
 *     cdef int64_t length(self):
 *         if self.sp_array.get():             # <<<<<<<<<<<<<<
 *             return self.sp_array.get().length()
 *         else:
 */
  __pyx_t_1 = (__pyx_v_self->sp_array.get() != 0);
  if (__pyx_t_1) {

    /* "pyarrow/array.pxi":871
 *     cdef int64_t length(self):
 *         if self.sp_array.get():
 *             return self.sp_array.get().length()             # <<<<<<<<<<<<<<
 *         else:
 *             return 0
 */
    __pyx_r = __pyx_v_self->sp_array.get()->length();
    goto __pyx_L0;

    /* "pyarrow/array.pxi":870
 * 
 *     cdef int64_t length(self):
 *         if self.sp_array.get():             # <<<<<<<<<<<<<<
 *             return self.sp_array.get().length()
 *         else:
 */
  }

  /* "pyarrow/array.pxi":873
 *             return self.sp_array.get().length()
 *         else:
 *             return 0             # <<<<<<<<<<<<<<
 * 
 *     def isnull(self):
 */
  /*else*/ {
    __pyx_r = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/array.pxi":869
 *         return self.length()
 * 
 *     cdef int64_t length(self):             # <<<<<<<<<<<<<<
 *         if self.sp_array.get():
 *             return self.sp_array.get().length()
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":875
 *             return 0
 * 
 *     def isnull(self):             # <<<<<<<<<<<<<<
 *         raise NotImplemented
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_40isnull(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_39isnull[] = "Array.isnull(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_40isnull(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("isnull (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_39isnull(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_39isnull(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("isnull", 0);

  /* "pyarrow/array.pxi":876
 * 
 *     def isnull(self):
 *         raise NotImplemented             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, index):
 */
  __Pyx_Raise(__pyx_builtin_NotImplemented, 0, 0, 0);
  __PYX_ERR(1, 876, __pyx_L1_error)

  /* "pyarrow/array.pxi":875
 *             return 0
 * 
 *     def isnull(self):             # <<<<<<<<<<<<<<
 *         raise NotImplemented
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.Array.isnull", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":878
 *         raise NotImplemented
 * 
 *     def __getitem__(self, index):             # <<<<<<<<<<<<<<
 *         """
 *         Return the value at the given index.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_42__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_41__getitem__[] = "\n        Return the value at the given index.\n\n        Returns\n        -------\n        value : Scalar\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7pyarrow_3lib_5Array_41__getitem__;
#endif
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_42__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_41__getitem__(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self), ((PyObject *)__pyx_v_index));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_41__getitem__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "pyarrow/array.pxi":886
 *         value : Scalar
 *         """
 *         if PySlice_Check(index):             # <<<<<<<<<<<<<<
 *             return _normalize_slice(self, index)
 * 
 */
  __pyx_t_1 = (PySlice_Check(__pyx_v_index) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/array.pxi":887
 *         """
 *         if PySlice_Check(index):
 *             return _normalize_slice(self, index)             # <<<<<<<<<<<<<<
 * 
 *         return self.getitem(_normalize_index(index, self.length()))
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_normalize_slice); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 887, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_self), __pyx_v_index};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 887, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_self), __pyx_v_index};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 887, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    {
      __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 887, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_self));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_self));
      __Pyx_INCREF(__pyx_v_index);
      __Pyx_GIVEREF(__pyx_v_index);
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_index);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 887, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/array.pxi":886
 *         value : Scalar
 *         """
 *         if PySlice_Check(index):             # <<<<<<<<<<<<<<
 *             return _normalize_slice(self, index)
 * 
 */
  }

  /* "pyarrow/array.pxi":889
 *             return _normalize_slice(self, index)
 * 
 *         return self.getitem(_normalize_index(index, self.length()))             # <<<<<<<<<<<<<<
 * 
 *     cdef getitem(self, int64_t i):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 889, __pyx_L1_error)
  __pyx_t_8 = __pyx_f_7pyarrow_3lib__normalize_index(__pyx_t_7, ((struct __pyx_vtabstruct_7pyarrow_3lib_Array *)__pyx_v_self->__pyx_vtab)->length(__pyx_v_self)); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1L))) __PYX_ERR(1, 889, __pyx_L1_error)
  __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_3lib_Array *)__pyx_v_self->__pyx_vtab)->getitem(__pyx_v_self, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 889, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":878
 *         raise NotImplemented
 * 
 *     def __getitem__(self, index):             # <<<<<<<<<<<<<<
 *         """
 *         Return the value at the given index.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.Array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":891
 *         return self.getitem(_normalize_index(index, self.length()))
 * 
 *     cdef getitem(self, int64_t i):             # <<<<<<<<<<<<<<
 *         return box_scalar(self.type, self.sp_array, i)
 * 
 */

static PyObject *__pyx_f_7pyarrow_3lib_5Array_getitem(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, int64_t __pyx_v_i) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("getitem", 0);

  /* "pyarrow/array.pxi":892
 * 
 *     cdef getitem(self, int64_t i):
 *         return box_scalar(self.type, self.sp_array, i)             # <<<<<<<<<<<<<<
 * 
 *     def slice(self, offset=0, length=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_v_self->type);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_box_scalar(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1), __pyx_v_self->sp_array, __pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 892, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":891
 *         return self.getitem(_normalize_index(index, self.length()))
 * 
 *     cdef getitem(self, int64_t i):             # <<<<<<<<<<<<<<
 *         return box_scalar(self.type, self.sp_array, i)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Array.getitem", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":894
 *         return box_scalar(self.type, self.sp_array, i)
 * 
 *     def slice(self, offset=0, length=None):             # <<<<<<<<<<<<<<
 *         """
 *         Compute zero-copy slice of this array
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_44slice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_43slice[] = "Array.slice(self, offset=0, length=None)\n\n        Compute zero-copy slice of this array\n\n        Parameters\n        ----------\n        offset : int, default 0\n            Offset from start of array to slice\n        length : int, default None\n            Length of slice (default is until end of Array starting from\n            offset)\n\n        Returns\n        -------\n        sliced : RecordBatch\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_44slice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_offset = 0;
  PyObject *__pyx_v_length = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("slice (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_offset,&__pyx_n_s_length,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)__pyx_int_0);
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offset);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_length);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "slice") < 0)) __PYX_ERR(1, 894, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_offset = values[0];
    __pyx_v_length = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("slice", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 894, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Array.slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_43slice(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self), __pyx_v_offset, __pyx_v_length);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_43slice(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, PyObject *__pyx_v_offset, PyObject *__pyx_v_length) {
  std::shared_ptr< arrow::Array>  __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int64_t __pyx_t_4;
  int64_t __pyx_t_5;
  __Pyx_RefNannySetupContext("slice", 0);

  /* "pyarrow/array.pxi":913
 *             shared_ptr[CArray] result
 * 
 *         if offset < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError('Offset must be non-negative')
 * 
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_offset, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 913, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 913, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/array.pxi":914
 * 
 *         if offset < 0:
 *             raise IndexError('Offset must be non-negative')             # <<<<<<<<<<<<<<
 * 
 *         if length is None:
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__147, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 914, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(1, 914, __pyx_L1_error)

    /* "pyarrow/array.pxi":913
 *             shared_ptr[CArray] result
 * 
 *         if offset < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError('Offset must be non-negative')
 * 
 */
  }

  /* "pyarrow/array.pxi":916
 *             raise IndexError('Offset must be non-negative')
 * 
 *         if length is None:             # <<<<<<<<<<<<<<
 *             result = self.ap.Slice(offset)
 *         else:
 */
  __pyx_t_2 = (__pyx_v_length == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/array.pxi":917
 * 
 *         if length is None:
 *             result = self.ap.Slice(offset)             # <<<<<<<<<<<<<<
 *         else:
 *             result = self.ap.Slice(offset, length)
 */
    __pyx_t_4 = __Pyx_PyInt_As_int64_t(__pyx_v_offset); if (unlikely((__pyx_t_4 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 917, __pyx_L1_error)
    __pyx_v_result = __pyx_v_self->ap->Slice(__pyx_t_4);

    /* "pyarrow/array.pxi":916
 *             raise IndexError('Offset must be non-negative')
 * 
 *         if length is None:             # <<<<<<<<<<<<<<
 *             result = self.ap.Slice(offset)
 *         else:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/array.pxi":919
 *             result = self.ap.Slice(offset)
 *         else:
 *             result = self.ap.Slice(offset, length)             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_array(result)
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyInt_As_int64_t(__pyx_v_offset); if (unlikely((__pyx_t_4 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 919, __pyx_L1_error)
    __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_v_length); if (unlikely((__pyx_t_5 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 919, __pyx_L1_error)
    __pyx_v_result = __pyx_v_self->ap->Slice(__pyx_t_4, __pyx_t_5);
  }
  __pyx_L4:;

  /* "pyarrow/array.pxi":921
 *             result = self.ap.Slice(offset, length)
 * 
 *         return pyarrow_wrap_array(result)             # <<<<<<<<<<<<<<
 * 
 *     def take(self, Array indices):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 921, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":894
 *         return box_scalar(self.type, self.sp_array, i)
 * 
 *     def slice(self, offset=0, length=None):             # <<<<<<<<<<<<<<
 *         """
 *         Compute zero-copy slice of this array
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Array.slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":923
 *         return pyarrow_wrap_array(result)
 * 
 *     def take(self, Array indices):             # <<<<<<<<<<<<<<
 *         """
 *         Take elements from an array.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_46take(PyObject *__pyx_v_self, PyObject *__pyx_v_indices); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_45take[] = "Array.take(self, Array indices)\n\n        Take elements from an array.\n\n        The resulting array will be of the same type as the input array, with\n        elements taken from the input array at the given indices. If an index\n        is null then the taken element will be null.\n\n        Parameters\n        ----------\n        indices : Array\n            The indices of the values to extract. Array needs to be of\n            integer type.\n\n        Returns\n        -------\n        Array\n\n        Examples\n        --------\n\n        >>> import pyarrow as pa\n        >>> arr = pa.array([\"a\", \"b\", \"c\", None, \"e\", \"f\"])\n        >>> indices = pa.array([0, None, 4, 3])\n        >>> arr.take(indices)\n        <pyarrow.lib.StringArray object at 0x7ffa4fc7d368>\n        [\n          \"a\",\n          null,\n          \"e\",\n          null\n        ]\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_46take(PyObject *__pyx_v_self, PyObject *__pyx_v_indices) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indices), __pyx_ptype_7pyarrow_3lib_Array, 1, "indices", 0))) __PYX_ERR(1, 923, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_45take(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_indices));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_45take(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_indices) {
   arrow::compute::TakeOptions __pyx_v_options;
   arrow::compute::Datum __pyx_v_out;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("take", 0);

  /* "pyarrow/array.pxi":960
 *             cdef CDatum out
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(Take(_context(), CDatum(self.sp_array),
 *                               CDatum(indices.sp_array), options, &out))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":961
 * 
 *         with nogil:
 *             check_status(Take(_context(), CDatum(self.sp_array),             # <<<<<<<<<<<<<<
 *                               CDatum(indices.sp_array), options, &out))
 * 
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::compute::Take(__pyx_f_7pyarrow_3lib__context(),  arrow::compute::Datum(__pyx_v_self->sp_array),  arrow::compute::Datum(__pyx_v_indices->sp_array), __pyx_v_options, (&__pyx_v_out))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 961, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":960
 *             cdef CDatum out
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(Take(_context(), CDatum(self.sp_array),
 *                               CDatum(indices.sp_array), options, &out))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/array.pxi":964
 *                               CDatum(indices.sp_array), options, &out))
 * 
 *         return wrap_datum(out)             # <<<<<<<<<<<<<<
 * 
 *     def filter(self, Array mask):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_wrap_datum(__pyx_v_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 964, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":923
 *         return pyarrow_wrap_array(result)
 * 
 *     def take(self, Array indices):             # <<<<<<<<<<<<<<
 *         """
 *         Take elements from an array.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Array.take", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":966
 *         return wrap_datum(out)
 * 
 *     def filter(self, Array mask):             # <<<<<<<<<<<<<<
 *         """
 *         Filter the array with a boolean mask.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_48filter(PyObject *__pyx_v_self, PyObject *__pyx_v_mask); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_47filter[] = "Array.filter(self, Array mask)\n\n        Filter the array with a boolean mask.\n\n        Parameters\n        ----------\n        mask : Array\n            The boolean mask indicating which values to extract.\n\n        Returns\n        -------\n        Array\n\n        Examples\n        --------\n\n        >>> import pyarrow as pa\n        >>> arr = pa.array([\"a\", \"b\", \"c\", None, \"e\"])\n        >>> mask = pa.array([True, False, None, False, True])\n        >>> arr.filter(mask)\n        <pyarrow.lib.StringArray object at 0x7fa826df9200>\n        [\n          \"a\",\n          null,\n          \"e\"\n        ]\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_48filter(PyObject *__pyx_v_self, PyObject *__pyx_v_mask) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("filter (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_7pyarrow_3lib_Array, 1, "mask", 0))) __PYX_ERR(1, 966, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_47filter(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_mask));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_47filter(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_mask) {
   arrow::compute::Datum __pyx_v_out;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("filter", 0);

  /* "pyarrow/array.pxi":996
 *             cdef CDatum out
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(FilterKernel(_context(), CDatum(self.sp_array),
 *                                       CDatum(mask.sp_array), &out))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":997
 * 
 *         with nogil:
 *             check_status(FilterKernel(_context(), CDatum(self.sp_array),             # <<<<<<<<<<<<<<
 *                                       CDatum(mask.sp_array), &out))
 * 
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status( arrow::compute::Filter(__pyx_f_7pyarrow_3lib__context(),  arrow::compute::Datum(__pyx_v_self->sp_array),  arrow::compute::Datum(__pyx_v_mask->sp_array), (&__pyx_v_out))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 997, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":996
 *             cdef CDatum out
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(FilterKernel(_context(), CDatum(self.sp_array),
 *                                       CDatum(mask.sp_array), &out))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/array.pxi":1000
 *                                       CDatum(mask.sp_array), &out))
 * 
 *         return wrap_datum(out)             # <<<<<<<<<<<<<<
 * 
 *     def _to_pandas(self, options, **kwargs):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_wrap_datum(__pyx_v_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":966
 *         return wrap_datum(out)
 * 
 *     def filter(self, Array mask):             # <<<<<<<<<<<<<<
 *         """
 *         Filter the array with a boolean mask.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Array.filter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1002
 *         return wrap_datum(out)
 * 
 *     def _to_pandas(self, options, **kwargs):             # <<<<<<<<<<<<<<
 *         return _array_like_to_pandas(self, options)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_50_to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_49_to_pandas[] = "Array._to_pandas(self, options, **kwargs)";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_50_to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_options = 0;
  CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_to_pandas (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_options,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "_to_pandas") < 0)) __PYX_ERR(1, 1002, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_options = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_to_pandas", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1002, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("pyarrow.lib.Array._to_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_49_to_pandas(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self), __pyx_v_options, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_49_to_pandas(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, PyObject *__pyx_v_options, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("_to_pandas", 0);

  /* "pyarrow/array.pxi":1003
 * 
 *     def _to_pandas(self, options, **kwargs):
 *         return _array_like_to_pandas(self, options)             # <<<<<<<<<<<<<<
 * 
 *     def __array__(self, dtype=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__array_like_to_pandas(((PyObject *)__pyx_v_self), __pyx_v_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1002
 *         return wrap_datum(out)
 * 
 *     def _to_pandas(self, options, **kwargs):             # <<<<<<<<<<<<<<
 *         return _array_like_to_pandas(self, options)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Array._to_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1005
 *         return _array_like_to_pandas(self, options)
 * 
 *     def __array__(self, dtype=None):             # <<<<<<<<<<<<<<
 *         values = self.to_numpy(zero_copy_only=False)
 *         if dtype is None:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_52__array__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_51__array__[] = "Array.__array__(self, dtype=None)";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_52__array__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_dtype = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__array__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dtype,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__array__") < 0)) __PYX_ERR(1, 1005, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_dtype = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__array__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1005, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Array.__array__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_51__array__(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self), __pyx_v_dtype);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_51__array__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, PyObject *__pyx_v_dtype) {
  PyObject *__pyx_v_values = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("__array__", 0);

  /* "pyarrow/array.pxi":1006
 * 
 *     def __array__(self, dtype=None):
 *         values = self.to_numpy(zero_copy_only=False)             # <<<<<<<<<<<<<<
 *         if dtype is None:
 *             return values
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_to_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1006, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1006, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_zero_copy_only, Py_False) < 0) __PYX_ERR(1, 1006, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1006, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_values = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyarrow/array.pxi":1007
 *     def __array__(self, dtype=None):
 *         values = self.to_numpy(zero_copy_only=False)
 *         if dtype is None:             # <<<<<<<<<<<<<<
 *             return values
 *         return values.astype(dtype)
 */
  __pyx_t_4 = (__pyx_v_dtype == Py_None);
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "pyarrow/array.pxi":1008
 *         values = self.to_numpy(zero_copy_only=False)
 *         if dtype is None:
 *             return values             # <<<<<<<<<<<<<<
 *         return values.astype(dtype)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_values);
    __pyx_r = __pyx_v_values;
    goto __pyx_L0;

    /* "pyarrow/array.pxi":1007
 *     def __array__(self, dtype=None):
 *         values = self.to_numpy(zero_copy_only=False)
 *         if dtype is None:             # <<<<<<<<<<<<<<
 *             return values
 *         return values.astype(dtype)
 */
  }

  /* "pyarrow/array.pxi":1009
 *         if dtype is None:
 *             return values
 *         return values.astype(dtype)             # <<<<<<<<<<<<<<
 * 
 *     def to_numpy(self, zero_copy_only=True, writable=False):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1009, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_v_dtype) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_dtype);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1009, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1005
 *         return _array_like_to_pandas(self, options)
 * 
 *     def __array__(self, dtype=None):             # <<<<<<<<<<<<<<
 *         values = self.to_numpy(zero_copy_only=False)
 *         if dtype is None:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Array.__array__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_values);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1011
 *         return values.astype(dtype)
 * 
 *     def to_numpy(self, zero_copy_only=True, writable=False):             # <<<<<<<<<<<<<<
 *         """
 *         Return a NumPy view or copy of this array (experimental).
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_54to_numpy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_53to_numpy[] = "Array.to_numpy(self, zero_copy_only=True, writable=False)\n\n        Return a NumPy view or copy of this array (experimental).\n\n        By default, tries to return a view of this array. This is only\n        supported for primitive arrays with the same memory layout as NumPy\n        (i.e. integers, floating point, ..) and without any nulls.\n\n        Parameters\n        ----------\n        zero_copy_only : bool, default True\n            If True, an exception will be raised if the conversion to a numpy\n            array would require copying the underlying data (e.g. in presence\n            of nulls, or for non-primitive types).\n        writable : bool, default False\n            For numpy arrays created with zero copy (view on the Arrow data),\n            the resulting array is not writable (Arrow data is immutable).\n            By setting this to True, a copy of the array is made to ensure\n            it is writable.\n\n        Returns\n        -------\n        array : numpy.ndarray\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_54to_numpy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_zero_copy_only = 0;
  PyObject *__pyx_v_writable = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_numpy (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_zero_copy_only,&__pyx_n_s_writable,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)Py_True);
    values[1] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zero_copy_only);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_writable);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "to_numpy") < 0)) __PYX_ERR(1, 1011, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_zero_copy_only = values[0];
    __pyx_v_writable = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_numpy", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1011, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Array.to_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_53to_numpy(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self), __pyx_v_zero_copy_only, __pyx_v_writable);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_53to_numpy(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, PyObject *__pyx_v_zero_copy_only, PyObject *__pyx_v_writable) {
  PyObject *__pyx_v_out;
  arrow::py::PandasOptions __pyx_v_c_options;
  PyObject *__pyx_v_array = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  bool __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("to_numpy", 0);

  /* "pyarrow/array.pxi":1040
 *             object values
 * 
 *         if zero_copy_only and writable:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 "Cannot return a writable array if asking for zero-copy")
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_zero_copy_only); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 1040, __pyx_L1_error)
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_writable); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 1040, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/array.pxi":1041
 * 
 *         if zero_copy_only and writable:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 "Cannot return a writable array if asking for zero-copy")
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__148, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1041, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(1, 1041, __pyx_L1_error)

    /* "pyarrow/array.pxi":1040
 *             object values
 * 
 *         if zero_copy_only and writable:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 "Cannot return a writable array if asking for zero-copy")
 */
  }

  /* "pyarrow/array.pxi":1044
 *                 "Cannot return a writable array if asking for zero-copy")
 * 
 *         c_options.zero_copy_only = zero_copy_only             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_zero_copy_only); if (unlikely((__pyx_t_4 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(1, 1044, __pyx_L1_error)
  __pyx_v_c_options.zero_copy_only = __pyx_t_4;

  /* "pyarrow/array.pxi":1046
 *         c_options.zero_copy_only = zero_copy_only
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(ConvertArrayToPandas(c_options, self.sp_array,
 *                                               self, &out))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":1047
 * 
 *         with nogil:
 *             check_status(ConvertArrayToPandas(c_options, self.sp_array,             # <<<<<<<<<<<<<<
 *                                               self, &out))
 * 
 */
        __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::ConvertArrayToPandas(__pyx_v_c_options, __pyx_v_self->sp_array, ((PyObject *)__pyx_v_self), (&__pyx_v_out))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1047, __pyx_L7_error)
      }

      /* "pyarrow/array.pxi":1046
 *         c_options.zero_copy_only = zero_copy_only
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(ConvertArrayToPandas(c_options, self.sp_array,
 *                                               self, &out))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L8;
        }
        __pyx_L7_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L8:;
      }
  }

  /* "pyarrow/array.pxi":1052
 *         # wrap_array_output uses pandas to convert to Categorical, here
 *         # always convert to numpy array without pandas dependency
 *         array = PyObject_to_object(out)             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(array, dict):
 */
  __pyx_t_3 = __pyx_f_7pyarrow_8includes_6common_PyObject_to_object(__pyx_v_out); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1052, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_array = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyarrow/array.pxi":1054
 *         array = PyObject_to_object(out)
 * 
 *         if isinstance(array, dict):             # <<<<<<<<<<<<<<
 *             array = np.take(array['dictionary'], array['indices'])
 * 
 */
  __pyx_t_1 = PyDict_Check(__pyx_v_array); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":1055
 * 
 *         if isinstance(array, dict):
 *             array = np.take(array['dictionary'], array['indices'])             # <<<<<<<<<<<<<<
 * 
 *         if writable and not array.flags.writeable:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1055, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_take); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1055, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_array, __pyx_n_u_dictionary); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1055, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_array, __pyx_n_u_indices); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1055, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
        __pyx_t_5 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_7)) {
      PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_6, __pyx_t_8};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1055, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
      PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_6, __pyx_t_8};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1055, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    } else
    #endif
    {
      __pyx_t_10 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1055, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (__pyx_t_9) {
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_5, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_5, __pyx_t_8);
      __pyx_t_6 = 0;
      __pyx_t_8 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1055, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF_SET(__pyx_v_array, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/array.pxi":1054
 *         array = PyObject_to_object(out)
 * 
 *         if isinstance(array, dict):             # <<<<<<<<<<<<<<
 *             array = np.take(array['dictionary'], array['indices'])
 * 
 */
  }

  /* "pyarrow/array.pxi":1057
 *             array = np.take(array['dictionary'], array['indices'])
 * 
 *         if writable and not array.flags.writeable:             # <<<<<<<<<<<<<<
 *             # if the conversion already needed to a copy, writeable is True
 *             array = array.copy()
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_writable); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 1057, __pyx_L1_error)
  if (__pyx_t_1) {
  } else {
    __pyx_t_2 = __pyx_t_1;
    goto __pyx_L11_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_array, __pyx_n_s_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1057, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_writeable); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1057, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 1057, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_11 = ((!__pyx_t_1) != 0);
  __pyx_t_2 = __pyx_t_11;
  __pyx_L11_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":1059
 *         if writable and not array.flags.writeable:
 *             # if the conversion already needed to a copy, writeable is True
 *             array = array.copy()             # <<<<<<<<<<<<<<
 *         return array
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_array, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1059, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_10 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_7 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1059, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_array, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "pyarrow/array.pxi":1057
 *             array = np.take(array['dictionary'], array['indices'])
 * 
 *         if writable and not array.flags.writeable:             # <<<<<<<<<<<<<<
 *             # if the conversion already needed to a copy, writeable is True
 *             array = array.copy()
 */
  }

  /* "pyarrow/array.pxi":1060
 *             # if the conversion already needed to a copy, writeable is True
 *             array = array.copy()
 *         return array             # <<<<<<<<<<<<<<
 * 
 *     def to_pylist(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_array);
  __pyx_r = __pyx_v_array;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1011
 *         return values.astype(dtype)
 * 
 *     def to_numpy(self, zero_copy_only=True, writable=False):             # <<<<<<<<<<<<<<
 *         """
 *         Return a NumPy view or copy of this array (experimental).
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("pyarrow.lib.Array.to_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_array);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1062
 *         return array
 * 
 *     def to_pylist(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert to a list of native Python objects.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_56to_pylist(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_55to_pylist[] = "Array.to_pylist(self)\n\n        Convert to a list of native Python objects.\n\n        Returns\n        -------\n        lst : list\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_56to_pylist(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_pylist (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_55to_pylist(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_55to_pylist(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  PyObject *__pyx_8genexpr5__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("to_pylist", 0);

  /* "pyarrow/array.pxi":1070
 *         lst : list
 *         """
 *         return [x.as_py() for x in self]             # <<<<<<<<<<<<<<
 * 
 *     def validate(self, *, full=False):
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1070, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (likely(PyList_CheckExact(((PyObject *)__pyx_v_self))) || PyTuple_CheckExact(((PyObject *)__pyx_v_self))) {
      __pyx_t_2 = ((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
      __pyx_t_4 = NULL;
    } else {
      __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1070, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1070, __pyx_L5_error)
    }
    for (;;) {
      if (likely(!__pyx_t_4)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 1070, __pyx_L5_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1070, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        } else {
          if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 1070, __pyx_L5_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1070, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        }
      } else {
        __pyx_t_5 = __pyx_t_4(__pyx_t_2);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(1, 1070, __pyx_L5_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_x, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr5__pyx_v_x, __pyx_n_s_as_py); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1070, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1070, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 1070, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_x); __pyx_8genexpr5__pyx_v_x = 0;
    goto __pyx_L8_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_x); __pyx_8genexpr5__pyx_v_x = 0;
    goto __pyx_L1_error;
    __pyx_L8_exit_scope:;
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1062
 *         return array
 * 
 *     def to_pylist(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert to a list of native Python objects.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.Array.to_pylist", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1072
 *         return [x.as_py() for x in self]
 * 
 *     def validate(self, *, full=False):             # <<<<<<<<<<<<<<
 *         """
 *         Perform validation checks.  An exception is raised if validation fails.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_58validate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_57validate[] = "Array.validate(self, *, full=False)\n\n        Perform validation checks.  An exception is raised if validation fails.\n\n        By default only cheap validation checks are run.  Pass `full=True`\n        for thorough validation checks (potentially O(n)).\n\n        Parameters\n        ----------\n        full: bool, default False\n            If True, run expensive checks, otherwise cheap checks only.\n\n        Raises\n        ------\n        ArrowInvalid\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_58validate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_full = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("validate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_full,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      if (kw_args == 1) {
        const Py_ssize_t index = 0;
        PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]);
        if (value) { values[index] = value; kw_args--; }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, 0, "validate") < 0)) __PYX_ERR(1, 1072, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 0) {
      goto __pyx_L5_argtuple_error;
    } else {
    }
    __pyx_v_full = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("validate", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1072, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Array.validate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_57validate(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self), __pyx_v_full);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_57validate(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, PyObject *__pyx_v_full) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("validate", 0);

  /* "pyarrow/array.pxi":1088
 *         ArrowInvalid
 *         """
 *         if full:             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 check_status(self.ap.ValidateFull())
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_full); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 1088, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/array.pxi":1089
 *         """
 *         if full:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(self.ap.ValidateFull())
 *         else:
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "pyarrow/array.pxi":1090
 *         if full:
 *             with nogil:
 *                 check_status(self.ap.ValidateFull())             # <<<<<<<<<<<<<<
 *         else:
 *             with nogil:
 */
          __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->ap->ValidateFull()); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 1090, __pyx_L5_error)
        }

        /* "pyarrow/array.pxi":1089
 *         """
 *         if full:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(self.ap.ValidateFull())
 *         else:
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L6;
          }
          __pyx_L5_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L6:;
        }
    }

    /* "pyarrow/array.pxi":1088
 *         ArrowInvalid
 *         """
 *         if full:             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 check_status(self.ap.ValidateFull())
 */
    goto __pyx_L3;
  }

  /* "pyarrow/array.pxi":1092
 *                 check_status(self.ap.ValidateFull())
 *         else:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(self.ap.Validate())
 * 
 */
  /*else*/ {
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "pyarrow/array.pxi":1093
 *         else:
 *             with nogil:
 *                 check_status(self.ap.Validate())             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
          __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->ap->Validate()); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 1093, __pyx_L8_error)
        }

        /* "pyarrow/array.pxi":1092
 *                 check_status(self.ap.ValidateFull())
 *         else:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(self.ap.Validate())
 * 
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L9;
          }
          __pyx_L8_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L9:;
        }
    }
  }
  __pyx_L3:;

  /* "pyarrow/array.pxi":1072
 *         return [x.as_py() for x in self]
 * 
 *     def validate(self, *, full=False):             # <<<<<<<<<<<<<<
 *         """
 *         Perform validation checks.  An exception is raised if validation fails.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.Array.validate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1096
 * 
 *     @property
 *     def offset(self):             # <<<<<<<<<<<<<<
 *         """
 *         A relative position into another array's data, to enable zero-copy
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_6offset_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_6offset_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_6offset___get__(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_6offset___get__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/array.pxi":1102
 *         operations with the physical storage buffers.
 *         """
 *         return self.sp_array.get().offset()             # <<<<<<<<<<<<<<
 * 
 *     def buffers(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->sp_array.get()->offset()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1096
 * 
 *     @property
 *     def offset(self):             # <<<<<<<<<<<<<<
 *         """
 *         A relative position into another array's data, to enable zero-copy
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Array.offset.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1104
 *         return self.sp_array.get().offset()
 * 
 *     def buffers(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list of Buffer objects pointing to this array's physical
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_60buffers(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_59buffers[] = "Array.buffers(self)\n\n        Return a list of Buffer objects pointing to this array's physical\n        storage.\n\n        To correctly interpret these buffers, you need to also apply the offset\n        multiplied with the size of the stored data type.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_60buffers(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("buffers (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_59buffers(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_59buffers(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("buffers", 0);

  /* "pyarrow/array.pxi":1112
 *         multiplied with the size of the stored data type.
 *         """
 *         res = []             # <<<<<<<<<<<<<<
 *         _append_array_buffers(self.sp_array.get().data().get(), res)
 *         return res
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_res = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":1113
 *         """
 *         res = []
 *         _append_array_buffers(self.sp_array.get().data().get(), res)             # <<<<<<<<<<<<<<
 *         return res
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__append_array_buffers(__pyx_v_self->sp_array.get()->data().get(), __pyx_v_res); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":1114
 *         res = []
 *         _append_array_buffers(self.sp_array.get().data().get(), res)
 *         return res             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1104
 *         return self.sp_array.get().offset()
 * 
 *     def buffers(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a list of Buffer objects pointing to this array's physical
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Array.buffers", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/lib.pxd":277
 * 
 *     cdef readonly:
 *         DataType type             # <<<<<<<<<<<<<<
 *         # To allow Table to propagate metadata to pandas.Series
 *         object _name
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_4type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_4type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_4type___get__(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_4type___get__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->type));
  __pyx_r = ((PyObject *)__pyx_v_self->type);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/lib.pxd":279
 *         DataType type
 *         # To allow Table to propagate metadata to pandas.Series
 *         object _name             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CArray]& sp_array) except *
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_5_name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_5_name_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_5_name___get__(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_5_name___get__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_name);
  __pyx_r = __pyx_v_self->_name;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1117
 * 
 * 
 * cdef _array_like_to_pandas(obj, options):             # <<<<<<<<<<<<<<
 *     cdef:
 *         PyObject* out
 */

static PyObject *__pyx_f_7pyarrow_3lib__array_like_to_pandas(PyObject *__pyx_v_obj, PyObject *__pyx_v_options) {
  PyObject *__pyx_v_out;
  arrow::py::PandasOptions __pyx_v_c_options;
  PyObject *__pyx_v_original_type = NULL;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_make_tz_aware = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("_array_like_to_pandas", 0);
  __Pyx_INCREF(__pyx_v_obj);

  /* "pyarrow/array.pxi":1120
 *     cdef:
 *         PyObject* out
 *         PandasOptions c_options = _convert_pandas_options(options)             # <<<<<<<<<<<<<<
 * 
 *     original_type = obj.type
 */
  if (!(likely(PyDict_CheckExact(__pyx_v_options))||((__pyx_v_options) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_options)->tp_name), 0))) __PYX_ERR(1, 1120, __pyx_L1_error)
  __pyx_v_c_options = __pyx_f_7pyarrow_3lib__convert_pandas_options(((PyObject*)__pyx_v_options));

  /* "pyarrow/array.pxi":1122
 *         PandasOptions c_options = _convert_pandas_options(options)
 * 
 *     original_type = obj.type             # <<<<<<<<<<<<<<
 *     name = obj._name
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_original_type = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":1123
 * 
 *     original_type = obj.type
 *     name = obj._name             # <<<<<<<<<<<<<<
 * 
 *     if obj.type.id == _Type_TIMESTAMP and obj.type.unit != 'ns':
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_name_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_name = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":1125
 *     name = obj._name
 * 
 *     if obj.type.id == _Type_TIMESTAMP and obj.type.unit != 'ns':             # <<<<<<<<<<<<<<
 *         # pandas only stores ns data - casting here is faster
 *         obj = obj.cast(timestamp('ns'))
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIMESTAMP); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1125, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(1, 1125, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_5) {
  } else {
    __pyx_t_2 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_ns, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(1, 1125, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":1127
 *     if obj.type.id == _Type_TIMESTAMP and obj.type.unit != 'ns':
 *         # pandas only stores ns data - casting here is faster
 *         obj = obj.cast(timestamp('ns'))             # <<<<<<<<<<<<<<
 * 
 *     # ARROW-3789(wesm): when converting to DataFrame we coerce
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_cast); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1127, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_timestamp); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1127, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_n_u_ns) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_n_u_ns);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1127, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1127, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/array.pxi":1125
 *     name = obj._name
 * 
 *     if obj.type.id == _Type_TIMESTAMP and obj.type.unit != 'ns':             # <<<<<<<<<<<<<<
 *         # pandas only stores ns data - casting here is faster
 *         obj = obj.cast(timestamp('ns'))
 */
  }

  /* "pyarrow/array.pxi":1132
 *     # date/timestamp types to nanoseconds. Not consistent but we should
 *     # make it so in the future
 *     c_options.coerce_temporal_nanoseconds = False             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(obj, Array):
 */
  __pyx_v_c_options.coerce_temporal_nanoseconds = 0;

  /* "pyarrow/array.pxi":1134
 *     c_options.coerce_temporal_nanoseconds = False
 * 
 *     if isinstance(obj, Array):             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(ConvertArrayToPandas(c_options,
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_ptype_7pyarrow_3lib_Array); 
  __pyx_t_5 = (__pyx_t_2 != 0);
  if (__pyx_t_5) {

    /* "pyarrow/array.pxi":1135
 * 
 *     if isinstance(obj, Array):
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(ConvertArrayToPandas(c_options,
 *                                               (<Array> obj).sp_array,
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "pyarrow/array.pxi":1136
 *     if isinstance(obj, Array):
 *         with nogil:
 *             check_status(ConvertArrayToPandas(c_options,             # <<<<<<<<<<<<<<
 *                                               (<Array> obj).sp_array,
 *                                               obj, &out))
 */
          __pyx_t_8 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::ConvertArrayToPandas(__pyx_v_c_options, ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_obj)->sp_array, __pyx_v_obj, (&__pyx_v_out))); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(1, 1136, __pyx_L8_error)
        }

        /* "pyarrow/array.pxi":1135
 * 
 *     if isinstance(obj, Array):
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(ConvertArrayToPandas(c_options,
 *                                               (<Array> obj).sp_array,
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L9;
          }
          __pyx_L8_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L9:;
        }
    }

    /* "pyarrow/array.pxi":1134
 *     c_options.coerce_temporal_nanoseconds = False
 * 
 *     if isinstance(obj, Array):             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(ConvertArrayToPandas(c_options,
 */
    goto __pyx_L6;
  }

  /* "pyarrow/array.pxi":1139
 *                                               (<Array> obj).sp_array,
 *                                               obj, &out))
 *     elif isinstance(obj, ChunkedArray):             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(libarrow.ConvertChunkedArrayToPandas(
 */
  __pyx_t_5 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_ptype_7pyarrow_3lib_ChunkedArray); 
  __pyx_t_2 = (__pyx_t_5 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":1140
 *                                               obj, &out))
 *     elif isinstance(obj, ChunkedArray):
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(libarrow.ConvertChunkedArrayToPandas(
 *                 c_options,
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "pyarrow/array.pxi":1141
 *     elif isinstance(obj, ChunkedArray):
 *         with nogil:
 *             check_status(libarrow.ConvertChunkedArrayToPandas(             # <<<<<<<<<<<<<<
 *                 c_options,
 *                 (<ChunkedArray> obj).sp_chunked_array,
 */
          __pyx_t_8 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::ConvertChunkedArrayToPandas(__pyx_v_c_options, ((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_obj)->sp_chunked_array, __pyx_v_obj, (&__pyx_v_out))); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(1, 1141, __pyx_L11_error)
        }

        /* "pyarrow/array.pxi":1140
 *                                               obj, &out))
 *     elif isinstance(obj, ChunkedArray):
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(libarrow.ConvertChunkedArrayToPandas(
 *                 c_options,
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L12;
          }
          __pyx_L11_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L12:;
        }
    }

    /* "pyarrow/array.pxi":1139
 *                                               (<Array> obj).sp_array,
 *                                               obj, &out))
 *     elif isinstance(obj, ChunkedArray):             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(libarrow.ConvertChunkedArrayToPandas(
 */
  }
  __pyx_L6:;

  /* "pyarrow/array.pxi":1146
 *                 obj, &out))
 * 
 *     result = pandas_api.series(wrap_array_output(out), name=name)             # <<<<<<<<<<<<<<
 * 
 *     if (isinstance(original_type, TimestampType) and
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_7pyarrow_3lib_pandas_api), __pyx_n_s_series); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __pyx_f_7pyarrow_3lib_wrap_array_output(__pyx_v_out); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_name, __pyx_v_name) < 0) __PYX_ERR(1, 1146, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_result = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "pyarrow/array.pxi":1148
 *     result = pandas_api.series(wrap_array_output(out), name=name)
 * 
 *     if (isinstance(original_type, TimestampType) and             # <<<<<<<<<<<<<<
 *             original_type.tz is not None):
 *         from pyarrow.pandas_compat import make_tz_aware
 */
  __pyx_t_5 = __Pyx_TypeCheck(__pyx_v_original_type, __pyx_ptype_7pyarrow_3lib_TimestampType); 
  __pyx_t_9 = (__pyx_t_5 != 0);
  if (__pyx_t_9) {
  } else {
    __pyx_t_2 = __pyx_t_9;
    goto __pyx_L14_bool_binop_done;
  }

  /* "pyarrow/array.pxi":1149
 * 
 *     if (isinstance(original_type, TimestampType) and
 *             original_type.tz is not None):             # <<<<<<<<<<<<<<
 *         from pyarrow.pandas_compat import make_tz_aware
 *         result = make_tz_aware(result, original_type.tz)
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_original_type, __pyx_n_s_tz); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_9 = (__pyx_t_6 != Py_None);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_5 = (__pyx_t_9 != 0);
  __pyx_t_2 = __pyx_t_5;
  __pyx_L14_bool_binop_done:;

  /* "pyarrow/array.pxi":1148
 *     result = pandas_api.series(wrap_array_output(out), name=name)
 * 
 *     if (isinstance(original_type, TimestampType) and             # <<<<<<<<<<<<<<
 *             original_type.tz is not None):
 *         from pyarrow.pandas_compat import make_tz_aware
 */
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":1150
 *     if (isinstance(original_type, TimestampType) and
 *             original_type.tz is not None):
 *         from pyarrow.pandas_compat import make_tz_aware             # <<<<<<<<<<<<<<
 *         result = make_tz_aware(result, original_type.tz)
 * 
 */
    __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_n_s_make_tz_aware);
    __Pyx_GIVEREF(__pyx_n_s_make_tz_aware);
    PyList_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_make_tz_aware);
    __pyx_t_4 = __Pyx_Import(__pyx_n_s_pyarrow_pandas_compat, __pyx_t_6, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_make_tz_aware); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_6);
    __pyx_v_make_tz_aware = __pyx_t_6;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/array.pxi":1151
 *             original_type.tz is not None):
 *         from pyarrow.pandas_compat import make_tz_aware
 *         result = make_tz_aware(result, original_type.tz)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_original_type, __pyx_n_s_tz); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1151, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_make_tz_aware);
    __pyx_t_3 = __pyx_v_make_tz_aware; __pyx_t_1 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_8 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_result, __pyx_t_6};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1151, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_result, __pyx_t_6};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1151, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1151, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_1) {
        __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __pyx_t_1 = NULL;
      }
      __Pyx_INCREF(__pyx_v_result);
      __Pyx_GIVEREF(__pyx_v_result);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_v_result);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1151, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/array.pxi":1148
 *     result = pandas_api.series(wrap_array_output(out), name=name)
 * 
 *     if (isinstance(original_type, TimestampType) and             # <<<<<<<<<<<<<<
 *             original_type.tz is not None):
 *         from pyarrow.pandas_compat import make_tz_aware
 */
  }

  /* "pyarrow/array.pxi":1153
 *         result = make_tz_aware(result, original_type.tz)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1117
 * 
 * 
 * cdef _array_like_to_pandas(obj, options):             # <<<<<<<<<<<<<<
 *     cdef:
 *         PyObject* out
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib._array_like_to_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_original_type);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_make_tz_aware);
  __Pyx_XDECREF(__pyx_v_obj);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1156
 * 
 * 
 * cdef wrap_array_output(PyObject* output):             # <<<<<<<<<<<<<<
 *     cdef object obj = PyObject_to_object(output)
 * 
 */

static PyObject *__pyx_f_7pyarrow_3lib_wrap_array_output(PyObject *__pyx_v_output) {
  PyObject *__pyx_v_obj = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("wrap_array_output", 0);

  /* "pyarrow/array.pxi":1157
 * 
 * cdef wrap_array_output(PyObject* output):
 *     cdef object obj = PyObject_to_object(output)             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(obj, dict):
 */
  __pyx_t_1 = __pyx_f_7pyarrow_8includes_6common_PyObject_to_object(__pyx_v_output); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_obj = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":1159
 *     cdef object obj = PyObject_to_object(output)
 * 
 *     if isinstance(obj, dict):             # <<<<<<<<<<<<<<
 *         return pandas_api.categorical_type(obj['indices'],
 *                                            categories=obj['dictionary'],
 */
  __pyx_t_2 = PyDict_Check(__pyx_v_obj); 
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/array.pxi":1160
 * 
 *     if isinstance(obj, dict):
 *         return pandas_api.categorical_type(obj['indices'],             # <<<<<<<<<<<<<<
 *                                            categories=obj['dictionary'],
 *                                            ordered=obj['ordered'],
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_7pyarrow_3lib_pandas_api), __pyx_n_s_categorical_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_u_indices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/array.pxi":1161
 *     if isinstance(obj, dict):
 *         return pandas_api.categorical_type(obj['indices'],
 *                                            categories=obj['dictionary'],             # <<<<<<<<<<<<<<
 *                                            ordered=obj['ordered'],
 *                                            fastpath=True)
 */
    __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_u_dictionary); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_categories, __pyx_t_6) < 0) __PYX_ERR(1, 1161, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/array.pxi":1162
 *         return pandas_api.categorical_type(obj['indices'],
 *                                            categories=obj['dictionary'],
 *                                            ordered=obj['ordered'],             # <<<<<<<<<<<<<<
 *                                            fastpath=True)
 *     else:
 */
    __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_u_ordered); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1162, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_ordered, __pyx_t_6) < 0) __PYX_ERR(1, 1161, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/array.pxi":1163
 *                                            categories=obj['dictionary'],
 *                                            ordered=obj['ordered'],
 *                                            fastpath=True)             # <<<<<<<<<<<<<<
 *     else:
 *         return obj
 */
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_fastpath, Py_True) < 0) __PYX_ERR(1, 1161, __pyx_L1_error)

    /* "pyarrow/array.pxi":1160
 * 
 *     if isinstance(obj, dict):
 *         return pandas_api.categorical_type(obj['indices'],             # <<<<<<<<<<<<<<
 *                                            categories=obj['dictionary'],
 *                                            ordered=obj['ordered'],
 */
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;

    /* "pyarrow/array.pxi":1159
 *     cdef object obj = PyObject_to_object(output)
 * 
 *     if isinstance(obj, dict):             # <<<<<<<<<<<<<<
 *         return pandas_api.categorical_type(obj['indices'],
 *                                            categories=obj['dictionary'],
 */
  }

  /* "pyarrow/array.pxi":1165
 *                                            fastpath=True)
 *     else:
 *         return obj             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_obj);
    __pyx_r = __pyx_v_obj;
    goto __pyx_L0;
  }

  /* "pyarrow/array.pxi":1156
 * 
 * 
 * cdef wrap_array_output(PyObject* output):             # <<<<<<<<<<<<<<
 *     cdef object obj = PyObject_to_object(output)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.wrap_array_output", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_obj);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1317
 * 
 *     @staticmethod
 *     def from_arrays(offsets, values, MemoryPool pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct ListArray from arrays of int32 offsets and values
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9ListArray_1from_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_9ListArray_from_arrays[] = "ListArray.from_arrays(offsets, values, MemoryPool pool=None)\n\n        Construct ListArray from arrays of int32 offsets and values\n\n        Parameters\n        ----------\n        offsets : Array (int32 type)\n        values : Array (any type)\n\n        Returns\n        -------\n        list_array : ListArray\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_9ListArray_1from_arrays = {"from_arrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_9ListArray_1from_arrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_9ListArray_from_arrays};
static PyObject *__pyx_pw_7pyarrow_3lib_9ListArray_1from_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_offsets = 0;
  PyObject *__pyx_v_values = 0;
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_pool = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_arrays (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_offsets,&__pyx_n_s_values,&__pyx_n_s_pool,0};
    PyObject* values[3] = {0,0,0};
    values[2] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offsets)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_arrays", 0, 2, 3, 1); __PYX_ERR(1, 1317, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pool);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_arrays") < 0)) __PYX_ERR(1, 1317, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_offsets = values[0];
    __pyx_v_values = values[1];
    __pyx_v_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_arrays", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1317, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.ListArray.from_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "pool", 0))) __PYX_ERR(1, 1317, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_9ListArray_from_arrays(__pyx_v_offsets, __pyx_v_values, __pyx_v_pool);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_9ListArray_from_arrays(PyObject *__pyx_v_offsets, PyObject *__pyx_v_values, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_pool) {
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v__offsets = 0;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v__values = 0;
  std::shared_ptr< arrow::Array>  __pyx_v_out;
   arrow::MemoryPool *__pyx_v_cpool;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("from_arrays", 0);

  /* "pyarrow/array.pxi":1333
 *             Array _offsets, _values
 *             shared_ptr[CArray] out
 *         cdef CMemoryPool* cpool = maybe_unbox_memory_pool(pool)             # <<<<<<<<<<<<<<
 * 
 *         _offsets = asarray(offsets, type='int32')
 */
  __pyx_v_cpool = __pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(__pyx_v_pool);

  /* "pyarrow/array.pxi":1335
 *         cdef CMemoryPool* cpool = maybe_unbox_memory_pool(pool)
 * 
 *         _offsets = asarray(offsets, type='int32')             # <<<<<<<<<<<<<<
 *         _values = asarray(values)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1335, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1335, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_offsets);
  __Pyx_GIVEREF(__pyx_v_offsets);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_offsets);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1335, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_type, __pyx_n_u_int32) < 0) __PYX_ERR(1, 1335, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1335, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1335, __pyx_L1_error)
  __pyx_v__offsets = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyarrow/array.pxi":1336
 * 
 *         _offsets = asarray(offsets, type='int32')
 *         _values = asarray(values)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_values) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_values);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1336, __pyx_L1_error)
  __pyx_v__values = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyarrow/array.pxi":1338
 *         _values = asarray(values)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CListArray.FromArrays(_offsets.ap[0], _values.ap[0],
 *                                                cpool, &out))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":1339
 * 
 *         with nogil:
 *             check_status(CListArray.FromArrays(_offsets.ap[0], _values.ap[0],             # <<<<<<<<<<<<<<
 *                                                cpool, &out))
 *         cdef Array result = pyarrow_wrap_array(out)
 */
        __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status( arrow::ListArray::FromArrays((__pyx_v__offsets->ap[0]), (__pyx_v__values->ap[0]), __pyx_v_cpool, (&__pyx_v_out))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1339, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":1338
 *         _values = asarray(values)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CListArray.FromArrays(_offsets.ap[0], _values.ap[0],
 *                                                cpool, &out))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/array.pxi":1341
 *             check_status(CListArray.FromArrays(_offsets.ap[0], _values.ap[0],
 *                                                cpool, &out))
 *         cdef Array result = pyarrow_wrap_array(out)             # <<<<<<<<<<<<<<
 *         result.validate()
 *         return result
 */
  __pyx_t_4 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_out); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1341, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyarrow/array.pxi":1342
 *                                                cpool, &out))
 *         cdef Array result = pyarrow_wrap_array(out)
 *         result.validate()             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_validate); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/array.pxi":1343
 *         cdef Array result = pyarrow_wrap_array(out)
 *         result.validate()
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1317
 * 
 *     @staticmethod
 *     def from_arrays(offsets, values, MemoryPool pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct ListArray from arrays of int32 offsets and values
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.ListArray.from_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__offsets);
  __Pyx_XDECREF((PyObject *)__pyx_v__values);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1346
 * 
 *     @property
 *     def values(self):             # <<<<<<<<<<<<<<
 *         cdef CListArray* arr = <CListArray*> self.ap
 *         return pyarrow_wrap_array(arr.values())
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9ListArray_6values_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_9ListArray_6values_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9ListArray_6values___get__(((struct __pyx_obj_7pyarrow_3lib_ListArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_9ListArray_6values___get__(struct __pyx_obj_7pyarrow_3lib_ListArray *__pyx_v_self) {
   arrow::ListArray *__pyx_v_arr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/array.pxi":1347
 *     @property
 *     def values(self):
 *         cdef CListArray* arr = <CListArray*> self.ap             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_array(arr.values())
 * 
 */
  __pyx_v_arr = (( arrow::ListArray *)__pyx_v_self->__pyx_base.ap);

  /* "pyarrow/array.pxi":1348
 *     def values(self):
 *         cdef CListArray* arr = <CListArray*> self.ap
 *         return pyarrow_wrap_array(arr.values())             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_arr->values()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1346
 * 
 *     @property
 *     def values(self):             # <<<<<<<<<<<<<<
 *         cdef CListArray* arr = <CListArray*> self.ap
 *         return pyarrow_wrap_array(arr.values())
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.ListArray.values.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1351
 * 
 *     @property
 *     def offsets(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the offsets as an int32 array.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9ListArray_7offsets_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_9ListArray_7offsets_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_9ListArray_7offsets___get__(((struct __pyx_obj_7pyarrow_3lib_ListArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_9ListArray_7offsets___get__(struct __pyx_obj_7pyarrow_3lib_ListArray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/array.pxi":1355
 *         Return the offsets as an int32 array.
 *         """
 *         return Array.from_buffers(             # <<<<<<<<<<<<<<
 *             int32(), len(self) + 1, [None, self.buffers()[1]],
 *             offset=self.offset)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_Array), __pyx_n_s_from_buffers); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyarrow/array.pxi":1356
 *         """
 *         return Array.from_buffers(
 *             int32(), len(self) + 1, [None, self.buffers()[1]],             # <<<<<<<<<<<<<<
 *             offset=self.offset)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_int32); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = PyObject_Length(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 1356, __pyx_L1_error)
  __pyx_t_3 = PyInt_FromSsize_t((__pyx_t_5 + 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_buffers); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyList_SET_ITEM(__pyx_t_4, 0, Py_None);
  __Pyx_GIVEREF(__pyx_t_6);
  PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_6);
  __pyx_t_6 = 0;

  /* "pyarrow/array.pxi":1355
 *         Return the offsets as an int32 array.
 *         """
 *         return Array.from_buffers(             # <<<<<<<<<<<<<<
 *             int32(), len(self) + 1, [None, self.buffers()[1]],
 *             offset=self.offset)
 */
  __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;

  /* "pyarrow/array.pxi":1357
 *         return Array.from_buffers(
 *             int32(), len(self) + 1, [None, self.buffers()[1]],
 *             offset=self.offset)             # <<<<<<<<<<<<<<
 * 
 *     def flatten(self, MemoryPool memory_pool=None):
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_offset); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_offset, __pyx_t_3) < 0) __PYX_ERR(1, 1357, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/array.pxi":1355
 *         Return the offsets as an int32 array.
 *         """
 *         return Array.from_buffers(             # <<<<<<<<<<<<<<
 *             int32(), len(self) + 1, [None, self.buffers()[1]],
 *             offset=self.offset)
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1351
 * 
 *     @property
 *     def offsets(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the offsets as an int32 array.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.ListArray.offsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1359
 *             offset=self.offset)
 * 
 *     def flatten(self, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Unnest this ListArray by one level
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9ListArray_3flatten(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_9ListArray_2flatten[] = "ListArray.flatten(self, MemoryPool memory_pool=None)\n\n        Unnest this ListArray by one level\n\n        The returned Array is logically a concatenation of all the sub-lists\n        in this Array.\n\n        Note that this method is different from ``self.values()`` in that\n        it takes care of the slicing offset as well as null elements backed\n        by non-empty sub-lists.\n\n        Parameters\n        ----------\n        memory_pool : pyarrow.MemoryPool, optional\n            If not passed, will allocate memory from the currently-set default\n            memory pool\n\n        Returns\n        -------\n        result : Array\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_9ListArray_3flatten(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flatten (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_memory_pool,0};
    PyObject* values[1] = {0};
    values[0] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "flatten") < 0)) __PYX_ERR(1, 1359, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("flatten", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1359, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.ListArray.flatten", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(1, 1359, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_9ListArray_2flatten(((struct __pyx_obj_7pyarrow_3lib_ListArray *)__pyx_v_self), __pyx_v_memory_pool);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_9ListArray_2flatten(struct __pyx_obj_7pyarrow_3lib_ListArray *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool) {
  std::shared_ptr< arrow::Array>  __pyx_v_c_result_array;
   arrow::MemoryPool *__pyx_v_cpool;
   arrow::ListArray *__pyx_v_arr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr< arrow::Array>  __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("flatten", 0);

  /* "pyarrow/array.pxi":1382
 *         cdef:
 *             shared_ptr[CArray] c_result_array
 *             CMemoryPool* cpool = maybe_unbox_memory_pool(memory_pool)             # <<<<<<<<<<<<<<
 *             CListArray* arr = <CListArray*> self.ap
 * 
 */
  __pyx_v_cpool = __pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(__pyx_v_memory_pool);

  /* "pyarrow/array.pxi":1383
 *             shared_ptr[CArray] c_result_array
 *             CMemoryPool* cpool = maybe_unbox_memory_pool(memory_pool)
 *             CListArray* arr = <CListArray*> self.ap             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_v_arr = (( arrow::ListArray *)__pyx_v_self->__pyx_base.ap);

  /* "pyarrow/array.pxi":1385
 *             CListArray* arr = <CListArray*> self.ap
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             c_result_array = GetResultValue(arr.Flatten(cpool))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":1386
 * 
 *         with nogil:
 *             c_result_array = GetResultValue(arr.Flatten(cpool))             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_array(c_result_array)
 */
        __pyx_t_1 = arrow::py::GetResultValue<std::shared_ptr< arrow::Array> >(__pyx_v_arr->Flatten(__pyx_v_cpool)); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(1, 1386, __pyx_L4_error)
        __pyx_v_c_result_array = __pyx_t_1;
      }

      /* "pyarrow/array.pxi":1385
 *             CListArray* arr = <CListArray*> self.ap
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             c_result_array = GetResultValue(arr.Flatten(cpool))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/array.pxi":1388
 *             c_result_array = GetResultValue(arr.Flatten(cpool))
 * 
 *         return pyarrow_wrap_array(c_result_array)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_c_result_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1359
 *             offset=self.offset)
 * 
 *     def flatten(self, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Unnest this ListArray by one level
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.ListArray.flatten", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1398
 * 
 *     @staticmethod
 *     def from_arrays(offsets, values, MemoryPool pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct LargeListArray from arrays of int64 offsets and values
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14LargeListArray_1from_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14LargeListArray_from_arrays[] = "LargeListArray.from_arrays(offsets, values, MemoryPool pool=None)\n\n        Construct LargeListArray from arrays of int64 offsets and values\n\n        Parameters\n        ----------\n        offsets : Array (int64 type)\n        values : Array (any type)\n\n        Returns\n        -------\n        list_array : LargeListArray\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_14LargeListArray_1from_arrays = {"from_arrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_14LargeListArray_1from_arrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_14LargeListArray_from_arrays};
static PyObject *__pyx_pw_7pyarrow_3lib_14LargeListArray_1from_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_offsets = 0;
  PyObject *__pyx_v_values = 0;
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_pool = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_arrays (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_offsets,&__pyx_n_s_values,&__pyx_n_s_pool,0};
    PyObject* values[3] = {0,0,0};
    values[2] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offsets)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_arrays", 0, 2, 3, 1); __PYX_ERR(1, 1398, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pool);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_arrays") < 0)) __PYX_ERR(1, 1398, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_offsets = values[0];
    __pyx_v_values = values[1];
    __pyx_v_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_arrays", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1398, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.LargeListArray.from_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "pool", 0))) __PYX_ERR(1, 1398, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_14LargeListArray_from_arrays(__pyx_v_offsets, __pyx_v_values, __pyx_v_pool);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14LargeListArray_from_arrays(PyObject *__pyx_v_offsets, PyObject *__pyx_v_values, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_pool) {
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v__offsets = 0;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v__values = 0;
  std::shared_ptr< arrow::Array>  __pyx_v_out;
   arrow::MemoryPool *__pyx_v_cpool;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("from_arrays", 0);

  /* "pyarrow/array.pxi":1414
 *             Array _offsets, _values
 *             shared_ptr[CArray] out
 *         cdef CMemoryPool* cpool = maybe_unbox_memory_pool(pool)             # <<<<<<<<<<<<<<
 * 
 *         _offsets = asarray(offsets, type='int64')
 */
  __pyx_v_cpool = __pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(__pyx_v_pool);

  /* "pyarrow/array.pxi":1416
 *         cdef CMemoryPool* cpool = maybe_unbox_memory_pool(pool)
 * 
 *         _offsets = asarray(offsets, type='int64')             # <<<<<<<<<<<<<<
 *         _values = asarray(values)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_offsets);
  __Pyx_GIVEREF(__pyx_v_offsets);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_offsets);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_type, __pyx_n_u_int64) < 0) __PYX_ERR(1, 1416, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1416, __pyx_L1_error)
  __pyx_v__offsets = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyarrow/array.pxi":1417
 * 
 *         _offsets = asarray(offsets, type='int64')
 *         _values = asarray(values)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_values) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_values);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1417, __pyx_L1_error)
  __pyx_v__values = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyarrow/array.pxi":1419
 *         _values = asarray(values)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CLargeListArray.FromArrays(_offsets.ap[0],
 *                                                     _values.ap[0],
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":1420
 * 
 *         with nogil:
 *             check_status(CLargeListArray.FromArrays(_offsets.ap[0],             # <<<<<<<<<<<<<<
 *                                                     _values.ap[0],
 *                                                     cpool, &out))
 */
        __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status( arrow::LargeListArray::FromArrays((__pyx_v__offsets->ap[0]), (__pyx_v__values->ap[0]), __pyx_v_cpool, (&__pyx_v_out))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1420, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":1419
 *         _values = asarray(values)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CLargeListArray.FromArrays(_offsets.ap[0],
 *                                                     _values.ap[0],
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/array.pxi":1423
 *                                                     _values.ap[0],
 *                                                     cpool, &out))
 *         cdef Array result = pyarrow_wrap_array(out)             # <<<<<<<<<<<<<<
 *         result.validate()
 *         return result
 */
  __pyx_t_4 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_out); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1423, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyarrow/array.pxi":1424
 *                                                     cpool, &out))
 *         cdef Array result = pyarrow_wrap_array(out)
 *         result.validate()             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_validate); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/array.pxi":1425
 *         cdef Array result = pyarrow_wrap_array(out)
 *         result.validate()
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1398
 * 
 *     @staticmethod
 *     def from_arrays(offsets, values, MemoryPool pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct LargeListArray from arrays of int64 offsets and values
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.LargeListArray.from_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__offsets);
  __Pyx_XDECREF((PyObject *)__pyx_v__values);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1428
 * 
 *     @property
 *     def values(self):             # <<<<<<<<<<<<<<
 *         cdef CLargeListArray* arr = <CLargeListArray*> self.ap
 *         return pyarrow_wrap_array(arr.values())
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14LargeListArray_6values_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14LargeListArray_6values_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14LargeListArray_6values___get__(((struct __pyx_obj_7pyarrow_3lib_LargeListArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14LargeListArray_6values___get__(struct __pyx_obj_7pyarrow_3lib_LargeListArray *__pyx_v_self) {
   arrow::LargeListArray *__pyx_v_arr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/array.pxi":1429
 *     @property
 *     def values(self):
 *         cdef CLargeListArray* arr = <CLargeListArray*> self.ap             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_array(arr.values())
 * 
 */
  __pyx_v_arr = (( arrow::LargeListArray *)__pyx_v_self->__pyx_base.ap);

  /* "pyarrow/array.pxi":1430
 *     def values(self):
 *         cdef CLargeListArray* arr = <CLargeListArray*> self.ap
 *         return pyarrow_wrap_array(arr.values())             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_arr->values()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1428
 * 
 *     @property
 *     def values(self):             # <<<<<<<<<<<<<<
 *         cdef CLargeListArray* arr = <CLargeListArray*> self.ap
 *         return pyarrow_wrap_array(arr.values())
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.LargeListArray.values.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1433
 * 
 *     @property
 *     def offsets(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the offsets as an int64 array.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14LargeListArray_7offsets_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14LargeListArray_7offsets_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14LargeListArray_7offsets___get__(((struct __pyx_obj_7pyarrow_3lib_LargeListArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14LargeListArray_7offsets___get__(struct __pyx_obj_7pyarrow_3lib_LargeListArray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/array.pxi":1437
 *         Return the offsets as an int64 array.
 *         """
 *         return Array.from_buffers(             # <<<<<<<<<<<<<<
 *             int64(), len(self) + 1, [None, self.buffers()[1]],
 *             offset=self.offset)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_Array), __pyx_n_s_from_buffers); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1437, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyarrow/array.pxi":1438
 *         """
 *         return Array.from_buffers(
 *             int64(), len(self) + 1, [None, self.buffers()[1]],             # <<<<<<<<<<<<<<
 *             offset=self.offset)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_int64); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = PyObject_Length(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 1438, __pyx_L1_error)
  __pyx_t_3 = PyInt_FromSsize_t((__pyx_t_5 + 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_buffers); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyList_SET_ITEM(__pyx_t_4, 0, Py_None);
  __Pyx_GIVEREF(__pyx_t_6);
  PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_6);
  __pyx_t_6 = 0;

  /* "pyarrow/array.pxi":1437
 *         Return the offsets as an int64 array.
 *         """
 *         return Array.from_buffers(             # <<<<<<<<<<<<<<
 *             int64(), len(self) + 1, [None, self.buffers()[1]],
 *             offset=self.offset)
 */
  __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1437, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;

  /* "pyarrow/array.pxi":1439
 *         return Array.from_buffers(
 *             int64(), len(self) + 1, [None, self.buffers()[1]],
 *             offset=self.offset)             # <<<<<<<<<<<<<<
 * 
 *     def flatten(self, MemoryPool memory_pool=None):
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_offset); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_offset, __pyx_t_3) < 0) __PYX_ERR(1, 1439, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/array.pxi":1437
 *         Return the offsets as an int64 array.
 *         """
 *         return Array.from_buffers(             # <<<<<<<<<<<<<<
 *             int64(), len(self) + 1, [None, self.buffers()[1]],
 *             offset=self.offset)
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1437, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1433
 * 
 *     @property
 *     def offsets(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the offsets as an int64 array.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.LargeListArray.offsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1441
 *             offset=self.offset)
 * 
 *     def flatten(self, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Unnest this LargeListArray by one level.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14LargeListArray_3flatten(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14LargeListArray_2flatten[] = "LargeListArray.flatten(self, MemoryPool memory_pool=None)\n\n        Unnest this LargeListArray by one level.\n\n        The returned Array is logically a concatenation of all the sub-lists\n        in this Array.\n\n        Note that this method is different from ``self.values()`` in that\n        it takes care of the slicing offset as well as null elements backed\n        by non-empty sub-lists.\n\n        Parameters\n        ----------\n        memory_pool : pyarrow.MemoryPool, optional\n            If not passed, will allocate memory from the currently-set default\n            memory pool\n\n        Returns\n        -------\n        result : Array\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_14LargeListArray_3flatten(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flatten (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_memory_pool,0};
    PyObject* values[1] = {0};
    values[0] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "flatten") < 0)) __PYX_ERR(1, 1441, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("flatten", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1441, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.LargeListArray.flatten", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(1, 1441, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_14LargeListArray_2flatten(((struct __pyx_obj_7pyarrow_3lib_LargeListArray *)__pyx_v_self), __pyx_v_memory_pool);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14LargeListArray_2flatten(struct __pyx_obj_7pyarrow_3lib_LargeListArray *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool) {
  std::shared_ptr< arrow::Array>  __pyx_v_c_result_array;
   arrow::MemoryPool *__pyx_v_cpool;
   arrow::LargeListArray *__pyx_v_arr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr< arrow::Array>  __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("flatten", 0);

  /* "pyarrow/array.pxi":1464
 *         cdef:
 *             shared_ptr[CArray] c_result_array
 *             CMemoryPool* cpool = maybe_unbox_memory_pool(memory_pool)             # <<<<<<<<<<<<<<
 *             CLargeListArray* arr = <CLargeListArray*> self.ap
 * 
 */
  __pyx_v_cpool = __pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(__pyx_v_memory_pool);

  /* "pyarrow/array.pxi":1465
 *             shared_ptr[CArray] c_result_array
 *             CMemoryPool* cpool = maybe_unbox_memory_pool(memory_pool)
 *             CLargeListArray* arr = <CLargeListArray*> self.ap             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_v_arr = (( arrow::LargeListArray *)__pyx_v_self->__pyx_base.ap);

  /* "pyarrow/array.pxi":1467
 *             CLargeListArray* arr = <CLargeListArray*> self.ap
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             c_result_array = GetResultValue(arr.Flatten(cpool))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":1468
 * 
 *         with nogil:
 *             c_result_array = GetResultValue(arr.Flatten(cpool))             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_array(c_result_array)
 */
        __pyx_t_1 = arrow::py::GetResultValue<std::shared_ptr< arrow::Array> >(__pyx_v_arr->Flatten(__pyx_v_cpool)); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(1, 1468, __pyx_L4_error)
        __pyx_v_c_result_array = __pyx_t_1;
      }

      /* "pyarrow/array.pxi":1467
 *             CLargeListArray* arr = <CLargeListArray*> self.ap
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             c_result_array = GetResultValue(arr.Flatten(cpool))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/array.pxi":1470
 *             c_result_array = GetResultValue(arr.Flatten(cpool))
 * 
 *         return pyarrow_wrap_array(c_result_array)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_c_result_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1470, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1441
 *             offset=self.offset)
 * 
 *     def flatten(self, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Unnest this LargeListArray by one level.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.LargeListArray.flatten", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1479
 * 
 *     @staticmethod
 *     def from_arrays(offsets, keys, items, MemoryPool pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct MapArray from arrays of int32 offsets and key, item arrays
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8MapArray_1from_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_8MapArray_from_arrays[] = "MapArray.from_arrays(offsets, keys, items, MemoryPool pool=None)\n\n        Construct MapArray from arrays of int32 offsets and key, item arrays\n\n        Parameters\n        ----------\n        offsets : array-like or sequence (int32 type)\n        keys : array-like or sequence (any type)\n        items : array-like or sequence (any type)\n\n        Returns\n        -------\n        map_array : MapArray\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_8MapArray_1from_arrays = {"from_arrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_8MapArray_1from_arrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_8MapArray_from_arrays};
static PyObject *__pyx_pw_7pyarrow_3lib_8MapArray_1from_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_offsets = 0;
  PyObject *__pyx_v_keys = 0;
  PyObject *__pyx_v_items = 0;
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_pool = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_arrays (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_offsets,&__pyx_n_s_keys,&__pyx_n_s_items,&__pyx_n_s_pool,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offsets)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_keys)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_arrays", 0, 3, 4, 1); __PYX_ERR(1, 1479, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_items)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_arrays", 0, 3, 4, 2); __PYX_ERR(1, 1479, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pool);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_arrays") < 0)) __PYX_ERR(1, 1479, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_offsets = values[0];
    __pyx_v_keys = values[1];
    __pyx_v_items = values[2];
    __pyx_v_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_arrays", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1479, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.MapArray.from_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "pool", 0))) __PYX_ERR(1, 1479, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_8MapArray_from_arrays(__pyx_v_offsets, __pyx_v_keys, __pyx_v_items, __pyx_v_pool);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8MapArray_from_arrays(PyObject *__pyx_v_offsets, PyObject *__pyx_v_keys, PyObject *__pyx_v_items, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_pool) {
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v__offsets = 0;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v__keys = 0;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v__items = 0;
  std::shared_ptr< arrow::Array>  __pyx_v_out;
   arrow::MemoryPool *__pyx_v_cpool;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("from_arrays", 0);

  /* "pyarrow/array.pxi":1496
 *             Array _offsets, _keys, _items
 *             shared_ptr[CArray] out
 *         cdef CMemoryPool* cpool = maybe_unbox_memory_pool(pool)             # <<<<<<<<<<<<<<
 * 
 *         _offsets = asarray(offsets, type='int32')
 */
  __pyx_v_cpool = __pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(__pyx_v_pool);

  /* "pyarrow/array.pxi":1498
 *         cdef CMemoryPool* cpool = maybe_unbox_memory_pool(pool)
 * 
 *         _offsets = asarray(offsets, type='int32')             # <<<<<<<<<<<<<<
 *         _keys = asarray(keys)
 *         _items = asarray(items)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_offsets);
  __Pyx_GIVEREF(__pyx_v_offsets);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_offsets);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_type, __pyx_n_u_int32) < 0) __PYX_ERR(1, 1498, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1498, __pyx_L1_error)
  __pyx_v__offsets = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyarrow/array.pxi":1499
 * 
 *         _offsets = asarray(offsets, type='int32')
 *         _keys = asarray(keys)             # <<<<<<<<<<<<<<
 *         _items = asarray(items)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_keys) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_keys);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1499, __pyx_L1_error)
  __pyx_v__keys = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyarrow/array.pxi":1500
 *         _offsets = asarray(offsets, type='int32')
 *         _keys = asarray(keys)
 *         _items = asarray(items)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_items) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_items);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1500, __pyx_L1_error)
  __pyx_v__items = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyarrow/array.pxi":1502
 *         _items = asarray(items)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CMapArray.FromArrays(_offsets.sp_array,
 *                                               _keys.sp_array, _items.sp_array,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":1503
 * 
 *         with nogil:
 *             check_status(CMapArray.FromArrays(_offsets.sp_array,             # <<<<<<<<<<<<<<
 *                                               _keys.sp_array, _items.sp_array,
 *                                               cpool, &out))
 */
        __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status( arrow::MapArray::FromArrays(__pyx_v__offsets->sp_array, __pyx_v__keys->sp_array, __pyx_v__items->sp_array, __pyx_v_cpool, (&__pyx_v_out))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1503, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":1502
 *         _items = asarray(items)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CMapArray.FromArrays(_offsets.sp_array,
 *                                               _keys.sp_array, _items.sp_array,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/array.pxi":1506
 *                                               _keys.sp_array, _items.sp_array,
 *                                               cpool, &out))
 *         cdef Array result = pyarrow_wrap_array(out)             # <<<<<<<<<<<<<<
 *         result.validate()
 *         return result
 */
  __pyx_t_4 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_out); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1506, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyarrow/array.pxi":1507
 *                                               cpool, &out))
 *         cdef Array result = pyarrow_wrap_array(out)
 *         result.validate()             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_validate); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/array.pxi":1508
 *         cdef Array result = pyarrow_wrap_array(out)
 *         result.validate()
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1479
 * 
 *     @staticmethod
 *     def from_arrays(offsets, keys, items, MemoryPool pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct MapArray from arrays of int32 offsets and key, item arrays
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.MapArray.from_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__offsets);
  __Pyx_XDECREF((PyObject *)__pyx_v__keys);
  __Pyx_XDECREF((PyObject *)__pyx_v__items);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1511
 * 
 *     @property
 *     def keys(self):             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_array((<CMapArray*> self.ap).keys())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8MapArray_4keys_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_8MapArray_4keys_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8MapArray_4keys___get__(((struct __pyx_obj_7pyarrow_3lib_MapArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8MapArray_4keys___get__(struct __pyx_obj_7pyarrow_3lib_MapArray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/array.pxi":1512
 *     @property
 *     def keys(self):
 *         return pyarrow_wrap_array((<CMapArray*> self.ap).keys())             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array((( arrow::MapArray *)__pyx_v_self->__pyx_base.ap)->keys()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1511
 * 
 *     @property
 *     def keys(self):             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_array((<CMapArray*> self.ap).keys())
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.MapArray.keys.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1515
 * 
 *     @property
 *     def items(self):             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_array((<CMapArray*> self.ap).items())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8MapArray_5items_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_8MapArray_5items_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8MapArray_5items___get__(((struct __pyx_obj_7pyarrow_3lib_MapArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8MapArray_5items___get__(struct __pyx_obj_7pyarrow_3lib_MapArray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/array.pxi":1516
 *     @property
 *     def items(self):
 *         return pyarrow_wrap_array((<CMapArray*> self.ap).items())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array((( arrow::MapArray *)__pyx_v_self->__pyx_base.ap)->items()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1516, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1515
 * 
 *     @property
 *     def items(self):             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_array((<CMapArray*> self.ap).items())
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.MapArray.items.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1525
 * 
 *     @staticmethod
 *     def from_arrays(values, int32_t list_size):             # <<<<<<<<<<<<<<
 *         """
 *         Construct FixedSizeListArray from array of values and a list length.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18FixedSizeListArray_1from_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18FixedSizeListArray_from_arrays[] = "FixedSizeListArray.from_arrays(values, int32_t list_size)\n\n        Construct FixedSizeListArray from array of values and a list length.\n\n        Parameters\n        ----------\n        values : Array (any type)\n        list_size : int\n            The fixed length of the lists.\n\n        Returns\n        -------\n        FixedSizeListArray\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_18FixedSizeListArray_1from_arrays = {"from_arrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_18FixedSizeListArray_1from_arrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_18FixedSizeListArray_from_arrays};
static PyObject *__pyx_pw_7pyarrow_3lib_18FixedSizeListArray_1from_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_values = 0;
  int32_t __pyx_v_list_size;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_arrays (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_values,&__pyx_n_s_list_size,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_list_size)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_arrays", 1, 2, 2, 1); __PYX_ERR(1, 1525, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_arrays") < 0)) __PYX_ERR(1, 1525, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_values = values[0];
    __pyx_v_list_size = __Pyx_PyInt_As_int32_t(values[1]); if (unlikely((__pyx_v_list_size == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 1525, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_arrays", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1525, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.FixedSizeListArray.from_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_18FixedSizeListArray_from_arrays(__pyx_v_values, __pyx_v_list_size);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18FixedSizeListArray_from_arrays(PyObject *__pyx_v_values, int32_t __pyx_v_list_size) {
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v__values = 0;
  arrow::Result<std::shared_ptr< arrow::Array> >  __pyx_v_c_result;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::shared_ptr< arrow::Array>  __pyx_t_4;
  __Pyx_RefNannySetupContext("from_arrays", 0);

  /* "pyarrow/array.pxi":1543
 *             CResult[shared_ptr[CArray]] c_result
 * 
 *         _values = asarray(values)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_values) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_values);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1543, __pyx_L1_error)
  __pyx_v__values = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":1545
 *         _values = asarray(values)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             c_result = CFixedSizeListArray.FromArrays(
 *                 _values.sp_array, list_size)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":1546
 * 
 *         with nogil:
 *             c_result = CFixedSizeListArray.FromArrays(             # <<<<<<<<<<<<<<
 *                 _values.sp_array, list_size)
 *         cdef Array result = pyarrow_wrap_array(GetResultValue(c_result))
 */
        __pyx_v_c_result =  arrow::FixedSizeListArray::FromArrays(__pyx_v__values->sp_array, __pyx_v_list_size);
      }

      /* "pyarrow/array.pxi":1545
 *         _values = asarray(values)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             c_result = CFixedSizeListArray.FromArrays(
 *                 _values.sp_array, list_size)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/array.pxi":1548
 *             c_result = CFixedSizeListArray.FromArrays(
 *                 _values.sp_array, list_size)
 *         cdef Array result = pyarrow_wrap_array(GetResultValue(c_result))             # <<<<<<<<<<<<<<
 *         result.validate()
 *         return result
 */
  __pyx_t_4 = arrow::py::GetResultValue<std::shared_ptr< arrow::Array> >(__pyx_v_c_result); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1548, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1548, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1548, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":1549
 *                 _values.sp_array, list_size)
 *         cdef Array result = pyarrow_wrap_array(GetResultValue(c_result))
 *         result.validate()             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_validate); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1549, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1549, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":1550
 *         cdef Array result = pyarrow_wrap_array(GetResultValue(c_result))
 *         result.validate()
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1525
 * 
 *     @staticmethod
 *     def from_arrays(values, int32_t list_size):             # <<<<<<<<<<<<<<
 *         """
 *         Construct FixedSizeListArray from array of values and a list length.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.FixedSizeListArray.from_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__values);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1553
 * 
 *     @property
 *     def values(self):             # <<<<<<<<<<<<<<
 *         return self.flatten()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18FixedSizeListArray_6values_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_18FixedSizeListArray_6values_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_18FixedSizeListArray_6values___get__(((struct __pyx_obj_7pyarrow_3lib_FixedSizeListArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18FixedSizeListArray_6values___get__(struct __pyx_obj_7pyarrow_3lib_FixedSizeListArray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/array.pxi":1554
 *     @property
 *     def values(self):
 *         return self.flatten()             # <<<<<<<<<<<<<<
 * 
 *     def flatten(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flatten); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1554, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1554, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1553
 * 
 *     @property
 *     def values(self):             # <<<<<<<<<<<<<<
 *         return self.flatten()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.FixedSizeListArray.values.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1556
 *         return self.flatten()
 * 
 *     def flatten(self):             # <<<<<<<<<<<<<<
 *         """
 *         Unnest this FixedSizeListArray by one level.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18FixedSizeListArray_3flatten(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18FixedSizeListArray_2flatten[] = "FixedSizeListArray.flatten(self)\n\n        Unnest this FixedSizeListArray by one level.\n\n        Returns\n        -------\n        result : Array\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_18FixedSizeListArray_3flatten(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flatten (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_18FixedSizeListArray_2flatten(((struct __pyx_obj_7pyarrow_3lib_FixedSizeListArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18FixedSizeListArray_2flatten(struct __pyx_obj_7pyarrow_3lib_FixedSizeListArray *__pyx_v_self) {
   arrow::FixedSizeListArray *__pyx_v_arr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("flatten", 0);

  /* "pyarrow/array.pxi":1564
 *         result : Array
 *         """
 *         cdef CFixedSizeListArray* arr = <CFixedSizeListArray*> self.ap             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_array(arr.values())
 * 
 */
  __pyx_v_arr = (( arrow::FixedSizeListArray *)__pyx_v_self->__pyx_base.ap);

  /* "pyarrow/array.pxi":1565
 *         """
 *         cdef CFixedSizeListArray* arr = <CFixedSizeListArray*> self.ap
 *         return pyarrow_wrap_array(arr.values())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_arr->values()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1565, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1556
 *         return self.flatten()
 * 
 *     def flatten(self):             # <<<<<<<<<<<<<<
 *         """
 *         Unnest this FixedSizeListArray by one level.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FixedSizeListArray.flatten", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1574
 * 
 *     @staticmethod
 *     def from_dense(Array types, Array value_offsets, list children,             # <<<<<<<<<<<<<<
 *                    list field_names=None, list type_codes=None):
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10UnionArray_1from_dense(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10UnionArray_from_dense[] = "UnionArray.from_dense(Array types, Array value_offsets, list children, list field_names=None, list type_codes=None)\n\n        Construct dense UnionArray from arrays of int8 types, int32 offsets and\n        children arrays\n\n        Parameters\n        ----------\n        types : Array (int8 type)\n        value_offsets : Array (int32 type)\n        children : list\n        field_names : list\n        type_codes : list\n\n        Returns\n        -------\n        union_array : UnionArray\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_10UnionArray_1from_dense = {"from_dense", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10UnionArray_1from_dense, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10UnionArray_from_dense};
static PyObject *__pyx_pw_7pyarrow_3lib_10UnionArray_1from_dense(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_types = 0;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_value_offsets = 0;
  PyObject *__pyx_v_children = 0;
  PyObject *__pyx_v_field_names = 0;
  PyObject *__pyx_v_type_codes = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_dense (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_types,&__pyx_n_s_value_offsets,&__pyx_n_s_children,&__pyx_n_s_field_names,&__pyx_n_s_type_codes,0};
    PyObject* values[5] = {0,0,0,0,0};

    /* "pyarrow/array.pxi":1575
 *     @staticmethod
 *     def from_dense(Array types, Array value_offsets, list children,
 *                    list field_names=None, list type_codes=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct dense UnionArray from arrays of int8 types, int32 offsets and
 */
    values[3] = ((PyObject*)Py_None);
    values[4] = ((PyObject*)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_types)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value_offsets)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_dense", 0, 3, 5, 1); __PYX_ERR(1, 1574, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_dense", 0, 3, 5, 2); __PYX_ERR(1, 1574, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field_names);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type_codes);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_dense") < 0)) __PYX_ERR(1, 1574, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_types = ((struct __pyx_obj_7pyarrow_3lib_Array *)values[0]);
    __pyx_v_value_offsets = ((struct __pyx_obj_7pyarrow_3lib_Array *)values[1]);
    __pyx_v_children = ((PyObject*)values[2]);
    __pyx_v_field_names = ((PyObject*)values[3]);
    __pyx_v_type_codes = ((PyObject*)values[4]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_dense", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1574, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.UnionArray.from_dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_types), __pyx_ptype_7pyarrow_3lib_Array, 1, "types", 0))) __PYX_ERR(1, 1574, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value_offsets), __pyx_ptype_7pyarrow_3lib_Array, 1, "value_offsets", 0))) __PYX_ERR(1, 1574, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_children), (&PyList_Type), 1, "children", 1))) __PYX_ERR(1, 1574, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field_names), (&PyList_Type), 1, "field_names", 1))) __PYX_ERR(1, 1575, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_type_codes), (&PyList_Type), 1, "type_codes", 1))) __PYX_ERR(1, 1575, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_10UnionArray_from_dense(__pyx_v_types, __pyx_v_value_offsets, __pyx_v_children, __pyx_v_field_names, __pyx_v_type_codes);

  /* "pyarrow/array.pxi":1574
 * 
 *     @staticmethod
 *     def from_dense(Array types, Array value_offsets, list children,             # <<<<<<<<<<<<<<
 *                    list field_names=None, list type_codes=None):
 *         """
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10UnionArray_from_dense(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_types, struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_value_offsets, PyObject *__pyx_v_children, PyObject *__pyx_v_field_names, PyObject *__pyx_v_type_codes) {
  std::shared_ptr< arrow::Array>  __pyx_v_out;
  std::vector<std::shared_ptr< arrow::Array> >  __pyx_v_c;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_child = 0;
  std::vector<std::string>  __pyx_v_c_field_names;
  std::vector<int8_t>  __pyx_v_c_type_codes;
  PyObject *__pyx_v_x = NULL;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  std::string __pyx_t_8;
  int8_t __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("from_dense", 0);

  /* "pyarrow/array.pxi":1597
 *         cdef vector[c_string] c_field_names
 *         cdef vector[int8_t] c_type_codes
 *         for child in children:             # <<<<<<<<<<<<<<
 *             c.push_back(child.sp_array)
 *         if field_names is not None:
 */
  if (unlikely(__pyx_v_children == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(1, 1597, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_children; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 1597, __pyx_L1_error)
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1597, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1597, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_child, ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "pyarrow/array.pxi":1598
 *         cdef vector[int8_t] c_type_codes
 *         for child in children:
 *             c.push_back(child.sp_array)             # <<<<<<<<<<<<<<
 *         if field_names is not None:
 *             for x in field_names:
 */
    try {
      __pyx_v_c.push_back(__pyx_v_child->sp_array);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(1, 1598, __pyx_L1_error)
    }

    /* "pyarrow/array.pxi":1597
 *         cdef vector[c_string] c_field_names
 *         cdef vector[int8_t] c_type_codes
 *         for child in children:             # <<<<<<<<<<<<<<
 *             c.push_back(child.sp_array)
 *         if field_names is not None:
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":1599
 *         for child in children:
 *             c.push_back(child.sp_array)
 *         if field_names is not None:             # <<<<<<<<<<<<<<
 *             for x in field_names:
 *                 c_field_names.push_back(tobytes(x))
 */
  __pyx_t_4 = (__pyx_v_field_names != ((PyObject*)Py_None));
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "pyarrow/array.pxi":1600
 *             c.push_back(child.sp_array)
 *         if field_names is not None:
 *             for x in field_names:             # <<<<<<<<<<<<<<
 *                 c_field_names.push_back(tobytes(x))
 *         if type_codes is not None:
 */
    if (unlikely(__pyx_v_field_names == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(1, 1600, __pyx_L1_error)
    }
    __pyx_t_1 = __pyx_v_field_names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    for (;;) {
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 1600, __pyx_L1_error)
      #else
      __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1600, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      #endif
      __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "pyarrow/array.pxi":1601
 *         if field_names is not None:
 *             for x in field_names:
 *                 c_field_names.push_back(tobytes(x))             # <<<<<<<<<<<<<<
 *         if type_codes is not None:
 *             for x in type_codes:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1601, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_x) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_x);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1601, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_8 = __pyx_convert_string_from_py_std__in_string(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1601, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      try {
        __pyx_v_c_field_names.push_back(__pyx_t_8);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(1, 1601, __pyx_L1_error)
      }

      /* "pyarrow/array.pxi":1600
 *             c.push_back(child.sp_array)
 *         if field_names is not None:
 *             for x in field_names:             # <<<<<<<<<<<<<<
 *                 c_field_names.push_back(tobytes(x))
 *         if type_codes is not None:
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/array.pxi":1599
 *         for child in children:
 *             c.push_back(child.sp_array)
 *         if field_names is not None:             # <<<<<<<<<<<<<<
 *             for x in field_names:
 *                 c_field_names.push_back(tobytes(x))
 */
  }

  /* "pyarrow/array.pxi":1602
 *             for x in field_names:
 *                 c_field_names.push_back(tobytes(x))
 *         if type_codes is not None:             # <<<<<<<<<<<<<<
 *             for x in type_codes:
 *                 c_type_codes.push_back(x)
 */
  __pyx_t_5 = (__pyx_v_type_codes != ((PyObject*)Py_None));
  __pyx_t_4 = (__pyx_t_5 != 0);
  if (__pyx_t_4) {

    /* "pyarrow/array.pxi":1603
 *                 c_field_names.push_back(tobytes(x))
 *         if type_codes is not None:
 *             for x in type_codes:             # <<<<<<<<<<<<<<
 *                 c_type_codes.push_back(x)
 *         with nogil:
 */
    if (unlikely(__pyx_v_type_codes == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(1, 1603, __pyx_L1_error)
    }
    __pyx_t_1 = __pyx_v_type_codes; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    for (;;) {
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 1603, __pyx_L1_error)
      #else
      __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1603, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      #endif
      __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "pyarrow/array.pxi":1604
 *         if type_codes is not None:
 *             for x in type_codes:
 *                 c_type_codes.push_back(x)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(CUnionArray.MakeDense(
 */
      __pyx_t_9 = __Pyx_PyInt_As_int8_t(__pyx_v_x); if (unlikely((__pyx_t_9 == ((int8_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 1604, __pyx_L1_error)
      try {
        __pyx_v_c_type_codes.push_back(__pyx_t_9);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(1, 1604, __pyx_L1_error)
      }

      /* "pyarrow/array.pxi":1603
 *                 c_field_names.push_back(tobytes(x))
 *         if type_codes is not None:
 *             for x in type_codes:             # <<<<<<<<<<<<<<
 *                 c_type_codes.push_back(x)
 *         with nogil:
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/array.pxi":1602
 *             for x in field_names:
 *                 c_field_names.push_back(tobytes(x))
 *         if type_codes is not None:             # <<<<<<<<<<<<<<
 *             for x in type_codes:
 *                 c_type_codes.push_back(x)
 */
  }

  /* "pyarrow/array.pxi":1605
 *             for x in type_codes:
 *                 c_type_codes.push_back(x)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CUnionArray.MakeDense(
 *                 deref(types.ap), deref(value_offsets.ap), c, c_field_names,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":1606
 *                 c_type_codes.push_back(x)
 *         with nogil:
 *             check_status(CUnionArray.MakeDense(             # <<<<<<<<<<<<<<
 *                 deref(types.ap), deref(value_offsets.ap), c, c_field_names,
 *                 c_type_codes, &out))
 */
        __pyx_t_10 = __pyx_f_7pyarrow_3lib_check_status( arrow::UnionArray::MakeDense((*__pyx_v_types->ap), (*__pyx_v_value_offsets->ap), __pyx_v_c, __pyx_v_c_field_names, __pyx_v_c_type_codes, (&__pyx_v_out))); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 1606, __pyx_L12_error)
      }

      /* "pyarrow/array.pxi":1605
 *             for x in type_codes:
 *                 c_type_codes.push_back(x)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CUnionArray.MakeDense(
 *                 deref(types.ap), deref(value_offsets.ap), c, c_field_names,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L13;
        }
        __pyx_L12_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L13:;
      }
  }

  /* "pyarrow/array.pxi":1609
 *                 deref(types.ap), deref(value_offsets.ap), c, c_field_names,
 *                 c_type_codes, &out))
 *         cdef Array result = pyarrow_wrap_array(out)             # <<<<<<<<<<<<<<
 *         result.validate()
 *         return result
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_out); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1609, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":1610
 *                 c_type_codes, &out))
 *         cdef Array result = pyarrow_wrap_array(out)
 *         result.validate()             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_validate); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1610, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1610, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":1611
 *         cdef Array result = pyarrow_wrap_array(out)
 *         result.validate()
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1574
 * 
 *     @staticmethod
 *     def from_dense(Array types, Array value_offsets, list children,             # <<<<<<<<<<<<<<
 *                    list field_names=None, list type_codes=None):
 *         """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.UnionArray.from_dense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_child);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1614
 * 
 *     @staticmethod
 *     def from_sparse(Array types, list children, list field_names=None,             # <<<<<<<<<<<<<<
 *                     list type_codes=None):
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10UnionArray_3from_sparse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10UnionArray_2from_sparse[] = "UnionArray.from_sparse(Array types, list children, list field_names=None, list type_codes=None)\n\n        Construct sparse UnionArray from arrays of int8 types and children\n        arrays\n\n        Parameters\n        ----------\n        types : Array (int8 type)\n        children : list\n        field_names : list\n        type_codes : list\n\n        Returns\n        -------\n        union_array : UnionArray\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_10UnionArray_3from_sparse = {"from_sparse", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10UnionArray_3from_sparse, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10UnionArray_2from_sparse};
static PyObject *__pyx_pw_7pyarrow_3lib_10UnionArray_3from_sparse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_types = 0;
  PyObject *__pyx_v_children = 0;
  PyObject *__pyx_v_field_names = 0;
  PyObject *__pyx_v_type_codes = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_sparse (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_types,&__pyx_n_s_children,&__pyx_n_s_field_names,&__pyx_n_s_type_codes,0};
    PyObject* values[4] = {0,0,0,0};
    values[2] = ((PyObject*)Py_None);

    /* "pyarrow/array.pxi":1615
 *     @staticmethod
 *     def from_sparse(Array types, list children, list field_names=None,
 *                     list type_codes=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct sparse UnionArray from arrays of int8 types and children
 */
    values[3] = ((PyObject*)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_types)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_children)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_sparse", 0, 2, 4, 1); __PYX_ERR(1, 1614, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field_names);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type_codes);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_sparse") < 0)) __PYX_ERR(1, 1614, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_types = ((struct __pyx_obj_7pyarrow_3lib_Array *)values[0]);
    __pyx_v_children = ((PyObject*)values[1]);
    __pyx_v_field_names = ((PyObject*)values[2]);
    __pyx_v_type_codes = ((PyObject*)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_sparse", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1614, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.UnionArray.from_sparse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_types), __pyx_ptype_7pyarrow_3lib_Array, 1, "types", 0))) __PYX_ERR(1, 1614, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_children), (&PyList_Type), 1, "children", 1))) __PYX_ERR(1, 1614, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field_names), (&PyList_Type), 1, "field_names", 1))) __PYX_ERR(1, 1614, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_type_codes), (&PyList_Type), 1, "type_codes", 1))) __PYX_ERR(1, 1615, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_10UnionArray_2from_sparse(__pyx_v_types, __pyx_v_children, __pyx_v_field_names, __pyx_v_type_codes);

  /* "pyarrow/array.pxi":1614
 * 
 *     @staticmethod
 *     def from_sparse(Array types, list children, list field_names=None,             # <<<<<<<<<<<<<<
 *                     list type_codes=None):
 *         """
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10UnionArray_2from_sparse(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_types, PyObject *__pyx_v_children, PyObject *__pyx_v_field_names, PyObject *__pyx_v_type_codes) {
  std::shared_ptr< arrow::Array>  __pyx_v_out;
  std::vector<std::shared_ptr< arrow::Array> >  __pyx_v_c;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_child = 0;
  std::vector<std::string>  __pyx_v_c_field_names;
  std::vector<int8_t>  __pyx_v_c_type_codes;
  PyObject *__pyx_v_x = NULL;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  std::string __pyx_t_8;
  int8_t __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("from_sparse", 0);

  /* "pyarrow/array.pxi":1636
 *         cdef vector[c_string] c_field_names
 *         cdef vector[int8_t] c_type_codes
 *         for child in children:             # <<<<<<<<<<<<<<
 *             c.push_back(child.sp_array)
 *         if field_names is not None:
 */
  if (unlikely(__pyx_v_children == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(1, 1636, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_children; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 1636, __pyx_L1_error)
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1636, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1636, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_child, ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "pyarrow/array.pxi":1637
 *         cdef vector[int8_t] c_type_codes
 *         for child in children:
 *             c.push_back(child.sp_array)             # <<<<<<<<<<<<<<
 *         if field_names is not None:
 *             for x in field_names:
 */
    try {
      __pyx_v_c.push_back(__pyx_v_child->sp_array);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(1, 1637, __pyx_L1_error)
    }

    /* "pyarrow/array.pxi":1636
 *         cdef vector[c_string] c_field_names
 *         cdef vector[int8_t] c_type_codes
 *         for child in children:             # <<<<<<<<<<<<<<
 *             c.push_back(child.sp_array)
 *         if field_names is not None:
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":1638
 *         for child in children:
 *             c.push_back(child.sp_array)
 *         if field_names is not None:             # <<<<<<<<<<<<<<
 *             for x in field_names:
 *                 c_field_names.push_back(tobytes(x))
 */
  __pyx_t_4 = (__pyx_v_field_names != ((PyObject*)Py_None));
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "pyarrow/array.pxi":1639
 *             c.push_back(child.sp_array)
 *         if field_names is not None:
 *             for x in field_names:             # <<<<<<<<<<<<<<
 *                 c_field_names.push_back(tobytes(x))
 *         if type_codes is not None:
 */
    if (unlikely(__pyx_v_field_names == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(1, 1639, __pyx_L1_error)
    }
    __pyx_t_1 = __pyx_v_field_names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    for (;;) {
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 1639, __pyx_L1_error)
      #else
      __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1639, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      #endif
      __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "pyarrow/array.pxi":1640
 *         if field_names is not None:
 *             for x in field_names:
 *                 c_field_names.push_back(tobytes(x))             # <<<<<<<<<<<<<<
 *         if type_codes is not None:
 *             for x in type_codes:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1640, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_x) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_x);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1640, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_8 = __pyx_convert_string_from_py_std__in_string(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1640, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      try {
        __pyx_v_c_field_names.push_back(__pyx_t_8);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(1, 1640, __pyx_L1_error)
      }

      /* "pyarrow/array.pxi":1639
 *             c.push_back(child.sp_array)
 *         if field_names is not None:
 *             for x in field_names:             # <<<<<<<<<<<<<<
 *                 c_field_names.push_back(tobytes(x))
 *         if type_codes is not None:
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/array.pxi":1638
 *         for child in children:
 *             c.push_back(child.sp_array)
 *         if field_names is not None:             # <<<<<<<<<<<<<<
 *             for x in field_names:
 *                 c_field_names.push_back(tobytes(x))
 */
  }

  /* "pyarrow/array.pxi":1641
 *             for x in field_names:
 *                 c_field_names.push_back(tobytes(x))
 *         if type_codes is not None:             # <<<<<<<<<<<<<<
 *             for x in type_codes:
 *                 c_type_codes.push_back(x)
 */
  __pyx_t_5 = (__pyx_v_type_codes != ((PyObject*)Py_None));
  __pyx_t_4 = (__pyx_t_5 != 0);
  if (__pyx_t_4) {

    /* "pyarrow/array.pxi":1642
 *                 c_field_names.push_back(tobytes(x))
 *         if type_codes is not None:
 *             for x in type_codes:             # <<<<<<<<<<<<<<
 *                 c_type_codes.push_back(x)
 *         with nogil:
 */
    if (unlikely(__pyx_v_type_codes == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(1, 1642, __pyx_L1_error)
    }
    __pyx_t_1 = __pyx_v_type_codes; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    for (;;) {
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 1642, __pyx_L1_error)
      #else
      __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1642, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      #endif
      __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "pyarrow/array.pxi":1643
 *         if type_codes is not None:
 *             for x in type_codes:
 *                 c_type_codes.push_back(x)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(CUnionArray.MakeSparse(deref(types.ap), c,
 */
      __pyx_t_9 = __Pyx_PyInt_As_int8_t(__pyx_v_x); if (unlikely((__pyx_t_9 == ((int8_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 1643, __pyx_L1_error)
      try {
        __pyx_v_c_type_codes.push_back(__pyx_t_9);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(1, 1643, __pyx_L1_error)
      }

      /* "pyarrow/array.pxi":1642
 *                 c_field_names.push_back(tobytes(x))
 *         if type_codes is not None:
 *             for x in type_codes:             # <<<<<<<<<<<<<<
 *                 c_type_codes.push_back(x)
 *         with nogil:
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/array.pxi":1641
 *             for x in field_names:
 *                 c_field_names.push_back(tobytes(x))
 *         if type_codes is not None:             # <<<<<<<<<<<<<<
 *             for x in type_codes:
 *                 c_type_codes.push_back(x)
 */
  }

  /* "pyarrow/array.pxi":1644
 *             for x in type_codes:
 *                 c_type_codes.push_back(x)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CUnionArray.MakeSparse(deref(types.ap), c,
 *                                                 c_field_names,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":1645
 *                 c_type_codes.push_back(x)
 *         with nogil:
 *             check_status(CUnionArray.MakeSparse(deref(types.ap), c,             # <<<<<<<<<<<<<<
 *                                                 c_field_names,
 *                                                 c_type_codes,
 */
        __pyx_t_10 = __pyx_f_7pyarrow_3lib_check_status( arrow::UnionArray::MakeSparse((*__pyx_v_types->ap), __pyx_v_c, __pyx_v_c_field_names, __pyx_v_c_type_codes, (&__pyx_v_out))); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 1645, __pyx_L12_error)
      }

      /* "pyarrow/array.pxi":1644
 *             for x in type_codes:
 *                 c_type_codes.push_back(x)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CUnionArray.MakeSparse(deref(types.ap), c,
 *                                                 c_field_names,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L13;
        }
        __pyx_L12_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L13:;
      }
  }

  /* "pyarrow/array.pxi":1649
 *                                                 c_type_codes,
 *                                                 &out))
 *         cdef Array result = pyarrow_wrap_array(out)             # <<<<<<<<<<<<<<
 *         result.validate()
 *         return result
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_out); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1649, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":1650
 *                                                 &out))
 *         cdef Array result = pyarrow_wrap_array(out)
 *         result.validate()             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_validate); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1650, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1650, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":1651
 *         cdef Array result = pyarrow_wrap_array(out)
 *         result.validate()
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1614
 * 
 *     @staticmethod
 *     def from_sparse(Array types, list children, list field_names=None,             # <<<<<<<<<<<<<<
 *                     list type_codes=None):
 *         """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.UnionArray.from_sparse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_child);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1660
 * 
 *     @staticmethod
 *     def from_buffers(int length, Buffer value_offsets, Buffer data,             # <<<<<<<<<<<<<<
 *                      Buffer null_bitmap=None, int null_count=-1,
 *                      int offset=0):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11StringArray_1from_buffers(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11StringArray_from_buffers[] = "StringArray.from_buffers(int length, Buffer value_offsets, Buffer data, Buffer null_bitmap=None, int null_count=-1, int offset=0)\n\n        Construct a StringArray from value_offsets and data buffers.\n        If there are nulls in the data, also a null_bitmap and the matching\n        null_count must be passed.\n\n        Parameters\n        ----------\n        length : int\n        value_offsets : Buffer\n        data : Buffer\n        null_bitmap : Buffer, optional\n        null_count : int, default 0\n        offset : int, default 0\n\n        Returns\n        -------\n        string_array : StringArray\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_11StringArray_1from_buffers = {"from_buffers", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_11StringArray_1from_buffers, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_11StringArray_from_buffers};
static PyObject *__pyx_pw_7pyarrow_3lib_11StringArray_1from_buffers(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_length;
  struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_value_offsets = 0;
  struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_data = 0;
  struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_null_bitmap = 0;
  int __pyx_v_null_count;
  int __pyx_v_offset;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_buffers (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_length,&__pyx_n_s_value_offsets,&__pyx_n_s_data,&__pyx_n_s_null_bitmap,&__pyx_n_s_null_count,&__pyx_n_s_offset,0};
    PyObject* values[6] = {0,0,0,0,0,0};

    /* "pyarrow/array.pxi":1661
 *     @staticmethod
 *     def from_buffers(int length, Buffer value_offsets, Buffer data,
 *                      Buffer null_bitmap=None, int null_count=-1,             # <<<<<<<<<<<<<<
 *                      int offset=0):
 *         """
 */
    values[3] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_Buffer *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_length)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value_offsets)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_buffers", 0, 3, 6, 1); __PYX_ERR(1, 1660, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_buffers", 0, 3, 6, 2); __PYX_ERR(1, 1660, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_null_bitmap);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_null_count);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offset);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_buffers") < 0)) __PYX_ERR(1, 1660, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_length = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_length == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 1660, __pyx_L3_error)
    __pyx_v_value_offsets = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)values[1]);
    __pyx_v_data = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)values[2]);
    __pyx_v_null_bitmap = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)values[3]);
    if (values[4]) {
      __pyx_v_null_count = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_null_count == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 1661, __pyx_L3_error)
    } else {
      __pyx_v_null_count = ((int)-1);
    }
    if (values[5]) {
      __pyx_v_offset = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 1662, __pyx_L3_error)
    } else {
      __pyx_v_offset = ((int)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_buffers", 0, 3, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1660, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.StringArray.from_buffers", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value_offsets), __pyx_ptype_7pyarrow_3lib_Buffer, 1, "value_offsets", 0))) __PYX_ERR(1, 1660, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), __pyx_ptype_7pyarrow_3lib_Buffer, 1, "data", 0))) __PYX_ERR(1, 1660, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_null_bitmap), __pyx_ptype_7pyarrow_3lib_Buffer, 1, "null_bitmap", 0))) __PYX_ERR(1, 1661, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_11StringArray_from_buffers(__pyx_v_length, __pyx_v_value_offsets, __pyx_v_data, __pyx_v_null_bitmap, __pyx_v_null_count, __pyx_v_offset);

  /* "pyarrow/array.pxi":1660
 * 
 *     @staticmethod
 *     def from_buffers(int length, Buffer value_offsets, Buffer data,             # <<<<<<<<<<<<<<
 *                      Buffer null_bitmap=None, int null_count=-1,
 *                      int offset=0):
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11StringArray_from_buffers(int __pyx_v_length, struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_value_offsets, struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_data, struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_null_bitmap, int __pyx_v_null_count, int __pyx_v_offset) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_RefNannySetupContext("from_buffers", 0);

  /* "pyarrow/array.pxi":1681
 *         string_array : StringArray
 *         """
 *         return Array.from_buffers(utf8(), length,             # <<<<<<<<<<<<<<
 *                                   [null_bitmap, value_offsets, data],
 *                                   null_count, offset)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_Array), __pyx_n_s_from_buffers); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_utf8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_length); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "pyarrow/array.pxi":1682
 *         """
 *         return Array.from_buffers(utf8(), length,
 *                                   [null_bitmap, value_offsets, data],             # <<<<<<<<<<<<<<
 *                                   null_count, offset)
 * 
 */
  __pyx_t_5 = PyList_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1682, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(((PyObject *)__pyx_v_null_bitmap));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_null_bitmap));
  PyList_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_null_bitmap));
  __Pyx_INCREF(((PyObject *)__pyx_v_value_offsets));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_value_offsets));
  PyList_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_value_offsets));
  __Pyx_INCREF(((PyObject *)__pyx_v_data));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_data));
  PyList_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_data));

  /* "pyarrow/array.pxi":1683
 *         return Array.from_buffers(utf8(), length,
 *                                   [null_bitmap, value_offsets, data],
 *                                   null_count, offset)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_null_count); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1683, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_offset); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1683, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_9 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[6] = {__pyx_t_8, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 5+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1681, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[6] = {__pyx_t_8, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 5+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1681, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else
  #endif
  {
    __pyx_t_10 = PyTuple_New(5+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1681, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    if (__pyx_t_8) {
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_9, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_9, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_10, 4+__pyx_t_9, __pyx_t_7);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_6 = 0;
    __pyx_t_7 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1681, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1660
 * 
 *     @staticmethod
 *     def from_buffers(int length, Buffer value_offsets, Buffer data,             # <<<<<<<<<<<<<<
 *                      Buffer null_bitmap=None, int null_count=-1,
 *                      int offset=0):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("pyarrow.lib.StringArray.from_buffers", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1692
 * 
 *     @staticmethod
 *     def from_buffers(int length, Buffer value_offsets, Buffer data,             # <<<<<<<<<<<<<<
 *                      Buffer null_bitmap=None, int null_count=-1,
 *                      int offset=0):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16LargeStringArray_1from_buffers(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16LargeStringArray_from_buffers[] = "LargeStringArray.from_buffers(int length, Buffer value_offsets, Buffer data, Buffer null_bitmap=None, int null_count=-1, int offset=0)\n\n        Construct a LargeStringArray from value_offsets and data buffers.\n        If there are nulls in the data, also a null_bitmap and the matching\n        null_count must be passed.\n\n        Parameters\n        ----------\n        length : int\n        value_offsets : Buffer\n        data : Buffer\n        null_bitmap : Buffer, optional\n        null_count : int, default 0\n        offset : int, default 0\n\n        Returns\n        -------\n        string_array : StringArray\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_16LargeStringArray_1from_buffers = {"from_buffers", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_16LargeStringArray_1from_buffers, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_16LargeStringArray_from_buffers};
static PyObject *__pyx_pw_7pyarrow_3lib_16LargeStringArray_1from_buffers(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_length;
  struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_value_offsets = 0;
  struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_data = 0;
  struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_null_bitmap = 0;
  int __pyx_v_null_count;
  int __pyx_v_offset;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_buffers (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_length,&__pyx_n_s_value_offsets,&__pyx_n_s_data,&__pyx_n_s_null_bitmap,&__pyx_n_s_null_count,&__pyx_n_s_offset,0};
    PyObject* values[6] = {0,0,0,0,0,0};

    /* "pyarrow/array.pxi":1693
 *     @staticmethod
 *     def from_buffers(int length, Buffer value_offsets, Buffer data,
 *                      Buffer null_bitmap=None, int null_count=-1,             # <<<<<<<<<<<<<<
 *                      int offset=0):
 *         """
 */
    values[3] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_Buffer *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_length)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value_offsets)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_buffers", 0, 3, 6, 1); __PYX_ERR(1, 1692, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_buffers", 0, 3, 6, 2); __PYX_ERR(1, 1692, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_null_bitmap);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_null_count);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offset);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_buffers") < 0)) __PYX_ERR(1, 1692, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_length = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_length == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 1692, __pyx_L3_error)
    __pyx_v_value_offsets = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)values[1]);
    __pyx_v_data = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)values[2]);
    __pyx_v_null_bitmap = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)values[3]);
    if (values[4]) {
      __pyx_v_null_count = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_null_count == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 1693, __pyx_L3_error)
    } else {
      __pyx_v_null_count = ((int)-1);
    }
    if (values[5]) {
      __pyx_v_offset = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 1694, __pyx_L3_error)
    } else {
      __pyx_v_offset = ((int)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_buffers", 0, 3, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1692, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.LargeStringArray.from_buffers", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value_offsets), __pyx_ptype_7pyarrow_3lib_Buffer, 1, "value_offsets", 0))) __PYX_ERR(1, 1692, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), __pyx_ptype_7pyarrow_3lib_Buffer, 1, "data", 0))) __PYX_ERR(1, 1692, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_null_bitmap), __pyx_ptype_7pyarrow_3lib_Buffer, 1, "null_bitmap", 0))) __PYX_ERR(1, 1693, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_16LargeStringArray_from_buffers(__pyx_v_length, __pyx_v_value_offsets, __pyx_v_data, __pyx_v_null_bitmap, __pyx_v_null_count, __pyx_v_offset);

  /* "pyarrow/array.pxi":1692
 * 
 *     @staticmethod
 *     def from_buffers(int length, Buffer value_offsets, Buffer data,             # <<<<<<<<<<<<<<
 *                      Buffer null_bitmap=None, int null_count=-1,
 *                      int offset=0):
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16LargeStringArray_from_buffers(int __pyx_v_length, struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_value_offsets, struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_data, struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_null_bitmap, int __pyx_v_null_count, int __pyx_v_offset) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_RefNannySetupContext("from_buffers", 0);

  /* "pyarrow/array.pxi":1713
 *         string_array : StringArray
 *         """
 *         return Array.from_buffers(large_utf8(), length,             # <<<<<<<<<<<<<<
 *                                   [null_bitmap, value_offsets, data],
 *                                   null_count, offset)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_Array), __pyx_n_s_from_buffers); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1713, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_large_utf8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1713, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1713, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_length); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1713, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "pyarrow/array.pxi":1714
 *         """
 *         return Array.from_buffers(large_utf8(), length,
 *                                   [null_bitmap, value_offsets, data],             # <<<<<<<<<<<<<<
 *                                   null_count, offset)
 * 
 */
  __pyx_t_5 = PyList_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1714, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(((PyObject *)__pyx_v_null_bitmap));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_null_bitmap));
  PyList_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_null_bitmap));
  __Pyx_INCREF(((PyObject *)__pyx_v_value_offsets));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_value_offsets));
  PyList_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_value_offsets));
  __Pyx_INCREF(((PyObject *)__pyx_v_data));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_data));
  PyList_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_data));

  /* "pyarrow/array.pxi":1715
 *         return Array.from_buffers(large_utf8(), length,
 *                                   [null_bitmap, value_offsets, data],
 *                                   null_count, offset)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_null_count); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1715, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_offset); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1715, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_9 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[6] = {__pyx_t_8, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 5+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1713, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[6] = {__pyx_t_8, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 5+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1713, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else
  #endif
  {
    __pyx_t_10 = PyTuple_New(5+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1713, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    if (__pyx_t_8) {
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_9, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_9, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_10, 4+__pyx_t_9, __pyx_t_7);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_6 = 0;
    __pyx_t_7 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1713, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1692
 * 
 *     @staticmethod
 *     def from_buffers(int length, Buffer value_offsets, Buffer data,             # <<<<<<<<<<<<<<
 *                      Buffer null_bitmap=None, int null_count=-1,
 *                      int offset=0):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("pyarrow.lib.LargeStringArray.from_buffers", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1735
 *     """
 * 
 *     def dictionary_encode(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryArray_1dictionary_encode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15DictionaryArray_dictionary_encode[] = "DictionaryArray.dictionary_encode(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryArray_1dictionary_encode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dictionary_encode (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15DictionaryArray_dictionary_encode(((struct __pyx_obj_7pyarrow_3lib_DictionaryArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15DictionaryArray_dictionary_encode(struct __pyx_obj_7pyarrow_3lib_DictionaryArray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dictionary_encode", 0);

  /* "pyarrow/array.pxi":1736
 * 
 *     def dictionary_encode(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1735
 *     """
 * 
 *     def dictionary_encode(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1739
 * 
 *     @property
 *     def dictionary(self):             # <<<<<<<<<<<<<<
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.ap)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryArray_10dictionary_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryArray_10dictionary_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15DictionaryArray_10dictionary___get__(((struct __pyx_obj_7pyarrow_3lib_DictionaryArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15DictionaryArray_10dictionary___get__(struct __pyx_obj_7pyarrow_3lib_DictionaryArray *__pyx_v_self) {
   arrow::DictionaryArray *__pyx_v_darr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/array.pxi":1740
 *     @property
 *     def dictionary(self):
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.ap)             # <<<<<<<<<<<<<<
 * 
 *         if self._dictionary is None:
 */
  __pyx_v_darr = (( arrow::DictionaryArray *)__pyx_v_self->__pyx_base.ap);

  /* "pyarrow/array.pxi":1742
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.ap)
 * 
 *         if self._dictionary is None:             # <<<<<<<<<<<<<<
 *             self._dictionary = pyarrow_wrap_array(darr.dictionary())
 * 
 */
  __pyx_t_1 = (__pyx_v_self->_dictionary == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":1743
 * 
 *         if self._dictionary is None:
 *             self._dictionary = pyarrow_wrap_array(darr.dictionary())             # <<<<<<<<<<<<<<
 * 
 *         return self._dictionary
 */
    __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_darr->dictionary()); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1743, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_GOTREF(__pyx_v_self->_dictionary);
    __Pyx_DECREF(__pyx_v_self->_dictionary);
    __pyx_v_self->_dictionary = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "pyarrow/array.pxi":1742
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.ap)
 * 
 *         if self._dictionary is None:             # <<<<<<<<<<<<<<
 *             self._dictionary = pyarrow_wrap_array(darr.dictionary())
 * 
 */
  }

  /* "pyarrow/array.pxi":1745
 *             self._dictionary = pyarrow_wrap_array(darr.dictionary())
 * 
 *         return self._dictionary             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_dictionary);
  __pyx_r = __pyx_v_self->_dictionary;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1739
 * 
 *     @property
 *     def dictionary(self):             # <<<<<<<<<<<<<<
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.ap)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.DictionaryArray.dictionary.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1748
 * 
 *     @property
 *     def indices(self):             # <<<<<<<<<<<<<<
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.ap)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryArray_7indices_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryArray_7indices_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15DictionaryArray_7indices___get__(((struct __pyx_obj_7pyarrow_3lib_DictionaryArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15DictionaryArray_7indices___get__(struct __pyx_obj_7pyarrow_3lib_DictionaryArray *__pyx_v_self) {
   arrow::DictionaryArray *__pyx_v_darr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/array.pxi":1749
 *     @property
 *     def indices(self):
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.ap)             # <<<<<<<<<<<<<<
 * 
 *         if self._indices is None:
 */
  __pyx_v_darr = (( arrow::DictionaryArray *)__pyx_v_self->__pyx_base.ap);

  /* "pyarrow/array.pxi":1751
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.ap)
 * 
 *         if self._indices is None:             # <<<<<<<<<<<<<<
 *             self._indices = pyarrow_wrap_array(darr.indices())
 * 
 */
  __pyx_t_1 = (__pyx_v_self->_indices == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":1752
 * 
 *         if self._indices is None:
 *             self._indices = pyarrow_wrap_array(darr.indices())             # <<<<<<<<<<<<<<
 * 
 *         return self._indices
 */
    __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_darr->indices()); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1752, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_GOTREF(__pyx_v_self->_indices);
    __Pyx_DECREF(__pyx_v_self->_indices);
    __pyx_v_self->_indices = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "pyarrow/array.pxi":1751
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.ap)
 * 
 *         if self._indices is None:             # <<<<<<<<<<<<<<
 *             self._indices = pyarrow_wrap_array(darr.indices())
 * 
 */
  }

  /* "pyarrow/array.pxi":1754
 *             self._indices = pyarrow_wrap_array(darr.indices())
 * 
 *         return self._indices             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_indices);
  __pyx_r = __pyx_v_self->_indices;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1748
 * 
 *     @property
 *     def indices(self):             # <<<<<<<<<<<<<<
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.ap)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.DictionaryArray.indices.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1757
 * 
 *     @staticmethod
 *     def from_arrays(indices, dictionary, mask=None, bint ordered=False,             # <<<<<<<<<<<<<<
 *                     bint from_pandas=False, bint safe=True,
 *                     MemoryPool memory_pool=None):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryArray_3from_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15DictionaryArray_2from_arrays[] = "DictionaryArray.from_arrays(indices, dictionary, mask=None, bool ordered=False, bool from_pandas=False, bool safe=True, MemoryPool memory_pool=None)\n\n        Construct Arrow DictionaryArray from array of indices (must be\n        non-negative integers) and corresponding array of dictionary values\n\n        Parameters\n        ----------\n        indices : ndarray or pandas.Series, integer type\n        dictionary : ndarray or pandas.Series\n        mask : ndarray or pandas.Series, boolean type\n            True values indicate that indices are actually null\n        from_pandas : boolean, default False\n            If True, the indices should be treated as though they originated in\n            a pandas.Categorical (null encoded as -1)\n        ordered : boolean, default False\n            Set to True if the category values are ordered\n        safe : boolean, default True\n            If True, check that the dictionary indices are in range\n        memory_pool : MemoryPool, default None\n            For memory allocations, if required, otherwise uses default pool\n\n        Returns\n        -------\n        dict_array : DictionaryArray\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_15DictionaryArray_3from_arrays = {"from_arrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_15DictionaryArray_3from_arrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_15DictionaryArray_2from_arrays};
static PyObject *__pyx_pw_7pyarrow_3lib_15DictionaryArray_3from_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_indices = 0;
  PyObject *__pyx_v_dictionary = 0;
  PyObject *__pyx_v_mask = 0;
  int __pyx_v_ordered;
  int __pyx_v_from_pandas;
  int __pyx_v_safe;
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_arrays (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_dictionary,&__pyx_n_s_mask,&__pyx_n_s_ordered,&__pyx_n_s_from_pandas,&__pyx_n_s_safe,&__pyx_n_s_memory_pool,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    values[2] = ((PyObject *)Py_None);

    /* "pyarrow/array.pxi":1759
 *     def from_arrays(indices, dictionary, mask=None, bint ordered=False,
 *                     bint from_pandas=False, bint safe=True,
 *                     MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct Arrow DictionaryArray from array of indices (must be
 */
    values[6] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dictionary)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_arrays", 0, 2, 7, 1); __PYX_ERR(1, 1757, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mask);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ordered);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_from_pandas);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_safe);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[6] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_arrays") < 0)) __PYX_ERR(1, 1757, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_indices = values[0];
    __pyx_v_dictionary = values[1];
    __pyx_v_mask = values[2];
    if (values[3]) {
      __pyx_v_ordered = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_ordered == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 1757, __pyx_L3_error)
    } else {

      /* "pyarrow/array.pxi":1757
 * 
 *     @staticmethod
 *     def from_arrays(indices, dictionary, mask=None, bint ordered=False,             # <<<<<<<<<<<<<<
 *                     bint from_pandas=False, bint safe=True,
 *                     MemoryPool memory_pool=None):
 */
      __pyx_v_ordered = ((int)0);
    }
    if (values[4]) {
      __pyx_v_from_pandas = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_from_pandas == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 1758, __pyx_L3_error)
    } else {

      /* "pyarrow/array.pxi":1758
 *     @staticmethod
 *     def from_arrays(indices, dictionary, mask=None, bint ordered=False,
 *                     bint from_pandas=False, bint safe=True,             # <<<<<<<<<<<<<<
 *                     MemoryPool memory_pool=None):
 *         """
 */
      __pyx_v_from_pandas = ((int)0);
    }
    if (values[5]) {
      __pyx_v_safe = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_safe == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 1758, __pyx_L3_error)
    } else {
      __pyx_v_safe = ((int)1);
    }
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[6]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_arrays", 0, 2, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1757, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.DictionaryArray.from_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(1, 1759, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_15DictionaryArray_2from_arrays(__pyx_v_indices, __pyx_v_dictionary, __pyx_v_mask, __pyx_v_ordered, __pyx_v_from_pandas, __pyx_v_safe, __pyx_v_memory_pool);

  /* "pyarrow/array.pxi":1757
 * 
 *     @staticmethod
 *     def from_arrays(indices, dictionary, mask=None, bint ordered=False,             # <<<<<<<<<<<<<<
 *                     bint from_pandas=False, bint safe=True,
 *                     MemoryPool memory_pool=None):
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15DictionaryArray_2from_arrays(PyObject *__pyx_v_indices, PyObject *__pyx_v_dictionary, PyObject *__pyx_v_mask, int __pyx_v_ordered, int __pyx_v_from_pandas, int __pyx_v_safe, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool) {
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v__indices = 0;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v__dictionary = 0;
  std::shared_ptr< arrow::DataType>  __pyx_v_c_type;
  std::shared_ptr< arrow::Array>  __pyx_v_c_result;
  bool __pyx_v_c_ordered;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("from_arrays", 0);

  /* "pyarrow/array.pxi":1789
 *             shared_ptr[CArray] c_result
 * 
 *         if isinstance(indices, Array):             # <<<<<<<<<<<<<<
 *             if mask is not None:
 *                 raise NotImplementedError(
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_indices, __pyx_ptype_7pyarrow_3lib_Array); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":1790
 * 
 *         if isinstance(indices, Array):
 *             if mask is not None:             # <<<<<<<<<<<<<<
 *                 raise NotImplementedError(
 *                     "mask not implemented with Arrow array inputs yet")
 */
    __pyx_t_2 = (__pyx_v_mask != Py_None);
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (unlikely(__pyx_t_1)) {

      /* "pyarrow/array.pxi":1791
 *         if isinstance(indices, Array):
 *             if mask is not None:
 *                 raise NotImplementedError(             # <<<<<<<<<<<<<<
 *                     "mask not implemented with Arrow array inputs yet")
 *             _indices = indices
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__149, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1791, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(1, 1791, __pyx_L1_error)

      /* "pyarrow/array.pxi":1790
 * 
 *         if isinstance(indices, Array):
 *             if mask is not None:             # <<<<<<<<<<<<<<
 *                 raise NotImplementedError(
 *                     "mask not implemented with Arrow array inputs yet")
 */
    }

    /* "pyarrow/array.pxi":1793
 *                 raise NotImplementedError(
 *                     "mask not implemented with Arrow array inputs yet")
 *             _indices = indices             # <<<<<<<<<<<<<<
 *         else:
 *             if from_pandas:
 */
    if (!(likely(((__pyx_v_indices) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_indices, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1793, __pyx_L1_error)
    __pyx_t_3 = __pyx_v_indices;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v__indices = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/array.pxi":1789
 *             shared_ptr[CArray] c_result
 * 
 *         if isinstance(indices, Array):             # <<<<<<<<<<<<<<
 *             if mask is not None:
 *                 raise NotImplementedError(
 */
    goto __pyx_L3;
  }

  /* "pyarrow/array.pxi":1795
 *             _indices = indices
 *         else:
 *             if from_pandas:             # <<<<<<<<<<<<<<
 *                 _indices = _codes_to_indices(indices, mask, None, memory_pool)
 *             else:
 */
  /*else*/ {
    __pyx_t_1 = (__pyx_v_from_pandas != 0);
    if (__pyx_t_1) {

      /* "pyarrow/array.pxi":1796
 *         else:
 *             if from_pandas:
 *                 _indices = _codes_to_indices(indices, mask, None, memory_pool)             # <<<<<<<<<<<<<<
 *             else:
 *                 _indices = array(indices, mask=mask, memory_pool=memory_pool)
 */
      __pyx_t_3 = __pyx_f_7pyarrow_3lib__codes_to_indices(__pyx_v_indices, __pyx_v_mask, ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None), __pyx_v_memory_pool); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1796, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1796, __pyx_L1_error)
      __pyx_v__indices = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_3);
      __pyx_t_3 = 0;

      /* "pyarrow/array.pxi":1795
 *             _indices = indices
 *         else:
 *             if from_pandas:             # <<<<<<<<<<<<<<
 *                 _indices = _codes_to_indices(indices, mask, None, memory_pool)
 *             else:
 */
      goto __pyx_L5;
    }

    /* "pyarrow/array.pxi":1798
 *                 _indices = _codes_to_indices(indices, mask, None, memory_pool)
 *             else:
 *                 _indices = array(indices, mask=mask, memory_pool=memory_pool)             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(dictionary, Array):
 */
    /*else*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1798, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1798, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_indices);
      __Pyx_GIVEREF(__pyx_v_indices);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_indices);
      __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1798, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_mask, __pyx_v_mask) < 0) __PYX_ERR(1, 1798, __pyx_L1_error)
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_memory_pool, ((PyObject *)__pyx_v_memory_pool)) < 0) __PYX_ERR(1, 1798, __pyx_L1_error)
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1798, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1798, __pyx_L1_error)
      __pyx_v__indices = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_6);
      __pyx_t_6 = 0;
    }
    __pyx_L5:;
  }
  __pyx_L3:;

  /* "pyarrow/array.pxi":1800
 *                 _indices = array(indices, mask=mask, memory_pool=memory_pool)
 * 
 *         if isinstance(dictionary, Array):             # <<<<<<<<<<<<<<
 *             _dictionary = dictionary
 *         else:
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_dictionary, __pyx_ptype_7pyarrow_3lib_Array); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":1801
 * 
 *         if isinstance(dictionary, Array):
 *             _dictionary = dictionary             # <<<<<<<<<<<<<<
 *         else:
 *             _dictionary = array(dictionary, memory_pool=memory_pool)
 */
    if (!(likely(((__pyx_v_dictionary) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dictionary, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1801, __pyx_L1_error)
    __pyx_t_6 = __pyx_v_dictionary;
    __Pyx_INCREF(__pyx_t_6);
    __pyx_v__dictionary = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "pyarrow/array.pxi":1800
 *                 _indices = array(indices, mask=mask, memory_pool=memory_pool)
 * 
 *         if isinstance(dictionary, Array):             # <<<<<<<<<<<<<<
 *             _dictionary = dictionary
 *         else:
 */
    goto __pyx_L6;
  }

  /* "pyarrow/array.pxi":1803
 *             _dictionary = dictionary
 *         else:
 *             _dictionary = array(dictionary, memory_pool=memory_pool)             # <<<<<<<<<<<<<<
 * 
 *         if not isinstance(_indices, IntegerArray):
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1803, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1803, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_dictionary);
    __Pyx_GIVEREF(__pyx_v_dictionary);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_dictionary);
    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1803, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_memory_pool, ((PyObject *)__pyx_v_memory_pool)) < 0) __PYX_ERR(1, 1803, __pyx_L1_error)
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1803, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1803, __pyx_L1_error)
    __pyx_v__dictionary = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_3);
    __pyx_t_3 = 0;
  }
  __pyx_L6:;

  /* "pyarrow/array.pxi":1805
 *             _dictionary = array(dictionary, memory_pool=memory_pool)
 * 
 *         if not isinstance(_indices, IntegerArray):             # <<<<<<<<<<<<<<
 *             raise ValueError('Indices must be integer type')
 * 
 */
  __pyx_t_2 = __Pyx_TypeCheck(((PyObject *)__pyx_v__indices), __pyx_ptype_7pyarrow_3lib_IntegerArray); 
  __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/array.pxi":1806
 * 
 *         if not isinstance(_indices, IntegerArray):
 *             raise ValueError('Indices must be integer type')             # <<<<<<<<<<<<<<
 * 
 *         cdef c_bool c_ordered = ordered
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__150, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1806, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(1, 1806, __pyx_L1_error)

    /* "pyarrow/array.pxi":1805
 *             _dictionary = array(dictionary, memory_pool=memory_pool)
 * 
 *         if not isinstance(_indices, IntegerArray):             # <<<<<<<<<<<<<<
 *             raise ValueError('Indices must be integer type')
 * 
 */
  }

  /* "pyarrow/array.pxi":1808
 *             raise ValueError('Indices must be integer type')
 * 
 *         cdef c_bool c_ordered = ordered             # <<<<<<<<<<<<<<
 * 
 *         c_type.reset(new CDictionaryType(_indices.type.sp_type,
 */
  __pyx_v_c_ordered = __pyx_v_ordered;

  /* "pyarrow/array.pxi":1810
 *         cdef c_bool c_ordered = ordered
 * 
 *         c_type.reset(new CDictionaryType(_indices.type.sp_type,             # <<<<<<<<<<<<<<
 *                                          _dictionary.sp_array.get().type(),
 *                                          c_ordered))
 */
  __pyx_v_c_type.reset(new  arrow::DictionaryType(__pyx_v__indices->type->sp_type, __pyx_v__dictionary->sp_array.get()->type(), __pyx_v_c_ordered));

  /* "pyarrow/array.pxi":1814
 *                                          c_ordered))
 * 
 *         if safe:             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 check_status(
 */
  __pyx_t_1 = (__pyx_v_safe != 0);
  if (__pyx_t_1) {

    /* "pyarrow/array.pxi":1815
 * 
 *         if safe:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(
 *                     CDictionaryArray.FromArrays(c_type, _indices.sp_array,
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "pyarrow/array.pxi":1816
 *         if safe:
 *             with nogil:
 *                 check_status(             # <<<<<<<<<<<<<<
 *                     CDictionaryArray.FromArrays(c_type, _indices.sp_array,
 *                                                 _dictionary.sp_array,
 */
          __pyx_t_7 = __pyx_f_7pyarrow_3lib_check_status( arrow::DictionaryArray::FromArrays(__pyx_v_c_type, __pyx_v__indices->sp_array, __pyx_v__dictionary->sp_array, (&__pyx_v_c_result))); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(1, 1816, __pyx_L10_error)
        }

        /* "pyarrow/array.pxi":1815
 * 
 *         if safe:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(
 *                     CDictionaryArray.FromArrays(c_type, _indices.sp_array,
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L11;
          }
          __pyx_L10_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L11:;
        }
    }

    /* "pyarrow/array.pxi":1814
 *                                          c_ordered))
 * 
 *         if safe:             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 check_status(
 */
    goto __pyx_L8;
  }

  /* "pyarrow/array.pxi":1821
 *                                                 &c_result))
 *         else:
 *             c_result.reset(new CDictionaryArray(c_type, _indices.sp_array,             # <<<<<<<<<<<<<<
 *                                                 _dictionary.sp_array))
 * 
 */
  /*else*/ {

    /* "pyarrow/array.pxi":1822
 *         else:
 *             c_result.reset(new CDictionaryArray(c_type, _indices.sp_array,
 *                                                 _dictionary.sp_array))             # <<<<<<<<<<<<<<
 * 
 *         cdef Array result = pyarrow_wrap_array(c_result)
 */
    __pyx_v_c_result.reset(new  arrow::DictionaryArray(__pyx_v_c_type, __pyx_v__indices->sp_array, __pyx_v__dictionary->sp_array));
  }
  __pyx_L8:;

  /* "pyarrow/array.pxi":1824
 *                                                 _dictionary.sp_array))
 * 
 *         cdef Array result = pyarrow_wrap_array(c_result)             # <<<<<<<<<<<<<<
 *         result.validate()
 *         return result
 */
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_c_result); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1824, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1824, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyarrow/array.pxi":1825
 * 
 *         cdef Array result = pyarrow_wrap_array(c_result)
 *         result.validate()             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_validate); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1825, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1825, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/array.pxi":1826
 *         cdef Array result = pyarrow_wrap_array(c_result)
 *         result.validate()
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1757
 * 
 *     @staticmethod
 *     def from_arrays(indices, dictionary, mask=None, bint ordered=False,             # <<<<<<<<<<<<<<
 *                     bint from_pandas=False, bint safe=True,
 *                     MemoryPool memory_pool=None):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.DictionaryArray.from_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__indices);
  __Pyx_XDECREF((PyObject *)__pyx_v__dictionary);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1834
 *     """
 * 
 *     def field(self, index):             # <<<<<<<<<<<<<<
 *         """
 *         Retrieves the child array belonging to field
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11StructArray_1field(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11StructArray_field[] = "StructArray.field(self, index)\n\n        Retrieves the child array belonging to field\n\n        Parameters\n        ----------\n        index : Union[int, str]\n            Index / position or name of the field\n\n        Returns\n        -------\n        result : Array\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11StructArray_1field(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("field (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11StructArray_field(((struct __pyx_obj_7pyarrow_3lib_StructArray *)__pyx_v_self), ((PyObject *)__pyx_v_index));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11StructArray_field(struct __pyx_obj_7pyarrow_3lib_StructArray *__pyx_v_self, PyObject *__pyx_v_index) {
   arrow::StructArray *__pyx_v_arr;
  std::shared_ptr< arrow::Array>  __pyx_v_child;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("field", 0);

  /* "pyarrow/array.pxi":1848
 *         """
 *         cdef:
 *             CStructArray* arr = <CStructArray*> self.ap             # <<<<<<<<<<<<<<
 *             shared_ptr[CArray] child
 * 
 */
  __pyx_v_arr = (( arrow::StructArray *)__pyx_v_self->__pyx_base.ap);

  /* "pyarrow/array.pxi":1851
 *             shared_ptr[CArray] child
 * 
 *         if isinstance(index, six.string_types):             # <<<<<<<<<<<<<<
 *             child = arr.GetFieldByName(tobytes(index))
 *             if child == nullptr:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_six); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1851, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_string_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1851, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_index, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1851, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "pyarrow/array.pxi":1852
 * 
 *         if isinstance(index, six.string_types):
 *             child = arr.GetFieldByName(tobytes(index))             # <<<<<<<<<<<<<<
 *             if child == nullptr:
 *                 raise KeyError(index)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1852, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v_index) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_index);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1852, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1852, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_child = __pyx_v_arr->GetFieldByName(__pyx_t_6);

    /* "pyarrow/array.pxi":1853
 *         if isinstance(index, six.string_types):
 *             child = arr.GetFieldByName(tobytes(index))
 *             if child == nullptr:             # <<<<<<<<<<<<<<
 *                 raise KeyError(index)
 *         elif isinstance(index, six.integer_types):
 */
    __pyx_t_4 = ((__pyx_v_child == nullptr) != 0);
    if (unlikely(__pyx_t_4)) {

      /* "pyarrow/array.pxi":1854
 *             child = arr.GetFieldByName(tobytes(index))
 *             if child == nullptr:
 *                 raise KeyError(index)             # <<<<<<<<<<<<<<
 *         elif isinstance(index, six.integer_types):
 *             child = arr.field(
 */
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(1, 1854, __pyx_L1_error)

      /* "pyarrow/array.pxi":1853
 *         if isinstance(index, six.string_types):
 *             child = arr.GetFieldByName(tobytes(index))
 *             if child == nullptr:             # <<<<<<<<<<<<<<
 *                 raise KeyError(index)
 *         elif isinstance(index, six.integer_types):
 */
    }

    /* "pyarrow/array.pxi":1851
 *             shared_ptr[CArray] child
 * 
 *         if isinstance(index, six.string_types):             # <<<<<<<<<<<<<<
 *             child = arr.GetFieldByName(tobytes(index))
 *             if child == nullptr:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/array.pxi":1855
 *             if child == nullptr:
 *                 raise KeyError(index)
 *         elif isinstance(index, six.integer_types):             # <<<<<<<<<<<<<<
 *             child = arr.field(
 *                 <int>_normalize_index(index, self.ap.num_fields()))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_six); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1855, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_integer_types); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1855, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = PyObject_IsInstance(__pyx_v_index, __pyx_t_1); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1855, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (likely(__pyx_t_3)) {

    /* "pyarrow/array.pxi":1857
 *         elif isinstance(index, six.integer_types):
 *             child = arr.field(
 *                 <int>_normalize_index(index, self.ap.num_fields()))             # <<<<<<<<<<<<<<
 *         else:
 *             raise TypeError('Expected integer or string index')
 */
    __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1857, __pyx_L1_error)
    __pyx_t_8 = __pyx_f_7pyarrow_3lib__normalize_index(__pyx_t_7, __pyx_v_self->__pyx_base.ap->num_fields()); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1L))) __PYX_ERR(1, 1857, __pyx_L1_error)

    /* "pyarrow/array.pxi":1856
 *                 raise KeyError(index)
 *         elif isinstance(index, six.integer_types):
 *             child = arr.field(             # <<<<<<<<<<<<<<
 *                 <int>_normalize_index(index, self.ap.num_fields()))
 *         else:
 */
    __pyx_v_child = __pyx_v_arr->field(((int)__pyx_t_8));

    /* "pyarrow/array.pxi":1855
 *             if child == nullptr:
 *                 raise KeyError(index)
 *         elif isinstance(index, six.integer_types):             # <<<<<<<<<<<<<<
 *             child = arr.field(
 *                 <int>_normalize_index(index, self.ap.num_fields()))
 */
    goto __pyx_L3;
  }

  /* "pyarrow/array.pxi":1859
 *                 <int>_normalize_index(index, self.ap.num_fields()))
 *         else:
 *             raise TypeError('Expected integer or string index')             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_array(child)
 */
  /*else*/ {
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1859, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(1, 1859, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "pyarrow/array.pxi":1861
 *             raise TypeError('Expected integer or string index')
 * 
 *         return pyarrow_wrap_array(child)             # <<<<<<<<<<<<<<
 * 
 *     def flatten(self, MemoryPool memory_pool=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_child); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1861, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1834
 *     """
 * 
 *     def field(self, index):             # <<<<<<<<<<<<<<
 *         """
 *         Retrieves the child array belonging to field
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.StructArray.field", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1863
 *         return pyarrow_wrap_array(child)
 * 
 *     def flatten(self, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Flatten this StructArray, returning one individual array for each
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11StructArray_3flatten(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11StructArray_2flatten[] = "StructArray.flatten(self, MemoryPool memory_pool=None)\n\n        Flatten this StructArray, returning one individual array for each\n        field in the struct.\n\n        Parameters\n        ----------\n        memory_pool : MemoryPool, default None\n            For memory allocations, if required, otherwise use default pool\n\n        Returns\n        -------\n        result : List[Array]\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11StructArray_3flatten(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flatten (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_memory_pool,0};
    PyObject* values[1] = {0};
    values[0] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "flatten") < 0)) __PYX_ERR(1, 1863, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("flatten", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1863, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.StructArray.flatten", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(1, 1863, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_11StructArray_2flatten(((struct __pyx_obj_7pyarrow_3lib_StructArray *)__pyx_v_self), __pyx_v_memory_pool);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11StructArray_2flatten(struct __pyx_obj_7pyarrow_3lib_StructArray *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool) {
  std::vector<std::shared_ptr< arrow::Array> >  __pyx_v_arrays;
   arrow::MemoryPool *__pyx_v_pool;
   arrow::StructArray *__pyx_v_sarr;
  std::shared_ptr< arrow::Array>  __pyx_8genexpr6__pyx_v_arr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  std::vector<std::shared_ptr< arrow::Array> > ::iterator __pyx_t_3;
  std::shared_ptr< arrow::Array>  __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("flatten", 0);

  /* "pyarrow/array.pxi":1879
 *         cdef:
 *             vector[shared_ptr[CArray]] arrays
 *             CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)             # <<<<<<<<<<<<<<
 *             CStructArray* sarr = <CStructArray*> self.ap
 * 
 */
  __pyx_v_pool = __pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(__pyx_v_memory_pool);

  /* "pyarrow/array.pxi":1880
 *             vector[shared_ptr[CArray]] arrays
 *             CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)
 *             CStructArray* sarr = <CStructArray*> self.ap             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_v_sarr = (( arrow::StructArray *)__pyx_v_self->__pyx_base.ap);

  /* "pyarrow/array.pxi":1882
 *             CStructArray* sarr = <CStructArray*> self.ap
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(sarr.Flatten(pool, &arrays))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":1883
 * 
 *         with nogil:
 *             check_status(sarr.Flatten(pool, &arrays))             # <<<<<<<<<<<<<<
 * 
 *         return [pyarrow_wrap_array(arr) for arr in arrays]
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_sarr->Flatten(__pyx_v_pool, (&__pyx_v_arrays))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1883, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":1882
 *             CStructArray* sarr = <CStructArray*> self.ap
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(sarr.Flatten(pool, &arrays))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/array.pxi":1885
 *             check_status(sarr.Flatten(pool, &arrays))
 * 
 *         return [pyarrow_wrap_array(arr) for arr in arrays]             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1885, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_v_arrays.begin();
    for (;;) {
      if (!(__pyx_t_3 != __pyx_v_arrays.end())) break;
      __pyx_t_4 = *__pyx_t_3;
      ++__pyx_t_3;
      __pyx_8genexpr6__pyx_v_arr = __pyx_t_4;
      __pyx_t_5 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_8genexpr6__pyx_v_arr); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1885, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 1885, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  } /* exit inner scope */
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1863
 *         return pyarrow_wrap_array(child)
 * 
 *     def flatten(self, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Flatten this StructArray, returning one individual array for each
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.StructArray.flatten", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1888
 * 
 *     @staticmethod
 *     def from_arrays(arrays, names=None, fields=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct StructArray from collection of arrays representing
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11StructArray_5from_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11StructArray_4from_arrays[] = "StructArray.from_arrays(arrays, names=None, fields=None)\n\n        Construct StructArray from collection of arrays representing\n        each field in the struct.\n\n        Either field names or field instances must be passed.\n\n        Parameters\n        ----------\n        arrays : sequence of Array\n        names : List[str] (optional)\n            Field names for each struct child\n        fields : List[Field] (optional)\n            Field instances for each struct child\n\n        Returns\n        -------\n        result : StructArray\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_11StructArray_5from_arrays = {"from_arrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_11StructArray_5from_arrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_11StructArray_4from_arrays};
static PyObject *__pyx_pw_7pyarrow_3lib_11StructArray_5from_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_arrays = 0;
  PyObject *__pyx_v_names = 0;
  PyObject *__pyx_v_fields = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_arrays (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arrays,&__pyx_n_s_names,&__pyx_n_s_fields,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arrays)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_names);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fields);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_arrays") < 0)) __PYX_ERR(1, 1888, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_arrays = values[0];
    __pyx_v_names = values[1];
    __pyx_v_fields = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_arrays", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1888, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.StructArray.from_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_11StructArray_4from_arrays(__pyx_v_arrays, __pyx_v_names, __pyx_v_fields);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11StructArray_4from_arrays(PyObject *__pyx_v_arrays, PyObject *__pyx_v_names, PyObject *__pyx_v_fields) {
  std::vector<std::shared_ptr< arrow::Array> >  __pyx_v_c_arrays;
  std::vector<std::string>  __pyx_v_c_names;
  std::vector<std::shared_ptr< arrow::Field> >  __pyx_v_c_fields;
  arrow::Result<std::shared_ptr< arrow::Array> >  __pyx_v_c_result;
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_py_field = 0;
  PyObject *__pyx_v_arr = NULL;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_item = NULL;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_result = 0;
  PyObject *__pyx_8genexpr7__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  std::string __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  std::shared_ptr< arrow::Array>  __pyx_t_15;
  __Pyx_RefNannySetupContext("from_arrays", 0);
  __Pyx_INCREF(__pyx_v_arrays);

  /* "pyarrow/array.pxi":1919
 *             DataType struct_type
 * 
 *         if names is None and fields is None:             # <<<<<<<<<<<<<<
 *             raise ValueError('Must pass either names or fields')
 *         if names is not None and fields is not None:
 */
  __pyx_t_2 = (__pyx_v_names == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_fields == Py_None);
  __pyx_t_2 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/array.pxi":1920
 * 
 *         if names is None and fields is None:
 *             raise ValueError('Must pass either names or fields')             # <<<<<<<<<<<<<<
 *         if names is not None and fields is not None:
 *             raise ValueError('Must pass either names or fields, not both')
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__151, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1920, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(1, 1920, __pyx_L1_error)

    /* "pyarrow/array.pxi":1919
 *             DataType struct_type
 * 
 *         if names is None and fields is None:             # <<<<<<<<<<<<<<
 *             raise ValueError('Must pass either names or fields')
 *         if names is not None and fields is not None:
 */
  }

  /* "pyarrow/array.pxi":1921
 *         if names is None and fields is None:
 *             raise ValueError('Must pass either names or fields')
 *         if names is not None and fields is not None:             # <<<<<<<<<<<<<<
 *             raise ValueError('Must pass either names or fields, not both')
 * 
 */
  __pyx_t_2 = (__pyx_v_names != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_fields != Py_None);
  __pyx_t_2 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L7_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/array.pxi":1922
 *             raise ValueError('Must pass either names or fields')
 *         if names is not None and fields is not None:
 *             raise ValueError('Must pass either names or fields, not both')             # <<<<<<<<<<<<<<
 * 
 *         arrays = [asarray(x) for x in arrays]
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__152, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1922, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(1, 1922, __pyx_L1_error)

    /* "pyarrow/array.pxi":1921
 *         if names is None and fields is None:
 *             raise ValueError('Must pass either names or fields')
 *         if names is not None and fields is not None:             # <<<<<<<<<<<<<<
 *             raise ValueError('Must pass either names or fields, not both')
 * 
 */
  }

  /* "pyarrow/array.pxi":1924
 *             raise ValueError('Must pass either names or fields, not both')
 * 
 *         arrays = [asarray(x) for x in arrays]             # <<<<<<<<<<<<<<
 *         for arr in arrays:
 *             c_arrays.push_back(pyarrow_unwrap_array(arr))
 */
  { /* enter inner scope */
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1924, __pyx_L11_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (likely(PyList_CheckExact(__pyx_v_arrays)) || PyTuple_CheckExact(__pyx_v_arrays)) {
      __pyx_t_5 = __pyx_v_arrays; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_arrays); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1924, __pyx_L11_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1924, __pyx_L11_error)
    }
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(1, 1924, __pyx_L11_error)
          #else
          __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1924, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(1, 1924, __pyx_L11_error)
          #else
          __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1924, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        }
      } else {
        __pyx_t_8 = __pyx_t_7(__pyx_t_5);
        if (unlikely(!__pyx_t_8)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(1, 1924, __pyx_L11_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_8);
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v_x, __pyx_t_8);
      __pyx_t_8 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_asarray); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1924, __pyx_L11_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
        }
      }
      __pyx_t_8 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, __pyx_8genexpr7__pyx_v_x) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_8genexpr7__pyx_v_x);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1924, __pyx_L11_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_8))) __PYX_ERR(1, 1924, __pyx_L11_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_x); __pyx_8genexpr7__pyx_v_x = 0;
    goto __pyx_L14_exit_scope;
    __pyx_L11_error:;
    __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_x); __pyx_8genexpr7__pyx_v_x = 0;
    goto __pyx_L1_error;
    __pyx_L14_exit_scope:;
  } /* exit inner scope */
  __Pyx_DECREF_SET(__pyx_v_arrays, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyarrow/array.pxi":1925
 * 
 *         arrays = [asarray(x) for x in arrays]
 *         for arr in arrays:             # <<<<<<<<<<<<<<
 *             c_arrays.push_back(pyarrow_unwrap_array(arr))
 *         if names is not None:
 */
  if (likely(PyList_CheckExact(__pyx_v_arrays)) || PyTuple_CheckExact(__pyx_v_arrays)) {
    __pyx_t_4 = __pyx_v_arrays; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_arrays); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1925, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1925, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(1, 1925, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1925, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(1, 1925, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1925, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_7(__pyx_t_4);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(1, 1925, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_arr, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "pyarrow/array.pxi":1926
 *         arrays = [asarray(x) for x in arrays]
 *         for arr in arrays:
 *             c_arrays.push_back(pyarrow_unwrap_array(arr))             # <<<<<<<<<<<<<<
 *         if names is not None:
 *             for name in names:
 */
    try {
      __pyx_v_c_arrays.push_back(__pyx_f_7pyarrow_3lib_pyarrow_unwrap_array(__pyx_v_arr));
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(1, 1926, __pyx_L1_error)
    }

    /* "pyarrow/array.pxi":1925
 * 
 *         arrays = [asarray(x) for x in arrays]
 *         for arr in arrays:             # <<<<<<<<<<<<<<
 *             c_arrays.push_back(pyarrow_unwrap_array(arr))
 *         if names is not None:
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/array.pxi":1927
 *         for arr in arrays:
 *             c_arrays.push_back(pyarrow_unwrap_array(arr))
 *         if names is not None:             # <<<<<<<<<<<<<<
 *             for name in names:
 *                 c_names.push_back(tobytes(name))
 */
  __pyx_t_1 = (__pyx_v_names != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":1928
 *             c_arrays.push_back(pyarrow_unwrap_array(arr))
 *         if names is not None:
 *             for name in names:             # <<<<<<<<<<<<<<
 *                 c_names.push_back(tobytes(name))
 *         else:
 */
    if (likely(PyList_CheckExact(__pyx_v_names)) || PyTuple_CheckExact(__pyx_v_names)) {
      __pyx_t_4 = __pyx_v_names; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_names); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1928, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1928, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(1, 1928, __pyx_L1_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1928, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(1, 1928, __pyx_L1_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1928, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        }
      } else {
        __pyx_t_5 = __pyx_t_7(__pyx_t_4);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(1, 1928, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "pyarrow/array.pxi":1929
 *         if names is not None:
 *             for name in names:
 *                 c_names.push_back(tobytes(name))             # <<<<<<<<<<<<<<
 *         else:
 *             for item in fields:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1929, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
        }
      }
      __pyx_t_5 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_name);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1929, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_11 = __pyx_convert_string_from_py_std__in_string(__pyx_t_5); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1929, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      try {
        __pyx_v_c_names.push_back(__pyx_t_11);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(1, 1929, __pyx_L1_error)
      }

      /* "pyarrow/array.pxi":1928
 *             c_arrays.push_back(pyarrow_unwrap_array(arr))
 *         if names is not None:
 *             for name in names:             # <<<<<<<<<<<<<<
 *                 c_names.push_back(tobytes(name))
 *         else:
 */
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/array.pxi":1927
 *         for arr in arrays:
 *             c_arrays.push_back(pyarrow_unwrap_array(arr))
 *         if names is not None:             # <<<<<<<<<<<<<<
 *             for name in names:
 *                 c_names.push_back(tobytes(name))
 */
    goto __pyx_L17;
  }

  /* "pyarrow/array.pxi":1931
 *                 c_names.push_back(tobytes(name))
 *         else:
 *             for item in fields:             # <<<<<<<<<<<<<<
 *                 if isinstance(item, tuple):
 *                     py_field = field(*item)
 */
  /*else*/ {
    if (likely(PyList_CheckExact(__pyx_v_fields)) || PyTuple_CheckExact(__pyx_v_fields)) {
      __pyx_t_4 = __pyx_v_fields; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_fields); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1931, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1931, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(1, 1931, __pyx_L1_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1931, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(1, 1931, __pyx_L1_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1931, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        }
      } else {
        __pyx_t_5 = __pyx_t_7(__pyx_t_4);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(1, 1931, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "pyarrow/array.pxi":1932
 *         else:
 *             for item in fields:
 *                 if isinstance(item, tuple):             # <<<<<<<<<<<<<<
 *                     py_field = field(*item)
 *                 else:
 */
      __pyx_t_2 = PyTuple_Check(__pyx_v_item); 
      __pyx_t_1 = (__pyx_t_2 != 0);
      if (__pyx_t_1) {

        /* "pyarrow/array.pxi":1933
 *             for item in fields:
 *                 if isinstance(item, tuple):
 *                     py_field = field(*item)             # <<<<<<<<<<<<<<
 *                 else:
 *                     py_field = item
 */
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_field); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1933, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_8 = __Pyx_PySequence_Tuple(__pyx_v_item); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1933, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1933, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(1, 1933, __pyx_L1_error)
        __Pyx_XDECREF_SET(__pyx_v_py_field, ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_9));
        __pyx_t_9 = 0;

        /* "pyarrow/array.pxi":1932
 *         else:
 *             for item in fields:
 *                 if isinstance(item, tuple):             # <<<<<<<<<<<<<<
 *                     py_field = field(*item)
 *                 else:
 */
        goto __pyx_L22;
      }

      /* "pyarrow/array.pxi":1935
 *                     py_field = field(*item)
 *                 else:
 *                     py_field = item             # <<<<<<<<<<<<<<
 *                 c_fields.push_back(py_field.sp_field)
 * 
 */
      /*else*/ {
        if (!(likely(((__pyx_v_item) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_item, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(1, 1935, __pyx_L1_error)
        __pyx_t_9 = __pyx_v_item;
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_XDECREF_SET(__pyx_v_py_field, ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_9));
        __pyx_t_9 = 0;
      }
      __pyx_L22:;

      /* "pyarrow/array.pxi":1936
 *                 else:
 *                     py_field = item
 *                 c_fields.push_back(py_field.sp_field)             # <<<<<<<<<<<<<<
 * 
 *         if (c_arrays.size() == 0 and c_names.size() == 0 and
 */
      try {
        __pyx_v_c_fields.push_back(__pyx_v_py_field->sp_field);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(1, 1936, __pyx_L1_error)
      }

      /* "pyarrow/array.pxi":1931
 *                 c_names.push_back(tobytes(name))
 *         else:
 *             for item in fields:             # <<<<<<<<<<<<<<
 *                 if isinstance(item, tuple):
 *                     py_field = field(*item)
 */
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_L17:;

  /* "pyarrow/array.pxi":1938
 *                 c_fields.push_back(py_field.sp_field)
 * 
 *         if (c_arrays.size() == 0 and c_names.size() == 0 and             # <<<<<<<<<<<<<<
 *                 c_fields.size() == 0):
 *             # The C++ side doesn't allow this
 */
  __pyx_t_2 = ((__pyx_v_c_arrays.size() == 0) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L24_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_c_names.size() == 0) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L24_bool_binop_done;
  }

  /* "pyarrow/array.pxi":1939
 * 
 *         if (c_arrays.size() == 0 and c_names.size() == 0 and
 *                 c_fields.size() == 0):             # <<<<<<<<<<<<<<
 *             # The C++ side doesn't allow this
 *             return array([], struct([]))
 */
  __pyx_t_2 = ((__pyx_v_c_fields.size() == 0) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L24_bool_binop_done:;

  /* "pyarrow/array.pxi":1938
 *                 c_fields.push_back(py_field.sp_field)
 * 
 *         if (c_arrays.size() == 0 and c_names.size() == 0 and             # <<<<<<<<<<<<<<
 *                 c_fields.size() == 0):
 *             # The C++ side doesn't allow this
 */
  if (__pyx_t_1) {

    /* "pyarrow/array.pxi":1941
 *                 c_fields.size() == 0):
 *             # The C++ side doesn't allow this
 *             return array([], struct([]))             # <<<<<<<<<<<<<<
 * 
 *         if names is not None:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_array); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1941, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1941, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_struct); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1941, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_12 = PyList_New(0); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 1941, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_13 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_13)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_13);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
      }
    }
    __pyx_t_5 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_13, __pyx_t_12) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_12);
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1941, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = NULL;
    __pyx_t_14 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_9, function);
        __pyx_t_14 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_9)) {
      PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_8, __pyx_t_5};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1941, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
      PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_8, __pyx_t_5};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1941, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    {
      __pyx_t_12 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 1941, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      if (__pyx_t_10) {
        __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_14, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_14, __pyx_t_5);
      __pyx_t_8 = 0;
      __pyx_t_5 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1941, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "pyarrow/array.pxi":1938
 *                 c_fields.push_back(py_field.sp_field)
 * 
 *         if (c_arrays.size() == 0 and c_names.size() == 0 and             # <<<<<<<<<<<<<<
 *                 c_fields.size() == 0):
 *             # The C++ side doesn't allow this
 */
  }

  /* "pyarrow/array.pxi":1943
 *             return array([], struct([]))
 * 
 *         if names is not None:             # <<<<<<<<<<<<<<
 *             # XXX Cannot pass "nullptr" for a shared_ptr<T> argument:
 *             # https://github.com/cython/cython/issues/3020
 */
  __pyx_t_1 = (__pyx_v_names != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":1946
 *             # XXX Cannot pass "nullptr" for a shared_ptr<T> argument:
 *             # https://github.com/cython/cython/issues/3020
 *             c_result = CStructArray.MakeFromFieldNames(             # <<<<<<<<<<<<<<
 *                 c_arrays, c_names, shared_ptr[CBuffer](), -1, 0)
 *         else:
 */
    __pyx_v_c_result =  arrow::StructArray::Make(__pyx_v_c_arrays, __pyx_v_c_names, std::shared_ptr< arrow::Buffer> (), -1L, 0);

    /* "pyarrow/array.pxi":1943
 *             return array([], struct([]))
 * 
 *         if names is not None:             # <<<<<<<<<<<<<<
 *             # XXX Cannot pass "nullptr" for a shared_ptr<T> argument:
 *             # https://github.com/cython/cython/issues/3020
 */
    goto __pyx_L27;
  }

  /* "pyarrow/array.pxi":1949
 *                 c_arrays, c_names, shared_ptr[CBuffer](), -1, 0)
 *         else:
 *             c_result = CStructArray.MakeFromFields(             # <<<<<<<<<<<<<<
 *                 c_arrays, c_fields, shared_ptr[CBuffer](), -1, 0)
 *         cdef Array result = pyarrow_wrap_array(GetResultValue(c_result))
 */
  /*else*/ {

    /* "pyarrow/array.pxi":1950
 *         else:
 *             c_result = CStructArray.MakeFromFields(
 *                 c_arrays, c_fields, shared_ptr[CBuffer](), -1, 0)             # <<<<<<<<<<<<<<
 *         cdef Array result = pyarrow_wrap_array(GetResultValue(c_result))
 *         result.validate()
 */
    __pyx_v_c_result =  arrow::StructArray::Make(__pyx_v_c_arrays, __pyx_v_c_fields, std::shared_ptr< arrow::Buffer> (), -1L, 0);
  }
  __pyx_L27:;

  /* "pyarrow/array.pxi":1951
 *             c_result = CStructArray.MakeFromFields(
 *                 c_arrays, c_fields, shared_ptr[CBuffer](), -1, 0)
 *         cdef Array result = pyarrow_wrap_array(GetResultValue(c_result))             # <<<<<<<<<<<<<<
 *         result.validate()
 *         return result
 */
  __pyx_t_15 = arrow::py::GetResultValue<std::shared_ptr< arrow::Array> >(__pyx_v_c_result); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1951, __pyx_L1_error)
  __pyx_t_4 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_t_15); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1951, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1951, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyarrow/array.pxi":1952
 *                 c_arrays, c_fields, shared_ptr[CBuffer](), -1, 0)
 *         cdef Array result = pyarrow_wrap_array(GetResultValue(c_result))
 *         result.validate()             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_validate); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 1952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_12 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_12)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
    }
  }
  __pyx_t_4 = (__pyx_t_12) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_12) : __Pyx_PyObject_CallNoArg(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/array.pxi":1953
 *         cdef Array result = pyarrow_wrap_array(GetResultValue(c_result))
 *         result.validate()
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1888
 * 
 *     @staticmethod
 *     def from_arrays(arrays, names=None, fields=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct StructArray from collection of arrays representing
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("pyarrow.lib.StructArray.from_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_py_field);
  __Pyx_XDECREF(__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_arrays);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1962
 * 
 *     @property
 *     def storage(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             CExtensionArray* ext_array = <CExtensionArray*>(self.ap)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14ExtensionArray_7storage_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14ExtensionArray_7storage_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14ExtensionArray_7storage___get__(((struct __pyx_obj_7pyarrow_3lib_ExtensionArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14ExtensionArray_7storage___get__(struct __pyx_obj_7pyarrow_3lib_ExtensionArray *__pyx_v_self) {
   arrow::ExtensionArray *__pyx_v_ext_array;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/array.pxi":1964
 *     def storage(self):
 *         cdef:
 *             CExtensionArray* ext_array = <CExtensionArray*>(self.ap)             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_array(ext_array.storage())
 */
  __pyx_v_ext_array = (( arrow::ExtensionArray *)__pyx_v_self->__pyx_base.ap);

  /* "pyarrow/array.pxi":1966
 *             CExtensionArray* ext_array = <CExtensionArray*>(self.ap)
 * 
 *         return pyarrow_wrap_array(ext_array.storage())             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_ext_array->storage()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1966, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1962
 * 
 *     @property
 *     def storage(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             CExtensionArray* ext_array = <CExtensionArray*>(self.ap)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.ExtensionArray.storage.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1969
 * 
 *     @staticmethod
 *     def from_storage(BaseExtensionType typ, Array storage):             # <<<<<<<<<<<<<<
 *         """
 *         Construct ExtensionArray from type and storage array.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14ExtensionArray_1from_storage(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14ExtensionArray_from_storage[] = "ExtensionArray.from_storage(BaseExtensionType typ, Array storage)\n\n        Construct ExtensionArray from type and storage array.\n\n        Parameters\n        ----------\n        typ: DataType\n            The extension type for the result array.\n        storage: Array\n            The underlying storage for the result array.\n\n        Returns\n        -------\n        ext_array : ExtensionArray\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_14ExtensionArray_1from_storage = {"from_storage", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_14ExtensionArray_1from_storage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_14ExtensionArray_from_storage};
static PyObject *__pyx_pw_7pyarrow_3lib_14ExtensionArray_1from_storage(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_BaseExtensionType *__pyx_v_typ = 0;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_storage = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_storage (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_typ,&__pyx_n_s_storage,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_typ)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_storage)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_storage", 1, 2, 2, 1); __PYX_ERR(1, 1969, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_storage") < 0)) __PYX_ERR(1, 1969, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_typ = ((struct __pyx_obj_7pyarrow_3lib_BaseExtensionType *)values[0]);
    __pyx_v_storage = ((struct __pyx_obj_7pyarrow_3lib_Array *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_storage", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1969, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.ExtensionArray.from_storage", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_typ), __pyx_ptype_7pyarrow_3lib_BaseExtensionType, 1, "typ", 0))) __PYX_ERR(1, 1969, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_storage), __pyx_ptype_7pyarrow_3lib_Array, 1, "storage", 0))) __PYX_ERR(1, 1969, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_14ExtensionArray_from_storage(__pyx_v_typ, __pyx_v_storage);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14ExtensionArray_from_storage(struct __pyx_obj_7pyarrow_3lib_BaseExtensionType *__pyx_v_typ, struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_storage) {
  std::shared_ptr< arrow::ExtensionArray>  __pyx_v_ext_array;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  std::shared_ptr< arrow::ExtensionArray>  __pyx_t_7;
  __Pyx_RefNannySetupContext("from_storage", 0);

  /* "pyarrow/array.pxi":1987
 *             shared_ptr[CExtensionArray] ext_array
 * 
 *         if storage.type != typ.storage_type:             # <<<<<<<<<<<<<<
 *             raise TypeError("Incompatible storage type {0} "
 *                             "for extension type {1}".format(storage.type, typ))
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_typ), __pyx_n_s_storage_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1987, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_v_storage->type), __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1987, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(1, 1987, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(__pyx_t_3)) {

    /* "pyarrow/array.pxi":1989
 *         if storage.type != typ.storage_type:
 *             raise TypeError("Incompatible storage type {0} "
 *                             "for extension type {1}".format(storage.type, typ))             # <<<<<<<<<<<<<<
 * 
 *         ext_array = make_shared[CExtensionArray](typ.sp_type, storage.sp_array)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Incompatible_storage_type_0_for, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1989, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_5 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_storage->type), ((PyObject *)__pyx_v_typ)};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1989, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_storage->type), ((PyObject *)__pyx_v_typ)};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1989, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    {
      __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1989, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_storage->type));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_storage->type));
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_storage->type));
      __Pyx_INCREF(((PyObject *)__pyx_v_typ));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_typ));
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__pyx_v_typ));
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1989, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/array.pxi":1988
 * 
 *         if storage.type != typ.storage_type:
 *             raise TypeError("Incompatible storage type {0} "             # <<<<<<<<<<<<<<
 *                             "for extension type {1}".format(storage.type, typ))
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1988, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(1, 1988, __pyx_L1_error)

    /* "pyarrow/array.pxi":1987
 *             shared_ptr[CExtensionArray] ext_array
 * 
 *         if storage.type != typ.storage_type:             # <<<<<<<<<<<<<<
 *             raise TypeError("Incompatible storage type {0} "
 *                             "for extension type {1}".format(storage.type, typ))
 */
  }

  /* "pyarrow/array.pxi":1991
 *                             "for extension type {1}".format(storage.type, typ))
 * 
 *         ext_array = make_shared[CExtensionArray](typ.sp_type, storage.sp_array)             # <<<<<<<<<<<<<<
 *         cdef Array result = pyarrow_wrap_array(<shared_ptr[CArray]> ext_array)
 *         result.validate()
 */
  try {
    __pyx_t_7 = std::make_shared< arrow::ExtensionArray>(__pyx_v_typ->__pyx_base.sp_type, __pyx_v_storage->sp_array);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(1, 1991, __pyx_L1_error)
  }
  __pyx_v_ext_array = __pyx_t_7;

  /* "pyarrow/array.pxi":1992
 * 
 *         ext_array = make_shared[CExtensionArray](typ.sp_type, storage.sp_array)
 *         cdef Array result = pyarrow_wrap_array(<shared_ptr[CArray]> ext_array)             # <<<<<<<<<<<<<<
 *         result.validate()
 *         return result
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(((std::shared_ptr< arrow::Array> )__pyx_v_ext_array)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1992, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 1992, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":1993
 *         ext_array = make_shared[CExtensionArray](typ.sp_type, storage.sp_array)
 *         cdef Array result = pyarrow_wrap_array(<shared_ptr[CArray]> ext_array)
 *         result.validate()             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_validate); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":1994
 *         cdef Array result = pyarrow_wrap_array(<shared_ptr[CArray]> ext_array)
 *         result.validate()
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def _to_pandas(self, options, **kwargs):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1969
 * 
 *     @staticmethod
 *     def from_storage(BaseExtensionType typ, Array storage):             # <<<<<<<<<<<<<<
 *         """
 *         Construct ExtensionArray from type and storage array.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.ExtensionArray.from_storage", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1996
 *         return result
 * 
 *     def _to_pandas(self, options, **kwargs):             # <<<<<<<<<<<<<<
 *         result = Array._to_pandas(self, options, **kwargs)
 *         # TODO(wesm): is passing through these parameters to the storage array
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14ExtensionArray_3_to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14ExtensionArray_2_to_pandas[] = "ExtensionArray._to_pandas(self, options, **kwargs)";
static PyObject *__pyx_pw_7pyarrow_3lib_14ExtensionArray_3_to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_options = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_to_pandas (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_options,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "_to_pandas") < 0)) __PYX_ERR(1, 1996, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_options = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_to_pandas", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1996, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("pyarrow.lib.ExtensionArray._to_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_14ExtensionArray_2_to_pandas(((struct __pyx_obj_7pyarrow_3lib_ExtensionArray *)__pyx_v_self), __pyx_v_options, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14ExtensionArray_2_to_pandas(struct __pyx_obj_7pyarrow_3lib_ExtensionArray *__pyx_v_self, PyObject *__pyx_v_options, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("_to_pandas", 0);

  /* "pyarrow/array.pxi":1997
 * 
 *     def _to_pandas(self, options, **kwargs):
 *         result = Array._to_pandas(self, options, **kwargs)             # <<<<<<<<<<<<<<
 *         # TODO(wesm): is passing through these parameters to the storage array
 *         # correct?
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_Array), __pyx_n_s_to_pandas); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1997, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1997, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_options);
  __Pyx_GIVEREF(__pyx_v_options);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_options);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1997, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyarrow/array.pxi":2000
 *         # TODO(wesm): is passing through these parameters to the storage array
 *         # correct?
 *         return result.to_pandas(options, **kwargs)             # <<<<<<<<<<<<<<
 * 
 *     def to_numpy(self, **kwargs):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_to_pandas_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_options);
  __Pyx_GIVEREF(__pyx_v_options);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_options);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1996
 *         return result
 * 
 *     def _to_pandas(self, options, **kwargs):             # <<<<<<<<<<<<<<
 *         result = Array._to_pandas(self, options, **kwargs)
 *         # TODO(wesm): is passing through these parameters to the storage array
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.ExtensionArray._to_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":2002
 *         return result.to_pandas(options, **kwargs)
 * 
 *     def to_numpy(self, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         See Array.to_numpy
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14ExtensionArray_5to_numpy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14ExtensionArray_4to_numpy[] = "ExtensionArray.to_numpy(self, **kwargs)\n\n        See Array.to_numpy\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_14ExtensionArray_5to_numpy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_numpy (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("to_numpy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
  if (__pyx_kwds && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "to_numpy", 1))) return NULL;
  if (__pyx_kwds) {
    __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return NULL;
    __Pyx_GOTREF(__pyx_v_kwargs);
  } else {
    __pyx_v_kwargs = NULL;
  }
  __pyx_r = __pyx_pf_7pyarrow_3lib_14ExtensionArray_4to_numpy(((struct __pyx_obj_7pyarrow_3lib_ExtensionArray *)__pyx_v_self), __pyx_v_kwargs);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14ExtensionArray_4to_numpy(struct __pyx_obj_7pyarrow_3lib_ExtensionArray *__pyx_v_self, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("to_numpy", 0);

  /* "pyarrow/array.pxi":2006
 *         See Array.to_numpy
 *         """
 *         return self.storage.to_numpy(**kwargs)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_storage); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2006, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_to_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2006, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2006, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":2002
 *         return result.to_pandas(options, **kwargs)
 * 
 *     def to_numpy(self, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         See Array.to_numpy
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.ExtensionArray.to_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":2046
 * 
 * 
 * cdef object get_values(object obj, bint* is_series):             # <<<<<<<<<<<<<<
 *     if pandas_api.is_series(obj) or pandas_api.is_index(obj):
 *         result = pandas_api.get_values(obj)
 */

static PyObject *__pyx_f_7pyarrow_3lib_get_values(PyObject *__pyx_v_obj, int *__pyx_v_is_series) {
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("get_values", 0);

  /* "pyarrow/array.pxi":2047
 * 
 * cdef object get_values(object obj, bint* is_series):
 *     if pandas_api.is_series(obj) or pandas_api.is_index(obj):             # <<<<<<<<<<<<<<
 *         result = pandas_api.get_values(obj)
 *         is_series[0] = True
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_3lib__PandasAPIShim *)__pyx_v_7pyarrow_3lib_pandas_api->__pyx_vtab)->is_series(__pyx_v_7pyarrow_3lib_pandas_api, __pyx_v_obj, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2047, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(1, 2047, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_3lib__PandasAPIShim *)__pyx_v_7pyarrow_3lib_pandas_api->__pyx_vtab)->is_index(__pyx_v_7pyarrow_3lib_pandas_api, __pyx_v_obj, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2047, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(1, 2047, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "pyarrow/array.pxi":2048
 * cdef object get_values(object obj, bint* is_series):
 *     if pandas_api.is_series(obj) or pandas_api.is_index(obj):
 *         result = pandas_api.get_values(obj)             # <<<<<<<<<<<<<<
 *         is_series[0] = True
 *     elif isinstance(obj, np.ndarray):
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_3lib__PandasAPIShim *)__pyx_v_7pyarrow_3lib_pandas_api->__pyx_vtab)->get_values(__pyx_v_7pyarrow_3lib_pandas_api, __pyx_v_obj, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2048, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_result = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pyarrow/array.pxi":2049
 *     if pandas_api.is_series(obj) or pandas_api.is_index(obj):
 *         result = pandas_api.get_values(obj)
 *         is_series[0] = True             # <<<<<<<<<<<<<<
 *     elif isinstance(obj, np.ndarray):
 *         result = obj
 */
    (__pyx_v_is_series[0]) = 1;

    /* "pyarrow/array.pxi":2047
 * 
 * cdef object get_values(object obj, bint* is_series):
 *     if pandas_api.is_series(obj) or pandas_api.is_index(obj):             # <<<<<<<<<<<<<<
 *         result = pandas_api.get_values(obj)
 *         is_series[0] = True
 */
    goto __pyx_L3;
  }

  /* "pyarrow/array.pxi":2050
 *         result = pandas_api.get_values(obj)
 *         is_series[0] = True
 *     elif isinstance(obj, np.ndarray):             # <<<<<<<<<<<<<<
 *         result = obj
 *         is_series[0] = False
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_4); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2050, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/array.pxi":2051
 *         is_series[0] = True
 *     elif isinstance(obj, np.ndarray):
 *         result = obj             # <<<<<<<<<<<<<<
 *         is_series[0] = False
 *     else:
 */
    __Pyx_INCREF(__pyx_v_obj);
    __pyx_v_result = __pyx_v_obj;

    /* "pyarrow/array.pxi":2052
 *     elif isinstance(obj, np.ndarray):
 *         result = obj
 *         is_series[0] = False             # <<<<<<<<<<<<<<
 *     else:
 *         result = pandas_api.series(obj).values
 */
    (__pyx_v_is_series[0]) = 0;

    /* "pyarrow/array.pxi":2050
 *         result = pandas_api.get_values(obj)
 *         is_series[0] = True
 *     elif isinstance(obj, np.ndarray):             # <<<<<<<<<<<<<<
 *         result = obj
 *         is_series[0] = False
 */
    goto __pyx_L3;
  }

  /* "pyarrow/array.pxi":2054
 *         is_series[0] = False
 *     else:
 *         result = pandas_api.series(obj).values             # <<<<<<<<<<<<<<
 *         is_series[0] = False
 * 
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_7pyarrow_3lib_pandas_api), __pyx_n_s_series); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2054, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_obj);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2054, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_values); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2054, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_result = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pyarrow/array.pxi":2055
 *     else:
 *         result = pandas_api.series(obj).values
 *         is_series[0] = False             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
    (__pyx_v_is_series[0]) = 0;
  }
  __pyx_L3:;

  /* "pyarrow/array.pxi":2057
 *         is_series[0] = False
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":2046
 * 
 * 
 * cdef object get_values(object obj, bint* is_series):             # <<<<<<<<<<<<<<
 *     if pandas_api.is_series(obj) or pandas_api.is_index(obj):
 *         result = pandas_api.get_values(obj)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.get_values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":2060
 * 
 * 
 * def concat_arrays(arrays, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *     """
 *     Returns a concatenation of the given arrays. The contents of those arrays
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_143concat_arrays(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_142concat_arrays[] = "concat_arrays(arrays, MemoryPool memory_pool=None)\n\n    Returns a concatenation of the given arrays. The contents of those arrays\n    are copied into the returned array. Raises exception if all of the arrays\n    are not of the same type.\n\n    Parameters\n    ----------\n    arrays : iterable of pyarrow.Array objects\n    memory_pool : MemoryPool, default None\n        For memory allocations. If None, the default pool is used.\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_143concat_arrays = {"concat_arrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_143concat_arrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_142concat_arrays};
static PyObject *__pyx_pw_7pyarrow_3lib_143concat_arrays(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_arrays = 0;
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("concat_arrays (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arrays,&__pyx_n_s_memory_pool,0};
    PyObject* values[2] = {0,0};
    values[1] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arrays)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "concat_arrays") < 0)) __PYX_ERR(1, 2060, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_arrays = values[0];
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("concat_arrays", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 2060, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.concat_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(1, 2060, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_142concat_arrays(__pyx_self, __pyx_v_arrays, __pyx_v_memory_pool);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_142concat_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arrays, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool) {
  std::vector<std::shared_ptr< arrow::Array> >  __pyx_v_c_arrays;
  std::shared_ptr< arrow::Array>  __pyx_v_c_result;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_array = 0;
   arrow::MemoryPool *__pyx_v_pool;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("concat_arrays", 0);

  /* "pyarrow/array.pxi":2076
 *         shared_ptr[CArray] c_result
 *         Array array
 *         CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)             # <<<<<<<<<<<<<<
 * 
 *     for array in arrays:
 */
  __pyx_v_pool = __pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(__pyx_v_memory_pool);

  /* "pyarrow/array.pxi":2078
 *         CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)
 * 
 *     for array in arrays:             # <<<<<<<<<<<<<<
 *         c_arrays.push_back(array.sp_array)
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_arrays)) || PyTuple_CheckExact(__pyx_v_arrays)) {
    __pyx_t_1 = __pyx_v_arrays; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_arrays); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2078, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2078, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 2078, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2078, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 2078, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2078, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(1, 2078, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(1, 2078, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_array, ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "pyarrow/array.pxi":2079
 * 
 *     for array in arrays:
 *         c_arrays.push_back(array.sp_array)             # <<<<<<<<<<<<<<
 * 
 *     with nogil:
 */
    try {
      __pyx_v_c_arrays.push_back(__pyx_v_array->sp_array);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(1, 2079, __pyx_L1_error)
    }

    /* "pyarrow/array.pxi":2078
 *         CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)
 * 
 *     for array in arrays:             # <<<<<<<<<<<<<<
 *         c_arrays.push_back(array.sp_array)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":2081
 *         c_arrays.push_back(array.sp_array)
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(Concatenate(c_arrays, pool, &c_result))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":2082
 * 
 *     with nogil:
 *         check_status(Concatenate(c_arrays, pool, &c_result))             # <<<<<<<<<<<<<<
 * 
 *     return pyarrow_wrap_array(c_result)
 */
        __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(arrow::Concatenate(__pyx_v_c_arrays, __pyx_v_pool, (&__pyx_v_c_result))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 2082, __pyx_L6_error)
      }

      /* "pyarrow/array.pxi":2081
 *         c_arrays.push_back(array.sp_array)
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(Concatenate(c_arrays, pool, &c_result))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L7;
        }
        __pyx_L6_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L7:;
      }
  }

  /* "pyarrow/array.pxi":2084
 *         check_status(Concatenate(c_arrays, pool, &c_result))
 * 
 *     return pyarrow_wrap_array(c_result)             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_c_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2084, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":2060
 * 
 * 
 * def concat_arrays(arrays, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *     """
 *     Returns a concatenation of the given arrays. The contents of those arrays
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.concat_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_array);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/builder.pxi":32
 *         unique_ptr[CStringBuilder] builder
 * 
 *     def __cinit__(self, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         cdef CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)
 *         self.builder.reset(new CStringBuilder(pool))
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_13StringBuilder_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_13StringBuilder_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_memory_pool,0};
    PyObject* values[1] = {0};
    values[0] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(12, 32, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(12, 32, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.StringBuilder.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(12, 32, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_13StringBuilder___cinit__(((struct __pyx_obj_7pyarrow_3lib_StringBuilder *)__pyx_v_self), __pyx_v_memory_pool);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_13StringBuilder___cinit__(struct __pyx_obj_7pyarrow_3lib_StringBuilder *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool) {
   arrow::MemoryPool *__pyx_v_pool;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/builder.pxi":33
 * 
 *     def __cinit__(self, MemoryPool memory_pool=None):
 *         cdef CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)             # <<<<<<<<<<<<<<
 *         self.builder.reset(new CStringBuilder(pool))
 * 
 */
  __pyx_v_pool = __pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(__pyx_v_memory_pool);

  /* "pyarrow/builder.pxi":34
 *     def __cinit__(self, MemoryPool memory_pool=None):
 *         cdef CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)
 *         self.builder.reset(new CStringBuilder(pool))             # <<<<<<<<<<<<<<
 * 
 *     def append(self, value):
 */
  __pyx_v_self->builder.reset(new  arrow::StringBuilder(__pyx_v_pool));

  /* "pyarrow/builder.pxi":32
 *         unique_ptr[CStringBuilder] builder
 * 
 *     def __cinit__(self, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         cdef CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)
 *         self.builder.reset(new CStringBuilder(pool))
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/builder.pxi":36
 *         self.builder.reset(new CStringBuilder(pool))
 * 
 *     def append(self, value):             # <<<<<<<<<<<<<<
 *         """
 *         Append a single value to the builder. The value can either be a
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13StringBuilder_3append(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13StringBuilder_2append[] = "StringBuilder.append(self, value)\n\n        Append a single value to the builder. The value can either be a\n        string/bytes object or a null value (np.nan or None).\n\n        Parameters\n        ----------\n        value : string/bytes or np.nan/None\n            The value to append to the string array builder\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_13StringBuilder_3append(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("append (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13StringBuilder_2append(((struct __pyx_obj_7pyarrow_3lib_StringBuilder *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13StringBuilder_2append(struct __pyx_obj_7pyarrow_3lib_StringBuilder *__pyx_v_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  std::string __pyx_t_7;
  __Pyx_RefNannySetupContext("append", 0);

  /* "pyarrow/builder.pxi":46
 *             The value to append to the string array builder
 *         """
 *         if value is None or value is np.nan:             # <<<<<<<<<<<<<<
 *             self.builder.get().AppendNull()
 *         elif isinstance(value, (six.string_types, six.binary_type)):
 */
  __pyx_t_2 = (__pyx_v_value == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_nan); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__pyx_v_value == __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_2 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "pyarrow/builder.pxi":47
 *         """
 *         if value is None or value is np.nan:
 *             self.builder.get().AppendNull()             # <<<<<<<<<<<<<<
 *         elif isinstance(value, (six.string_types, six.binary_type)):
 *             self.builder.get().Append(tobytes(value))
 */
    (void)(__pyx_v_self->builder.get()->AppendNull());

    /* "pyarrow/builder.pxi":46
 *             The value to append to the string array builder
 *         """
 *         if value is None or value is np.nan:             # <<<<<<<<<<<<<<
 *             self.builder.get().AppendNull()
 *         elif isinstance(value, (six.string_types, six.binary_type)):
 */
    goto __pyx_L3;
  }

  /* "pyarrow/builder.pxi":48
 *         if value is None or value is np.nan:
 *             self.builder.get().AppendNull()
 *         elif isinstance(value, (six.string_types, six.binary_type)):             # <<<<<<<<<<<<<<
 *             self.builder.get().Append(tobytes(value))
 *         else:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_six); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_string_types); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_six); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_binary_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_value, __pyx_t_4); 
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_value, __pyx_t_6); 
  __pyx_t_2 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L6_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (likely(__pyx_t_2)) {

    /* "pyarrow/builder.pxi":49
 *             self.builder.get().AppendNull()
 *         elif isinstance(value, (six.string_types, six.binary_type)):
 *             self.builder.get().Append(tobytes(value))             # <<<<<<<<<<<<<<
 *         else:
 *             raise TypeError('StringBuilder only accepts string objects')
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 49, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_value);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 49, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = __pyx_convert_string_from_py_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(12, 49, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    (void)(__pyx_v_self->builder.get()->Append(__pyx_t_7));

    /* "pyarrow/builder.pxi":48
 *         if value is None or value is np.nan:
 *             self.builder.get().AppendNull()
 *         elif isinstance(value, (six.string_types, six.binary_type)):             # <<<<<<<<<<<<<<
 *             self.builder.get().Append(tobytes(value))
 *         else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/builder.pxi":51
 *             self.builder.get().Append(tobytes(value))
 *         else:
 *             raise TypeError('StringBuilder only accepts string objects')             # <<<<<<<<<<<<<<
 * 
 *     def append_values(self, values):
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__153, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 51, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(12, 51, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "pyarrow/builder.pxi":36
 *         self.builder.reset(new CStringBuilder(pool))
 * 
 *     def append(self, value):             # <<<<<<<<<<<<<<
 *         """
 *         Append a single value to the builder. The value can either be a
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.StringBuilder.append", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/builder.pxi":53
 *             raise TypeError('StringBuilder only accepts string objects')
 * 
 *     def append_values(self, values):             # <<<<<<<<<<<<<<
 *         """
 *         Append all the values in an iterable to the string array builder
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13StringBuilder_5append_values(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13StringBuilder_4append_values[] = "StringBuilder.append_values(self, values)\n\n        Append all the values in an iterable to the string array builder\n        object.\n\n        Parameters\n        ----------\n        values : iterable of string/bytes or np.nan/None values\n            The values to append to the string array builder\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_13StringBuilder_5append_values(PyObject *__pyx_v_self, PyObject *__pyx_v_values) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("append_values (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13StringBuilder_4append_values(((struct __pyx_obj_7pyarrow_3lib_StringBuilder *)__pyx_v_self), ((PyObject *)__pyx_v_values));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13StringBuilder_4append_values(struct __pyx_obj_7pyarrow_3lib_StringBuilder *__pyx_v_self, PyObject *__pyx_v_values) {
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("append_values", 0);

  /* "pyarrow/builder.pxi":63
 *             The values to append to the string array builder
 *         """
 *         for value in values:             # <<<<<<<<<<<<<<
 *             self.append(value)
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_values)) || PyTuple_CheckExact(__pyx_v_values)) {
    __pyx_t_1 = __pyx_v_values; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 63, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 63, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(12, 63, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 63, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(12, 63, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 63, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(12, 63, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/builder.pxi":64
 *         """
 *         for value in values:
 *             self.append(value)             # <<<<<<<<<<<<<<
 * 
 *     def finish(self):
 */
    __pyx_t_5 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self), __pyx_v_value); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(12, 64, __pyx_L1_error)

    /* "pyarrow/builder.pxi":63
 *             The values to append to the string array builder
 *         """
 *         for value in values:             # <<<<<<<<<<<<<<
 *             self.append(value)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/builder.pxi":53
 *             raise TypeError('StringBuilder only accepts string objects')
 * 
 *     def append_values(self, values):             # <<<<<<<<<<<<<<
 *         """
 *         Append all the values in an iterable to the string array builder
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.StringBuilder.append_values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/builder.pxi":66
 *             self.append(value)
 * 
 *     def finish(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return result of builder as an Array object; also resets the builder.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13StringBuilder_7finish(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13StringBuilder_6finish[] = "StringBuilder.finish(self)\n\n        Return result of builder as an Array object; also resets the builder.\n\n        Returns\n        -------\n        array : pyarrow.Array\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_13StringBuilder_7finish(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("finish (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13StringBuilder_6finish(((struct __pyx_obj_7pyarrow_3lib_StringBuilder *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13StringBuilder_6finish(struct __pyx_obj_7pyarrow_3lib_StringBuilder *__pyx_v_self) {
  std::shared_ptr< arrow::Array>  __pyx_v_out;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("finish", 0);

  /* "pyarrow/builder.pxi":75
 *         """
 *         cdef shared_ptr[CArray] out
 *         with nogil:             # <<<<<<<<<<<<<<
 *             self.builder.get().Finish(&out)
 *         return pyarrow_wrap_array(out)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/builder.pxi":76
 *         cdef shared_ptr[CArray] out
 *         with nogil:
 *             self.builder.get().Finish(&out)             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_array(out)
 * 
 */
        (void)(__pyx_v_self->builder.get()->Finish((&__pyx_v_out)));
      }

      /* "pyarrow/builder.pxi":75
 *         """
 *         cdef shared_ptr[CArray] out
 *         with nogil:             # <<<<<<<<<<<<<<
 *             self.builder.get().Finish(&out)
 *         return pyarrow_wrap_array(out)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/builder.pxi":77
 *         with nogil:
 *             self.builder.get().Finish(&out)
 *         return pyarrow_wrap_array(out)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_out); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/builder.pxi":66
 *             self.append(value)
 * 
 *     def finish(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return result of builder as an Array object; also resets the builder.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.StringBuilder.finish", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/builder.pxi":80
 * 
 *     @property
 *     def null_count(self):             # <<<<<<<<<<<<<<
 *         return self.builder.get().null_count()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13StringBuilder_10null_count_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_13StringBuilder_10null_count_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13StringBuilder_10null_count___get__(((struct __pyx_obj_7pyarrow_3lib_StringBuilder *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13StringBuilder_10null_count___get__(struct __pyx_obj_7pyarrow_3lib_StringBuilder *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/builder.pxi":81
 *     @property
 *     def null_count(self):
 *         return self.builder.get().null_count()             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->builder.get()->null_count()); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/builder.pxi":80
 * 
 *     @property
 *     def null_count(self):             # <<<<<<<<<<<<<<
 *         return self.builder.get().null_count()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.StringBuilder.null_count.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/builder.pxi":83
 *         return self.builder.get().null_count()
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.builder.get().length()
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_7pyarrow_3lib_13StringBuilder_9__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pw_7pyarrow_3lib_13StringBuilder_9__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13StringBuilder_8__len__(((struct __pyx_obj_7pyarrow_3lib_StringBuilder *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static Py_ssize_t __pyx_pf_7pyarrow_3lib_13StringBuilder_8__len__(struct __pyx_obj_7pyarrow_3lib_StringBuilder *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "pyarrow/builder.pxi":84
 * 
 *     def __len__(self):
 *         return self.builder.get().length()             # <<<<<<<<<<<<<<
 */
  __pyx_r = __pyx_v_self->builder.get()->length();
  goto __pyx_L0;

  /* "pyarrow/builder.pxi":83
 *         return self.builder.get().null_count()
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.builder.get().length()
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13StringBuilder_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13StringBuilder_10__reduce_cython__[] = "StringBuilder.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_13StringBuilder_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13StringBuilder_10__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_StringBuilder *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13StringBuilder_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_StringBuilder *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__154, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.StringBuilder.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13StringBuilder_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13StringBuilder_12__setstate_cython__[] = "StringBuilder.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_13StringBuilder_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13StringBuilder_12__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_StringBuilder *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13StringBuilder_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_StringBuilder *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__155, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.StringBuilder.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":30
 *     """
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.chunked_array = NULL
 * 
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_12ChunkedArray_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_12ChunkedArray_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray___cinit__(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_12ChunkedArray___cinit__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/table.pxi":31
 * 
 *     def __cinit__(self):
 *         self.chunked_array = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self):
 */
  __pyx_v_self->chunked_array = NULL;

  /* "pyarrow/table.pxi":30
 *     """
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.chunked_array = NULL
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":33
 *         self.chunked_array = NULL
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call ChunkedArray's constructor directly, use "
 *                         "`chunked_array` function instead.")
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_12ChunkedArray_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_12ChunkedArray_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_2__init__(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_12ChunkedArray_2__init__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/table.pxi":34
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call ChunkedArray's constructor directly, use "             # <<<<<<<<<<<<<<
 *                         "`chunked_array` function instead.")
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__156, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(6, 34, __pyx_L1_error)

  /* "pyarrow/table.pxi":33
 *         self.chunked_array = NULL
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call ChunkedArray's constructor directly, use "
 *                         "`chunked_array` function instead.")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":37
 *                         "`chunked_array` function instead.")
 * 
 *     cdef void init(self, const shared_ptr[CChunkedArray]& chunked_array):             # <<<<<<<<<<<<<<
 *         self.sp_chunked_array = chunked_array
 *         self.chunked_array = chunked_array.get()
 */

static void __pyx_f_7pyarrow_3lib_12ChunkedArray_init(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, std::shared_ptr< arrow::ChunkedArray>  const &__pyx_v_chunked_array) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/table.pxi":38
 * 
 *     cdef void init(self, const shared_ptr[CChunkedArray]& chunked_array):
 *         self.sp_chunked_array = chunked_array             # <<<<<<<<<<<<<<
 *         self.chunked_array = chunked_array.get()
 * 
 */
  __pyx_v_self->sp_chunked_array = __pyx_v_chunked_array;

  /* "pyarrow/table.pxi":39
 *     cdef void init(self, const shared_ptr[CChunkedArray]& chunked_array):
 *         self.sp_chunked_array = chunked_array
 *         self.chunked_array = chunked_array.get()             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  __pyx_v_self->chunked_array = __pyx_v_chunked_array.get();

  /* "pyarrow/table.pxi":37
 *                         "`chunked_array` function instead.")
 * 
 *     cdef void init(self, const shared_ptr[CChunkedArray]& chunked_array):             # <<<<<<<<<<<<<<
 *         self.sp_chunked_array = chunked_array
 *         self.chunked_array = chunked_array.get()
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/table.pxi":41
 *         self.chunked_array = chunked_array.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return chunked_array, (self.chunks, self.type)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_5__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_4__reduce__[] = "ChunkedArray.__reduce__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_5__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_4__reduce__(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_4__reduce__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pyarrow/table.pxi":42
 * 
 *     def __reduce__(self):
 *         return chunked_array, (self.chunks, self.type)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_chunked_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_chunks); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":41
 *         self.chunked_array = chunked_array.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return chunked_array, (self.chunks, self.type)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":45
 * 
 *     @property
 *     def data(self):             # <<<<<<<<<<<<<<
 *         import warnings
 *         warnings.warn("Calling .data on ChunkedArray is provided for "
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_4data_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_4data_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_4data___get__(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_4data___get__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self) {
  PyObject *__pyx_v_warnings = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/table.pxi":46
 *     @property
 *     def data(self):
 *         import warnings             # <<<<<<<<<<<<<<
 *         warnings.warn("Calling .data on ChunkedArray is provided for "
 *                       "compatibility after Column was removed, simply drop "
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_warnings, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_warnings = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":47
 *     def data(self):
 *         import warnings
 *         warnings.warn("Calling .data on ChunkedArray is provided for "             # <<<<<<<<<<<<<<
 *                       "compatibility after Column was removed, simply drop "
 *                       "this attribute", FutureWarning)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_warnings, __pyx_n_s_warn); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyarrow/table.pxi":49
 *         warnings.warn("Calling .data on ChunkedArray is provided for "
 *                       "compatibility after Column was removed, simply drop "
 *                       "this attribute", FutureWarning)             # <<<<<<<<<<<<<<
 *         return self
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__157, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/table.pxi":50
 *                       "compatibility after Column was removed, simply drop "
 *                       "this attribute", FutureWarning)
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pyarrow/table.pxi":45
 * 
 *     @property
 *     def data(self):             # <<<<<<<<<<<<<<
 *         import warnings
 *         warnings.warn("Calling .data on ChunkedArray is provided for "
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.data.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_warnings);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":53
 * 
 *     @property
 *     def type(self):             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_data_type(self.sp_chunked_array.get().type())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_4type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_4type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_4type___get__(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_4type___get__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/table.pxi":54
 *     @property
 *     def type(self):
 *         return pyarrow_wrap_data_type(self.sp_chunked_array.get().type())             # <<<<<<<<<<<<<<
 * 
 *     def length(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_self->sp_chunked_array.get()->type()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":53
 * 
 *     @property
 *     def type(self):             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_data_type(self.sp_chunked_array.get().type())
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":56
 *         return pyarrow_wrap_data_type(self.sp_chunked_array.get().type())
 * 
 *     def length(self):             # <<<<<<<<<<<<<<
 *         return self.chunked_array.length()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_7length(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_6length[] = "ChunkedArray.length(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_7length(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("length (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_6length(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_6length(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("length", 0);

  /* "pyarrow/table.pxi":57
 * 
 *     def length(self):
 *         return self.chunked_array.length()             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->chunked_array->length()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":56
 *         return pyarrow_wrap_data_type(self.sp_chunked_array.get().type())
 * 
 *     def length(self):             # <<<<<<<<<<<<<<
 *         return self.chunked_array.length()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.length", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":59
 *         return self.chunked_array.length()
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.length()
 * 
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_7pyarrow_3lib_12ChunkedArray_9__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pw_7pyarrow_3lib_12ChunkedArray_9__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_8__len__(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static Py_ssize_t __pyx_pf_7pyarrow_3lib_12ChunkedArray_8__len__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "pyarrow/table.pxi":60
 * 
 *     def __len__(self):
 *         return self.length()             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_length); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(6, 60, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":59
 *         return self.chunked_array.length()
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.length()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":62
 *         return self.length()
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         type_format = object.__repr__(self)
 *         return '{0}\n{1}'.format(type_format, str(self))
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_11__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_11__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_10__repr__(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_10__repr__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self) {
  PyObject *__pyx_v_type_format = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pyarrow/table.pxi":63
 * 
 *     def __repr__(self):
 *         type_format = object.__repr__(self)             # <<<<<<<<<<<<<<
 *         return '{0}\n{1}'.format(type_format, str(self))
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_repr); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self));
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_type_format = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":64
 *     def __repr__(self):
 *         type_format = object.__repr__(self)
 *         return '{0}\n{1}'.format(type_format, str(self))             # <<<<<<<<<<<<<<
 * 
 *     def format(self, int indent=0, int window=10):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_0_1, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_type_format, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 64, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_type_format, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 64, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 64, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(__pyx_v_type_format);
    __Pyx_GIVEREF(__pyx_v_type_format);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_type_format);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 64, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":62
 *         return self.length()
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         type_format = object.__repr__(self)
 *         return '{0}\n{1}'.format(type_format, str(self))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_type_format);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":66
 *         return '{0}\n{1}'.format(type_format, str(self))
 * 
 *     def format(self, int indent=0, int window=10):             # <<<<<<<<<<<<<<
 *         cdef:
 *             c_string result
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_13format(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_12format[] = "ChunkedArray.format(self, int indent=0, int window=10)";
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_13format(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_indent;
  int __pyx_v_window;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("format (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indent,&__pyx_n_s_window,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indent);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_window);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "format") < 0)) __PYX_ERR(6, 66, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_indent = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_indent == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 66, __pyx_L3_error)
    } else {
      __pyx_v_indent = ((int)0);
    }
    if (values[1]) {
      __pyx_v_window = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_window == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 66, __pyx_L3_error)
    } else {
      __pyx_v_window = ((int)10);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("format", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 66, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.format", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_12format(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self), __pyx_v_indent, __pyx_v_window);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_12format(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, int __pyx_v_indent, int __pyx_v_window) {
  std::string __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("format", 0);

  /* "pyarrow/table.pxi":70
 *             c_string result
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(
 *                 PrettyPrint(
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":71
 * 
 *         with nogil:
 *             check_status(             # <<<<<<<<<<<<<<
 *                 PrettyPrint(
 *                     deref(self.chunked_array),
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::PrettyPrint((*__pyx_v_self->chunked_array), arrow::PrettyPrintOptions(__pyx_v_indent, __pyx_v_window), (&__pyx_v_result))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 71, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":70
 *             c_string result
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(
 *                 PrettyPrint(
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/table.pxi":79
 *             )
 * 
 *         return frombytes(result)             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":66
 *         return '{0}\n{1}'.format(type_format, str(self))
 * 
 *     def format(self, int indent=0, int window=10):             # <<<<<<<<<<<<<<
 *         cdef:
 *             c_string result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.format", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":81
 *         return frombytes(result)
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self.format()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_15__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_15__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_14__str__(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_14__str__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "pyarrow/table.pxi":82
 * 
 *     def __str__(self):
 *         return self.format()             # <<<<<<<<<<<<<<
 * 
 *     def validate(self, *, full=False):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":81
 *         return frombytes(result)
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self.format()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":84
 *         return self.format()
 * 
 *     def validate(self, *, full=False):             # <<<<<<<<<<<<<<
 *         """
 *         Perform validation checks.  An exception is raised if validation fails.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_17validate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_16validate[] = "ChunkedArray.validate(self, *, full=False)\n\n        Perform validation checks.  An exception is raised if validation fails.\n\n        By default only cheap validation checks are run.  Pass `full=True`\n        for thorough validation checks (potentially O(n)).\n\n        Parameters\n        ----------\n        full: bool, default False\n            If True, run expensive checks, otherwise cheap checks only.\n\n        Raises\n        ------\n        ArrowInvalid\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_17validate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_full = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("validate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_full,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      if (kw_args == 1) {
        const Py_ssize_t index = 0;
        PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]);
        if (value) { values[index] = value; kw_args--; }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, 0, "validate") < 0)) __PYX_ERR(6, 84, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 0) {
      goto __pyx_L5_argtuple_error;
    } else {
    }
    __pyx_v_full = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("validate", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 84, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.validate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_16validate(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self), __pyx_v_full);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_16validate(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, PyObject *__pyx_v_full) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("validate", 0);

  /* "pyarrow/table.pxi":100
 *         ArrowInvalid
 *         """
 *         if full:             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 check_status(self.sp_chunked_array.get().ValidateFull())
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_full); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 100, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/table.pxi":101
 *         """
 *         if full:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(self.sp_chunked_array.get().ValidateFull())
 *         else:
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "pyarrow/table.pxi":102
 *         if full:
 *             with nogil:
 *                 check_status(self.sp_chunked_array.get().ValidateFull())             # <<<<<<<<<<<<<<
 *         else:
 *             with nogil:
 */
          __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->sp_chunked_array.get()->ValidateFull()); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 102, __pyx_L5_error)
        }

        /* "pyarrow/table.pxi":101
 *         """
 *         if full:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(self.sp_chunked_array.get().ValidateFull())
 *         else:
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L6;
          }
          __pyx_L5_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L6:;
        }
    }

    /* "pyarrow/table.pxi":100
 *         ArrowInvalid
 *         """
 *         if full:             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 check_status(self.sp_chunked_array.get().ValidateFull())
 */
    goto __pyx_L3;
  }

  /* "pyarrow/table.pxi":104
 *                 check_status(self.sp_chunked_array.get().ValidateFull())
 *         else:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(self.sp_chunked_array.get().Validate())
 * 
 */
  /*else*/ {
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "pyarrow/table.pxi":105
 *         else:
 *             with nogil:
 *                 check_status(self.sp_chunked_array.get().Validate())             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
          __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->sp_chunked_array.get()->Validate()); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 105, __pyx_L8_error)
        }

        /* "pyarrow/table.pxi":104
 *                 check_status(self.sp_chunked_array.get().ValidateFull())
 *         else:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(self.sp_chunked_array.get().Validate())
 * 
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L9;
          }
          __pyx_L8_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L9:;
        }
    }
  }
  __pyx_L3:;

  /* "pyarrow/table.pxi":84
 *         return self.format()
 * 
 *     def validate(self, *, full=False):             # <<<<<<<<<<<<<<
 *         """
 *         Perform validation checks.  An exception is raised if validation fails.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.validate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":108
 * 
 *     @property
 *     def null_count(self):             # <<<<<<<<<<<<<<
 *         """
 *         Number of null entires
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_10null_count_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_10null_count_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_10null_count___get__(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_10null_count___get__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/table.pxi":116
 *         int
 *         """
 *         return self.chunked_array.null_count()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->chunked_array->null_count()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":108
 * 
 *     @property
 *     def null_count(self):             # <<<<<<<<<<<<<<
 *         """
 *         Number of null entires
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.null_count.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":119
 * 
 *     @property
 *     def nbytes(self):             # <<<<<<<<<<<<<<
 *         """
 *         Total number of bytes consumed by the elements of the chunked array.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_6nbytes_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_6nbytes___get__(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_6nbytes___get__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self) {
  PyObject *__pyx_v_size = NULL;
  PyObject *__pyx_v_chunk = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/table.pxi":123
 *         Total number of bytes consumed by the elements of the chunked array.
 *         """
 *         size = 0             # <<<<<<<<<<<<<<
 *         for chunk in self.iterchunks():
 *             size += chunk.nbytes
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_size = __pyx_int_0;

  /* "pyarrow/table.pxi":124
 *         """
 *         size = 0
 *         for chunk in self.iterchunks():             # <<<<<<<<<<<<<<
 *             size += chunk.nbytes
 *         return size
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_iterchunks); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 124, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 124, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(6, 124, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 124, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(6, 124, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 124, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(6, 124, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_chunk, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/table.pxi":125
 *         size = 0
 *         for chunk in self.iterchunks():
 *             size += chunk.nbytes             # <<<<<<<<<<<<<<
 *         return size
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_chunk, __pyx_n_s_nbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 125, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_size, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 125, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_size, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/table.pxi":124
 *         """
 *         size = 0
 *         for chunk in self.iterchunks():             # <<<<<<<<<<<<<<
 *             size += chunk.nbytes
 *         return size
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/table.pxi":126
 *         for chunk in self.iterchunks():
 *             size += chunk.nbytes
 *         return size             # <<<<<<<<<<<<<<
 * 
 *     def __sizeof__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_size);
  __pyx_r = __pyx_v_size;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":119
 * 
 *     @property
 *     def nbytes(self):             # <<<<<<<<<<<<<<
 *         """
 *         Total number of bytes consumed by the elements of the chunked array.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_size);
  __Pyx_XDECREF(__pyx_v_chunk);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":128
 *         return size
 * 
 *     def __sizeof__(self):             # <<<<<<<<<<<<<<
 *         return super(ChunkedArray, self).__sizeof__() + self.nbytes
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_19__sizeof__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_18__sizeof__[] = "ChunkedArray.__sizeof__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_19__sizeof__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sizeof__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_18__sizeof__(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_18__sizeof__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__sizeof__", 0);

  /* "pyarrow/table.pxi":129
 * 
 *     def __sizeof__(self):
 *         return super(ChunkedArray, self).__sizeof__() + self.nbytes             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_7pyarrow_3lib_ChunkedArray));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7pyarrow_3lib_ChunkedArray));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_7pyarrow_3lib_ChunkedArray));
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self));
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sizeof); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_nbytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":128
 *         return size
 * 
 *     def __sizeof__(self):             # <<<<<<<<<<<<<<
 *         return super(ChunkedArray, self).__sizeof__() + self.nbytes
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.__sizeof__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pyarrow_3lib_12ChunkedArray_22generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/table.pxi":131
 *         return super(ChunkedArray, self).__sizeof__() + self.nbytes
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         for chunk in self.iterchunks():
 *             for item in chunk:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_21__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_21__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_20__iter__(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_20__iter__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10___iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10___iter__ *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_10___iter__(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_10___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10___iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(6, 131, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7pyarrow_3lib_12ChunkedArray_22generator8, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_ChunkedArray___iter, __pyx_n_s_pyarrow_lib); if (unlikely(!gen)) __PYX_ERR(6, 131, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7pyarrow_3lib_12ChunkedArray_22generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10___iter__ *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10___iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L8_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(6, 131, __pyx_L1_error)

  /* "pyarrow/table.pxi":132
 * 
 *     def __iter__(self):
 *         for chunk in self.iterchunks():             # <<<<<<<<<<<<<<
 *             for item in chunk:
 *                 yield item
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_iterchunks); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 132, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 132, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(6, 132, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 132, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(6, 132, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 132, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(6, 132, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_chunk);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_chunk, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/table.pxi":133
 *     def __iter__(self):
 *         for chunk in self.iterchunks():
 *             for item in chunk:             # <<<<<<<<<<<<<<
 *                 yield item
 * 
 */
    if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_chunk)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_chunk)) {
      __pyx_t_1 = __pyx_cur_scope->__pyx_v_chunk; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_chunk); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 133, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 133, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(6, 133, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 133, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(6, 133, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 133, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_7(__pyx_t_1);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(6, 133, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_item);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_item, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;

      /* "pyarrow/table.pxi":134
 *         for chunk in self.iterchunks():
 *             for item in chunk:
 *                 yield item             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, key):
 */
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_item);
      __pyx_r = __pyx_cur_scope->__pyx_v_item;
      __Pyx_XGIVEREF(__pyx_t_1);
      __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
      __Pyx_XGIVEREF(__pyx_t_2);
      __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
      __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
      __pyx_cur_scope->__pyx_t_3 = __pyx_t_5;
      __pyx_cur_scope->__pyx_t_4 = __pyx_t_6;
      __pyx_cur_scope->__pyx_t_5 = __pyx_t_7;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, yielding value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L8_resume_from_yield:;
      __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
      __pyx_cur_scope->__pyx_t_0 = 0;
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
      __pyx_cur_scope->__pyx_t_1 = 0;
      __Pyx_XGOTREF(__pyx_t_2);
      __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
      __pyx_t_5 = __pyx_cur_scope->__pyx_t_3;
      __pyx_t_6 = __pyx_cur_scope->__pyx_t_4;
      __pyx_t_7 = __pyx_cur_scope->__pyx_t_5;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(6, 134, __pyx_L1_error)

      /* "pyarrow/table.pxi":133
 *     def __iter__(self):
 *         for chunk in self.iterchunks():
 *             for item in chunk:             # <<<<<<<<<<<<<<
 *                 yield item
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/table.pxi":132
 * 
 *     def __iter__(self):
 *         for chunk in self.iterchunks():             # <<<<<<<<<<<<<<
 *             for item in chunk:
 *                 yield item
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "pyarrow/table.pxi":131
 *         return super(ChunkedArray, self).__sizeof__() + self.nbytes
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         for chunk in self.iterchunks():
 *             for item in chunk:
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":136
 *                 yield item
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         if isinstance(key, slice):
 *             return _normalize_slice(self, key)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_24__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_24__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_23__getitem__(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self), ((PyObject *)__pyx_v_key));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_23__getitem__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int64_t __pyx_t_8;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "pyarrow/table.pxi":137
 * 
 *     def __getitem__(self, key):
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return _normalize_slice(self, key)
 *         elif isinstance(key, six.integer_types):
 */
  __pyx_t_1 = PySlice_Check(__pyx_v_key); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":138
 *     def __getitem__(self, key):
 *         if isinstance(key, slice):
 *             return _normalize_slice(self, key)             # <<<<<<<<<<<<<<
 *         elif isinstance(key, six.integer_types):
 *             return self.getitem(key)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_normalize_slice); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 138, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_key};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 138, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_key};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 138, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 138, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_self));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_self));
      __Pyx_INCREF(__pyx_v_key);
      __Pyx_GIVEREF(__pyx_v_key);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_key);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 138, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "pyarrow/table.pxi":137
 * 
 *     def __getitem__(self, key):
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return _normalize_slice(self, key)
 *         elif isinstance(key, six.integer_types):
 */
  }

  /* "pyarrow/table.pxi":139
 *         if isinstance(key, slice):
 *             return _normalize_slice(self, key)
 *         elif isinstance(key, six.integer_types):             # <<<<<<<<<<<<<<
 *             return self.getitem(key)
 *         else:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_six); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_integer_types); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_key, __pyx_t_4); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 139, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (likely(__pyx_t_1)) {

    /* "pyarrow/table.pxi":140
 *             return _normalize_slice(self, key)
 *         elif isinstance(key, six.integer_types):
 *             return self.getitem(key)             # <<<<<<<<<<<<<<
 *         else:
 *             raise TypeError("key must either be a slice or integer")
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_8 = __Pyx_PyInt_As_int64_t(__pyx_v_key); if (unlikely((__pyx_t_8 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 140, __pyx_L1_error)
    __pyx_t_4 = ((struct __pyx_vtabstruct_7pyarrow_3lib_ChunkedArray *)__pyx_v_self->__pyx_vtab)->getitem(__pyx_v_self, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 140, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "pyarrow/table.pxi":139
 *         if isinstance(key, slice):
 *             return _normalize_slice(self, key)
 *         elif isinstance(key, six.integer_types):             # <<<<<<<<<<<<<<
 *             return self.getitem(key)
 *         else:
 */
  }

  /* "pyarrow/table.pxi":142
 *             return self.getitem(key)
 *         else:
 *             raise TypeError("key must either be a slice or integer")             # <<<<<<<<<<<<<<
 * 
 *     cdef getitem(self, int64_t i):
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__158, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 142, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(6, 142, __pyx_L1_error)
  }

  /* "pyarrow/table.pxi":136
 *                 yield item
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         if isinstance(key, slice):
 *             return _normalize_slice(self, key)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":144
 *             raise TypeError("key must either be a slice or integer")
 * 
 *     cdef getitem(self, int64_t i):             # <<<<<<<<<<<<<<
 *         cdef int j
 * 
 */

static PyObject *__pyx_f_7pyarrow_3lib_12ChunkedArray_getitem(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, int64_t __pyx_v_i) {
  int __pyx_v_j;
  PyObject *__pyx_v_index = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  long __pyx_t_3;
  long __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("getitem", 0);

  /* "pyarrow/table.pxi":147
 *         cdef int j
 * 
 *         index = _normalize_index(i, self.chunked_array.length())             # <<<<<<<<<<<<<<
 *         for j in range(self.num_chunks):
 *             if index < self.chunked_array.chunk(j).get().length():
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__normalize_index(__pyx_v_i, __pyx_v_self->chunked_array->length()); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1L))) __PYX_ERR(6, 147, __pyx_L1_error)
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_index = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/table.pxi":148
 * 
 *         index = _normalize_index(i, self.chunked_array.length())
 *         for j in range(self.num_chunks):             # <<<<<<<<<<<<<<
 *             if index < self.chunked_array.chunk(j).get().length():
 *                 return self.chunk(j)[index]
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_chunks); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_2); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(6, 148, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_t_3;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_j = __pyx_t_5;

    /* "pyarrow/table.pxi":149
 *         index = _normalize_index(i, self.chunked_array.length())
 *         for j in range(self.num_chunks):
 *             if index < self.chunked_array.chunk(j).get().length():             # <<<<<<<<<<<<<<
 *                 return self.chunk(j)[index]
 *             else:
 */
    __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_self->chunked_array->chunk(__pyx_v_j).get()->length()); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 149, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PyObject_RichCompare(__pyx_v_index, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 149, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(6, 149, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_7) {

      /* "pyarrow/table.pxi":150
 *         for j in range(self.num_chunks):
 *             if index < self.chunked_array.chunk(j).get().length():
 *                 return self.chunk(j)[index]             # <<<<<<<<<<<<<<
 *             else:
 *                 index -= self.chunked_array.chunk(j).get().length()
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_chunk); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 150, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 150, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      __pyx_t_6 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_9, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_8);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 150, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 150, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

      /* "pyarrow/table.pxi":149
 *         index = _normalize_index(i, self.chunked_array.length())
 *         for j in range(self.num_chunks):
 *             if index < self.chunked_array.chunk(j).get().length():             # <<<<<<<<<<<<<<
 *                 return self.chunk(j)[index]
 *             else:
 */
    }

    /* "pyarrow/table.pxi":152
 *                 return self.chunk(j)[index]
 *             else:
 *                 index -= self.chunked_array.chunk(j).get().length()             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, other):
 */
    /*else*/ {
      __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_self->chunked_array->chunk(__pyx_v_j).get()->length()); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 152, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = PyNumber_InPlaceSubtract(__pyx_v_index, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 152, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_6);
      __pyx_t_6 = 0;
    }
  }

  /* "pyarrow/table.pxi":144
 *             raise TypeError("key must either be a slice or integer")
 * 
 *     cdef getitem(self, int64_t i):             # <<<<<<<<<<<<<<
 *         cdef int j
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.getitem", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":154
 *                 index -= self.chunked_array.chunk(j).get().length()
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         try:
 *             return self.equals(other)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_26__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_26__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_25__eq__(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self), ((PyObject *)__pyx_v_other));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_25__eq__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("__eq__", 0);

  /* "pyarrow/table.pxi":155
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except TypeError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "pyarrow/table.pxi":156
 *     def __eq__(self, other):
 *         try:
 *             return self.equals(other)             # <<<<<<<<<<<<<<
 *         except TypeError:
 *             return NotImplemented
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_equals); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 156, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_other) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_other);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 156, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L7_try_return;

      /* "pyarrow/table.pxi":155
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except TypeError:
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/table.pxi":157
 *         try:
 *             return self.equals(other)
 *         except TypeError:             # <<<<<<<<<<<<<<
 *             return NotImplemented
 * 
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(6, 157, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);

      /* "pyarrow/table.pxi":158
 *             return self.equals(other)
 *         except TypeError:
 *             return NotImplemented             # <<<<<<<<<<<<<<
 * 
 *     def equals(self, ChunkedArray other):
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_builtin_NotImplemented);
      __pyx_r = __pyx_builtin_NotImplemented;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/table.pxi":155
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except TypeError:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "pyarrow/table.pxi":154
 *                 index -= self.chunked_array.chunk(j).get().length()
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         try:
 *             return self.equals(other)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":160
 *             return NotImplemented
 * 
 *     def equals(self, ChunkedArray other):             # <<<<<<<<<<<<<<
 *         """
 *         Return whether the contents of two chunked arrays are equal
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_28equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_27equals[] = "ChunkedArray.equals(self, ChunkedArray other)\n\n        Return whether the contents of two chunked arrays are equal\n\n        Parameters\n        ----------\n        other : pyarrow.ChunkedArray\n\n        Returns\n        -------\n        are_equal : boolean\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_28equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("equals (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_7pyarrow_3lib_ChunkedArray, 1, "other", 0))) __PYX_ERR(6, 160, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_27equals(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_27equals(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_other) {
   arrow::ChunkedArray *__pyx_v_this_arr;
   arrow::ChunkedArray *__pyx_v_other_arr;
  bool __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
   arrow::ChunkedArray *__pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("equals", 0);

  /* "pyarrow/table.pxi":173
 *         """
 *         cdef:
 *             CChunkedArray* this_arr = self.chunked_array             # <<<<<<<<<<<<<<
 *             CChunkedArray* other_arr = other.chunked_array
 *             c_bool result
 */
  __pyx_t_1 = __pyx_v_self->chunked_array;
  __pyx_v_this_arr = __pyx_t_1;

  /* "pyarrow/table.pxi":174
 *         cdef:
 *             CChunkedArray* this_arr = self.chunked_array
 *             CChunkedArray* other_arr = other.chunked_array             # <<<<<<<<<<<<<<
 *             c_bool result
 * 
 */
  __pyx_t_1 = __pyx_v_other->chunked_array;
  __pyx_v_other_arr = __pyx_t_1;

  /* "pyarrow/table.pxi":177
 *             c_bool result
 * 
 *         if other is None:             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_other) == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/table.pxi":178
 * 
 *         if other is None:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "pyarrow/table.pxi":177
 *             c_bool result
 * 
 *         if other is None:             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  }

  /* "pyarrow/table.pxi":180
 *             return False
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = this_arr.Equals(deref(other_arr))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":181
 * 
 *         with nogil:
 *             result = this_arr.Equals(deref(other_arr))             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
        __pyx_v_result = __pyx_v_this_arr->Equals((*__pyx_v_other_arr));
      }

      /* "pyarrow/table.pxi":180
 *             return False
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = this_arr.Equals(deref(other_arr))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L6;
        }
        __pyx_L6:;
      }
  }

  /* "pyarrow/table.pxi":183
 *             result = this_arr.Equals(deref(other_arr))
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def _to_pandas(self, options, **kwargs):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":160
 *             return NotImplemented
 * 
 *     def equals(self, ChunkedArray other):             # <<<<<<<<<<<<<<
 *         """
 *         Return whether the contents of two chunked arrays are equal
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.equals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":185
 *         return result
 * 
 *     def _to_pandas(self, options, **kwargs):             # <<<<<<<<<<<<<<
 *         return _array_like_to_pandas(self, options)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_30_to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_29_to_pandas[] = "ChunkedArray._to_pandas(self, options, **kwargs)";
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_30_to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_options = 0;
  CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_to_pandas (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_options,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "_to_pandas") < 0)) __PYX_ERR(6, 185, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_options = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_to_pandas", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 185, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray._to_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_29_to_pandas(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self), __pyx_v_options, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_29_to_pandas(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, PyObject *__pyx_v_options, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("_to_pandas", 0);

  /* "pyarrow/table.pxi":186
 * 
 *     def _to_pandas(self, options, **kwargs):
 *         return _array_like_to_pandas(self, options)             # <<<<<<<<<<<<<<
 * 
 *     def __array__(self, dtype=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__array_like_to_pandas(((PyObject *)__pyx_v_self), __pyx_v_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":185
 *         return result
 * 
 *     def _to_pandas(self, options, **kwargs):             # <<<<<<<<<<<<<<
 *         return _array_like_to_pandas(self, options)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray._to_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":188
 *         return _array_like_to_pandas(self, options)
 * 
 *     def __array__(self, dtype=None):             # <<<<<<<<<<<<<<
 *         cdef:
 *             PyObject* out
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_32__array__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_31__array__[] = "ChunkedArray.__array__(self, dtype=None)";
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_32__array__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_dtype = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__array__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dtype,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__array__") < 0)) __PYX_ERR(6, 188, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_dtype = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__array__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 188, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.__array__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_31__array__(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self), __pyx_v_dtype);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_31__array__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, PyObject *__pyx_v_dtype) {
  PyObject *__pyx_v_out;
  arrow::py::PandasOptions __pyx_v_c_options;
  PyObject *__pyx_v_values = 0;
  PyObject *__pyx_8genexpr8__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  int __pyx_t_13;
  __Pyx_RefNannySetupContext("__array__", 0);

  /* "pyarrow/table.pxi":194
 *             object values
 * 
 *         if self.type.id == _Type_EXTENSION:             # <<<<<<<<<<<<<<
 *             return (
 *                 chunked_array(
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::EXTENSION); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 194, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(6, 194, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "pyarrow/table.pxi":195
 * 
 *         if self.type.id == _Type_EXTENSION:
 *             return (             # <<<<<<<<<<<<<<
 *                 chunked_array(
 *                     [self.chunk(i).storage for i in range(self.num_chunks)]
 */
    __Pyx_XDECREF(__pyx_r);

    /* "pyarrow/table.pxi":196
 *         if self.type.id == _Type_EXTENSION:
 *             return (
 *                 chunked_array(             # <<<<<<<<<<<<<<
 *                     [self.chunk(i).storage for i in range(self.num_chunks)]
 *                 ).__array__(dtype)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_chunked_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 196, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    { /* enter inner scope */

      /* "pyarrow/table.pxi":197
 *             return (
 *                 chunked_array(
 *                     [self.chunk(i).storage for i in range(self.num_chunks)]             # <<<<<<<<<<<<<<
 *                 ).__array__(dtype)
 *             )
 */
      __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 197, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_chunks); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 197, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 197, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
        __pyx_t_6 = __pyx_t_7; __Pyx_INCREF(__pyx_t_6); __pyx_t_8 = 0;
        __pyx_t_9 = NULL;
      } else {
        __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 197, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 197, __pyx_L6_error)
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      for (;;) {
        if (likely(!__pyx_t_9)) {
          if (likely(PyList_CheckExact(__pyx_t_6))) {
            if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_6)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_7 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(6, 197, __pyx_L6_error)
            #else
            __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 197, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_7);
            #endif
          } else {
            if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(6, 197, __pyx_L6_error)
            #else
            __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 197, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_7);
            #endif
          }
        } else {
          __pyx_t_7 = __pyx_t_9(__pyx_t_6);
          if (unlikely(!__pyx_t_7)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(6, 197, __pyx_L6_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_7);
        }
        __Pyx_XDECREF_SET(__pyx_8genexpr8__pyx_v_i, __pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_chunk); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 197, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
          if (likely(__pyx_t_11)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_11);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_10, function);
          }
        }
        __pyx_t_7 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_11, __pyx_8genexpr8__pyx_v_i) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_8genexpr8__pyx_v_i);
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 197, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_storage); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 197, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_10))) __PYX_ERR(6, 197, __pyx_L6_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_i); __pyx_8genexpr8__pyx_v_i = 0;
      goto __pyx_L9_exit_scope;
      __pyx_L6_error:;
      __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_i); __pyx_8genexpr8__pyx_v_i = 0;
      goto __pyx_L1_error;
      __pyx_L9_exit_scope:;
    } /* exit inner scope */
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 196, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pyarrow/table.pxi":198
 *                 chunked_array(
 *                     [self.chunk(i).storage for i in range(self.num_chunks)]
 *                 ).__array__(dtype)             # <<<<<<<<<<<<<<
 *             )
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 198, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_v_dtype) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_dtype);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 198, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "pyarrow/table.pxi":194
 *             object values
 * 
 *         if self.type.id == _Type_EXTENSION:             # <<<<<<<<<<<<<<
 *             return (
 *                 chunked_array(
 */
  }

  /* "pyarrow/table.pxi":201
 *             )
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(libarrow.ConvertChunkedArrayToPandas(
 *                 c_options,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":202
 * 
 *         with nogil:
 *             check_status(libarrow.ConvertChunkedArrayToPandas(             # <<<<<<<<<<<<<<
 *                 c_options,
 *                 self.sp_chunked_array,
 */
        __pyx_t_12 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::ConvertChunkedArrayToPandas(__pyx_v_c_options, __pyx_v_self->sp_chunked_array, ((PyObject *)__pyx_v_self), (&__pyx_v_out))); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(6, 202, __pyx_L11_error)
      }

      /* "pyarrow/table.pxi":201
 *             )
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(libarrow.ConvertChunkedArrayToPandas(
 *                 c_options,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L12;
        }
        __pyx_L11_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L12:;
      }
  }

  /* "pyarrow/table.pxi":209
 *         # wrap_array_output uses pandas to convert to Categorical, here
 *         # always convert to numpy array
 *         values = PyObject_to_object(out)             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(values, dict):
 */
  __pyx_t_3 = __pyx_f_7pyarrow_8includes_6common_PyObject_to_object(__pyx_v_out); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_values = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyarrow/table.pxi":211
 *         values = PyObject_to_object(out)
 * 
 *         if isinstance(values, dict):             # <<<<<<<<<<<<<<
 *             values = np.take(values['dictionary'], values['indices'])
 * 
 */
  __pyx_t_4 = PyDict_Check(__pyx_v_values); 
  __pyx_t_13 = (__pyx_t_4 != 0);
  if (__pyx_t_13) {

    /* "pyarrow/table.pxi":212
 * 
 *         if isinstance(values, dict):
 *             values = np.take(values['dictionary'], values['indices'])             # <<<<<<<<<<<<<<
 * 
 *         if dtype is None:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 212, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_take); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 212, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_values, __pyx_n_u_dictionary); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 212, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_values, __pyx_n_u_indices); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 212, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_12 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_12 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_2, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 212, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_2, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 212, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    {
      __pyx_t_10 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 212, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_12, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_12, __pyx_t_5);
      __pyx_t_2 = 0;
      __pyx_t_5 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 212, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/table.pxi":211
 *         values = PyObject_to_object(out)
 * 
 *         if isinstance(values, dict):             # <<<<<<<<<<<<<<
 *             values = np.take(values['dictionary'], values['indices'])
 * 
 */
  }

  /* "pyarrow/table.pxi":214
 *             values = np.take(values['dictionary'], values['indices'])
 * 
 *         if dtype is None:             # <<<<<<<<<<<<<<
 *             return values
 *         return values.astype(dtype)
 */
  __pyx_t_13 = (__pyx_v_dtype == Py_None);
  __pyx_t_4 = (__pyx_t_13 != 0);
  if (__pyx_t_4) {

    /* "pyarrow/table.pxi":215
 * 
 *         if dtype is None:
 *             return values             # <<<<<<<<<<<<<<
 *         return values.astype(dtype)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_values);
    __pyx_r = __pyx_v_values;
    goto __pyx_L0;

    /* "pyarrow/table.pxi":214
 *             values = np.take(values['dictionary'], values['indices'])
 * 
 *         if dtype is None:             # <<<<<<<<<<<<<<
 *             return values
 *         return values.astype(dtype)
 */
  }

  /* "pyarrow/table.pxi":216
 *         if dtype is None:
 *             return values
 *         return values.astype(dtype)             # <<<<<<<<<<<<<<
 * 
 *     def cast(self, object target_type, bint safe=True):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_10 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_10)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_3 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_10, __pyx_v_dtype) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_dtype);
  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":188
 *         return _array_like_to_pandas(self, options)
 * 
 *     def __array__(self, dtype=None):             # <<<<<<<<<<<<<<
 *         cdef:
 *             PyObject* out
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.__array__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_values);
  __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":218
 *         return values.astype(dtype)
 * 
 *     def cast(self, object target_type, bint safe=True):             # <<<<<<<<<<<<<<
 *         """
 *         Cast values to another data type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_34cast(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_33cast[] = "ChunkedArray.cast(self, target_type, bool safe=True)\n\n        Cast values to another data type\n\n        Parameters\n        ----------\n        target_type : DataType\n            Type to cast to\n        safe : boolean, default True\n            Check for overflows or other unsafe conversions\n\n        Returns\n        -------\n        casted : ChunkedArray\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_34cast(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_target_type = 0;
  int __pyx_v_safe;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cast (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_target_type,&__pyx_n_s_safe,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_target_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_safe);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cast") < 0)) __PYX_ERR(6, 218, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_target_type = values[0];
    if (values[1]) {
      __pyx_v_safe = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_safe == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 218, __pyx_L3_error)
    } else {
      __pyx_v_safe = ((int)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cast", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 218, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.cast", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_33cast(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self), __pyx_v_target_type, __pyx_v_safe);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_33cast(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, PyObject *__pyx_v_target_type, int __pyx_v_safe) {
   arrow::compute::CastOptions __pyx_v_options;
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_type = 0;
   arrow::compute::Datum __pyx_v_out;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("cast", 0);

  /* "pyarrow/table.pxi":234
 *         """
 *         cdef:
 *             CCastOptions options = CCastOptions(safe)             # <<<<<<<<<<<<<<
 *             DataType type = ensure_type(target_type)
 *             shared_ptr[CArray] result
 */
  __pyx_v_options =  arrow::compute::CastOptions(__pyx_v_safe);

  /* "pyarrow/table.pxi":235
 *         cdef:
 *             CCastOptions options = CCastOptions(safe)
 *             DataType type = ensure_type(target_type)             # <<<<<<<<<<<<<<
 *             shared_ptr[CArray] result
 *             CDatum out
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_ensure_type(__pyx_v_target_type, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":239
 *             CDatum out
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(Cast(_context(), CDatum(self.sp_chunked_array),
 *                               type.sp_type, options, &out))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":240
 * 
 *         with nogil:
 *             check_status(Cast(_context(), CDatum(self.sp_chunked_array),             # <<<<<<<<<<<<<<
 *                               type.sp_type, options, &out))
 * 
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(arrow::compute::Cast(__pyx_f_7pyarrow_3lib__context(),  arrow::compute::Datum(__pyx_v_self->sp_chunked_array), __pyx_v_type->sp_type, __pyx_v_options, (&__pyx_v_out))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 240, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":239
 *             CDatum out
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(Cast(_context(), CDatum(self.sp_chunked_array),
 *                               type.sp_type, options, &out))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/table.pxi":243
 *                               type.sp_type, options, &out))
 * 
 *         return pyarrow_wrap_chunked_array(out.chunked_array())             # <<<<<<<<<<<<<<
 * 
 *     def dictionary_encode(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_chunked_array(__pyx_v_out.chunked_array()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":218
 *         return values.astype(dtype)
 * 
 *     def cast(self, object target_type, bint safe=True):             # <<<<<<<<<<<<<<
 *         """
 *         Cast values to another data type
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.cast", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_type);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":245
 *         return pyarrow_wrap_chunked_array(out.chunked_array())
 * 
 *     def dictionary_encode(self):             # <<<<<<<<<<<<<<
 *         """
 *         Compute dictionary-encoded representation of array
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_36dictionary_encode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_35dictionary_encode[] = "ChunkedArray.dictionary_encode(self)\n\n        Compute dictionary-encoded representation of array\n\n        Returns\n        -------\n        pyarrow.ChunkedArray\n            Same chunking as the input, all chunks share a common dictionary.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_36dictionary_encode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dictionary_encode (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_35dictionary_encode(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_35dictionary_encode(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self) {
   arrow::compute::Datum __pyx_v_out;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("dictionary_encode", 0);

  /* "pyarrow/table.pxi":256
 *         cdef CDatum out
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(
 *                 DictionaryEncode(_context(), CDatum(self.sp_chunked_array),
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":257
 * 
 *         with nogil:
 *             check_status(             # <<<<<<<<<<<<<<
 *                 DictionaryEncode(_context(), CDatum(self.sp_chunked_array),
 *                                  &out))
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::compute::DictionaryEncode(__pyx_f_7pyarrow_3lib__context(),  arrow::compute::Datum(__pyx_v_self->sp_chunked_array), (&__pyx_v_out))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 257, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":256
 *         cdef CDatum out
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(
 *                 DictionaryEncode(_context(), CDatum(self.sp_chunked_array),
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/table.pxi":261
 *                                  &out))
 * 
 *         return wrap_datum(out)             # <<<<<<<<<<<<<<
 * 
 *     def flatten(self, MemoryPool memory_pool=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_wrap_datum(__pyx_v_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":245
 *         return pyarrow_wrap_chunked_array(out.chunked_array())
 * 
 *     def dictionary_encode(self):             # <<<<<<<<<<<<<<
 *         """
 *         Compute dictionary-encoded representation of array
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.dictionary_encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":263
 *         return wrap_datum(out)
 * 
 *     def flatten(self, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Flatten this ChunkedArray.  If it has a struct type, the column is
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_38flatten(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_37flatten[] = "ChunkedArray.flatten(self, MemoryPool memory_pool=None)\n\n        Flatten this ChunkedArray.  If it has a struct type, the column is\n        flattened into one array per struct field.\n\n        Parameters\n        ----------\n        memory_pool : MemoryPool, default None\n            For memory allocations, if required, otherwise use default pool\n\n        Returns\n        -------\n        result : List[ChunkedArray]\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_38flatten(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flatten (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_memory_pool,0};
    PyObject* values[1] = {0};
    values[0] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "flatten") < 0)) __PYX_ERR(6, 263, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("flatten", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 263, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.flatten", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(6, 263, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_37flatten(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self), __pyx_v_memory_pool);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_37flatten(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool) {
  std::vector<std::shared_ptr< arrow::ChunkedArray> >  __pyx_v_flattened;
   arrow::MemoryPool *__pyx_v_pool;
  std::shared_ptr< arrow::ChunkedArray>  __pyx_8genexpr9__pyx_v_col;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  std::vector<std::shared_ptr< arrow::ChunkedArray> > ::iterator __pyx_t_3;
  std::shared_ptr< arrow::ChunkedArray>  __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("flatten", 0);

  /* "pyarrow/table.pxi":279
 *         cdef:
 *             vector[shared_ptr[CChunkedArray]] flattened
 *             CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_v_pool = __pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(__pyx_v_memory_pool);

  /* "pyarrow/table.pxi":281
 *             CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.chunked_array.Flatten(pool, &flattened))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":282
 * 
 *         with nogil:
 *             check_status(self.chunked_array.Flatten(pool, &flattened))             # <<<<<<<<<<<<<<
 * 
 *         return [pyarrow_wrap_chunked_array(col) for col in flattened]
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->chunked_array->Flatten(__pyx_v_pool, (&__pyx_v_flattened))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 282, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":281
 *             CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.chunked_array.Flatten(pool, &flattened))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/table.pxi":284
 *             check_status(self.chunked_array.Flatten(pool, &flattened))
 * 
 *         return [pyarrow_wrap_chunked_array(col) for col in flattened]             # <<<<<<<<<<<<<<
 * 
 *     def unique(self):
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 284, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_v_flattened.begin();
    for (;;) {
      if (!(__pyx_t_3 != __pyx_v_flattened.end())) break;
      __pyx_t_4 = *__pyx_t_3;
      ++__pyx_t_3;
      __pyx_8genexpr9__pyx_v_col = __pyx_t_4;
      __pyx_t_5 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_chunked_array(__pyx_8genexpr9__pyx_v_col); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 284, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) __PYX_ERR(6, 284, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  } /* exit inner scope */
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":263
 *         return wrap_datum(out)
 * 
 *     def flatten(self, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Flatten this ChunkedArray.  If it has a struct type, the column is
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.flatten", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":286
 *         return [pyarrow_wrap_chunked_array(col) for col in flattened]
 * 
 *     def unique(self):             # <<<<<<<<<<<<<<
 *         """
 *         Compute distinct elements in array
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_40unique(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_39unique[] = "ChunkedArray.unique(self)\n\n        Compute distinct elements in array\n\n        Returns\n        -------\n        pyarrow.Array\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_40unique(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("unique (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_39unique(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_39unique(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self) {
  std::shared_ptr< arrow::Array>  __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("unique", 0);

  /* "pyarrow/table.pxi":296
 *         cdef shared_ptr[CArray] result
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(
 *                 Unique(_context(), CDatum(self.sp_chunked_array), &result))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":297
 * 
 *         with nogil:
 *             check_status(             # <<<<<<<<<<<<<<
 *                 Unique(_context(), CDatum(self.sp_chunked_array), &result))
 * 
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::compute::Unique(__pyx_f_7pyarrow_3lib__context(),  arrow::compute::Datum(__pyx_v_self->sp_chunked_array), (&__pyx_v_result))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 297, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":296
 *         cdef shared_ptr[CArray] result
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(
 *                 Unique(_context(), CDatum(self.sp_chunked_array), &result))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/table.pxi":300
 *                 Unique(_context(), CDatum(self.sp_chunked_array), &result))
 * 
 *         return pyarrow_wrap_array(result)             # <<<<<<<<<<<<<<
 * 
 *     def slice(self, offset=0, length=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":286
 *         return [pyarrow_wrap_chunked_array(col) for col in flattened]
 * 
 *     def unique(self):             # <<<<<<<<<<<<<<
 *         """
 *         Compute distinct elements in array
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.unique", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":302
 *         return pyarrow_wrap_array(result)
 * 
 *     def slice(self, offset=0, length=None):             # <<<<<<<<<<<<<<
 *         """
 *         Compute zero-copy slice of this ChunkedArray
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_42slice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_41slice[] = "ChunkedArray.slice(self, offset=0, length=None)\n\n        Compute zero-copy slice of this ChunkedArray\n\n        Parameters\n        ----------\n        offset : int, default 0\n            Offset from start of array to slice\n        length : int, default None\n            Length of slice (default is until end of batch starting from\n            offset)\n\n        Returns\n        -------\n        sliced : ChunkedArray\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_42slice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_offset = 0;
  PyObject *__pyx_v_length = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("slice (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_offset,&__pyx_n_s_length,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)__pyx_int_0);
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offset);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_length);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "slice") < 0)) __PYX_ERR(6, 302, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_offset = values[0];
    __pyx_v_length = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("slice", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 302, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_41slice(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self), __pyx_v_offset, __pyx_v_length);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_41slice(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, PyObject *__pyx_v_offset, PyObject *__pyx_v_length) {
  std::shared_ptr< arrow::ChunkedArray>  __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int64_t __pyx_t_4;
  int64_t __pyx_t_5;
  __Pyx_RefNannySetupContext("slice", 0);

  /* "pyarrow/table.pxi":320
 *         cdef shared_ptr[CChunkedArray] result
 * 
 *         if offset < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError('Offset must be non-negative')
 * 
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_offset, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 320, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 320, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/table.pxi":321
 * 
 *         if offset < 0:
 *             raise IndexError('Offset must be non-negative')             # <<<<<<<<<<<<<<
 * 
 *         if length is None:
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__147, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 321, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(6, 321, __pyx_L1_error)

    /* "pyarrow/table.pxi":320
 *         cdef shared_ptr[CChunkedArray] result
 * 
 *         if offset < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError('Offset must be non-negative')
 * 
 */
  }

  /* "pyarrow/table.pxi":323
 *             raise IndexError('Offset must be non-negative')
 * 
 *         if length is None:             # <<<<<<<<<<<<<<
 *             result = self.chunked_array.Slice(offset)
 *         else:
 */
  __pyx_t_2 = (__pyx_v_length == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/table.pxi":324
 * 
 *         if length is None:
 *             result = self.chunked_array.Slice(offset)             # <<<<<<<<<<<<<<
 *         else:
 *             result = self.chunked_array.Slice(offset, length)
 */
    __pyx_t_4 = __Pyx_PyInt_As_int64_t(__pyx_v_offset); if (unlikely((__pyx_t_4 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 324, __pyx_L1_error)
    __pyx_v_result = __pyx_v_self->chunked_array->Slice(__pyx_t_4);

    /* "pyarrow/table.pxi":323
 *             raise IndexError('Offset must be non-negative')
 * 
 *         if length is None:             # <<<<<<<<<<<<<<
 *             result = self.chunked_array.Slice(offset)
 *         else:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/table.pxi":326
 *             result = self.chunked_array.Slice(offset)
 *         else:
 *             result = self.chunked_array.Slice(offset, length)             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_chunked_array(result)
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyInt_As_int64_t(__pyx_v_offset); if (unlikely((__pyx_t_4 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 326, __pyx_L1_error)
    __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_v_length); if (unlikely((__pyx_t_5 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 326, __pyx_L1_error)
    __pyx_v_result = __pyx_v_self->chunked_array->Slice(__pyx_t_4, __pyx_t_5);
  }
  __pyx_L4:;

  /* "pyarrow/table.pxi":328
 *             result = self.chunked_array.Slice(offset, length)
 * 
 *         return pyarrow_wrap_chunked_array(result)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_chunked_array(__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":302
 *         return pyarrow_wrap_array(result)
 * 
 *     def slice(self, offset=0, length=None):             # <<<<<<<<<<<<<<
 *         """
 *         Compute zero-copy slice of this ChunkedArray
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":331
 * 
 *     @property
 *     def num_chunks(self):             # <<<<<<<<<<<<<<
 *         """
 *         Number of underlying chunks
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_10num_chunks_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_10num_chunks_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_10num_chunks___get__(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_10num_chunks___get__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/table.pxi":339
 *         int
 *         """
 *         return self.chunked_array.num_chunks()             # <<<<<<<<<<<<<<
 * 
 *     def chunk(self, i):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->chunked_array->num_chunks()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":331
 * 
 *     @property
 *     def num_chunks(self):             # <<<<<<<<<<<<<<
 *         """
 *         Number of underlying chunks
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.num_chunks.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":341
 *         return self.chunked_array.num_chunks()
 * 
 *     def chunk(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Select a chunk by its index
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_44chunk(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_43chunk[] = "ChunkedArray.chunk(self, i)\n\n        Select a chunk by its index\n\n        Parameters\n        ----------\n        i : int\n\n        Returns\n        -------\n        pyarrow.Array\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_44chunk(PyObject *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("chunk (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_43chunk(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self), ((PyObject *)__pyx_v_i));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_43chunk(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("chunk", 0);

  /* "pyarrow/table.pxi":353
 *         pyarrow.Array
 *         """
 *         if i >= self.num_chunks or i < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError('Chunk index out of range.')
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_chunks); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_i, __pyx_t_2, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 353, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(6, 353, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!__pyx_t_4) {
  } else {
    __pyx_t_1 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_i, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 353, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(6, 353, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/table.pxi":354
 *         """
 *         if i >= self.num_chunks or i < 0:
 *             raise IndexError('Chunk index out of range.')             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_array(self.chunked_array.chunk(i))
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__159, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 354, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(6, 354, __pyx_L1_error)

    /* "pyarrow/table.pxi":353
 *         pyarrow.Array
 *         """
 *         if i >= self.num_chunks or i < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError('Chunk index out of range.')
 * 
 */
  }

  /* "pyarrow/table.pxi":356
 *             raise IndexError('Chunk index out of range.')
 * 
 *         return pyarrow_wrap_array(self.chunked_array.chunk(i))             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_i); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 356, __pyx_L1_error)
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_self->chunked_array->chunk(__pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":341
 *         return self.chunked_array.num_chunks()
 * 
 *     def chunk(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Select a chunk by its index
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.chunk", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":359
 * 
 *     @property
 *     def chunks(self):             # <<<<<<<<<<<<<<
 *         return list(self.iterchunks())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_6chunks_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_6chunks_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_6chunks___get__(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_6chunks___get__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/table.pxi":360
 *     @property
 *     def chunks(self):
 *         return list(self.iterchunks())             # <<<<<<<<<<<<<<
 * 
 *     def iterchunks(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_iterchunks); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":359
 * 
 *     @property
 *     def chunks(self):             # <<<<<<<<<<<<<<
 *         return list(self.iterchunks())
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.chunks.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pyarrow_3lib_12ChunkedArray_47generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/table.pxi":362
 *         return list(self.iterchunks())
 * 
 *     def iterchunks(self):             # <<<<<<<<<<<<<<
 *         for i in range(self.num_chunks):
 *             yield self.chunk(i)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_46iterchunks(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_45iterchunks[] = "ChunkedArray.iterchunks(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_46iterchunks(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iterchunks (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_45iterchunks(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_45iterchunks(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11_iterchunks *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iterchunks", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11_iterchunks *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_11_iterchunks(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_11_iterchunks, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11_iterchunks *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(6, 362, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7pyarrow_3lib_12ChunkedArray_47generator9, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iterchunks, __pyx_n_s_ChunkedArray_iterchunks, __pyx_n_s_pyarrow_lib); if (unlikely(!gen)) __PYX_ERR(6, 362, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.iterchunks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7pyarrow_3lib_12ChunkedArray_47generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11_iterchunks *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11_iterchunks *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iterchunks", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(6, 362, __pyx_L1_error)

  /* "pyarrow/table.pxi":363
 * 
 *     def iterchunks(self):
 *         for i in range(self.num_chunks):             # <<<<<<<<<<<<<<
 *             yield self.chunk(i)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_num_chunks); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 363, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 363, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(6, 363, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 363, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(6, 363, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 363, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(6, 363, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_i, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/table.pxi":364
 *     def iterchunks(self):
 *         for i in range(self.num_chunks):
 *             yield self.chunk(i)             # <<<<<<<<<<<<<<
 * 
 *     def to_pylist(self):
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_chunk); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 364, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_cur_scope->__pyx_v_i) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_cur_scope->__pyx_v_i);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 364, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(6, 364, __pyx_L1_error)

    /* "pyarrow/table.pxi":363
 * 
 *     def iterchunks(self):
 *         for i in range(self.num_chunks):             # <<<<<<<<<<<<<<
 *             yield self.chunk(i)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "pyarrow/table.pxi":362
 *         return list(self.iterchunks())
 * 
 *     def iterchunks(self):             # <<<<<<<<<<<<<<
 *         for i in range(self.num_chunks):
 *             yield self.chunk(i)
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("iterchunks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":366
 *             yield self.chunk(i)
 * 
 *     def to_pylist(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert to a list of native Python objects.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_49to_pylist(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_48to_pylist[] = "ChunkedArray.to_pylist(self)\n\n        Convert to a list of native Python objects.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_49to_pylist(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_pylist (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_48to_pylist(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_48to_pylist(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self) {
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("to_pylist", 0);

  /* "pyarrow/table.pxi":370
 *         Convert to a list of native Python objects.
 *         """
 *         result = []             # <<<<<<<<<<<<<<
 *         for i in range(self.num_chunks):
 *             result += self.chunk(i).to_pylist()
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":371
 *         """
 *         result = []
 *         for i in range(self.num_chunks):             # <<<<<<<<<<<<<<
 *             result += self.chunk(i).to_pylist()
 *         return result
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_chunks); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 371, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 371, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(6, 371, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 371, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(6, 371, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 371, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(6, 371, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/table.pxi":372
 *         result = []
 *         for i in range(self.num_chunks):
 *             result += self.chunk(i).to_pylist()             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_chunk); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 372, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_i) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_i);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 372, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_to_pylist); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 372, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 372, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 372, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "pyarrow/table.pxi":371
 *         """
 *         result = []
 *         for i in range(self.num_chunks):             # <<<<<<<<<<<<<<
 *             result += self.chunk(i).to_pylist()
 *         return result
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":373
 *         for i in range(self.num_chunks):
 *             result += self.chunk(i).to_pylist()
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":366
 *             yield self.chunk(i)
 * 
 *     def to_pylist(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert to a list of native Python objects.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.ChunkedArray.to_pylist", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/lib.pxd":446
 *     cdef readonly:
 *         # To allow Table to propagate metadata to pandas.Series
 *         object _name             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CChunkedArray]& chunked_array)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_5_name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_5_name_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_5_name___get__(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_5_name___get__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_name);
  __pyx_r = __pyx_v_self->_name;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":376
 * 
 * 
 * def chunked_array(arrays, type=None):             # <<<<<<<<<<<<<<
 *     """
 *     Construct chunked array from list of array-like objects
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_145chunked_array(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_144chunked_array[] = "chunked_array(arrays, type=None)\n\n    Construct chunked array from list of array-like objects\n\n    Parameters\n    ----------\n    arrays : Array, list of Array, or values coercible to arrays\n        Must all be the same data type. Can be empty only if type also\n        passed\n    type : DataType or string coercible to DataType\n\n    Returns\n    -------\n    ChunkedArray\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_145chunked_array = {"chunked_array", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_145chunked_array, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_144chunked_array};
static PyObject *__pyx_pw_7pyarrow_3lib_145chunked_array(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_arrays = 0;
  PyObject *__pyx_v_type = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("chunked_array (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arrays,&__pyx_n_s_type,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arrays)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "chunked_array") < 0)) __PYX_ERR(6, 376, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_arrays = values[0];
    __pyx_v_type = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("chunked_array", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 376, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.chunked_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_144chunked_array(__pyx_self, __pyx_v_arrays, __pyx_v_type);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_144chunked_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arrays, PyObject *__pyx_v_type) {
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_arr = 0;
  std::vector<std::shared_ptr< arrow::Array> >  __pyx_v_c_arrays;
  std::shared_ptr< arrow::ChunkedArray>  __pyx_v_sp_chunked_array;
  std::shared_ptr< arrow::DataType>  __pyx_v_sp_data_type;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("chunked_array", 0);
  __Pyx_INCREF(__pyx_v_arrays);

  /* "pyarrow/table.pxi":397
 *         shared_ptr[CDataType] sp_data_type
 * 
 *     if isinstance(arrays, Array):             # <<<<<<<<<<<<<<
 *         arrays = [arrays]
 * 
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_arrays, __pyx_ptype_7pyarrow_3lib_Array); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":398
 * 
 *     if isinstance(arrays, Array):
 *         arrays = [arrays]             # <<<<<<<<<<<<<<
 * 
 *     for x in arrays:
 */
    __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 398, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_arrays);
    __Pyx_GIVEREF(__pyx_v_arrays);
    PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_arrays);
    __Pyx_DECREF_SET(__pyx_v_arrays, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/table.pxi":397
 *         shared_ptr[CDataType] sp_data_type
 * 
 *     if isinstance(arrays, Array):             # <<<<<<<<<<<<<<
 *         arrays = [arrays]
 * 
 */
  }

  /* "pyarrow/table.pxi":400
 *         arrays = [arrays]
 * 
 *     for x in arrays:             # <<<<<<<<<<<<<<
 *         if isinstance(x, Array):
 *             arr = x
 */
  if (likely(PyList_CheckExact(__pyx_v_arrays)) || PyTuple_CheckExact(__pyx_v_arrays)) {
    __pyx_t_3 = __pyx_v_arrays; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_arrays); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 400, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 400, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(6, 400, __pyx_L1_error)
        #else
        __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 400, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(6, 400, __pyx_L1_error)
        #else
        __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 400, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        #endif
      }
    } else {
      __pyx_t_6 = __pyx_t_5(__pyx_t_3);
      if (unlikely(!__pyx_t_6)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(6, 400, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "pyarrow/table.pxi":401
 * 
 *     for x in arrays:
 *         if isinstance(x, Array):             # <<<<<<<<<<<<<<
 *             arr = x
 *             if type is not None:
 */
    __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_x, __pyx_ptype_7pyarrow_3lib_Array); 
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "pyarrow/table.pxi":402
 *     for x in arrays:
 *         if isinstance(x, Array):
 *             arr = x             # <<<<<<<<<<<<<<
 *             if type is not None:
 *                 assert x.type == type
 */
      if (!(likely(((__pyx_v_x) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_x, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(6, 402, __pyx_L1_error)
      __pyx_t_6 = __pyx_v_x;
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_XDECREF_SET(__pyx_v_arr, ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_6));
      __pyx_t_6 = 0;

      /* "pyarrow/table.pxi":403
 *         if isinstance(x, Array):
 *             arr = x
 *             if type is not None:             # <<<<<<<<<<<<<<
 *                 assert x.type == type
 *         else:
 */
      __pyx_t_1 = (__pyx_v_type != Py_None);
      __pyx_t_2 = (__pyx_t_1 != 0);
      if (__pyx_t_2) {

        /* "pyarrow/table.pxi":404
 *             arr = x
 *             if type is not None:
 *                 assert x.type == type             # <<<<<<<<<<<<<<
 *         else:
 *             arr = array(x, type=type)
 */
        #ifndef CYTHON_WITHOUT_ASSERTIONS
        if (unlikely(!Py_OptimizeFlag)) {
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 404, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_v_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 404, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 404, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_2)) {
            PyErr_SetNone(PyExc_AssertionError);
            __PYX_ERR(6, 404, __pyx_L1_error)
          }
        }
        #endif

        /* "pyarrow/table.pxi":403
 *         if isinstance(x, Array):
 *             arr = x
 *             if type is not None:             # <<<<<<<<<<<<<<
 *                 assert x.type == type
 *         else:
 */
      }

      /* "pyarrow/table.pxi":401
 * 
 *     for x in arrays:
 *         if isinstance(x, Array):             # <<<<<<<<<<<<<<
 *             arr = x
 *             if type is not None:
 */
      goto __pyx_L6;
    }

    /* "pyarrow/table.pxi":406
 *                 assert x.type == type
 *         else:
 *             arr = array(x, type=type)             # <<<<<<<<<<<<<<
 * 
 *         c_arrays.push_back(arr.sp_array)
 */
    /*else*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 406, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 406, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_x);
      __Pyx_GIVEREF(__pyx_v_x);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_x);
      __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 406, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_type, __pyx_v_type) < 0) __PYX_ERR(6, 406, __pyx_L1_error)
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 406, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(6, 406, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_arr, ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_9));
      __pyx_t_9 = 0;
    }
    __pyx_L6:;

    /* "pyarrow/table.pxi":408
 *             arr = array(x, type=type)
 * 
 *         c_arrays.push_back(arr.sp_array)             # <<<<<<<<<<<<<<
 * 
 *     if type:
 */
    try {
      __pyx_v_c_arrays.push_back(__pyx_v_arr->sp_array);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(6, 408, __pyx_L1_error)
    }

    /* "pyarrow/table.pxi":400
 *         arrays = [arrays]
 * 
 *     for x in arrays:             # <<<<<<<<<<<<<<
 *         if isinstance(x, Array):
 *             arr = x
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/table.pxi":410
 *         c_arrays.push_back(arr.sp_array)
 * 
 *     if type:             # <<<<<<<<<<<<<<
 *         sp_data_type = pyarrow_unwrap_data_type(type)
 *         sp_chunked_array.reset(new CChunkedArray(c_arrays, sp_data_type))
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_type); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 410, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":411
 * 
 *     if type:
 *         sp_data_type = pyarrow_unwrap_data_type(type)             # <<<<<<<<<<<<<<
 *         sp_chunked_array.reset(new CChunkedArray(c_arrays, sp_data_type))
 *     else:
 */
    __pyx_v_sp_data_type = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_data_type(__pyx_v_type);

    /* "pyarrow/table.pxi":412
 *     if type:
 *         sp_data_type = pyarrow_unwrap_data_type(type)
 *         sp_chunked_array.reset(new CChunkedArray(c_arrays, sp_data_type))             # <<<<<<<<<<<<<<
 *     else:
 *         if c_arrays.size() == 0:
 */
    __pyx_v_sp_chunked_array.reset(new  arrow::ChunkedArray(__pyx_v_c_arrays, __pyx_v_sp_data_type));

    /* "pyarrow/table.pxi":410
 *         c_arrays.push_back(arr.sp_array)
 * 
 *     if type:             # <<<<<<<<<<<<<<
 *         sp_data_type = pyarrow_unwrap_data_type(type)
 *         sp_chunked_array.reset(new CChunkedArray(c_arrays, sp_data_type))
 */
    goto __pyx_L8;
  }

  /* "pyarrow/table.pxi":414
 *         sp_chunked_array.reset(new CChunkedArray(c_arrays, sp_data_type))
 *     else:
 *         if c_arrays.size() == 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Cannot construct a chunked array with neither "
 *                              "arrays nor type")
 */
  /*else*/ {
    __pyx_t_2 = ((__pyx_v_c_arrays.size() == 0) != 0);
    if (unlikely(__pyx_t_2)) {

      /* "pyarrow/table.pxi":415
 *     else:
 *         if c_arrays.size() == 0:
 *             raise ValueError("Cannot construct a chunked array with neither "             # <<<<<<<<<<<<<<
 *                              "arrays nor type")
 *         sp_chunked_array.reset(new CChunkedArray(c_arrays))
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__160, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 415, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(6, 415, __pyx_L1_error)

      /* "pyarrow/table.pxi":414
 *         sp_chunked_array.reset(new CChunkedArray(c_arrays, sp_data_type))
 *     else:
 *         if c_arrays.size() == 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Cannot construct a chunked array with neither "
 *                              "arrays nor type")
 */
    }

    /* "pyarrow/table.pxi":417
 *             raise ValueError("Cannot construct a chunked array with neither "
 *                              "arrays nor type")
 *         sp_chunked_array.reset(new CChunkedArray(c_arrays))             # <<<<<<<<<<<<<<
 * 
 *     with nogil:
 */
    __pyx_v_sp_chunked_array.reset(new  arrow::ChunkedArray(__pyx_v_c_arrays));
  }
  __pyx_L8:;

  /* "pyarrow/table.pxi":419
 *         sp_chunked_array.reset(new CChunkedArray(c_arrays))
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(sp_chunked_array.get().Validate())
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":420
 * 
 *     with nogil:
 *         check_status(sp_chunked_array.get().Validate())             # <<<<<<<<<<<<<<
 * 
 *     return pyarrow_wrap_chunked_array(sp_chunked_array)
 */
        __pyx_t_10 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_sp_chunked_array.get()->Validate()); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(6, 420, __pyx_L11_error)
      }

      /* "pyarrow/table.pxi":419
 *         sp_chunked_array.reset(new CChunkedArray(c_arrays))
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(sp_chunked_array.get().Validate())
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L12;
        }
        __pyx_L11_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L12:;
      }
  }

  /* "pyarrow/table.pxi":422
 *         check_status(sp_chunked_array.get().Validate())
 * 
 *     return pyarrow_wrap_chunked_array(sp_chunked_array)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_chunked_array(__pyx_v_sp_chunked_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":376
 * 
 * 
 * def chunked_array(arrays, type=None):             # <<<<<<<<<<<<<<
 *     """
 *     Construct chunked array from list of array-like objects
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pyarrow.lib.chunked_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_arrays);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":425
 * 
 * 
 * cdef _schema_from_arrays(arrays, names, metadata, shared_ptr[CSchema]* schema):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t K = len(arrays)
 */

static PyObject *__pyx_f_7pyarrow_3lib__schema_from_arrays(PyObject *__pyx_v_arrays, PyObject *__pyx_v_names, PyObject *__pyx_v_metadata, std::shared_ptr< arrow::Schema>  *__pyx_v_schema) {
  Py_ssize_t __pyx_v_K;
  std::string __pyx_v_c_name;
  std::shared_ptr< arrow::DataType>  __pyx_v_c_type;
  std::shared_ptr< arrow::KeyValueMetadata>  __pyx_v_c_meta;
  std::vector<std::shared_ptr< arrow::Field> >  __pyx_v_c_fields;
  PyObject *__pyx_v_converted_arrays = NULL;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  std::shared_ptr< arrow::DataType>  __pyx_t_14;
  std::string __pyx_t_15;
  int __pyx_t_16;
  __Pyx_RefNannySetupContext("_schema_from_arrays", 0);

  /* "pyarrow/table.pxi":427
 * cdef _schema_from_arrays(arrays, names, metadata, shared_ptr[CSchema]* schema):
 *     cdef:
 *         Py_ssize_t K = len(arrays)             # <<<<<<<<<<<<<<
 *         c_string c_name
 *         shared_ptr[CDataType] c_type
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_arrays); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(6, 427, __pyx_L1_error)
  __pyx_v_K = __pyx_t_1;

  /* "pyarrow/table.pxi":433
 *         vector[shared_ptr[CField]] c_fields
 * 
 *     if metadata is not None:             # <<<<<<<<<<<<<<
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')
 */
  __pyx_t_2 = (__pyx_v_metadata != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/table.pxi":434
 * 
 *     if metadata is not None:
 *         if not isinstance(metadata, dict):             # <<<<<<<<<<<<<<
 *             raise TypeError('Metadata must be an instance of dict')
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 */
    __pyx_t_3 = PyDict_Check(__pyx_v_metadata); 
    __pyx_t_2 = ((!(__pyx_t_3 != 0)) != 0);
    if (unlikely(__pyx_t_2)) {

      /* "pyarrow/table.pxi":435
 *     if metadata is not None:
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')             # <<<<<<<<<<<<<<
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 435, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(6, 435, __pyx_L1_error)

      /* "pyarrow/table.pxi":434
 * 
 *     if metadata is not None:
 *         if not isinstance(metadata, dict):             # <<<<<<<<<<<<<<
 *             raise TypeError('Metadata must be an instance of dict')
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 */
    }

    /* "pyarrow/table.pxi":436
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')
 *         c_meta = pyarrow_unwrap_metadata(metadata)             # <<<<<<<<<<<<<<
 * 
 *     if K == 0:
 */
    __pyx_v_c_meta = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_metadata(__pyx_v_metadata);

    /* "pyarrow/table.pxi":433
 *         vector[shared_ptr[CField]] c_fields
 * 
 *     if metadata is not None:             # <<<<<<<<<<<<<<
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')
 */
  }

  /* "pyarrow/table.pxi":438
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 * 
 *     if K == 0:             # <<<<<<<<<<<<<<
 *         schema.reset(new CSchema(c_fields, c_meta))
 *         return arrays
 */
  __pyx_t_2 = ((__pyx_v_K == 0) != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":439
 * 
 *     if K == 0:
 *         schema.reset(new CSchema(c_fields, c_meta))             # <<<<<<<<<<<<<<
 *         return arrays
 * 
 */
    __pyx_v_schema->reset(new  arrow::Schema(__pyx_v_c_fields, __pyx_v_c_meta));

    /* "pyarrow/table.pxi":440
 *     if K == 0:
 *         schema.reset(new CSchema(c_fields, c_meta))
 *         return arrays             # <<<<<<<<<<<<<<
 * 
 *     c_fields.resize(K)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_arrays);
    __pyx_r = __pyx_v_arrays;
    goto __pyx_L0;

    /* "pyarrow/table.pxi":438
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 * 
 *     if K == 0:             # <<<<<<<<<<<<<<
 *         schema.reset(new CSchema(c_fields, c_meta))
 *         return arrays
 */
  }

  /* "pyarrow/table.pxi":442
 *         return arrays
 * 
 *     c_fields.resize(K)             # <<<<<<<<<<<<<<
 * 
 *     if names is None:
 */
  try {
    __pyx_v_c_fields.resize(__pyx_v_K);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(6, 442, __pyx_L1_error)
  }

  /* "pyarrow/table.pxi":444
 *     c_fields.resize(K)
 * 
 *     if names is None:             # <<<<<<<<<<<<<<
 *         raise ValueError('Must pass names or schema to Table.from_arrays')
 * 
 */
  __pyx_t_2 = (__pyx_v_names == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (unlikely(__pyx_t_3)) {

    /* "pyarrow/table.pxi":445
 * 
 *     if names is None:
 *         raise ValueError('Must pass names or schema to Table.from_arrays')             # <<<<<<<<<<<<<<
 * 
 *     if len(names) != K:
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__161, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 445, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(6, 445, __pyx_L1_error)

    /* "pyarrow/table.pxi":444
 *     c_fields.resize(K)
 * 
 *     if names is None:             # <<<<<<<<<<<<<<
 *         raise ValueError('Must pass names or schema to Table.from_arrays')
 * 
 */
  }

  /* "pyarrow/table.pxi":447
 *         raise ValueError('Must pass names or schema to Table.from_arrays')
 * 
 *     if len(names) != K:             # <<<<<<<<<<<<<<
 *         raise ValueError('Length of names ({}) does not match '
 *                          'length of arrays ({})'.format(len(names), K))
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_names); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(6, 447, __pyx_L1_error)
  __pyx_t_3 = ((__pyx_t_1 != __pyx_v_K) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "pyarrow/table.pxi":449
 *     if len(names) != K:
 *         raise ValueError('Length of names ({}) does not match '
 *                          'length of arrays ({})'.format(len(names), K))             # <<<<<<<<<<<<<<
 * 
 *     converted_arrays = []
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Length_of_names_does_not_match_l, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 449, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Length(__pyx_v_names); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(6, 449, __pyx_L1_error)
    __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 449, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_K); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 449, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    __pyx_t_9 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_9 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_7};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 449, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_7};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 449, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    {
      __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 449, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (__pyx_t_8) {
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_7);
      __pyx_t_6 = 0;
      __pyx_t_7 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 449, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "pyarrow/table.pxi":448
 * 
 *     if len(names) != K:
 *         raise ValueError('Length of names ({}) does not match '             # <<<<<<<<<<<<<<
 *                          'length of arrays ({})'.format(len(names), K))
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 448, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(6, 448, __pyx_L1_error)

    /* "pyarrow/table.pxi":447
 *         raise ValueError('Must pass names or schema to Table.from_arrays')
 * 
 *     if len(names) != K:             # <<<<<<<<<<<<<<
 *         raise ValueError('Length of names ({}) does not match '
 *                          'length of arrays ({})'.format(len(names), K))
 */
  }

  /* "pyarrow/table.pxi":451
 *                          'length of arrays ({})'.format(len(names), K))
 * 
 *     converted_arrays = []             # <<<<<<<<<<<<<<
 *     for i in range(K):
 *         val = arrays[i]
 */
  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_converted_arrays = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pyarrow/table.pxi":452
 * 
 *     converted_arrays = []
 *     for i in range(K):             # <<<<<<<<<<<<<<
 *         val = arrays[i]
 *         if not isinstance(val, (Array, ChunkedArray)):
 */
  __pyx_t_1 = __pyx_v_K;
  __pyx_t_11 = __pyx_t_1;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "pyarrow/table.pxi":453
 *     converted_arrays = []
 *     for i in range(K):
 *         val = arrays[i]             # <<<<<<<<<<<<<<
 *         if not isinstance(val, (Array, ChunkedArray)):
 *             val = array(val)
 */
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_arrays, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 453, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "pyarrow/table.pxi":454
 *     for i in range(K):
 *         val = arrays[i]
 *         if not isinstance(val, (Array, ChunkedArray)):             # <<<<<<<<<<<<<<
 *             val = array(val)
 * 
 */
    __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_val, __pyx_ptype_7pyarrow_3lib_Array); 
    __pyx_t_13 = (__pyx_t_2 != 0);
    if (!__pyx_t_13) {
    } else {
      __pyx_t_3 = __pyx_t_13;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_13 = __Pyx_TypeCheck(__pyx_v_val, __pyx_ptype_7pyarrow_3lib_ChunkedArray); 
    __pyx_t_2 = (__pyx_t_13 != 0);
    __pyx_t_3 = __pyx_t_2;
    __pyx_L11_bool_binop_done:;
    __pyx_t_2 = ((!(__pyx_t_3 != 0)) != 0);
    if (__pyx_t_2) {

      /* "pyarrow/table.pxi":455
 *         val = arrays[i]
 *         if not isinstance(val, (Array, ChunkedArray)):
 *             val = array(val)             # <<<<<<<<<<<<<<
 * 
 *         c_type = (<DataType> val.type).sp_type
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 455, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_10 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_5 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_10, __pyx_v_val) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_val);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 455, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "pyarrow/table.pxi":454
 *     for i in range(K):
 *         val = arrays[i]
 *         if not isinstance(val, (Array, ChunkedArray)):             # <<<<<<<<<<<<<<
 *             val = array(val)
 * 
 */
    }

    /* "pyarrow/table.pxi":457
 *             val = array(val)
 * 
 *         c_type = (<DataType> val.type).sp_type             # <<<<<<<<<<<<<<
 * 
 *         if names[i] is None:
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 457, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_14 = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_5)->sp_type;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_c_type = __pyx_t_14;

    /* "pyarrow/table.pxi":459
 *         c_type = (<DataType> val.type).sp_type
 * 
 *         if names[i] is None:             # <<<<<<<<<<<<<<
 *             c_name = tobytes(u'None')
 *         else:
 */
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_names, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 459, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = (__pyx_t_5 == Py_None);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {

      /* "pyarrow/table.pxi":460
 * 
 *         if names[i] is None:
 *             c_name = tobytes(u'None')             # <<<<<<<<<<<<<<
 *         else:
 *             c_name = tobytes(names[i])
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 460, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_10 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_5 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_10, __pyx_n_u_None) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_n_u_None);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 460, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_15 = __pyx_convert_string_from_py_std__in_string(__pyx_t_5); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 460, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_c_name = __pyx_t_15;

      /* "pyarrow/table.pxi":459
 *         c_type = (<DataType> val.type).sp_type
 * 
 *         if names[i] is None:             # <<<<<<<<<<<<<<
 *             c_name = tobytes(u'None')
 *         else:
 */
      goto __pyx_L13;
    }

    /* "pyarrow/table.pxi":462
 *             c_name = tobytes(u'None')
 *         else:
 *             c_name = tobytes(names[i])             # <<<<<<<<<<<<<<
 *         c_fields[i].reset(new CField(c_name, c_type, True))
 *         converted_arrays.append(val)
 */
    /*else*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 462, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_names, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 462, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_7, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_10);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 462, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_15 = __pyx_convert_string_from_py_std__in_string(__pyx_t_5); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 462, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_c_name = __pyx_t_15;
    }
    __pyx_L13:;

    /* "pyarrow/table.pxi":463
 *         else:
 *             c_name = tobytes(names[i])
 *         c_fields[i].reset(new CField(c_name, c_type, True))             # <<<<<<<<<<<<<<
 *         converted_arrays.append(val)
 * 
 */
    (__pyx_v_c_fields[__pyx_v_i]).reset(new  arrow::Field(__pyx_v_c_name, __pyx_v_c_type, 1));

    /* "pyarrow/table.pxi":464
 *             c_name = tobytes(names[i])
 *         c_fields[i].reset(new CField(c_name, c_type, True))
 *         converted_arrays.append(val)             # <<<<<<<<<<<<<<
 * 
 *     schema.reset(new CSchema(c_fields, c_meta))
 */
    __pyx_t_16 = __Pyx_PyList_Append(__pyx_v_converted_arrays, __pyx_v_val); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(6, 464, __pyx_L1_error)
  }

  /* "pyarrow/table.pxi":466
 *         converted_arrays.append(val)
 * 
 *     schema.reset(new CSchema(c_fields, c_meta))             # <<<<<<<<<<<<<<
 *     return converted_arrays
 * 
 */
  __pyx_v_schema->reset(new  arrow::Schema(__pyx_v_c_fields, __pyx_v_c_meta));

  /* "pyarrow/table.pxi":467
 * 
 *     schema.reset(new CSchema(c_fields, c_meta))
 *     return converted_arrays             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_converted_arrays);
  __pyx_r = __pyx_v_converted_arrays;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":425
 * 
 * 
 * cdef _schema_from_arrays(arrays, names, metadata, shared_ptr[CSchema]* schema):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t K = len(arrays)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("pyarrow.lib._schema_from_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_converted_arrays);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":470
 * 
 * 
 * cdef _sanitize_arrays(arrays, names, schema, metadata,             # <<<<<<<<<<<<<<
 *                       shared_ptr[CSchema]* c_schema):
 *     cdef Schema cy_schema
 */

static PyObject *__pyx_f_7pyarrow_3lib__sanitize_arrays(PyObject *__pyx_v_arrays, PyObject *__pyx_v_names, PyObject *__pyx_v_schema, PyObject *__pyx_v_metadata, std::shared_ptr< arrow::Schema>  *__pyx_v_c_schema) {
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_cy_schema = 0;
  PyObject *__pyx_v_converted_arrays = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_item = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  std::shared_ptr< arrow::Schema>  __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  __Pyx_RefNannySetupContext("_sanitize_arrays", 0);

  /* "pyarrow/table.pxi":473
 *                       shared_ptr[CSchema]* c_schema):
 *     cdef Schema cy_schema
 *     if schema is None:             # <<<<<<<<<<<<<<
 *         converted_arrays = _schema_from_arrays(arrays, names, metadata,
 *                                                c_schema)
 */
  __pyx_t_1 = (__pyx_v_schema == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":474
 *     cdef Schema cy_schema
 *     if schema is None:
 *         converted_arrays = _schema_from_arrays(arrays, names, metadata,             # <<<<<<<<<<<<<<
 *                                                c_schema)
 *     else:
 */
    __pyx_t_3 = __pyx_f_7pyarrow_3lib__schema_from_arrays(__pyx_v_arrays, __pyx_v_names, __pyx_v_metadata, __pyx_v_c_schema); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 474, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_converted_arrays = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "pyarrow/table.pxi":473
 *                       shared_ptr[CSchema]* c_schema):
 *     cdef Schema cy_schema
 *     if schema is None:             # <<<<<<<<<<<<<<
 *         converted_arrays = _schema_from_arrays(arrays, names, metadata,
 *                                                c_schema)
 */
    goto __pyx_L3;
  }

  /* "pyarrow/table.pxi":477
 *                                                c_schema)
 *     else:
 *         if names is not None:             # <<<<<<<<<<<<<<
 *             raise ValueError('Cannot pass both schema and names')
 *         if metadata is not None:
 */
  /*else*/ {
    __pyx_t_2 = (__pyx_v_names != Py_None);
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (unlikely(__pyx_t_1)) {

      /* "pyarrow/table.pxi":478
 *     else:
 *         if names is not None:
 *             raise ValueError('Cannot pass both schema and names')             # <<<<<<<<<<<<<<
 *         if metadata is not None:
 *             raise ValueError('Cannot pass both schema and metadata')
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__162, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 478, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(6, 478, __pyx_L1_error)

      /* "pyarrow/table.pxi":477
 *                                                c_schema)
 *     else:
 *         if names is not None:             # <<<<<<<<<<<<<<
 *             raise ValueError('Cannot pass both schema and names')
 *         if metadata is not None:
 */
    }

    /* "pyarrow/table.pxi":479
 *         if names is not None:
 *             raise ValueError('Cannot pass both schema and names')
 *         if metadata is not None:             # <<<<<<<<<<<<<<
 *             raise ValueError('Cannot pass both schema and metadata')
 *         cy_schema = schema
 */
    __pyx_t_1 = (__pyx_v_metadata != Py_None);
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (unlikely(__pyx_t_2)) {

      /* "pyarrow/table.pxi":480
 *             raise ValueError('Cannot pass both schema and names')
 *         if metadata is not None:
 *             raise ValueError('Cannot pass both schema and metadata')             # <<<<<<<<<<<<<<
 *         cy_schema = schema
 * 
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__163, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 480, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(6, 480, __pyx_L1_error)

      /* "pyarrow/table.pxi":479
 *         if names is not None:
 *             raise ValueError('Cannot pass both schema and names')
 *         if metadata is not None:             # <<<<<<<<<<<<<<
 *             raise ValueError('Cannot pass both schema and metadata')
 *         cy_schema = schema
 */
    }

    /* "pyarrow/table.pxi":481
 *         if metadata is not None:
 *             raise ValueError('Cannot pass both schema and metadata')
 *         cy_schema = schema             # <<<<<<<<<<<<<<
 * 
 *         if len(schema) != len(arrays):
 */
    if (!(likely(((__pyx_v_schema) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_schema, __pyx_ptype_7pyarrow_3lib_Schema))))) __PYX_ERR(6, 481, __pyx_L1_error)
    __pyx_t_3 = __pyx_v_schema;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v_cy_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/table.pxi":483
 *         cy_schema = schema
 * 
 *         if len(schema) != len(arrays):             # <<<<<<<<<<<<<<
 *             raise ValueError('Schema and number of arrays unequal')
 * 
 */
    __pyx_t_4 = PyObject_Length(__pyx_v_schema); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(6, 483, __pyx_L1_error)
    __pyx_t_5 = PyObject_Length(__pyx_v_arrays); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(6, 483, __pyx_L1_error)
    __pyx_t_2 = ((__pyx_t_4 != __pyx_t_5) != 0);
    if (unlikely(__pyx_t_2)) {

      /* "pyarrow/table.pxi":484
 * 
 *         if len(schema) != len(arrays):
 *             raise ValueError('Schema and number of arrays unequal')             # <<<<<<<<<<<<<<
 * 
 *         c_schema[0] = cy_schema.sp_schema
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__164, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 484, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(6, 484, __pyx_L1_error)

      /* "pyarrow/table.pxi":483
 *         cy_schema = schema
 * 
 *         if len(schema) != len(arrays):             # <<<<<<<<<<<<<<
 *             raise ValueError('Schema and number of arrays unequal')
 * 
 */
    }

    /* "pyarrow/table.pxi":486
 *             raise ValueError('Schema and number of arrays unequal')
 * 
 *         c_schema[0] = cy_schema.sp_schema             # <<<<<<<<<<<<<<
 *         converted_arrays = []
 *         for i, item in enumerate(arrays):
 */
    __pyx_t_6 = __pyx_v_cy_schema->sp_schema;
    (__pyx_v_c_schema[0]) = __pyx_t_6;

    /* "pyarrow/table.pxi":487
 * 
 *         c_schema[0] = cy_schema.sp_schema
 *         converted_arrays = []             # <<<<<<<<<<<<<<
 *         for i, item in enumerate(arrays):
 *             item = asarray(item, type=schema[i].type)
 */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 487, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_converted_arrays = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "pyarrow/table.pxi":488
 *         c_schema[0] = cy_schema.sp_schema
 *         converted_arrays = []
 *         for i, item in enumerate(arrays):             # <<<<<<<<<<<<<<
 *             item = asarray(item, type=schema[i].type)
 *             converted_arrays.append(item)
 */
    __Pyx_INCREF(__pyx_int_0);
    __pyx_t_3 = __pyx_int_0;
    if (likely(PyList_CheckExact(__pyx_v_arrays)) || PyTuple_CheckExact(__pyx_v_arrays)) {
      __pyx_t_7 = __pyx_v_arrays; __Pyx_INCREF(__pyx_t_7); __pyx_t_5 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_arrays); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 488, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 488, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_8)) {
        if (likely(PyList_CheckExact(__pyx_t_7))) {
          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_9 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(6, 488, __pyx_L1_error)
          #else
          __pyx_t_9 = PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 488, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          #endif
        } else {
          if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(6, 488, __pyx_L1_error)
          #else
          __pyx_t_9 = PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 488, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          #endif
        }
      } else {
        __pyx_t_9 = __pyx_t_8(__pyx_t_7);
        if (unlikely(!__pyx_t_9)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(6, 488, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_9);
      }
      __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_9);
      __pyx_t_9 = 0;
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
      __pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 488, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_3);
      __pyx_t_3 = __pyx_t_9;
      __pyx_t_9 = 0;

      /* "pyarrow/table.pxi":489
 *         converted_arrays = []
 *         for i, item in enumerate(arrays):
 *             item = asarray(item, type=schema[i].type)             # <<<<<<<<<<<<<<
 *             converted_arrays.append(item)
 *     return converted_arrays
 */
      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_asarray); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 489, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 489, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_v_item);
      __Pyx_GIVEREF(__pyx_v_item);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_item);
      __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(6, 489, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_12 = __Pyx_PyObject_GetItem(__pyx_v_schema, __pyx_v_i); if (unlikely(!__pyx_t_12)) __PYX_ERR(6, 489, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_type); if (unlikely(!__pyx_t_13)) __PYX_ERR(6, 489, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_type, __pyx_t_13) < 0) __PYX_ERR(6, 489, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_13)) __PYX_ERR(6, 489, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF_SET(__pyx_v_item, __pyx_t_13);
      __pyx_t_13 = 0;

      /* "pyarrow/table.pxi":490
 *         for i, item in enumerate(arrays):
 *             item = asarray(item, type=schema[i].type)
 *             converted_arrays.append(item)             # <<<<<<<<<<<<<<
 *     return converted_arrays
 * 
 */
      __pyx_t_14 = __Pyx_PyObject_Append(__pyx_v_converted_arrays, __pyx_v_item); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(6, 490, __pyx_L1_error)

      /* "pyarrow/table.pxi":488
 *         c_schema[0] = cy_schema.sp_schema
 *         converted_arrays = []
 *         for i, item in enumerate(arrays):             # <<<<<<<<<<<<<<
 *             item = asarray(item, type=schema[i].type)
 *             converted_arrays.append(item)
 */
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "pyarrow/table.pxi":491
 *             item = asarray(item, type=schema[i].type)
 *             converted_arrays.append(item)
 *     return converted_arrays             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_converted_arrays);
  __pyx_r = __pyx_v_converted_arrays;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":470
 * 
 * 
 * cdef _sanitize_arrays(arrays, names, schema, metadata,             # <<<<<<<<<<<<<<
 *                       shared_ptr[CSchema]* c_schema):
 *     cdef Schema cy_schema
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("pyarrow.lib._sanitize_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_cy_schema);
  __Pyx_XDECREF(__pyx_v_converted_arrays);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":504
 *     """
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.batch = NULL
 *         self._schema = None
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_11RecordBatch_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_11RecordBatch_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch___cinit__(((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_11RecordBatch___cinit__(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/table.pxi":505
 * 
 *     def __cinit__(self):
 *         self.batch = NULL             # <<<<<<<<<<<<<<
 *         self._schema = None
 * 
 */
  __pyx_v_self->batch = NULL;

  /* "pyarrow/table.pxi":506
 *     def __cinit__(self):
 *         self.batch = NULL
 *         self._schema = None             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self):
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_schema);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_schema));
  __pyx_v_self->_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)Py_None);

  /* "pyarrow/table.pxi":504
 *     """
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.batch = NULL
 *         self._schema = None
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":508
 *         self._schema = None
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call RecordBatch's constructor directly, use "
 *                         "one of the `RecordBatch.from_*` functions instead.")
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_11RecordBatch_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_11RecordBatch_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_2__init__(((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_11RecordBatch_2__init__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/table.pxi":509
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call RecordBatch's constructor directly, use "             # <<<<<<<<<<<<<<
 *                         "one of the `RecordBatch.from_*` functions instead.")
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__165, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(6, 509, __pyx_L1_error)

  /* "pyarrow/table.pxi":508
 *         self._schema = None
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call RecordBatch's constructor directly, use "
 *                         "one of the `RecordBatch.from_*` functions instead.")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":512
 *                         "one of the `RecordBatch.from_*` functions instead.")
 * 
 *     cdef void init(self, const shared_ptr[CRecordBatch]& batch):             # <<<<<<<<<<<<<<
 *         self.sp_batch = batch
 *         self.batch = batch.get()
 */

static void __pyx_f_7pyarrow_3lib_11RecordBatch_init(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self, std::shared_ptr< arrow::RecordBatch>  const &__pyx_v_batch) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/table.pxi":513
 * 
 *     cdef void init(self, const shared_ptr[CRecordBatch]& batch):
 *         self.sp_batch = batch             # <<<<<<<<<<<<<<
 *         self.batch = batch.get()
 * 
 */
  __pyx_v_self->sp_batch = __pyx_v_batch;

  /* "pyarrow/table.pxi":514
 *     cdef void init(self, const shared_ptr[CRecordBatch]& batch):
 *         self.sp_batch = batch
 *         self.batch = batch.get()             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  __pyx_v_self->batch = __pyx_v_batch.get();

  /* "pyarrow/table.pxi":512
 *                         "one of the `RecordBatch.from_*` functions instead.")
 * 
 *     cdef void init(self, const shared_ptr[CRecordBatch]& batch):             # <<<<<<<<<<<<<<
 *         self.sp_batch = batch
 *         self.batch = batch.get()
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/table.pxi":516
 *         self.batch = batch.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return _reconstruct_record_batch, (self.columns, self.schema)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_5__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11RecordBatch_4__reduce__[] = "RecordBatch.__reduce__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_5__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_4__reduce__(((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_4__reduce__(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pyarrow/table.pxi":517
 * 
 *     def __reduce__(self):
 *         return _reconstruct_record_batch, (self.columns, self.schema)             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_reconstruct_record_batch); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_columns); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_schema); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":516
 *         self.batch = batch.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return _reconstruct_record_batch, (self.columns, self.schema)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":519
 *         return _reconstruct_record_batch, (self.columns, self.schema)
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.batch.num_rows()
 * 
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_7pyarrow_3lib_11RecordBatch_7__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pw_7pyarrow_3lib_11RecordBatch_7__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_6__len__(((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static Py_ssize_t __pyx_pf_7pyarrow_3lib_11RecordBatch_6__len__(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "pyarrow/table.pxi":520
 * 
 *     def __len__(self):
 *         return self.batch.num_rows()             # <<<<<<<<<<<<<<
 * 
 *     def validate(self, *, full=False):
 */
  __pyx_r = __pyx_v_self->batch->num_rows();
  goto __pyx_L0;

  /* "pyarrow/table.pxi":519
 *         return _reconstruct_record_batch, (self.columns, self.schema)
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.batch.num_rows()
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":522
 *         return self.batch.num_rows()
 * 
 *     def validate(self, *, full=False):             # <<<<<<<<<<<<<<
 *         """
 *         Perform validation checks.  An exception is raised if validation fails.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_9validate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11RecordBatch_8validate[] = "RecordBatch.validate(self, *, full=False)\n\n        Perform validation checks.  An exception is raised if validation fails.\n\n        By default only cheap validation checks are run.  Pass `full=True`\n        for thorough validation checks (potentially O(n)).\n\n        Parameters\n        ----------\n        full: bool, default False\n            If True, run expensive checks, otherwise cheap checks only.\n\n        Raises\n        ------\n        ArrowInvalid\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_9validate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_full = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("validate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_full,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      if (kw_args == 1) {
        const Py_ssize_t index = 0;
        PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]);
        if (value) { values[index] = value; kw_args--; }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, 0, "validate") < 0)) __PYX_ERR(6, 522, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 0) {
      goto __pyx_L5_argtuple_error;
    } else {
    }
    __pyx_v_full = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("validate", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 522, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.validate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_8validate(((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_self), __pyx_v_full);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_8validate(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self, PyObject *__pyx_v_full) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("validate", 0);

  /* "pyarrow/table.pxi":538
 *         ArrowInvalid
 *         """
 *         if full:             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 check_status(self.batch.ValidateFull())
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_full); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 538, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/table.pxi":539
 *         """
 *         if full:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(self.batch.ValidateFull())
 *         else:
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "pyarrow/table.pxi":540
 *         if full:
 *             with nogil:
 *                 check_status(self.batch.ValidateFull())             # <<<<<<<<<<<<<<
 *         else:
 *             with nogil:
 */
          __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->batch->ValidateFull()); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 540, __pyx_L5_error)
        }

        /* "pyarrow/table.pxi":539
 *         """
 *         if full:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(self.batch.ValidateFull())
 *         else:
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L6;
          }
          __pyx_L5_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L6:;
        }
    }

    /* "pyarrow/table.pxi":538
 *         ArrowInvalid
 *         """
 *         if full:             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 check_status(self.batch.ValidateFull())
 */
    goto __pyx_L3;
  }

  /* "pyarrow/table.pxi":542
 *                 check_status(self.batch.ValidateFull())
 *         else:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(self.batch.Validate())
 * 
 */
  /*else*/ {
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "pyarrow/table.pxi":543
 *         else:
 *             with nogil:
 *                 check_status(self.batch.Validate())             # <<<<<<<<<<<<<<
 * 
 *     def replace_schema_metadata(self, metadata=None):
 */
          __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->batch->Validate()); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 543, __pyx_L8_error)
        }

        /* "pyarrow/table.pxi":542
 *                 check_status(self.batch.ValidateFull())
 *         else:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(self.batch.Validate())
 * 
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L9;
          }
          __pyx_L8_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L9:;
        }
    }
  }
  __pyx_L3:;

  /* "pyarrow/table.pxi":522
 *         return self.batch.num_rows()
 * 
 *     def validate(self, *, full=False):             # <<<<<<<<<<<<<<
 *         """
 *         Perform validation checks.  An exception is raised if validation fails.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.validate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":545
 *                 check_status(self.batch.Validate())
 * 
 *     def replace_schema_metadata(self, metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         EXPERIMENTAL: Create shallow copy of record batch by replacing schema
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_11replace_schema_metadata(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11RecordBatch_10replace_schema_metadata[] = "RecordBatch.replace_schema_metadata(self, metadata=None)\n\n        EXPERIMENTAL: Create shallow copy of record batch by replacing schema\n        key-value metadata with the indicated new metadata (which may be None,\n        which deletes any existing metadata\n\n        Parameters\n        ----------\n        metadata : dict, default None\n\n        Returns\n        -------\n        shallow_copy : RecordBatch\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_11replace_schema_metadata(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_metadata = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("replace_schema_metadata (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_metadata,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_metadata);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "replace_schema_metadata") < 0)) __PYX_ERR(6, 545, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_metadata = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("replace_schema_metadata", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 545, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.replace_schema_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_10replace_schema_metadata(((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_self), __pyx_v_metadata);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_10replace_schema_metadata(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self, PyObject *__pyx_v_metadata) {
  std::shared_ptr< arrow::KeyValueMetadata>  __pyx_v_c_meta;
  std::shared_ptr< arrow::RecordBatch>  __pyx_v_c_batch;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("replace_schema_metadata", 0);

  /* "pyarrow/table.pxi":563
 *             shared_ptr[CRecordBatch] c_batch
 * 
 *         if metadata is not None:             # <<<<<<<<<<<<<<
 *             if not isinstance(metadata, dict):
 *                 raise TypeError('Metadata must be an instance of dict')
 */
  __pyx_t_1 = (__pyx_v_metadata != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":564
 * 
 *         if metadata is not None:
 *             if not isinstance(metadata, dict):             # <<<<<<<<<<<<<<
 *                 raise TypeError('Metadata must be an instance of dict')
 *             c_meta = pyarrow_unwrap_metadata(metadata)
 */
    __pyx_t_2 = PyDict_Check(__pyx_v_metadata); 
    __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0);
    if (unlikely(__pyx_t_1)) {

      /* "pyarrow/table.pxi":565
 *         if metadata is not None:
 *             if not isinstance(metadata, dict):
 *                 raise TypeError('Metadata must be an instance of dict')             # <<<<<<<<<<<<<<
 *             c_meta = pyarrow_unwrap_metadata(metadata)
 * 
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 565, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(6, 565, __pyx_L1_error)

      /* "pyarrow/table.pxi":564
 * 
 *         if metadata is not None:
 *             if not isinstance(metadata, dict):             # <<<<<<<<<<<<<<
 *                 raise TypeError('Metadata must be an instance of dict')
 *             c_meta = pyarrow_unwrap_metadata(metadata)
 */
    }

    /* "pyarrow/table.pxi":566
 *             if not isinstance(metadata, dict):
 *                 raise TypeError('Metadata must be an instance of dict')
 *             c_meta = pyarrow_unwrap_metadata(metadata)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
    __pyx_v_c_meta = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_metadata(__pyx_v_metadata);

    /* "pyarrow/table.pxi":563
 *             shared_ptr[CRecordBatch] c_batch
 * 
 *         if metadata is not None:             # <<<<<<<<<<<<<<
 *             if not isinstance(metadata, dict):
 *                 raise TypeError('Metadata must be an instance of dict')
 */
  }

  /* "pyarrow/table.pxi":568
 *             c_meta = pyarrow_unwrap_metadata(metadata)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             c_batch = self.batch.ReplaceSchemaMetadata(c_meta)
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":569
 * 
 *         with nogil:
 *             c_batch = self.batch.ReplaceSchemaMetadata(c_meta)             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_batch(c_batch)
 */
        __pyx_v_c_batch = __pyx_v_self->batch->ReplaceSchemaMetadata(__pyx_v_c_meta);
      }

      /* "pyarrow/table.pxi":568
 *             c_meta = pyarrow_unwrap_metadata(metadata)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             c_batch = self.batch.ReplaceSchemaMetadata(c_meta)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L7;
        }
        __pyx_L7:;
      }
  }

  /* "pyarrow/table.pxi":571
 *             c_batch = self.batch.ReplaceSchemaMetadata(c_meta)
 * 
 *         return pyarrow_wrap_batch(c_batch)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_batch(__pyx_v_c_batch); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":545
 *                 check_status(self.batch.Validate())
 * 
 *     def replace_schema_metadata(self, metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         EXPERIMENTAL: Create shallow copy of record batch by replacing schema
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.replace_schema_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":574
 * 
 *     @property
 *     def num_columns(self):             # <<<<<<<<<<<<<<
 *         """
 *         Number of columns
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_11num_columns_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_11num_columns_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_11num_columns___get__(((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_11num_columns___get__(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/table.pxi":582
 *         int
 *         """
 *         return self.batch.num_columns()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->batch->num_columns()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":574
 * 
 *     @property
 *     def num_columns(self):             # <<<<<<<<<<<<<<
 *         """
 *         Number of columns
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.num_columns.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":585
 * 
 *     @property
 *     def num_rows(self):             # <<<<<<<<<<<<<<
 *         """
 *         Number of rows
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_8num_rows_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_8num_rows_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_8num_rows___get__(((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_8num_rows___get__(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/table.pxi":596
 *         int
 *         """
 *         return len(self)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(6, 596, __pyx_L1_error)
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":585
 * 
 *     @property
 *     def num_rows(self):             # <<<<<<<<<<<<<<
 *         """
 *         Number of rows
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.num_rows.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":599
 * 
 *     @property
 *     def schema(self):             # <<<<<<<<<<<<<<
 *         """
 *         Schema of the RecordBatch and its columns
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_6schema_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_6schema_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_6schema___get__(((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_6schema___get__(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/table.pxi":607
 *         pyarrow.Schema
 *         """
 *         if self._schema is None:             # <<<<<<<<<<<<<<
 *             self._schema = pyarrow_wrap_schema(self.batch.schema())
 * 
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_self->_schema) == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":608
 *         """
 *         if self._schema is None:
 *             self._schema = pyarrow_wrap_schema(self.batch.schema())             # <<<<<<<<<<<<<<
 * 
 *         return self._schema
 */
    __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(__pyx_v_self->batch->schema()); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 608, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_Schema))))) __PYX_ERR(6, 608, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_GOTREF(__pyx_v_self->_schema);
    __Pyx_DECREF(((PyObject *)__pyx_v_self->_schema));
    __pyx_v_self->_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/table.pxi":607
 *         pyarrow.Schema
 *         """
 *         if self._schema is None:             # <<<<<<<<<<<<<<
 *             self._schema = pyarrow_wrap_schema(self.batch.schema())
 * 
 */
  }

  /* "pyarrow/table.pxi":610
 *             self._schema = pyarrow_wrap_schema(self.batch.schema())
 * 
 *         return self._schema             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->_schema));
  __pyx_r = ((PyObject *)__pyx_v_self->_schema);
  goto __pyx_L0;

  /* "pyarrow/table.pxi":599
 * 
 *     @property
 *     def schema(self):             # <<<<<<<<<<<<<<
 *         """
 *         Schema of the RecordBatch and its columns
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.schema.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":613
 * 
 *     @property
 *     def columns(self):             # <<<<<<<<<<<<<<
 *         """
 *         List of all columns in numerical order
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_7columns_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_7columns_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_7columns___get__(((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_7columns___get__(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self) {
  PyObject *__pyx_9genexpr10__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/table.pxi":621
 *         list of pa.Array
 *         """
 *         return [self.column(i) for i in range(self.num_columns)]             # <<<<<<<<<<<<<<
 * 
 *     def column(self, i):
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 621, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_columns); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 621, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 621, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 621, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 621, __pyx_L5_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_5)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(6, 621, __pyx_L5_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 621, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(6, 621, __pyx_L5_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 621, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_5(__pyx_t_2);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(6, 621, __pyx_L5_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_9genexpr10__pyx_v_i, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_column); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 621, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_9genexpr10__pyx_v_i) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_9genexpr10__pyx_v_i);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 621, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(6, 621, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_i); __pyx_9genexpr10__pyx_v_i = 0;
    goto __pyx_L8_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_i); __pyx_9genexpr10__pyx_v_i = 0;
    goto __pyx_L1_error;
    __pyx_L8_exit_scope:;
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":613
 * 
 *     @property
 *     def columns(self):             # <<<<<<<<<<<<<<
 *         """
 *         List of all columns in numerical order
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.columns.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":623
 *         return [self.column(i) for i in range(self.num_columns)]
 * 
 *     def column(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Select single column from record batch
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_13column(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11RecordBatch_12column[] = "RecordBatch.column(self, i)\n\n        Select single column from record batch\n\n        Returns\n        -------\n        column : pyarrow.Array\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_13column(PyObject *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("column (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_12column(((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_self), ((PyObject *)__pyx_v_i));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_12column(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self, PyObject *__pyx_v_i) {
  int __pyx_v_index;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("column", 0);

  /* "pyarrow/table.pxi":631
 *         column : pyarrow.Array
 *         """
 *         cdef int index = <int> _normalize_index(i, self.num_columns)             # <<<<<<<<<<<<<<
 *         cdef Array result = pyarrow_wrap_array(self.batch.column(index))
 *         result._name = self.schema[index].name
 */
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(6, 631, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_columns); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(6, 631, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_f_7pyarrow_3lib__normalize_index(__pyx_t_1, __pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1L))) __PYX_ERR(6, 631, __pyx_L1_error)
  __pyx_v_index = ((int)__pyx_t_4);

  /* "pyarrow/table.pxi":632
 *         """
 *         cdef int index = <int> _normalize_index(i, self.num_columns)
 *         cdef Array result = pyarrow_wrap_array(self.batch.column(index))             # <<<<<<<<<<<<<<
 *         result._name = self.schema[index].name
 *         return result
 */
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_self->batch->column(__pyx_v_index)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 632, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(6, 632, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/table.pxi":633
 *         cdef int index = <int> _normalize_index(i, self.num_columns)
 *         cdef Array result = pyarrow_wrap_array(self.batch.column(index))
 *         result._name = self.schema[index].name             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_schema); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_result->_name);
  __Pyx_DECREF(__pyx_v_result->_name);
  __pyx_v_result->_name = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/table.pxi":634
 *         cdef Array result = pyarrow_wrap_array(self.batch.column(index))
 *         result._name = self.schema[index].name
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/table.pxi":623
 *         return [self.column(i) for i in range(self.num_columns)]
 * 
 *     def column(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Select single column from record batch
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.column", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":637
 * 
 *     @property
 *     def nbytes(self):             # <<<<<<<<<<<<<<
 *         """
 *         Total number of bytes consumed by the elements of the record batch.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_6nbytes_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_6nbytes___get__(((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_6nbytes___get__(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self) {
  PyObject *__pyx_v_size = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/table.pxi":641
 *         Total number of bytes consumed by the elements of the record batch.
 *         """
 *         size = 0             # <<<<<<<<<<<<<<
 *         for i in range(self.num_columns):
 *             size += self.column(i).nbytes
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_size = __pyx_int_0;

  /* "pyarrow/table.pxi":642
 *         """
 *         size = 0
 *         for i in range(self.num_columns):             # <<<<<<<<<<<<<<
 *             size += self.column(i).nbytes
 *         return size
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_columns); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 642, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 642, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(6, 642, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 642, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(6, 642, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 642, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(6, 642, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/table.pxi":643
 *         size = 0
 *         for i in range(self.num_columns):
 *             size += self.column(i).nbytes             # <<<<<<<<<<<<<<
 *         return size
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_column); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 643, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_i) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_i);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 643, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_nbytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 643, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_size, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 643, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_size, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/table.pxi":642
 *         """
 *         size = 0
 *         for i in range(self.num_columns):             # <<<<<<<<<<<<<<
 *             size += self.column(i).nbytes
 *         return size
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":644
 *         for i in range(self.num_columns):
 *             size += self.column(i).nbytes
 *         return size             # <<<<<<<<<<<<<<
 * 
 *     def __sizeof__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_size);
  __pyx_r = __pyx_v_size;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":637
 * 
 *     @property
 *     def nbytes(self):             # <<<<<<<<<<<<<<
 *         """
 *         Total number of bytes consumed by the elements of the record batch.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_size);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":646
 *         return size
 * 
 *     def __sizeof__(self):             # <<<<<<<<<<<<<<
 *         return super(RecordBatch, self).__sizeof__() + self.nbytes
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_15__sizeof__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11RecordBatch_14__sizeof__[] = "RecordBatch.__sizeof__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_15__sizeof__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sizeof__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_14__sizeof__(((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_14__sizeof__(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__sizeof__", 0);

  /* "pyarrow/table.pxi":647
 * 
 *     def __sizeof__(self):
 *         return super(RecordBatch, self).__sizeof__() + self.nbytes             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, key):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 647, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_7pyarrow_3lib_RecordBatch));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7pyarrow_3lib_RecordBatch));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_7pyarrow_3lib_RecordBatch));
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self));
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 647, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sizeof); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 647, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 647, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_nbytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 647, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 647, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":646
 *         return size
 * 
 *     def __sizeof__(self):             # <<<<<<<<<<<<<<
 *         return super(RecordBatch, self).__sizeof__() + self.nbytes
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.__sizeof__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":649
 *         return super(RecordBatch, self).__sizeof__() + self.nbytes
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         if isinstance(key, slice):
 *             return _normalize_slice(self, key)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_17__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_17__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_16__getitem__(((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_self), ((PyObject *)__pyx_v_key));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_16__getitem__(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "pyarrow/table.pxi":650
 * 
 *     def __getitem__(self, key):
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return _normalize_slice(self, key)
 *         else:
 */
  __pyx_t_1 = PySlice_Check(__pyx_v_key); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":651
 *     def __getitem__(self, key):
 *         if isinstance(key, slice):
 *             return _normalize_slice(self, key)             # <<<<<<<<<<<<<<
 *         else:
 *             return self.column(key)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_normalize_slice); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 651, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_key};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 651, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_key};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 651, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 651, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_self));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_self));
      __Pyx_INCREF(__pyx_v_key);
      __Pyx_GIVEREF(__pyx_v_key);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_key);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 651, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "pyarrow/table.pxi":650
 * 
 *     def __getitem__(self, key):
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return _normalize_slice(self, key)
 *         else:
 */
  }

  /* "pyarrow/table.pxi":653
 *             return _normalize_slice(self, key)
 *         else:
 *             return self.column(key)             # <<<<<<<<<<<<<<
 * 
 *     def serialize(self, memory_pool=None):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_column); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 653, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_7, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_key);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 653, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/table.pxi":649
 *         return super(RecordBatch, self).__sizeof__() + self.nbytes
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         if isinstance(key, slice):
 *             return _normalize_slice(self, key)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":655
 *             return self.column(key)
 * 
 *     def serialize(self, memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Write RecordBatch to Buffer as encapsulated IPC message
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_19serialize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11RecordBatch_18serialize[] = "RecordBatch.serialize(self, memory_pool=None)\n\n        Write RecordBatch to Buffer as encapsulated IPC message\n\n        Parameters\n        ----------\n        memory_pool : MemoryPool, default None\n            Uses default memory pool if not specified\n\n        Returns\n        -------\n        serialized : Buffer\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_19serialize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_memory_pool = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("serialize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_memory_pool,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "serialize") < 0)) __PYX_ERR(6, 655, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_memory_pool = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("serialize", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 655, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.serialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_18serialize(((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_self), __pyx_v_memory_pool);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_18serialize(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self, PyObject *__pyx_v_memory_pool) {
  std::shared_ptr< arrow::Buffer>  __pyx_v_buffer;
   arrow::MemoryPool *__pyx_v_pool;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("serialize", 0);

  /* "pyarrow/table.pxi":670
 *         cdef:
 *             shared_ptr[CBuffer] buffer
 *             CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  if (!(likely(((__pyx_v_memory_pool) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_memory_pool, __pyx_ptype_7pyarrow_3lib_MemoryPool))))) __PYX_ERR(6, 670, __pyx_L1_error)
  __pyx_v_pool = __pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_v_memory_pool));

  /* "pyarrow/table.pxi":672
 *             CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(SerializeRecordBatch(deref(self.batch),
 *                                               pool, &buffer))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":673
 * 
 *         with nogil:
 *             check_status(SerializeRecordBatch(deref(self.batch),             # <<<<<<<<<<<<<<
 *                                               pool, &buffer))
 *         return pyarrow_wrap_buffer(buffer)
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::ipc::SerializeRecordBatch((*__pyx_v_self->batch), __pyx_v_pool, (&__pyx_v_buffer))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 673, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":672
 *             CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(SerializeRecordBatch(deref(self.batch),
 *                                               pool, &buffer))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/table.pxi":675
 *             check_status(SerializeRecordBatch(deref(self.batch),
 *                                               pool, &buffer))
 *         return pyarrow_wrap_buffer(buffer)             # <<<<<<<<<<<<<<
 * 
 *     def slice(self, offset=0, length=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":655
 *             return self.column(key)
 * 
 *     def serialize(self, memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Write RecordBatch to Buffer as encapsulated IPC message
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.serialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":677
 *         return pyarrow_wrap_buffer(buffer)
 * 
 *     def slice(self, offset=0, length=None):             # <<<<<<<<<<<<<<
 *         """
 *         Compute zero-copy slice of this RecordBatch
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_21slice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11RecordBatch_20slice[] = "RecordBatch.slice(self, offset=0, length=None)\n\n        Compute zero-copy slice of this RecordBatch\n\n        Parameters\n        ----------\n        offset : int, default 0\n            Offset from start of record batch to slice\n        length : int, default None\n            Length of slice (default is until end of batch starting from\n            offset)\n\n        Returns\n        -------\n        sliced : RecordBatch\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_21slice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_offset = 0;
  PyObject *__pyx_v_length = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("slice (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_offset,&__pyx_n_s_length,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)__pyx_int_0);
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offset);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_length);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "slice") < 0)) __PYX_ERR(6, 677, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_offset = values[0];
    __pyx_v_length = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("slice", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 677, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_20slice(((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_self), __pyx_v_offset, __pyx_v_length);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_20slice(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self, PyObject *__pyx_v_offset, PyObject *__pyx_v_length) {
  std::shared_ptr< arrow::RecordBatch>  __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int64_t __pyx_t_4;
  int64_t __pyx_t_5;
  __Pyx_RefNannySetupContext("slice", 0);

  /* "pyarrow/table.pxi":695
 *         cdef shared_ptr[CRecordBatch] result
 * 
 *         if offset < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError('Offset must be non-negative')
 * 
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_offset, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 695, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 695, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/table.pxi":696
 * 
 *         if offset < 0:
 *             raise IndexError('Offset must be non-negative')             # <<<<<<<<<<<<<<
 * 
 *         if length is None:
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__147, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 696, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(6, 696, __pyx_L1_error)

    /* "pyarrow/table.pxi":695
 *         cdef shared_ptr[CRecordBatch] result
 * 
 *         if offset < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError('Offset must be non-negative')
 * 
 */
  }

  /* "pyarrow/table.pxi":698
 *             raise IndexError('Offset must be non-negative')
 * 
 *         if length is None:             # <<<<<<<<<<<<<<
 *             result = self.batch.Slice(offset)
 *         else:
 */
  __pyx_t_2 = (__pyx_v_length == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/table.pxi":699
 * 
 *         if length is None:
 *             result = self.batch.Slice(offset)             # <<<<<<<<<<<<<<
 *         else:
 *             result = self.batch.Slice(offset, length)
 */
    __pyx_t_4 = __Pyx_PyInt_As_int64_t(__pyx_v_offset); if (unlikely((__pyx_t_4 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 699, __pyx_L1_error)
    __pyx_v_result = __pyx_v_self->batch->Slice(__pyx_t_4);

    /* "pyarrow/table.pxi":698
 *             raise IndexError('Offset must be non-negative')
 * 
 *         if length is None:             # <<<<<<<<<<<<<<
 *             result = self.batch.Slice(offset)
 *         else:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/table.pxi":701
 *             result = self.batch.Slice(offset)
 *         else:
 *             result = self.batch.Slice(offset, length)             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_batch(result)
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyInt_As_int64_t(__pyx_v_offset); if (unlikely((__pyx_t_4 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 701, __pyx_L1_error)
    __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_v_length); if (unlikely((__pyx_t_5 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 701, __pyx_L1_error)
    __pyx_v_result = __pyx_v_self->batch->Slice(__pyx_t_4, __pyx_t_5);
  }
  __pyx_L4:;

  /* "pyarrow/table.pxi":703
 *             result = self.batch.Slice(offset, length)
 * 
 *         return pyarrow_wrap_batch(result)             # <<<<<<<<<<<<<<
 * 
 *     def equals(self, RecordBatch other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_batch(__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":677
 *         return pyarrow_wrap_buffer(buffer)
 * 
 *     def slice(self, offset=0, length=None):             # <<<<<<<<<<<<<<
 *         """
 *         Compute zero-copy slice of this RecordBatch
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":705
 *         return pyarrow_wrap_batch(result)
 * 
 *     def equals(self, RecordBatch other):             # <<<<<<<<<<<<<<
 *         cdef:
 *             CRecordBatch* this_batch = self.batch
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_23equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11RecordBatch_22equals[] = "RecordBatch.equals(self, RecordBatch other)";
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_23equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("equals (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_7pyarrow_3lib_RecordBatch, 1, "other", 0))) __PYX_ERR(6, 705, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_22equals(((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_22equals(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_other) {
   arrow::RecordBatch *__pyx_v_this_batch;
   arrow::RecordBatch *__pyx_v_other_batch;
  bool __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
   arrow::RecordBatch *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("equals", 0);

  /* "pyarrow/table.pxi":707
 *     def equals(self, RecordBatch other):
 *         cdef:
 *             CRecordBatch* this_batch = self.batch             # <<<<<<<<<<<<<<
 *             CRecordBatch* other_batch = other.batch
 *             c_bool result
 */
  __pyx_t_1 = __pyx_v_self->batch;
  __pyx_v_this_batch = __pyx_t_1;

  /* "pyarrow/table.pxi":708
 *         cdef:
 *             CRecordBatch* this_batch = self.batch
 *             CRecordBatch* other_batch = other.batch             # <<<<<<<<<<<<<<
 *             c_bool result
 * 
 */
  __pyx_t_1 = __pyx_v_other->batch;
  __pyx_v_other_batch = __pyx_t_1;

  /* "pyarrow/table.pxi":711
 *             c_bool result
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = this_batch.Equals(deref(other_batch))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":712
 * 
 *         with nogil:
 *             result = this_batch.Equals(deref(other_batch))             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
        __pyx_v_result = __pyx_v_this_batch->Equals((*__pyx_v_other_batch));
      }

      /* "pyarrow/table.pxi":711
 *             c_bool result
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = this_batch.Equals(deref(other_batch))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/table.pxi":714
 *             result = this_batch.Equals(deref(other_batch))
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def to_pydict(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 714, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":705
 *         return pyarrow_wrap_batch(result)
 * 
 *     def equals(self, RecordBatch other):             # <<<<<<<<<<<<<<
 *         cdef:
 *             CRecordBatch* this_batch = self.batch
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.equals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":716
 *         return result
 * 
 *     def to_pydict(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert the RecordBatch to a dict or OrderedDict.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_25to_pydict(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11RecordBatch_24to_pydict[] = "RecordBatch.to_pydict(self)\n\n        Convert the RecordBatch to a dict or OrderedDict.\n\n        Returns\n        -------\n        dict\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_25to_pydict(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_pydict (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_24to_pydict(((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_24to_pydict(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self) {
  PyObject *__pyx_v_entries = NULL;
  int __pyx_v_i;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_column = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("to_pydict", 0);

  /* "pyarrow/table.pxi":724
 *         dict
 *         """
 *         entries = []             # <<<<<<<<<<<<<<
 *         for i in range(self.batch.num_columns()):
 *             name = bytes(self.batch.column_name(i)).decode('utf8')
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_entries = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":725
 *         """
 *         entries = []
 *         for i in range(self.batch.num_columns()):             # <<<<<<<<<<<<<<
 *             name = bytes(self.batch.column_name(i)).decode('utf8')
 *             column = self[i].to_pylist()
 */
  __pyx_t_2 = __pyx_v_self->batch->num_columns();
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "pyarrow/table.pxi":726
 *         entries = []
 *         for i in range(self.batch.num_columns()):
 *             name = bytes(self.batch.column_name(i)).decode('utf8')             # <<<<<<<<<<<<<<
 *             column = self[i].to_pylist()
 *             entries.append((name, column))
 */
    __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_self->batch->column_name(__pyx_v_i)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 726, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 726, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_decode_bytes(__pyx_t_5, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 726, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/table.pxi":727
 *         for i in range(self.batch.num_columns()):
 *             name = bytes(self.batch.column_name(i)).decode('utf8')
 *             column = self[i].to_pylist()             # <<<<<<<<<<<<<<
 *             entries.append((name, column))
 *         return ordered_dict(entries)
 */
    __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self), __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 727, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_to_pylist); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 727, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 727, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_column, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/table.pxi":728
 *             name = bytes(self.batch.column_name(i)).decode('utf8')
 *             column = self[i].to_pylist()
 *             entries.append((name, column))             # <<<<<<<<<<<<<<
 *         return ordered_dict(entries)
 * 
 */
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 728, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_name);
    __Pyx_INCREF(__pyx_v_column);
    __Pyx_GIVEREF(__pyx_v_column);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_column);
    __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_entries, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(6, 728, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyarrow/table.pxi":729
 *             column = self[i].to_pylist()
 *             entries.append((name, column))
 *         return ordered_dict(entries)             # <<<<<<<<<<<<<<
 * 
 *     def _to_pandas(self, options, **kwargs):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ordered_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_entries) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_entries);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":716
 *         return result
 * 
 *     def to_pydict(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert the RecordBatch to a dict or OrderedDict.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.to_pydict", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_entries);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_column);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":731
 *         return ordered_dict(entries)
 * 
 *     def _to_pandas(self, options, **kwargs):             # <<<<<<<<<<<<<<
 *         return Table.from_batches([self])._to_pandas(options, **kwargs)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_27_to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11RecordBatch_26_to_pandas[] = "RecordBatch._to_pandas(self, options, **kwargs)";
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_27_to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_options = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_to_pandas (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_options,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "_to_pandas") < 0)) __PYX_ERR(6, 731, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_options = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_to_pandas", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 731, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch._to_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_26_to_pandas(((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_self), __pyx_v_options, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_26_to_pandas(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self, PyObject *__pyx_v_options, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("_to_pandas", 0);

  /* "pyarrow/table.pxi":732
 * 
 *     def _to_pandas(self, options, **kwargs):
 *         return Table.from_batches([self])._to_pandas(options, **kwargs)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_Table), __pyx_n_s_from_batches); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyList_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_to_pandas); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_options);
  __Pyx_GIVEREF(__pyx_v_options);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_options);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":731
 *         return ordered_dict(entries)
 * 
 *     def _to_pandas(self, options, **kwargs):             # <<<<<<<<<<<<<<
 *         return Table.from_batches([self])._to_pandas(options, **kwargs)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch._to_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":735
 * 
 *     @classmethod
 *     def from_pandas(cls, df, Schema schema=None, preserve_index=None,             # <<<<<<<<<<<<<<
 *                     nthreads=None, columns=None):
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_29from_pandas(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11RecordBatch_28from_pandas[] = "RecordBatch.from_pandas(type cls, df, Schema schema=None, preserve_index=None, nthreads=None, columns=None)\n\n        Convert pandas.DataFrame to an Arrow RecordBatch\n\n        Parameters\n        ----------\n        df: pandas.DataFrame\n        schema: pyarrow.Schema, optional\n            The expected schema of the RecordBatch. This can be used to\n            indicate the type of columns if we cannot infer it automatically.\n            If passed, the output will have exactly this schema. Columns\n            specified in the schema that are not found in the DataFrame columns\n            or its index will raise an error. Additional columns or index\n            levels in the DataFrame which are not specified in the schema will\n            be ignored.\n        preserve_index : bool, optional\n            Whether to store the index as an additional column in the resulting\n            ``RecordBatch``. The default of None will store the index as a\n            column, except for RangeIndex which is stored as metadata only. Use\n            ``preserve_index=True`` to force it to be stored as a column.\n        nthreads : int, default None (may use up to system CPU count threads)\n            If greater than 1, convert columns to Arrow in parallel using\n            indicated number of threads\n        columns : list, optional\n           List of column to be converted. If None, use all columns.\n\n        Returns\n        -------\n        pyarrow.RecordBatch\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_29from_pandas(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_df = 0;
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema = 0;
  PyObject *__pyx_v_preserve_index = 0;
  PyObject *__pyx_v_nthreads = 0;
  PyObject *__pyx_v_columns = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_pandas (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_df,&__pyx_n_s_schema,&__pyx_n_s_preserve_index,&__pyx_n_s_nthreads,&__pyx_n_s_columns,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[1] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_Schema *)Py_None);
    values[2] = ((PyObject *)Py_None);

    /* "pyarrow/table.pxi":736
 *     @classmethod
 *     def from_pandas(cls, df, Schema schema=None, preserve_index=None,
 *                     nthreads=None, columns=None):             # <<<<<<<<<<<<<<
 *         """
 *         Convert pandas.DataFrame to an Arrow RecordBatch
 */
    values[3] = ((PyObject *)Py_None);
    values[4] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_df)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_schema);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_preserve_index);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nthreads);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_columns);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_pandas") < 0)) __PYX_ERR(6, 735, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_df = values[0];
    __pyx_v_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)values[1]);
    __pyx_v_preserve_index = values[2];
    __pyx_v_nthreads = values[3];
    __pyx_v_columns = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_pandas", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 735, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.from_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_schema), __pyx_ptype_7pyarrow_3lib_Schema, 1, "schema", 0))) __PYX_ERR(6, 735, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_28from_pandas(((PyTypeObject*)__pyx_v_cls), __pyx_v_df, __pyx_v_schema, __pyx_v_preserve_index, __pyx_v_nthreads, __pyx_v_columns);

  /* "pyarrow/table.pxi":735
 * 
 *     @classmethod
 *     def from_pandas(cls, df, Schema schema=None, preserve_index=None,             # <<<<<<<<<<<<<<
 *                     nthreads=None, columns=None):
 *         """
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_28from_pandas(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_df, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, PyObject *__pyx_v_preserve_index, PyObject *__pyx_v_nthreads, PyObject *__pyx_v_columns) {
  PyObject *__pyx_v_dataframe_to_arrays = NULL;
  PyObject *__pyx_v_arrays = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  __Pyx_RefNannySetupContext("from_pandas", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_schema);

  /* "pyarrow/table.pxi":766
 *         pyarrow.RecordBatch
 *         """
 *         from pyarrow.pandas_compat import dataframe_to_arrays             # <<<<<<<<<<<<<<
 *         arrays, schema = dataframe_to_arrays(
 *             df, schema, preserve_index, nthreads=nthreads, columns=columns
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_dataframe_to_arrays);
  __Pyx_GIVEREF(__pyx_n_s_dataframe_to_arrays);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_dataframe_to_arrays);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_pyarrow_pandas_compat, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_dataframe_to_arrays); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_dataframe_to_arrays = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/table.pxi":767
 *         """
 *         from pyarrow.pandas_compat import dataframe_to_arrays
 *         arrays, schema = dataframe_to_arrays(             # <<<<<<<<<<<<<<
 *             df, schema, preserve_index, nthreads=nthreads, columns=columns
 *         )
 */
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_df);
  __Pyx_GIVEREF(__pyx_v_df);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_df);
  __Pyx_INCREF(((PyObject *)__pyx_v_schema));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_schema));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_schema));
  __Pyx_INCREF(__pyx_v_preserve_index);
  __Pyx_GIVEREF(__pyx_v_preserve_index);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_preserve_index);

  /* "pyarrow/table.pxi":768
 *         from pyarrow.pandas_compat import dataframe_to_arrays
 *         arrays, schema = dataframe_to_arrays(
 *             df, schema, preserve_index, nthreads=nthreads, columns=columns             # <<<<<<<<<<<<<<
 *         )
 *         return cls.from_arrays(arrays, schema=schema)
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 768, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_nthreads, __pyx_v_nthreads) < 0) __PYX_ERR(6, 768, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_columns, __pyx_v_columns) < 0) __PYX_ERR(6, 768, __pyx_L1_error)

  /* "pyarrow/table.pxi":767
 *         """
 *         from pyarrow.pandas_compat import dataframe_to_arrays
 *         arrays, schema = dataframe_to_arrays(             # <<<<<<<<<<<<<<
 *             df, schema, preserve_index, nthreads=nthreads, columns=columns
 *         )
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_dataframe_to_arrays, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
    PyObject* sequence = __pyx_t_3;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(6, 767, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 767, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 767, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 767, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(6, 767, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(6, 767, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7pyarrow_3lib_Schema))))) __PYX_ERR(6, 767, __pyx_L1_error)
  __pyx_v_arrays = __pyx_t_1;
  __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_schema, ((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "pyarrow/table.pxi":770
 *             df, schema, preserve_index, nthreads=nthreads, columns=columns
 *         )
 *         return cls.from_arrays(arrays, schema=schema)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_cls), __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_arrays);
  __Pyx_GIVEREF(__pyx_v_arrays);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_arrays);
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_schema, ((PyObject *)__pyx_v_schema)) < 0) __PYX_ERR(6, 770, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":735
 * 
 *     @classmethod
 *     def from_pandas(cls, df, Schema schema=None, preserve_index=None,             # <<<<<<<<<<<<<<
 *                     nthreads=None, columns=None):
 *         """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.from_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dataframe_to_arrays);
  __Pyx_XDECREF(__pyx_v_arrays);
  __Pyx_XDECREF((PyObject *)__pyx_v_schema);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":773
 * 
 *     @staticmethod
 *     def from_arrays(list arrays, names=None, schema=None, metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a RecordBatch from multiple pyarrow.Arrays
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_31from_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11RecordBatch_30from_arrays[] = "RecordBatch.from_arrays(list arrays, names=None, schema=None, metadata=None)\n\n        Construct a RecordBatch from multiple pyarrow.Arrays\n\n        Parameters\n        ----------\n        arrays: list of pyarrow.Array\n            One for each field in RecordBatch\n        names : list of str, optional\n            Names for the batch fields. If not passed, schema must be passed\n        schema : Schema, default None\n            Schema for the created batch. If not passed, names must be passed\n        metadata : dict or Mapping, default None\n            Optional metadata for the schema (if inferred).\n\n        Returns\n        -------\n        pyarrow.RecordBatch\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_11RecordBatch_31from_arrays = {"from_arrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_11RecordBatch_31from_arrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_11RecordBatch_30from_arrays};
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_31from_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_arrays = 0;
  PyObject *__pyx_v_names = 0;
  PyObject *__pyx_v_schema = 0;
  PyObject *__pyx_v_metadata = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_arrays (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arrays,&__pyx_n_s_names,&__pyx_n_s_schema,&__pyx_n_s_metadata,0};
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arrays)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_names);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_schema);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_metadata);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_arrays") < 0)) __PYX_ERR(6, 773, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_arrays = ((PyObject*)values[0]);
    __pyx_v_names = values[1];
    __pyx_v_schema = values[2];
    __pyx_v_metadata = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_arrays", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 773, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.from_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arrays), (&PyList_Type), 1, "arrays", 1))) __PYX_ERR(6, 773, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_30from_arrays(__pyx_v_arrays, __pyx_v_names, __pyx_v_schema, __pyx_v_metadata);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_30from_arrays(PyObject *__pyx_v_arrays, PyObject *__pyx_v_names, PyObject *__pyx_v_schema, PyObject *__pyx_v_metadata) {
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_arr = 0;
  std::shared_ptr< arrow::Schema>  __pyx_v_c_schema;
  std::vector<std::shared_ptr< arrow::Array> >  __pyx_v_c_arrays;
  int64_t __pyx_v_num_rows;
  PyObject *__pyx_v_warnings = NULL;
  PyObject *__pyx_v_converted_arrays = NULL;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  __Pyx_RefNannySetupContext("from_arrays", 0);
  __Pyx_INCREF(__pyx_v_names);
  __Pyx_INCREF(__pyx_v_schema);

  /* "pyarrow/table.pxi":798
 *             int64_t num_rows
 * 
 *         if len(arrays) > 0:             # <<<<<<<<<<<<<<
 *             num_rows = len(arrays[0])
 *         else:
 */
  if (unlikely(__pyx_v_arrays == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(6, 798, __pyx_L1_error)
  }
  __pyx_t_1 = PyList_GET_SIZE(__pyx_v_arrays); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(6, 798, __pyx_L1_error)
  __pyx_t_2 = ((__pyx_t_1 > 0) != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":799
 * 
 *         if len(arrays) > 0:
 *             num_rows = len(arrays[0])             # <<<<<<<<<<<<<<
 *         else:
 *             num_rows = 0
 */
    if (unlikely(__pyx_v_arrays == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(6, 799, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_arrays, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 799, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(6, 799, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_num_rows = __pyx_t_1;

    /* "pyarrow/table.pxi":798
 *             int64_t num_rows
 * 
 *         if len(arrays) > 0:             # <<<<<<<<<<<<<<
 *             num_rows = len(arrays[0])
 *         else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/table.pxi":801
 *             num_rows = len(arrays[0])
 *         else:
 *             num_rows = 0             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(names, Schema):
 */
  /*else*/ {
    __pyx_v_num_rows = 0;
  }
  __pyx_L3:;

  /* "pyarrow/table.pxi":803
 *             num_rows = 0
 * 
 *         if isinstance(names, Schema):             # <<<<<<<<<<<<<<
 *             import warnings
 *             warnings.warn("Schema passed to names= option, please "
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_names, __pyx_ptype_7pyarrow_3lib_Schema); 
  __pyx_t_4 = (__pyx_t_2 != 0);
  if (__pyx_t_4) {

    /* "pyarrow/table.pxi":804
 * 
 *         if isinstance(names, Schema):
 *             import warnings             # <<<<<<<<<<<<<<
 *             warnings.warn("Schema passed to names= option, please "
 *                           "pass schema= explicitly. "
 */
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_warnings, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 804, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_warnings = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "pyarrow/table.pxi":805
 *         if isinstance(names, Schema):
 *             import warnings
 *             warnings.warn("Schema passed to names= option, please "             # <<<<<<<<<<<<<<
 *                           "pass schema= explicitly. "
 *                           "Will raise exception in future", FutureWarning)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_warnings, __pyx_n_s_warn); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 805, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "pyarrow/table.pxi":807
 *             warnings.warn("Schema passed to names= option, please "
 *                           "pass schema= explicitly. "
 *                           "Will raise exception in future", FutureWarning)             # <<<<<<<<<<<<<<
 *             schema = names
 *             names = None
 */
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__166, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 805, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "pyarrow/table.pxi":808
 *                           "pass schema= explicitly. "
 *                           "Will raise exception in future", FutureWarning)
 *             schema = names             # <<<<<<<<<<<<<<
 *             names = None
 * 
 */
    __Pyx_INCREF(__pyx_v_names);
    __Pyx_DECREF_SET(__pyx_v_schema, __pyx_v_names);

    /* "pyarrow/table.pxi":809
 *                           "Will raise exception in future", FutureWarning)
 *             schema = names
 *             names = None             # <<<<<<<<<<<<<<
 * 
 *         converted_arrays = _sanitize_arrays(arrays, names, schema, metadata,
 */
    __Pyx_INCREF(Py_None);
    __Pyx_DECREF_SET(__pyx_v_names, Py_None);

    /* "pyarrow/table.pxi":803
 *             num_rows = 0
 * 
 *         if isinstance(names, Schema):             # <<<<<<<<<<<<<<
 *             import warnings
 *             warnings.warn("Schema passed to names= option, please "
 */
  }

  /* "pyarrow/table.pxi":811
 *             names = None
 * 
 *         converted_arrays = _sanitize_arrays(arrays, names, schema, metadata,             # <<<<<<<<<<<<<<
 *                                             &c_schema)
 * 
 */
  __pyx_t_5 = __pyx_f_7pyarrow_3lib__sanitize_arrays(__pyx_v_arrays, __pyx_v_names, __pyx_v_schema, __pyx_v_metadata, (&__pyx_v_c_schema)); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 811, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_converted_arrays = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "pyarrow/table.pxi":814
 *                                             &c_schema)
 * 
 *         c_arrays.reserve(len(arrays))             # <<<<<<<<<<<<<<
 *         for arr in converted_arrays:
 *             if len(arr) != num_rows:
 */
  if (unlikely(__pyx_v_arrays == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(6, 814, __pyx_L1_error)
  }
  __pyx_t_1 = PyList_GET_SIZE(__pyx_v_arrays); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(6, 814, __pyx_L1_error)
  __pyx_v_c_arrays.reserve(__pyx_t_1);

  /* "pyarrow/table.pxi":815
 * 
 *         c_arrays.reserve(len(arrays))
 *         for arr in converted_arrays:             # <<<<<<<<<<<<<<
 *             if len(arr) != num_rows:
 *                 raise ValueError('Arrays were not all the same length: '
 */
  if (likely(PyList_CheckExact(__pyx_v_converted_arrays)) || PyTuple_CheckExact(__pyx_v_converted_arrays)) {
    __pyx_t_5 = __pyx_v_converted_arrays; __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_1 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_converted_arrays); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 815, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 815, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_5))) {
        if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(6, 815, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 815, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(6, 815, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 815, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_6(__pyx_t_5);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(6, 815, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(6, 815, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_arr, ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "pyarrow/table.pxi":816
 *         c_arrays.reserve(len(arrays))
 *         for arr in converted_arrays:
 *             if len(arr) != num_rows:             # <<<<<<<<<<<<<<
 *                 raise ValueError('Arrays were not all the same length: '
 *                                  '{0} vs {1}'.format(len(arr), num_rows))
 */
    __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(6, 816, __pyx_L1_error)
    __pyx_t_4 = ((__pyx_t_7 != __pyx_v_num_rows) != 0);
    if (unlikely(__pyx_t_4)) {

      /* "pyarrow/table.pxi":818
 *             if len(arr) != num_rows:
 *                 raise ValueError('Arrays were not all the same length: '
 *                                  '{0} vs {1}'.format(len(arr), num_rows))             # <<<<<<<<<<<<<<
 *             c_arrays.push_back(arr.sp_array)
 * 
 */
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Arrays_were_not_all_the_same_len, __pyx_n_s_format); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 818, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(6, 818, __pyx_L1_error)
      __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 818, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = __Pyx_PyInt_From_int64_t(__pyx_v_num_rows); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 818, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = NULL;
      __pyx_t_12 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
          __pyx_t_12 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_8)) {
        PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_9, __pyx_t_10};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 818, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
        PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_9, __pyx_t_10};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 818, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      } else
      #endif
      {
        __pyx_t_13 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(6, 818, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        if (__pyx_t_11) {
          __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
        }
        __Pyx_GIVEREF(__pyx_t_9);
        PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_12, __pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_10);
        PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_12, __pyx_t_10);
        __pyx_t_9 = 0;
        __pyx_t_10 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 818, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "pyarrow/table.pxi":817
 *         for arr in converted_arrays:
 *             if len(arr) != num_rows:
 *                 raise ValueError('Arrays were not all the same length: '             # <<<<<<<<<<<<<<
 *                                  '{0} vs {1}'.format(len(arr), num_rows))
 *             c_arrays.push_back(arr.sp_array)
 */
      __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 817, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(6, 817, __pyx_L1_error)

      /* "pyarrow/table.pxi":816
 *         c_arrays.reserve(len(arrays))
 *         for arr in converted_arrays:
 *             if len(arr) != num_rows:             # <<<<<<<<<<<<<<
 *                 raise ValueError('Arrays were not all the same length: '
 *                                  '{0} vs {1}'.format(len(arr), num_rows))
 */
    }

    /* "pyarrow/table.pxi":819
 *                 raise ValueError('Arrays were not all the same length: '
 *                                  '{0} vs {1}'.format(len(arr), num_rows))
 *             c_arrays.push_back(arr.sp_array)             # <<<<<<<<<<<<<<
 * 
 *         result = pyarrow_wrap_batch(CRecordBatch.Make(c_schema, num_rows,
 */
    try {
      __pyx_v_c_arrays.push_back(__pyx_v_arr->sp_array);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(6, 819, __pyx_L1_error)
    }

    /* "pyarrow/table.pxi":815
 * 
 *         c_arrays.reserve(len(arrays))
 *         for arr in converted_arrays:             # <<<<<<<<<<<<<<
 *             if len(arr) != num_rows:
 *                 raise ValueError('Arrays were not all the same length: '
 */
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/table.pxi":821
 *             c_arrays.push_back(arr.sp_array)
 * 
 *         result = pyarrow_wrap_batch(CRecordBatch.Make(c_schema, num_rows,             # <<<<<<<<<<<<<<
 *                                                       c_arrays))
 *         result.validate()
 */
  __pyx_t_5 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_batch( arrow::RecordBatch::Make(__pyx_v_c_schema, __pyx_v_num_rows, __pyx_v_c_arrays)); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_result = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "pyarrow/table.pxi":823
 *         result = pyarrow_wrap_batch(CRecordBatch.Make(c_schema, num_rows,
 *                                                       c_arrays))
 *         result.validate()             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_validate); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
    }
  }
  __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/table.pxi":824
 *                                                       c_arrays))
 *         result.validate()
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":773
 * 
 *     @staticmethod
 *     def from_arrays(list arrays, names=None, schema=None, metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a RecordBatch from multiple pyarrow.Arrays
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.from_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_warnings);
  __Pyx_XDECREF(__pyx_v_converted_arrays);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_names);
  __Pyx_XDECREF(__pyx_v_schema);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":827
 * 
 *     @staticmethod
 *     def from_struct_array(StructArray struct_array):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a RecordBatch from a StructArray.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_33from_struct_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11RecordBatch_32from_struct_array[] = "RecordBatch.from_struct_array(StructArray struct_array)\n\n        Construct a RecordBatch from a StructArray.\n\n        Each field in the StructArray will become a column in the resulting\n        ``RecordBatch``.\n\n        Parameters\n        ----------\n        struct_array: a StructArray.\n\n        Returns\n        -------\n        pyarrow.RecordBatch\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_11RecordBatch_33from_struct_array = {"from_struct_array", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_11RecordBatch_33from_struct_array, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_11RecordBatch_32from_struct_array};
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_33from_struct_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_StructArray *__pyx_v_struct_array = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_struct_array (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_struct_array,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_struct_array)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_struct_array") < 0)) __PYX_ERR(6, 827, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_struct_array = ((struct __pyx_obj_7pyarrow_3lib_StructArray *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_struct_array", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 827, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.from_struct_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_struct_array), __pyx_ptype_7pyarrow_3lib_StructArray, 1, "struct_array", 0))) __PYX_ERR(6, 827, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_32from_struct_array(__pyx_v_struct_array);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_32from_struct_array(struct __pyx_obj_7pyarrow_3lib_StructArray *__pyx_v_struct_array) {
  std::shared_ptr< arrow::RecordBatch>  __pyx_v_c_record_batch;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("from_struct_array", 0);

  /* "pyarrow/table.pxi":844
 *         cdef:
 *             shared_ptr[CRecordBatch] c_record_batch
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CRecordBatch.FromStructArray(struct_array.sp_array,
 *                                                       &c_record_batch))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":845
 *             shared_ptr[CRecordBatch] c_record_batch
 *         with nogil:
 *             check_status(CRecordBatch.FromStructArray(struct_array.sp_array,             # <<<<<<<<<<<<<<
 *                                                       &c_record_batch))
 *         return pyarrow_wrap_batch(c_record_batch)
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status( arrow::RecordBatch::FromStructArray(__pyx_v_struct_array->__pyx_base.sp_array, (&__pyx_v_c_record_batch))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 845, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":844
 *         cdef:
 *             shared_ptr[CRecordBatch] c_record_batch
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CRecordBatch.FromStructArray(struct_array.sp_array,
 *                                                       &c_record_batch))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/table.pxi":847
 *             check_status(CRecordBatch.FromStructArray(struct_array.sp_array,
 *                                                       &c_record_batch))
 *         return pyarrow_wrap_batch(c_record_batch)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_batch(__pyx_v_c_record_batch); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 847, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":827
 * 
 *     @staticmethod
 *     def from_struct_array(StructArray struct_array):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a RecordBatch from a StructArray.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.from_struct_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":850
 * 
 * 
 * def _reconstruct_record_batch(columns, schema):             # <<<<<<<<<<<<<<
 *     """
 *     Internal: reconstruct RecordBatch from pickled components.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_147_reconstruct_record_batch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_146_reconstruct_record_batch[] = "_reconstruct_record_batch(columns, schema)\n\n    Internal: reconstruct RecordBatch from pickled components.\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_147_reconstruct_record_batch = {"_reconstruct_record_batch", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_147_reconstruct_record_batch, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_146_reconstruct_record_batch};
static PyObject *__pyx_pw_7pyarrow_3lib_147_reconstruct_record_batch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_columns = 0;
  PyObject *__pyx_v_schema = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_reconstruct_record_batch (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_columns,&__pyx_n_s_schema,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_columns)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_schema)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_reconstruct_record_batch", 1, 2, 2, 1); __PYX_ERR(6, 850, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_reconstruct_record_batch") < 0)) __PYX_ERR(6, 850, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_columns = values[0];
    __pyx_v_schema = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_reconstruct_record_batch", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 850, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._reconstruct_record_batch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_146_reconstruct_record_batch(__pyx_self, __pyx_v_columns, __pyx_v_schema);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_146_reconstruct_record_batch(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_columns, PyObject *__pyx_v_schema) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("_reconstruct_record_batch", 0);

  /* "pyarrow/table.pxi":854
 *     Internal: reconstruct RecordBatch from pickled components.
 *     """
 *     return RecordBatch.from_arrays(columns, schema=schema)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_RecordBatch), __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 854, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 854, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_columns);
  __Pyx_GIVEREF(__pyx_v_columns);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_columns);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 854, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_schema, __pyx_v_schema) < 0) __PYX_ERR(6, 854, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 854, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":850
 * 
 * 
 * def _reconstruct_record_batch(columns, schema):             # <<<<<<<<<<<<<<
 *     """
 *     Internal: reconstruct RecordBatch from pickled components.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib._reconstruct_record_batch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":857
 * 
 * 
 * def table_to_blocks(options, Table table, categories, extension_columns):             # <<<<<<<<<<<<<<
 *     cdef:
 *         PyObject* result_obj
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_149table_to_blocks(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_148table_to_blocks[] = "table_to_blocks(options, Table table, categories, extension_columns)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_149table_to_blocks = {"table_to_blocks", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_149table_to_blocks, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_148table_to_blocks};
static PyObject *__pyx_pw_7pyarrow_3lib_149table_to_blocks(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_options = 0;
  struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_table = 0;
  PyObject *__pyx_v_categories = 0;
  PyObject *__pyx_v_extension_columns = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("table_to_blocks (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_options,&__pyx_n_s_table,&__pyx_n_s_categories,&__pyx_n_s_extension_columns,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_table)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("table_to_blocks", 1, 4, 4, 1); __PYX_ERR(6, 857, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_categories)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("table_to_blocks", 1, 4, 4, 2); __PYX_ERR(6, 857, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extension_columns)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("table_to_blocks", 1, 4, 4, 3); __PYX_ERR(6, 857, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "table_to_blocks") < 0)) __PYX_ERR(6, 857, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_options = values[0];
    __pyx_v_table = ((struct __pyx_obj_7pyarrow_3lib_Table *)values[1]);
    __pyx_v_categories = values[2];
    __pyx_v_extension_columns = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("table_to_blocks", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 857, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.table_to_blocks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_table), __pyx_ptype_7pyarrow_3lib_Table, 1, "table", 0))) __PYX_ERR(6, 857, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_148table_to_blocks(__pyx_self, __pyx_v_options, __pyx_v_table, __pyx_v_categories, __pyx_v_extension_columns);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_148table_to_blocks(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_options, struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_table, PyObject *__pyx_v_categories, PyObject *__pyx_v_extension_columns) {
  PyObject *__pyx_v_result_obj;
  std::shared_ptr< arrow::Table>  __pyx_v_c_table;
  arrow::py::PandasOptions __pyx_v_c_options;
  PyObject *__pyx_9genexpr11__pyx_v_cat = NULL;
  PyObject *__pyx_9genexpr12__pyx_v_col = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  std::unordered_set<std::string>  __pyx_t_10;
  std::shared_ptr< arrow::Table>  __pyx_t_11;
  int __pyx_t_12;
  __Pyx_RefNannySetupContext("table_to_blocks", 0);

  /* "pyarrow/table.pxi":862
 *         shared_ptr[CTable] c_table
 *         CMemoryPool* pool
 *         PandasOptions c_options = _convert_pandas_options(options)             # <<<<<<<<<<<<<<
 * 
 *     if categories is not None:
 */
  if (!(likely(PyDict_CheckExact(__pyx_v_options))||((__pyx_v_options) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_options)->tp_name), 0))) __PYX_ERR(6, 862, __pyx_L1_error)
  __pyx_v_c_options = __pyx_f_7pyarrow_3lib__convert_pandas_options(((PyObject*)__pyx_v_options));

  /* "pyarrow/table.pxi":864
 *         PandasOptions c_options = _convert_pandas_options(options)
 * 
 *     if categories is not None:             # <<<<<<<<<<<<<<
 *         c_options.categorical_columns = {tobytes(cat) for cat in categories}
 *     if extension_columns is not None:
 */
  __pyx_t_1 = (__pyx_v_categories != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":865
 * 
 *     if categories is not None:
 *         c_options.categorical_columns = {tobytes(cat) for cat in categories}             # <<<<<<<<<<<<<<
 *     if extension_columns is not None:
 *         c_options.extension_columns = {tobytes(col)
 */
    { /* enter inner scope */
      __pyx_t_3 = PySet_New(NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 865, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (likely(PyList_CheckExact(__pyx_v_categories)) || PyTuple_CheckExact(__pyx_v_categories)) {
        __pyx_t_4 = __pyx_v_categories; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
        __pyx_t_6 = NULL;
      } else {
        __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_categories); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 865, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 865, __pyx_L6_error)
      }
      for (;;) {
        if (likely(!__pyx_t_6)) {
          if (likely(PyList_CheckExact(__pyx_t_4))) {
            if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(6, 865, __pyx_L6_error)
            #else
            __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 865, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_7);
            #endif
          } else {
            if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(6, 865, __pyx_L6_error)
            #else
            __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 865, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_7);
            #endif
          }
        } else {
          __pyx_t_7 = __pyx_t_6(__pyx_t_4);
          if (unlikely(!__pyx_t_7)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(6, 865, __pyx_L6_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_7);
        }
        __Pyx_XDECREF_SET(__pyx_9genexpr11__pyx_v_cat, __pyx_t_7);
        __pyx_t_7 = 0;
        __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 865, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_8, function);
          }
        }
        __pyx_t_7 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_9genexpr11__pyx_v_cat) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_9genexpr11__pyx_v_cat);
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 865, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(PySet_Add(__pyx_t_3, (PyObject*)__pyx_t_7))) __PYX_ERR(6, 865, __pyx_L6_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_cat); __pyx_9genexpr11__pyx_v_cat = 0;
      goto __pyx_L9_exit_scope;
      __pyx_L6_error:;
      __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_cat); __pyx_9genexpr11__pyx_v_cat = 0;
      goto __pyx_L1_error;
      __pyx_L9_exit_scope:;
    } /* exit inner scope */
    __pyx_t_10 = __pyx_convert_unordered_set_from_py_std_3a__3a_string(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 865, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_c_options.categorical_columns = __pyx_t_10;

    /* "pyarrow/table.pxi":864
 *         PandasOptions c_options = _convert_pandas_options(options)
 * 
 *     if categories is not None:             # <<<<<<<<<<<<<<
 *         c_options.categorical_columns = {tobytes(cat) for cat in categories}
 *     if extension_columns is not None:
 */
  }

  /* "pyarrow/table.pxi":866
 *     if categories is not None:
 *         c_options.categorical_columns = {tobytes(cat) for cat in categories}
 *     if extension_columns is not None:             # <<<<<<<<<<<<<<
 *         c_options.extension_columns = {tobytes(col)
 *                                        for col in extension_columns}
 */
  __pyx_t_2 = (__pyx_v_extension_columns != Py_None);
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pyarrow/table.pxi":867
 *         c_options.categorical_columns = {tobytes(cat) for cat in categories}
 *     if extension_columns is not None:
 *         c_options.extension_columns = {tobytes(col)             # <<<<<<<<<<<<<<
 *                                        for col in extension_columns}
 * 
 */
    { /* enter inner scope */
      __pyx_t_3 = PySet_New(NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 867, __pyx_L13_error)
      __Pyx_GOTREF(__pyx_t_3);

      /* "pyarrow/table.pxi":868
 *     if extension_columns is not None:
 *         c_options.extension_columns = {tobytes(col)
 *                                        for col in extension_columns}             # <<<<<<<<<<<<<<
 * 
 *     # ARROW-3789(wesm); Convert date/timestamp types to datetime64[ns]
 */
      if (likely(PyList_CheckExact(__pyx_v_extension_columns)) || PyTuple_CheckExact(__pyx_v_extension_columns)) {
        __pyx_t_4 = __pyx_v_extension_columns; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
        __pyx_t_6 = NULL;
      } else {
        __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_extension_columns); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 868, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 868, __pyx_L13_error)
      }
      for (;;) {
        if (likely(!__pyx_t_6)) {
          if (likely(PyList_CheckExact(__pyx_t_4))) {
            if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(6, 868, __pyx_L13_error)
            #else
            __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 868, __pyx_L13_error)
            __Pyx_GOTREF(__pyx_t_7);
            #endif
          } else {
            if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(6, 868, __pyx_L13_error)
            #else
            __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 868, __pyx_L13_error)
            __Pyx_GOTREF(__pyx_t_7);
            #endif
          }
        } else {
          __pyx_t_7 = __pyx_t_6(__pyx_t_4);
          if (unlikely(!__pyx_t_7)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(6, 868, __pyx_L13_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_7);
        }
        __Pyx_XDECREF_SET(__pyx_9genexpr12__pyx_v_col, __pyx_t_7);
        __pyx_t_7 = 0;

        /* "pyarrow/table.pxi":867
 *         c_options.categorical_columns = {tobytes(cat) for cat in categories}
 *     if extension_columns is not None:
 *         c_options.extension_columns = {tobytes(col)             # <<<<<<<<<<<<<<
 *                                        for col in extension_columns}
 * 
 */
        __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 867, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_8, function);
          }
        }
        __pyx_t_7 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_9genexpr12__pyx_v_col) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_9genexpr12__pyx_v_col);
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 867, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(PySet_Add(__pyx_t_3, (PyObject*)__pyx_t_7))) __PYX_ERR(6, 867, __pyx_L13_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "pyarrow/table.pxi":868
 *     if extension_columns is not None:
 *         c_options.extension_columns = {tobytes(col)
 *                                        for col in extension_columns}             # <<<<<<<<<<<<<<
 * 
 *     # ARROW-3789(wesm); Convert date/timestamp types to datetime64[ns]
 */
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_col); __pyx_9genexpr12__pyx_v_col = 0;
      goto __pyx_L16_exit_scope;
      __pyx_L13_error:;
      __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_col); __pyx_9genexpr12__pyx_v_col = 0;
      goto __pyx_L1_error;
      __pyx_L16_exit_scope:;
    } /* exit inner scope */

    /* "pyarrow/table.pxi":867
 *         c_options.categorical_columns = {tobytes(cat) for cat in categories}
 *     if extension_columns is not None:
 *         c_options.extension_columns = {tobytes(col)             # <<<<<<<<<<<<<<
 *                                        for col in extension_columns}
 * 
 */
    __pyx_t_10 = __pyx_convert_unordered_set_from_py_std_3a__3a_string(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 867, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_c_options.extension_columns = __pyx_t_10;

    /* "pyarrow/table.pxi":866
 *     if categories is not None:
 *         c_options.categorical_columns = {tobytes(cat) for cat in categories}
 *     if extension_columns is not None:             # <<<<<<<<<<<<<<
 *         c_options.extension_columns = {tobytes(col)
 *                                        for col in extension_columns}
 */
  }

  /* "pyarrow/table.pxi":871
 * 
 *     # ARROW-3789(wesm); Convert date/timestamp types to datetime64[ns]
 *     c_options.coerce_temporal_nanoseconds = True             # <<<<<<<<<<<<<<
 * 
 *     if c_options.self_destruct:
 */
  __pyx_v_c_options.coerce_temporal_nanoseconds = 1;

  /* "pyarrow/table.pxi":873
 *     c_options.coerce_temporal_nanoseconds = True
 * 
 *     if c_options.self_destruct:             # <<<<<<<<<<<<<<
 *         # Move the shared_ptr, table is now unsafe to use further
 *         c_table = move(table.sp_table)
 */
  __pyx_t_1 = (__pyx_v_c_options.self_destruct != 0);
  if (__pyx_t_1) {

    /* "pyarrow/table.pxi":875
 *     if c_options.self_destruct:
 *         # Move the shared_ptr, table is now unsafe to use further
 *         c_table = move(table.sp_table)             # <<<<<<<<<<<<<<
 *         table.table = NULL
 *     else:
 */
    __pyx_v_c_table =  cymove::cymove<std::shared_ptr< arrow::Table> >(__pyx_v_table->sp_table);

    /* "pyarrow/table.pxi":876
 *         # Move the shared_ptr, table is now unsafe to use further
 *         c_table = move(table.sp_table)
 *         table.table = NULL             # <<<<<<<<<<<<<<
 *     else:
 *         c_table = table.sp_table
 */
    __pyx_v_table->table = NULL;

    /* "pyarrow/table.pxi":873
 *     c_options.coerce_temporal_nanoseconds = True
 * 
 *     if c_options.self_destruct:             # <<<<<<<<<<<<<<
 *         # Move the shared_ptr, table is now unsafe to use further
 *         c_table = move(table.sp_table)
 */
    goto __pyx_L17;
  }

  /* "pyarrow/table.pxi":878
 *         table.table = NULL
 *     else:
 *         c_table = table.sp_table             # <<<<<<<<<<<<<<
 * 
 *     with nogil:
 */
  /*else*/ {
    __pyx_t_11 = __pyx_v_table->sp_table;
    __pyx_v_c_table = __pyx_t_11;
  }
  __pyx_L17:;

  /* "pyarrow/table.pxi":880
 *         c_table = table.sp_table
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(
 *             libarrow.ConvertTableToPandas(c_options, move(c_table),
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":881
 * 
 *     with nogil:
 *         check_status(             # <<<<<<<<<<<<<<
 *             libarrow.ConvertTableToPandas(c_options, move(c_table),
 *                                           &result_obj)
 */
        __pyx_t_12 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::ConvertTableToPandas(__pyx_v_c_options,  cymove::cymove<std::shared_ptr< arrow::Table> >(__pyx_v_c_table), (&__pyx_v_result_obj))); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(6, 881, __pyx_L19_error)
      }

      /* "pyarrow/table.pxi":880
 *         c_table = table.sp_table
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(
 *             libarrow.ConvertTableToPandas(c_options, move(c_table),
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L20;
        }
        __pyx_L19_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L20:;
      }
  }

  /* "pyarrow/table.pxi":886
 *         )
 * 
 *     return PyObject_to_object(result_obj)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_8includes_6common_PyObject_to_object(__pyx_v_result_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 886, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":857
 * 
 * 
 * def table_to_blocks(options, Table table, categories, extension_columns):             # <<<<<<<<<<<<<<
 *     cdef:
 *         PyObject* result_obj
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pyarrow.lib.table_to_blocks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_cat);
  __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_col);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":899
 *     """
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.table = NULL
 * 
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_5Table_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_5Table_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table___cinit__(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_5Table___cinit__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/table.pxi":900
 * 
 *     def __cinit__(self):
 *         self.table = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self):
 */
  __pyx_v_self->table = NULL;

  /* "pyarrow/table.pxi":899
 *     """
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.table = NULL
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":902
 *         self.table = NULL
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call Table's constructor directly, use one of "
 *                         "the `Table.from_*` functions instead.")
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_5Table_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_5Table_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_2__init__(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_5Table_2__init__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/table.pxi":903
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call Table's constructor directly, use one of "             # <<<<<<<<<<<<<<
 *                         "the `Table.from_*` functions instead.")
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__167, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 903, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(6, 903, __pyx_L1_error)

  /* "pyarrow/table.pxi":902
 *         self.table = NULL
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call Table's constructor directly, use one of "
 *                         "the `Table.from_*` functions instead.")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Table.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":906
 *                         "the `Table.from_*` functions instead.")
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if self.table == NULL:
 *             raise ValueError("Table's internal pointer is NULL, do not use "
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_5__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_5__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_4__repr__(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_4__repr__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pyarrow/table.pxi":907
 * 
 *     def __repr__(self):
 *         if self.table == NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError("Table's internal pointer is NULL, do not use "
 *                              "any methods or attributes on this object")
 */
  __pyx_t_1 = ((__pyx_v_self->table == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/table.pxi":908
 *     def __repr__(self):
 *         if self.table == NULL:
 *             raise ValueError("Table's internal pointer is NULL, do not use "             # <<<<<<<<<<<<<<
 *                              "any methods or attributes on this object")
 *         return 'pyarrow.{}\n{}'.format(type(self).__name__, str(self.schema))
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__168, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 908, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(6, 908, __pyx_L1_error)

    /* "pyarrow/table.pxi":907
 * 
 *     def __repr__(self):
 *         if self.table == NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError("Table's internal pointer is NULL, do not use "
 *                              "any methods or attributes on this object")
 */
  }

  /* "pyarrow/table.pxi":910
 *             raise ValueError("Table's internal pointer is NULL, do not use "
 *                              "any methods or attributes on this object")
 *         return 'pyarrow.{}\n{}'.format(type(self).__name__, str(self.schema))             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CTable]& table):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_pyarrow, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_schema); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_4, __pyx_t_6};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 910, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_4, __pyx_t_6};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 910, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  {
    __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 910, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_6);
    __pyx_t_4 = 0;
    __pyx_t_6 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 910, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":906
 *                         "the `Table.from_*` functions instead.")
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if self.table == NULL:
 *             raise ValueError("Table's internal pointer is NULL, do not use "
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow.lib.Table.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":912
 *         return 'pyarrow.{}\n{}'.format(type(self).__name__, str(self.schema))
 * 
 *     cdef void init(self, const shared_ptr[CTable]& table):             # <<<<<<<<<<<<<<
 *         self.sp_table = table
 *         self.table = table.get()
 */

static void __pyx_f_7pyarrow_3lib_5Table_init(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, std::shared_ptr< arrow::Table>  const &__pyx_v_table) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/table.pxi":913
 * 
 *     cdef void init(self, const shared_ptr[CTable]& table):
 *         self.sp_table = table             # <<<<<<<<<<<<<<
 *         self.table = table.get()
 * 
 */
  __pyx_v_self->sp_table = __pyx_v_table;

  /* "pyarrow/table.pxi":914
 *     cdef void init(self, const shared_ptr[CTable]& table):
 *         self.sp_table = table
 *         self.table = table.get()             # <<<<<<<<<<<<<<
 * 
 *     def validate(self, *, full=False):
 */
  __pyx_v_self->table = __pyx_v_table.get();

  /* "pyarrow/table.pxi":912
 *         return 'pyarrow.{}\n{}'.format(type(self).__name__, str(self.schema))
 * 
 *     cdef void init(self, const shared_ptr[CTable]& table):             # <<<<<<<<<<<<<<
 *         self.sp_table = table
 *         self.table = table.get()
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/table.pxi":916
 *         self.table = table.get()
 * 
 *     def validate(self, *, full=False):             # <<<<<<<<<<<<<<
 *         """
 *         Perform validation checks.  An exception is raised if validation fails.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_7validate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_6validate[] = "Table.validate(self, *, full=False)\n\n        Perform validation checks.  An exception is raised if validation fails.\n\n        By default only cheap validation checks are run.  Pass `full=True`\n        for thorough validation checks (potentially O(n)).\n\n        Parameters\n        ----------\n        full: bool, default False\n            If True, run expensive checks, otherwise cheap checks only.\n\n        Raises\n        ------\n        ArrowInvalid\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_7validate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_full = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("validate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_full,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      if (kw_args == 1) {
        const Py_ssize_t index = 0;
        PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]);
        if (value) { values[index] = value; kw_args--; }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, 0, "validate") < 0)) __PYX_ERR(6, 916, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 0) {
      goto __pyx_L5_argtuple_error;
    } else {
    }
    __pyx_v_full = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("validate", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 916, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Table.validate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_6validate(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), __pyx_v_full);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_6validate(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_full) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("validate", 0);

  /* "pyarrow/table.pxi":932
 *         ArrowInvalid
 *         """
 *         if full:             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 check_status(self.table.ValidateFull())
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_full); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 932, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/table.pxi":933
 *         """
 *         if full:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(self.table.ValidateFull())
 *         else:
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "pyarrow/table.pxi":934
 *         if full:
 *             with nogil:
 *                 check_status(self.table.ValidateFull())             # <<<<<<<<<<<<<<
 *         else:
 *             with nogil:
 */
          __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->table->ValidateFull()); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 934, __pyx_L5_error)
        }

        /* "pyarrow/table.pxi":933
 *         """
 *         if full:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(self.table.ValidateFull())
 *         else:
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L6;
          }
          __pyx_L5_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L6:;
        }
    }

    /* "pyarrow/table.pxi":932
 *         ArrowInvalid
 *         """
 *         if full:             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 check_status(self.table.ValidateFull())
 */
    goto __pyx_L3;
  }

  /* "pyarrow/table.pxi":936
 *                 check_status(self.table.ValidateFull())
 *         else:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(self.table.Validate())
 * 
 */
  /*else*/ {
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "pyarrow/table.pxi":937
 *         else:
 *             with nogil:
 *                 check_status(self.table.Validate())             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
          __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->table->Validate()); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 937, __pyx_L8_error)
        }

        /* "pyarrow/table.pxi":936
 *                 check_status(self.table.ValidateFull())
 *         else:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(self.table.Validate())
 * 
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L9;
          }
          __pyx_L8_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L9:;
        }
    }
  }
  __pyx_L3:;

  /* "pyarrow/table.pxi":916
 *         self.table = table.get()
 * 
 *     def validate(self, *, full=False):             # <<<<<<<<<<<<<<
 *         """
 *         Perform validation checks.  An exception is raised if validation fails.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.Table.validate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":939
 *                 check_status(self.table.Validate())
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         # Reduce the columns as ChunkedArrays to avoid serializing schema
 *         # data twice
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_9__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_8__reduce__[] = "Table.__reduce__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_9__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_8__reduce__(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_8__reduce__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self) {
  PyObject *__pyx_v_columns = NULL;
  PyObject *__pyx_9genexpr13__pyx_v_col = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pyarrow/table.pxi":942
 *         # Reduce the columns as ChunkedArrays to avoid serializing schema
 *         # data twice
 *         columns = [col for col in self.columns]             # <<<<<<<<<<<<<<
 *         return _reconstruct_table, (columns, self.schema)
 * 
 */
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 942, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_columns); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 942, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 942, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 942, __pyx_L5_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (likely(!__pyx_t_5)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(6, 942, __pyx_L5_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 942, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(6, 942, __pyx_L5_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 942, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_5(__pyx_t_3);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(6, 942, __pyx_L5_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_9genexpr13__pyx_v_col, __pyx_t_2);
      __pyx_t_2 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_9genexpr13__pyx_v_col))) __PYX_ERR(6, 942, __pyx_L5_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_col); __pyx_9genexpr13__pyx_v_col = 0;
    goto __pyx_L8_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_col); __pyx_9genexpr13__pyx_v_col = 0;
    goto __pyx_L1_error;
    __pyx_L8_exit_scope:;
  } /* exit inner scope */
  __pyx_v_columns = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":943
 *         # data twice
 *         columns = [col for col in self.columns]
 *         return _reconstruct_table, (columns, self.schema)             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, key):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_reconstruct_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 943, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_schema); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 943, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 943, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_columns);
  __Pyx_GIVEREF(__pyx_v_columns);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_columns);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 943, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":939
 *                 check_status(self.table.Validate())
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         # Reduce the columns as ChunkedArrays to avoid serializing schema
 *         # data twice
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Table.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_columns);
  __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_col);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":945
 *         return _reconstruct_table, (columns, self.schema)
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         if isinstance(key, slice):
 *             return _normalize_slice(self, key)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_11__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_11__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_10__getitem__(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), ((PyObject *)__pyx_v_key));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_10__getitem__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "pyarrow/table.pxi":946
 * 
 *     def __getitem__(self, key):
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return _normalize_slice(self, key)
 *         else:
 */
  __pyx_t_1 = PySlice_Check(__pyx_v_key); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":947
 *     def __getitem__(self, key):
 *         if isinstance(key, slice):
 *             return _normalize_slice(self, key)             # <<<<<<<<<<<<<<
 *         else:
 *             return self.column(key)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_normalize_slice); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 947, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_key};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 947, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_key};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 947, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 947, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_self));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_self));
      __Pyx_INCREF(__pyx_v_key);
      __Pyx_GIVEREF(__pyx_v_key);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_key);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 947, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "pyarrow/table.pxi":946
 * 
 *     def __getitem__(self, key):
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return _normalize_slice(self, key)
 *         else:
 */
  }

  /* "pyarrow/table.pxi":949
 *             return _normalize_slice(self, key)
 *         else:
 *             return self.column(key)             # <<<<<<<<<<<<<<
 * 
 *     def slice(self, offset=0, length=None):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_column); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 949, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_7, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_key);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 949, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/table.pxi":945
 *         return _reconstruct_table, (columns, self.schema)
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         if isinstance(key, slice):
 *             return _normalize_slice(self, key)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.Table.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":951
 *             return self.column(key)
 * 
 *     def slice(self, offset=0, length=None):             # <<<<<<<<<<<<<<
 *         """
 *         Compute zero-copy slice of this Table
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_13slice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_12slice[] = "Table.slice(self, offset=0, length=None)\n\n        Compute zero-copy slice of this Table\n\n        Parameters\n        ----------\n        offset : int, default 0\n            Offset from start of table to slice\n        length : int, default None\n            Length of slice (default is until end of table starting from\n            offset)\n\n        Returns\n        -------\n        sliced : Table\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_13slice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_offset = 0;
  PyObject *__pyx_v_length = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("slice (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_offset,&__pyx_n_s_length,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)__pyx_int_0);
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offset);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_length);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "slice") < 0)) __PYX_ERR(6, 951, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_offset = values[0];
    __pyx_v_length = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("slice", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 951, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Table.slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_12slice(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), __pyx_v_offset, __pyx_v_length);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_12slice(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_offset, PyObject *__pyx_v_length) {
  std::shared_ptr< arrow::Table>  __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int64_t __pyx_t_4;
  int64_t __pyx_t_5;
  __Pyx_RefNannySetupContext("slice", 0);

  /* "pyarrow/table.pxi":969
 *         cdef shared_ptr[CTable] result
 * 
 *         if offset < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError('Offset must be non-negative')
 * 
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_offset, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 969, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 969, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/table.pxi":970
 * 
 *         if offset < 0:
 *             raise IndexError('Offset must be non-negative')             # <<<<<<<<<<<<<<
 * 
 *         if length is None:
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__147, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 970, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(6, 970, __pyx_L1_error)

    /* "pyarrow/table.pxi":969
 *         cdef shared_ptr[CTable] result
 * 
 *         if offset < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError('Offset must be non-negative')
 * 
 */
  }

  /* "pyarrow/table.pxi":972
 *             raise IndexError('Offset must be non-negative')
 * 
 *         if length is None:             # <<<<<<<<<<<<<<
 *             result = self.table.Slice(offset)
 *         else:
 */
  __pyx_t_2 = (__pyx_v_length == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/table.pxi":973
 * 
 *         if length is None:
 *             result = self.table.Slice(offset)             # <<<<<<<<<<<<<<
 *         else:
 *             result = self.table.Slice(offset, length)
 */
    __pyx_t_4 = __Pyx_PyInt_As_int64_t(__pyx_v_offset); if (unlikely((__pyx_t_4 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 973, __pyx_L1_error)
    __pyx_v_result = __pyx_v_self->table->Slice(__pyx_t_4);

    /* "pyarrow/table.pxi":972
 *             raise IndexError('Offset must be non-negative')
 * 
 *         if length is None:             # <<<<<<<<<<<<<<
 *             result = self.table.Slice(offset)
 *         else:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/table.pxi":975
 *             result = self.table.Slice(offset)
 *         else:
 *             result = self.table.Slice(offset, length)             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_table(result)
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyInt_As_int64_t(__pyx_v_offset); if (unlikely((__pyx_t_4 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 975, __pyx_L1_error)
    __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_v_length); if (unlikely((__pyx_t_5 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 975, __pyx_L1_error)
    __pyx_v_result = __pyx_v_self->table->Slice(__pyx_t_4, __pyx_t_5);
  }
  __pyx_L4:;

  /* "pyarrow/table.pxi":977
 *             result = self.table.Slice(offset, length)
 * 
 *         return pyarrow_wrap_table(result)             # <<<<<<<<<<<<<<
 * 
 *     def replace_schema_metadata(self, metadata=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table(__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 977, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":951
 *             return self.column(key)
 * 
 *     def slice(self, offset=0, length=None):             # <<<<<<<<<<<<<<
 *         """
 *         Compute zero-copy slice of this Table
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Table.slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":979
 *         return pyarrow_wrap_table(result)
 * 
 *     def replace_schema_metadata(self, metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         EXPERIMENTAL: Create shallow copy of table by replacing schema
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_15replace_schema_metadata(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_14replace_schema_metadata[] = "Table.replace_schema_metadata(self, metadata=None)\n\n        EXPERIMENTAL: Create shallow copy of table by replacing schema\n        key-value metadata with the indicated new metadata (which may be None,\n        which deletes any existing metadata\n\n        Parameters\n        ----------\n        metadata : dict, default None\n\n        Returns\n        -------\n        shallow_copy : Table\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_15replace_schema_metadata(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_metadata = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("replace_schema_metadata (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_metadata,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_metadata);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "replace_schema_metadata") < 0)) __PYX_ERR(6, 979, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_metadata = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("replace_schema_metadata", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 979, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Table.replace_schema_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_14replace_schema_metadata(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), __pyx_v_metadata);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_14replace_schema_metadata(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_metadata) {
  std::shared_ptr< arrow::KeyValueMetadata>  __pyx_v_c_meta;
  std::shared_ptr< arrow::Table>  __pyx_v_c_table;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("replace_schema_metadata", 0);

  /* "pyarrow/table.pxi":997
 *             shared_ptr[CTable] c_table
 * 
 *         if metadata is not None:             # <<<<<<<<<<<<<<
 *             if not isinstance(metadata, dict):
 *                 raise TypeError('Metadata must be an instance of dict')
 */
  __pyx_t_1 = (__pyx_v_metadata != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":998
 * 
 *         if metadata is not None:
 *             if not isinstance(metadata, dict):             # <<<<<<<<<<<<<<
 *                 raise TypeError('Metadata must be an instance of dict')
 *             c_meta = pyarrow_unwrap_metadata(metadata)
 */
    __pyx_t_2 = PyDict_Check(__pyx_v_metadata); 
    __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0);
    if (unlikely(__pyx_t_1)) {

      /* "pyarrow/table.pxi":999
 *         if metadata is not None:
 *             if not isinstance(metadata, dict):
 *                 raise TypeError('Metadata must be an instance of dict')             # <<<<<<<<<<<<<<
 *             c_meta = pyarrow_unwrap_metadata(metadata)
 * 
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 999, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(6, 999, __pyx_L1_error)

      /* "pyarrow/table.pxi":998
 * 
 *         if metadata is not None:
 *             if not isinstance(metadata, dict):             # <<<<<<<<<<<<<<
 *                 raise TypeError('Metadata must be an instance of dict')
 *             c_meta = pyarrow_unwrap_metadata(metadata)
 */
    }

    /* "pyarrow/table.pxi":1000
 *             if not isinstance(metadata, dict):
 *                 raise TypeError('Metadata must be an instance of dict')
 *             c_meta = pyarrow_unwrap_metadata(metadata)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
    __pyx_v_c_meta = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_metadata(__pyx_v_metadata);

    /* "pyarrow/table.pxi":997
 *             shared_ptr[CTable] c_table
 * 
 *         if metadata is not None:             # <<<<<<<<<<<<<<
 *             if not isinstance(metadata, dict):
 *                 raise TypeError('Metadata must be an instance of dict')
 */
  }

  /* "pyarrow/table.pxi":1002
 *             c_meta = pyarrow_unwrap_metadata(metadata)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             c_table = self.table.ReplaceSchemaMetadata(c_meta)
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":1003
 * 
 *         with nogil:
 *             c_table = self.table.ReplaceSchemaMetadata(c_meta)             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_table(c_table)
 */
        __pyx_v_c_table = __pyx_v_self->table->ReplaceSchemaMetadata(__pyx_v_c_meta);
      }

      /* "pyarrow/table.pxi":1002
 *             c_meta = pyarrow_unwrap_metadata(metadata)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             c_table = self.table.ReplaceSchemaMetadata(c_meta)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L7;
        }
        __pyx_L7:;
      }
  }

  /* "pyarrow/table.pxi":1005
 *             c_table = self.table.ReplaceSchemaMetadata(c_meta)
 * 
 *         return pyarrow_wrap_table(c_table)             # <<<<<<<<<<<<<<
 * 
 *     def flatten(self, MemoryPool memory_pool=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table(__pyx_v_c_table); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1005, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":979
 *         return pyarrow_wrap_table(result)
 * 
 *     def replace_schema_metadata(self, metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         EXPERIMENTAL: Create shallow copy of table by replacing schema
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Table.replace_schema_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1007
 *         return pyarrow_wrap_table(c_table)
 * 
 *     def flatten(self, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Flatten this Table.  Each column with a struct type is flattened
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_17flatten(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_16flatten[] = "Table.flatten(self, MemoryPool memory_pool=None)\n\n        Flatten this Table.  Each column with a struct type is flattened\n        into one column per struct field.  Other columns are left unchanged.\n\n        Parameters\n        ----------\n        memory_pool : MemoryPool, default None\n            For memory allocations, if required, otherwise use default pool\n\n        Returns\n        -------\n        result : Table\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_17flatten(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flatten (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_memory_pool,0};
    PyObject* values[1] = {0};
    values[0] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "flatten") < 0)) __PYX_ERR(6, 1007, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("flatten", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 1007, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Table.flatten", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(6, 1007, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_16flatten(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), __pyx_v_memory_pool);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_16flatten(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool) {
  std::shared_ptr< arrow::Table>  __pyx_v_flattened;
   arrow::MemoryPool *__pyx_v_pool;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("flatten", 0);

  /* "pyarrow/table.pxi":1023
 *         cdef:
 *             shared_ptr[CTable] flattened
 *             CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_v_pool = __pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(__pyx_v_memory_pool);

  /* "pyarrow/table.pxi":1025
 *             CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.table.Flatten(pool, &flattened))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":1026
 * 
 *         with nogil:
 *             check_status(self.table.Flatten(pool, &flattened))             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_table(flattened)
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->table->Flatten(__pyx_v_pool, (&__pyx_v_flattened))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 1026, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":1025
 *             CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.table.Flatten(pool, &flattened))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/table.pxi":1028
 *             check_status(self.table.Flatten(pool, &flattened))
 * 
 *         return pyarrow_wrap_table(flattened)             # <<<<<<<<<<<<<<
 * 
 *     def combine_chunks(self, MemoryPool memory_pool=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table(__pyx_v_flattened); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1028, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1007
 *         return pyarrow_wrap_table(c_table)
 * 
 *     def flatten(self, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Flatten this Table.  Each column with a struct type is flattened
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Table.flatten", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1030
 *         return pyarrow_wrap_table(flattened)
 * 
 *     def combine_chunks(self, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Make a new table by combining the chunks this table has.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_19combine_chunks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_18combine_chunks[] = "Table.combine_chunks(self, MemoryPool memory_pool=None)\n\n        Make a new table by combining the chunks this table has.\n\n        All the underlying chunks in the ChunkedArray of each column are\n        concatenated into zero or one chunk.\n\n        Parameters\n        ----------\n        memory_pool : MemoryPool, default None\n            For memory allocations, if required, otherwise use default pool\n\n        Returns\n        -------\n        result : Table\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_19combine_chunks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("combine_chunks (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_memory_pool,0};
    PyObject* values[1] = {0};
    values[0] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "combine_chunks") < 0)) __PYX_ERR(6, 1030, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("combine_chunks", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 1030, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Table.combine_chunks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(6, 1030, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_18combine_chunks(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), __pyx_v_memory_pool);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_18combine_chunks(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool) {
  std::shared_ptr< arrow::Table>  __pyx_v_combined;
   arrow::MemoryPool *__pyx_v_pool;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("combine_chunks", 0);

  /* "pyarrow/table.pxi":1048
 *         cdef:
 *             shared_ptr[CTable] combined
 *             CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_v_pool = __pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(__pyx_v_memory_pool);

  /* "pyarrow/table.pxi":1050
 *             CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.table.CombineChunks(pool, &combined))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":1051
 * 
 *         with nogil:
 *             check_status(self.table.CombineChunks(pool, &combined))             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_table(combined)
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->table->CombineChunks(__pyx_v_pool, (&__pyx_v_combined))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 1051, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":1050
 *             CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.table.CombineChunks(pool, &combined))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/table.pxi":1053
 *             check_status(self.table.CombineChunks(pool, &combined))
 * 
 *         return pyarrow_wrap_table(combined)             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table(__pyx_v_combined); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1053, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1030
 *         return pyarrow_wrap_table(flattened)
 * 
 *     def combine_chunks(self, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Make a new table by combining the chunks this table has.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Table.combine_chunks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1055
 *         return pyarrow_wrap_table(combined)
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         try:
 *             return self.equals(other)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_21__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_21__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_20__eq__(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), ((PyObject *)__pyx_v_other));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_20__eq__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("__eq__", 0);

  /* "pyarrow/table.pxi":1056
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except TypeError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "pyarrow/table.pxi":1057
 *     def __eq__(self, other):
 *         try:
 *             return self.equals(other)             # <<<<<<<<<<<<<<
 *         except TypeError:
 *             return NotImplemented
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_equals); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1057, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_other) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_other);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1057, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L7_try_return;

      /* "pyarrow/table.pxi":1056
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except TypeError:
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/table.pxi":1058
 *         try:
 *             return self.equals(other)
 *         except TypeError:             # <<<<<<<<<<<<<<
 *             return NotImplemented
 * 
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("pyarrow.lib.Table.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(6, 1058, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);

      /* "pyarrow/table.pxi":1059
 *             return self.equals(other)
 *         except TypeError:
 *             return NotImplemented             # <<<<<<<<<<<<<<
 * 
 *     def equals(self, Table other):
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_builtin_NotImplemented);
      __pyx_r = __pyx_builtin_NotImplemented;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/table.pxi":1056
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except TypeError:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "pyarrow/table.pxi":1055
 *         return pyarrow_wrap_table(combined)
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         try:
 *             return self.equals(other)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.Table.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1061
 *             return NotImplemented
 * 
 *     def equals(self, Table other):             # <<<<<<<<<<<<<<
 *         """
 *         Check if contents of two tables are equal
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_23equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_22equals[] = "Table.equals(self, Table other)\n\n        Check if contents of two tables are equal\n\n        Parameters\n        ----------\n        other : pyarrow.Table\n\n        Returns\n        -------\n        are_equal : boolean\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_23equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("equals (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_7pyarrow_3lib_Table, 1, "other", 0))) __PYX_ERR(6, 1061, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_22equals(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_22equals(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_other) {
   arrow::Table *__pyx_v_this_table;
   arrow::Table *__pyx_v_other_table;
  bool __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
   arrow::Table *__pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("equals", 0);

  /* "pyarrow/table.pxi":1074
 *         """
 *         cdef:
 *             CTable* this_table = self.table             # <<<<<<<<<<<<<<
 *             CTable* other_table = other.table
 *             c_bool result
 */
  __pyx_t_1 = __pyx_v_self->table;
  __pyx_v_this_table = __pyx_t_1;

  /* "pyarrow/table.pxi":1075
 *         cdef:
 *             CTable* this_table = self.table
 *             CTable* other_table = other.table             # <<<<<<<<<<<<<<
 *             c_bool result
 * 
 */
  __pyx_t_1 = __pyx_v_other->table;
  __pyx_v_other_table = __pyx_t_1;

  /* "pyarrow/table.pxi":1078
 *             c_bool result
 * 
 *         if other is None:             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_other) == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/table.pxi":1079
 * 
 *         if other is None:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "pyarrow/table.pxi":1078
 *             c_bool result
 * 
 *         if other is None:             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  }

  /* "pyarrow/table.pxi":1081
 *             return False
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = this_table.Equals(deref(other_table))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":1082
 * 
 *         with nogil:
 *             result = this_table.Equals(deref(other_table))             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
        __pyx_v_result = __pyx_v_this_table->Equals((*__pyx_v_other_table));
      }

      /* "pyarrow/table.pxi":1081
 *             return False
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = this_table.Equals(deref(other_table))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L6;
        }
        __pyx_L6:;
      }
  }

  /* "pyarrow/table.pxi":1084
 *             result = this_table.Equals(deref(other_table))
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def cast(self, Schema target_schema, bint safe=True):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1084, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1061
 *             return NotImplemented
 * 
 *     def equals(self, Table other):             # <<<<<<<<<<<<<<
 *         """
 *         Check if contents of two tables are equal
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.Table.equals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1086
 *         return result
 * 
 *     def cast(self, Schema target_schema, bint safe=True):             # <<<<<<<<<<<<<<
 *         """
 *         Cast table values to another schema
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_25cast(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_24cast[] = "Table.cast(self, Schema target_schema, bool safe=True)\n\n        Cast table values to another schema\n\n        Parameters\n        ----------\n        target_schema : Schema\n            Schema to cast to, the names and order of fields must match\n        safe : boolean, default True\n            Check for overflows or other unsafe conversions\n\n        Returns\n        -------\n        casted : Table\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_25cast(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_target_schema = 0;
  int __pyx_v_safe;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cast (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_target_schema,&__pyx_n_s_safe,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_target_schema)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_safe);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cast") < 0)) __PYX_ERR(6, 1086, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_target_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)values[0]);
    if (values[1]) {
      __pyx_v_safe = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_safe == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 1086, __pyx_L3_error)
    } else {
      __pyx_v_safe = ((int)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cast", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 1086, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Table.cast", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_target_schema), __pyx_ptype_7pyarrow_3lib_Schema, 1, "target_schema", 0))) __PYX_ERR(6, 1086, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_24cast(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), __pyx_v_target_schema, __pyx_v_safe);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_24cast(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_target_schema, int __pyx_v_safe) {
  struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_column = 0;
  struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_casted = 0;
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_field = 0;
  PyObject *__pyx_v_newcols = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  PyObject *(*__pyx_t_11)(PyObject *);
  int __pyx_t_12;
  __Pyx_RefNannySetupContext("cast", 0);

  /* "pyarrow/table.pxi":1104
 *             ChunkedArray column, casted
 *             Field field
 *             list newcols = []             # <<<<<<<<<<<<<<
 * 
 *         if self.schema.names != target_schema.names:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_newcols = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":1106
 *             list newcols = []
 * 
 *         if self.schema.names != target_schema.names:             # <<<<<<<<<<<<<<
 *             raise ValueError("Target schema's field names are not matching "
 *                              "the table's field names: {!r}, {!r}"
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_schema); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_names); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_target_schema), __pyx_n_s_names); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1106, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(6, 1106, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(__pyx_t_4)) {

    /* "pyarrow/table.pxi":1109
 *             raise ValueError("Target schema's field names are not matching "
 *                              "the table's field names: {!r}, {!r}"
 *                              .format(self.schema.names, target_schema.names))             # <<<<<<<<<<<<<<
 * 
 *         for column, field in zip(self.itercolumns(), target_schema):
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Target_schema_s_field_names_are, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1109, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_schema); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1109, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_names); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1109, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_target_schema), __pyx_n_s_names); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1109, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_5, __pyx_t_2};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1109, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_5, __pyx_t_2};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1109, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 1109, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_2);
      __pyx_t_5 = 0;
      __pyx_t_2 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1109, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/table.pxi":1107
 * 
 *         if self.schema.names != target_schema.names:
 *             raise ValueError("Target schema's field names are not matching "             # <<<<<<<<<<<<<<
 *                              "the table's field names: {!r}, {!r}"
 *                              .format(self.schema.names, target_schema.names))
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1107, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(6, 1107, __pyx_L1_error)

    /* "pyarrow/table.pxi":1106
 *             list newcols = []
 * 
 *         if self.schema.names != target_schema.names:             # <<<<<<<<<<<<<<
 *             raise ValueError("Target schema's field names are not matching "
 *                              "the table's field names: {!r}, {!r}"
 */
  }

  /* "pyarrow/table.pxi":1111
 *                              .format(self.schema.names, target_schema.names))
 * 
 *         for column, field in zip(self.itercolumns(), target_schema):             # <<<<<<<<<<<<<<
 *             casted = column.cast(field.type, safe=safe)
 *             newcols.append(casted)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_itercolumns); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_8 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_target_schema));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_target_schema));
  PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_target_schema));
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_9 = 0;
    __pyx_t_10 = NULL;
  } else {
    __pyx_t_9 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1111, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_10 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 1111, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_10)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(6, 1111, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1111, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(6, 1111, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1111, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_10(__pyx_t_3);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(6, 1111, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(6, 1111, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_8 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_2);
      #else
      __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 1111, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1111, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1111, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_11 = Py_TYPE(__pyx_t_5)->tp_iternext;
      index = 0; __pyx_t_8 = __pyx_t_11(__pyx_t_5); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_8);
      index = 1; __pyx_t_2 = __pyx_t_11(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_5), 2) < 0) __PYX_ERR(6, 1111, __pyx_L1_error)
      __pyx_t_11 = NULL;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L7_unpacking_done;
      __pyx_L6_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_11 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(6, 1111, __pyx_L1_error)
      __pyx_L7_unpacking_done:;
    }
    if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_7pyarrow_3lib_ChunkedArray))))) __PYX_ERR(6, 1111, __pyx_L1_error)
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(6, 1111, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_column, ((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_t_8));
    __pyx_t_8 = 0;
    __Pyx_XDECREF_SET(__pyx_v_field, ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "pyarrow/table.pxi":1112
 * 
 *         for column, field in zip(self.itercolumns(), target_schema):
 *             casted = column.cast(field.type, safe=safe)             # <<<<<<<<<<<<<<
 *             newcols.append(casted)
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_column), __pyx_n_s_cast); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(((PyObject *)__pyx_v_field->type));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_field->type));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_field->type));
    __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 1112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_safe); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_safe, __pyx_t_5) < 0) __PYX_ERR(6, 1112, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_7pyarrow_3lib_ChunkedArray))))) __PYX_ERR(6, 1112, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_casted, ((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "pyarrow/table.pxi":1113
 *         for column, field in zip(self.itercolumns(), target_schema):
 *             casted = column.cast(field.type, safe=safe)
 *             newcols.append(casted)             # <<<<<<<<<<<<<<
 * 
 *         return Table.from_arrays(newcols, schema=target_schema)
 */
    __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_newcols, ((PyObject *)__pyx_v_casted)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(6, 1113, __pyx_L1_error)

    /* "pyarrow/table.pxi":1111
 *                              .format(self.schema.names, target_schema.names))
 * 
 *         for column, field in zip(self.itercolumns(), target_schema):             # <<<<<<<<<<<<<<
 *             casted = column.cast(field.type, safe=safe)
 *             newcols.append(casted)
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/table.pxi":1115
 *             newcols.append(casted)
 * 
 *         return Table.from_arrays(newcols, schema=target_schema)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_Table), __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_newcols);
  __Pyx_GIVEREF(__pyx_v_newcols);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_newcols);
  __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 1115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_schema, ((PyObject *)__pyx_v_target_schema)) < 0) __PYX_ERR(6, 1115, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1086
 *         return result
 * 
 *     def cast(self, Schema target_schema, bint safe=True):             # <<<<<<<<<<<<<<
 *         """
 *         Cast table values to another schema
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow.lib.Table.cast", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_column);
  __Pyx_XDECREF((PyObject *)__pyx_v_casted);
  __Pyx_XDECREF((PyObject *)__pyx_v_field);
  __Pyx_XDECREF(__pyx_v_newcols);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1118
 * 
 *     @classmethod
 *     def from_pandas(cls, df, Schema schema=None, preserve_index=None,             # <<<<<<<<<<<<<<
 *                     nthreads=None, columns=None, bint safe=True):
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_27from_pandas(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_26from_pandas[] = "Table.from_pandas(type cls, df, Schema schema=None, preserve_index=None, nthreads=None, columns=None, bool safe=True)\n\n        Convert pandas.DataFrame to an Arrow Table.\n\n        The column types in the resulting Arrow Table are inferred from the\n        dtypes of the pandas.Series in the DataFrame. In the case of non-object\n        Series, the NumPy dtype is translated to its Arrow equivalent. In the\n        case of `object`, we need to guess the datatype by looking at the\n        Python objects in this Series.\n\n        Be aware that Series of the `object` dtype don't carry enough\n        information to always lead to a meaningful Arrow type. In the case that\n        we cannot infer a type, e.g. because the DataFrame is of length 0 or\n        the Series only contains None/nan objects, the type is set to\n        null. This behavior can be avoided by constructing an explicit schema\n        and passing it to this function.\n\n        Parameters\n        ----------\n        df : pandas.DataFrame\n        schema : pyarrow.Schema, optional\n            The expected schema of the Arrow Table. This can be used to\n            indicate the type of columns if we cannot infer it automatically.\n            If passed, the output will have exactly this schema. Columns\n            specified in the schema that are not found in the DataFrame columns\n            or its index will raise an error. Additional columns or index\n            levels in the DataFrame which are not specified in the schema will\n            be ignored.\n        preserve_index : bool, optional\n            Whether to store the index as an additional column in the resulting\n            ``Table``. The default of None will store the index as a column,\n            except for RangeIndex which is stored as metadata only. Use\n            ``preserve_index=True`` to force it to be stored as a column.\n        nthreads : int, default None (may use up to system CPU count threads)\n            If gre""ater than 1, convert columns to Arrow in parallel using\n            indicated number of threads\n        columns : list, optional\n           List of column to be converted. If None, use all columns.\n        safe : boolean, default True\n           Check for overflows or other unsafe conversions\n\n        Returns\n        -------\n        pyarrow.Table\n\n        Examples\n        --------\n\n        >>> import pandas as pd\n        >>> import pyarrow as pa\n        >>> df = pd.DataFrame({\n            ...     'int': [1, 2],\n            ...     'str': ['a', 'b']\n            ... })\n        >>> pa.Table.from_pandas(df)\n        <pyarrow.lib.Table object at 0x7f05d1fb1b40>\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_27from_pandas(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_df = 0;
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema = 0;
  PyObject *__pyx_v_preserve_index = 0;
  PyObject *__pyx_v_nthreads = 0;
  PyObject *__pyx_v_columns = 0;
  int __pyx_v_safe;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_pandas (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_df,&__pyx_n_s_schema,&__pyx_n_s_preserve_index,&__pyx_n_s_nthreads,&__pyx_n_s_columns,&__pyx_n_s_safe,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[1] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_Schema *)Py_None);
    values[2] = ((PyObject *)Py_None);

    /* "pyarrow/table.pxi":1119
 *     @classmethod
 *     def from_pandas(cls, df, Schema schema=None, preserve_index=None,
 *                     nthreads=None, columns=None, bint safe=True):             # <<<<<<<<<<<<<<
 *         """
 *         Convert pandas.DataFrame to an Arrow Table.
 */
    values[3] = ((PyObject *)Py_None);
    values[4] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_df)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_schema);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_preserve_index);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nthreads);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_columns);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_safe);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_pandas") < 0)) __PYX_ERR(6, 1118, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_df = values[0];
    __pyx_v_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)values[1]);
    __pyx_v_preserve_index = values[2];
    __pyx_v_nthreads = values[3];
    __pyx_v_columns = values[4];
    if (values[5]) {
      __pyx_v_safe = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_safe == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 1119, __pyx_L3_error)
    } else {
      __pyx_v_safe = ((int)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_pandas", 0, 1, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 1118, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Table.from_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_schema), __pyx_ptype_7pyarrow_3lib_Schema, 1, "schema", 0))) __PYX_ERR(6, 1118, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_26from_pandas(((PyTypeObject*)__pyx_v_cls), __pyx_v_df, __pyx_v_schema, __pyx_v_preserve_index, __pyx_v_nthreads, __pyx_v_columns, __pyx_v_safe);

  /* "pyarrow/table.pxi":1118
 * 
 *     @classmethod
 *     def from_pandas(cls, df, Schema schema=None, preserve_index=None,             # <<<<<<<<<<<<<<
 *                     nthreads=None, columns=None, bint safe=True):
 *         """
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_26from_pandas(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_df, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, PyObject *__pyx_v_preserve_index, PyObject *__pyx_v_nthreads, PyObject *__pyx_v_columns, int __pyx_v_safe) {
  PyObject *__pyx_v_dataframe_to_arrays = NULL;
  PyObject *__pyx_v_arrays = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  __Pyx_RefNannySetupContext("from_pandas", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_schema);

  /* "pyarrow/table.pxi":1176
 *         <pyarrow.lib.Table object at 0x7f05d1fb1b40>
 *         """
 *         from pyarrow.pandas_compat import dataframe_to_arrays             # <<<<<<<<<<<<<<
 *         arrays, schema = dataframe_to_arrays(
 *             df,
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_dataframe_to_arrays);
  __Pyx_GIVEREF(__pyx_n_s_dataframe_to_arrays);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_dataframe_to_arrays);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_pyarrow_pandas_compat, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_dataframe_to_arrays); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_dataframe_to_arrays = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/table.pxi":1177
 *         """
 *         from pyarrow.pandas_compat import dataframe_to_arrays
 *         arrays, schema = dataframe_to_arrays(             # <<<<<<<<<<<<<<
 *             df,
 *             schema=schema,
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_df);
  __Pyx_GIVEREF(__pyx_v_df);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_df);

  /* "pyarrow/table.pxi":1179
 *         arrays, schema = dataframe_to_arrays(
 *             df,
 *             schema=schema,             # <<<<<<<<<<<<<<
 *             preserve_index=preserve_index,
 *             nthreads=nthreads,
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_schema, ((PyObject *)__pyx_v_schema)) < 0) __PYX_ERR(6, 1179, __pyx_L1_error)

  /* "pyarrow/table.pxi":1180
 *             df,
 *             schema=schema,
 *             preserve_index=preserve_index,             # <<<<<<<<<<<<<<
 *             nthreads=nthreads,
 *             columns=columns,
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_preserve_index, __pyx_v_preserve_index) < 0) __PYX_ERR(6, 1179, __pyx_L1_error)

  /* "pyarrow/table.pxi":1181
 *             schema=schema,
 *             preserve_index=preserve_index,
 *             nthreads=nthreads,             # <<<<<<<<<<<<<<
 *             columns=columns,
 *             safe=safe
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_nthreads, __pyx_v_nthreads) < 0) __PYX_ERR(6, 1179, __pyx_L1_error)

  /* "pyarrow/table.pxi":1182
 *             preserve_index=preserve_index,
 *             nthreads=nthreads,
 *             columns=columns,             # <<<<<<<<<<<<<<
 *             safe=safe
 *         )
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_columns, __pyx_v_columns) < 0) __PYX_ERR(6, 1179, __pyx_L1_error)

  /* "pyarrow/table.pxi":1183
 *             nthreads=nthreads,
 *             columns=columns,
 *             safe=safe             # <<<<<<<<<<<<<<
 *         )
 *         return cls.from_arrays(arrays, schema=schema)
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_safe); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_safe, __pyx_t_3) < 0) __PYX_ERR(6, 1179, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/table.pxi":1177
 *         """
 *         from pyarrow.pandas_compat import dataframe_to_arrays
 *         arrays, schema = dataframe_to_arrays(             # <<<<<<<<<<<<<<
 *             df,
 *             schema=schema,
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_dataframe_to_arrays, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
    PyObject* sequence = __pyx_t_3;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(6, 1177, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(6, 1177, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(6, 1177, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7pyarrow_3lib_Schema))))) __PYX_ERR(6, 1177, __pyx_L1_error)
  __pyx_v_arrays = __pyx_t_1;
  __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_schema, ((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "pyarrow/table.pxi":1185
 *             safe=safe
 *         )
 *         return cls.from_arrays(arrays, schema=schema)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_cls), __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_arrays);
  __Pyx_GIVEREF(__pyx_v_arrays);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_arrays);
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_schema, ((PyObject *)__pyx_v_schema)) < 0) __PYX_ERR(6, 1185, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1118
 * 
 *     @classmethod
 *     def from_pandas(cls, df, Schema schema=None, preserve_index=None,             # <<<<<<<<<<<<<<
 *                     nthreads=None, columns=None, bint safe=True):
 *         """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.Table.from_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dataframe_to_arrays);
  __Pyx_XDECREF(__pyx_v_arrays);
  __Pyx_XDECREF((PyObject *)__pyx_v_schema);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1188
 * 
 *     @staticmethod
 *     def from_arrays(arrays, names=None, schema=None, metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a Table from Arrow arrays
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_29from_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_28from_arrays[] = "Table.from_arrays(arrays, names=None, schema=None, metadata=None)\n\n        Construct a Table from Arrow arrays\n\n        Parameters\n        ----------\n        arrays : list of pyarrow.Array or pyarrow.ChunkedArray\n            Equal-length arrays that should form the table.\n        names : list of str, optional\n            Names for the table columns. If not passed, schema must be passed\n        schema : Schema, default None\n            Schema for the created table. If not passed, names must be passed\n        metadata : dict or Mapping, default None\n            Optional metadata for the schema (if inferred).\n\n        Returns\n        -------\n        pyarrow.Table\n\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_5Table_29from_arrays = {"from_arrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_29from_arrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_28from_arrays};
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_29from_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_arrays = 0;
  PyObject *__pyx_v_names = 0;
  PyObject *__pyx_v_schema = 0;
  PyObject *__pyx_v_metadata = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_arrays (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arrays,&__pyx_n_s_names,&__pyx_n_s_schema,&__pyx_n_s_metadata,0};
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arrays)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_names);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_schema);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_metadata);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_arrays") < 0)) __PYX_ERR(6, 1188, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_arrays = values[0];
    __pyx_v_names = values[1];
    __pyx_v_schema = values[2];
    __pyx_v_metadata = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_arrays", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 1188, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Table.from_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_28from_arrays(__pyx_v_arrays, __pyx_v_names, __pyx_v_schema, __pyx_v_metadata);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_28from_arrays(PyObject *__pyx_v_arrays, PyObject *__pyx_v_names, PyObject *__pyx_v_schema, PyObject *__pyx_v_metadata) {
  std::vector<std::shared_ptr< arrow::ChunkedArray> >  __pyx_v_columns;
  std::shared_ptr< arrow::Schema>  __pyx_v_c_schema;
  int __pyx_v_K;
  PyObject *__pyx_v_converted_arrays = NULL;
  PyObject *__pyx_v_item = NULL;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  std::shared_ptr< arrow::ChunkedArray>  __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("from_arrays", 0);

  /* "pyarrow/table.pxi":1211
 *             vector[shared_ptr[CChunkedArray]] columns
 *             shared_ptr[CSchema] c_schema
 *             int i, K = <int> len(arrays)             # <<<<<<<<<<<<<<
 * 
 *         converted_arrays = _sanitize_arrays(arrays, names, schema, metadata,
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_arrays); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(6, 1211, __pyx_L1_error)
  __pyx_v_K = ((int)__pyx_t_1);

  /* "pyarrow/table.pxi":1213
 *             int i, K = <int> len(arrays)
 * 
 *         converted_arrays = _sanitize_arrays(arrays, names, schema, metadata,             # <<<<<<<<<<<<<<
 *                                             &c_schema)
 * 
 */
  __pyx_t_2 = __pyx_f_7pyarrow_3lib__sanitize_arrays(__pyx_v_arrays, __pyx_v_names, __pyx_v_schema, __pyx_v_metadata, (&__pyx_v_c_schema)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_converted_arrays = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/table.pxi":1216
 *                                             &c_schema)
 * 
 *         columns.reserve(K)             # <<<<<<<<<<<<<<
 *         for item in converted_arrays:
 *             if isinstance(item, Array):
 */
  __pyx_v_columns.reserve(__pyx_v_K);

  /* "pyarrow/table.pxi":1217
 * 
 *         columns.reserve(K)
 *         for item in converted_arrays:             # <<<<<<<<<<<<<<
 *             if isinstance(item, Array):
 *                 columns.push_back(
 */
  if (likely(PyList_CheckExact(__pyx_v_converted_arrays)) || PyTuple_CheckExact(__pyx_v_converted_arrays)) {
    __pyx_t_2 = __pyx_v_converted_arrays; __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_1 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_converted_arrays); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1217, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(6, 1217, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1217, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(6, 1217, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1217, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_2);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(6, 1217, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/table.pxi":1218
 *         columns.reserve(K)
 *         for item in converted_arrays:
 *             if isinstance(item, Array):             # <<<<<<<<<<<<<<
 *                 columns.push_back(
 *                     make_shared[CChunkedArray](
 */
    __pyx_t_5 = __Pyx_TypeCheck(__pyx_v_item, __pyx_ptype_7pyarrow_3lib_Array); 
    __pyx_t_6 = (__pyx_t_5 != 0);
    if (__pyx_t_6) {

      /* "pyarrow/table.pxi":1220
 *             if isinstance(item, Array):
 *                 columns.push_back(
 *                     make_shared[CChunkedArray](             # <<<<<<<<<<<<<<
 *                         (<Array> item).sp_array
 *                     )
 */
      try {
        __pyx_t_7 = std::make_shared< arrow::ChunkedArray>(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_item)->sp_array);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(6, 1220, __pyx_L1_error)
      }

      /* "pyarrow/table.pxi":1219
 *         for item in converted_arrays:
 *             if isinstance(item, Array):
 *                 columns.push_back(             # <<<<<<<<<<<<<<
 *                     make_shared[CChunkedArray](
 *                         (<Array> item).sp_array
 */
      try {
        __pyx_v_columns.push_back(__pyx_t_7);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(6, 1219, __pyx_L1_error)
      }

      /* "pyarrow/table.pxi":1218
 *         columns.reserve(K)
 *         for item in converted_arrays:
 *             if isinstance(item, Array):             # <<<<<<<<<<<<<<
 *                 columns.push_back(
 *                     make_shared[CChunkedArray](
 */
      goto __pyx_L5;
    }

    /* "pyarrow/table.pxi":1224
 *                     )
 *                 )
 *             elif isinstance(item, ChunkedArray):             # <<<<<<<<<<<<<<
 *                 columns.push_back((<ChunkedArray> item).sp_chunked_array)
 *             else:
 */
    __pyx_t_6 = __Pyx_TypeCheck(__pyx_v_item, __pyx_ptype_7pyarrow_3lib_ChunkedArray); 
    __pyx_t_5 = (__pyx_t_6 != 0);
    if (likely(__pyx_t_5)) {

      /* "pyarrow/table.pxi":1225
 *                 )
 *             elif isinstance(item, ChunkedArray):
 *                 columns.push_back((<ChunkedArray> item).sp_chunked_array)             # <<<<<<<<<<<<<<
 *             else:
 *                 raise TypeError(type(item))
 */
      try {
        __pyx_v_columns.push_back(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_item)->sp_chunked_array);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(6, 1225, __pyx_L1_error)
      }

      /* "pyarrow/table.pxi":1224
 *                     )
 *                 )
 *             elif isinstance(item, ChunkedArray):             # <<<<<<<<<<<<<<
 *                 columns.push_back((<ChunkedArray> item).sp_chunked_array)
 *             else:
 */
      goto __pyx_L5;
    }

    /* "pyarrow/table.pxi":1227
 *                 columns.push_back((<ChunkedArray> item).sp_chunked_array)
 *             else:
 *                 raise TypeError(type(item))             # <<<<<<<<<<<<<<
 * 
 *         result = pyarrow_wrap_table(CTable.Make(c_schema, columns))
 */
    /*else*/ {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1227, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(6, 1227, __pyx_L1_error)
    }
    __pyx_L5:;

    /* "pyarrow/table.pxi":1217
 * 
 *         columns.reserve(K)
 *         for item in converted_arrays:             # <<<<<<<<<<<<<<
 *             if isinstance(item, Array):
 *                 columns.push_back(
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/table.pxi":1229
 *                 raise TypeError(type(item))
 * 
 *         result = pyarrow_wrap_table(CTable.Make(c_schema, columns))             # <<<<<<<<<<<<<<
 *         result.validate()
 *         return result
 */
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table( arrow::Table::Make(__pyx_v_c_schema, __pyx_v_columns)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/table.pxi":1230
 * 
 *         result = pyarrow_wrap_table(CTable.Make(c_schema, columns))
 *         result.validate()             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_validate); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_2 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/table.pxi":1231
 *         result = pyarrow_wrap_table(CTable.Make(c_schema, columns))
 *         result.validate()
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1188
 * 
 *     @staticmethod
 *     def from_arrays(arrays, names=None, schema=None, metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a Table from Arrow arrays
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow.lib.Table.from_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_converted_arrays);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1234
 * 
 *     @staticmethod
 *     def from_pydict(mapping, schema=None, metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a Table from Arrow arrays or columns
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_31from_pydict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_30from_pydict[] = "Table.from_pydict(mapping, schema=None, metadata=None)\n\n        Construct a Table from Arrow arrays or columns\n\n        Parameters\n        ----------\n        mapping : dict or Mapping\n            A mapping of strings to Arrays or Python lists.\n        schema : Schema, default None\n            If not passed, will be inferred from the Mapping values\n        metadata : dict or Mapping, default None\n            Optional metadata for the schema (if inferred).\n\n        Returns\n        -------\n        pyarrow.Table\n\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_5Table_31from_pydict = {"from_pydict", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_31from_pydict, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_30from_pydict};
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_31from_pydict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_mapping = 0;
  PyObject *__pyx_v_schema = 0;
  PyObject *__pyx_v_metadata = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_pydict (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mapping,&__pyx_n_s_schema,&__pyx_n_s_metadata,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mapping)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_schema);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_metadata);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_pydict") < 0)) __PYX_ERR(6, 1234, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_mapping = values[0];
    __pyx_v_schema = values[1];
    __pyx_v_metadata = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_pydict", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 1234, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Table.from_pydict", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_30from_pydict(__pyx_v_mapping, __pyx_v_schema, __pyx_v_metadata);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_30from_pydict(PyObject *__pyx_v_mapping, PyObject *__pyx_v_schema, PyObject *__pyx_v_metadata) {
  PyObject *__pyx_v_arrays = NULL;
  PyObject *__pyx_v_names = NULL;
  PyObject *__pyx_v_k = NULL;
  PyObject *__pyx_v_v = NULL;
  PyObject *__pyx_v_field = NULL;
  PyObject *__pyx_v_present = NULL;
  PyObject *__pyx_v_missing = NULL;
  PyObject *__pyx_9genexpr14__pyx_v_n = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *(*__pyx_t_12)(PyObject *);
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  PyObject *(*__pyx_t_25)(PyObject *);
  PyObject *__pyx_t_26 = NULL;
  __Pyx_RefNannySetupContext("from_pydict", 0);

  /* "pyarrow/table.pxi":1252
 * 
 *         """
 *         arrays = []             # <<<<<<<<<<<<<<
 *         if schema is None:
 *             names = []
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_arrays = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":1253
 *         """
 *         arrays = []
 *         if schema is None:             # <<<<<<<<<<<<<<
 *             names = []
 *             for k, v in mapping.items():
 */
  __pyx_t_2 = (__pyx_v_schema == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/table.pxi":1254
 *         arrays = []
 *         if schema is None:
 *             names = []             # <<<<<<<<<<<<<<
 *             for k, v in mapping.items():
 *                 names.append(k)
 */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1254, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_names = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/table.pxi":1255
 *         if schema is None:
 *             names = []
 *             for k, v in mapping.items():             # <<<<<<<<<<<<<<
 *                 names.append(k)
 *                 arrays.append(asarray(v))
 */
    __pyx_t_4 = 0;
    if (unlikely(__pyx_v_mapping == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
      __PYX_ERR(6, 1255, __pyx_L1_error)
    }
    __pyx_t_7 = __Pyx_dict_iterator(__pyx_v_mapping, 0, __pyx_n_s_items, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 1255, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_7;
    __pyx_t_7 = 0;
    while (1) {
      __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_5, &__pyx_t_4, &__pyx_t_7, &__pyx_t_8, NULL, __pyx_t_6);
      if (unlikely(__pyx_t_9 == 0)) break;
      if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(6, 1255, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "pyarrow/table.pxi":1256
 *             names = []
 *             for k, v in mapping.items():
 *                 names.append(k)             # <<<<<<<<<<<<<<
 *                 arrays.append(asarray(v))
 *             return Table.from_arrays(arrays, names, metadata=metadata)
 */
      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_names, __pyx_v_k); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(6, 1256, __pyx_L1_error)

      /* "pyarrow/table.pxi":1257
 *             for k, v in mapping.items():
 *                 names.append(k)
 *                 arrays.append(asarray(v))             # <<<<<<<<<<<<<<
 *             return Table.from_arrays(arrays, names, metadata=metadata)
 *         elif isinstance(schema, Schema):
 */
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_asarray); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 1257, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_11 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      __pyx_t_8 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_11, __pyx_v_v) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_v);
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 1257, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_arrays, __pyx_t_8); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(6, 1257, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/table.pxi":1258
 *                 names.append(k)
 *                 arrays.append(asarray(v))
 *             return Table.from_arrays(arrays, names, metadata=metadata)             # <<<<<<<<<<<<<<
 *         elif isinstance(schema, Schema):
 *             for field in schema:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_Table), __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1258, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 1258, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_INCREF(__pyx_v_arrays);
    __Pyx_GIVEREF(__pyx_v_arrays);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_arrays);
    __Pyx_INCREF(__pyx_v_names);
    __Pyx_GIVEREF(__pyx_v_names);
    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_names);
    __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 1258, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_metadata, __pyx_v_metadata) < 0) __PYX_ERR(6, 1258, __pyx_L1_error)
    __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(6, 1258, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_r = __pyx_t_11;
    __pyx_t_11 = 0;
    goto __pyx_L0;

    /* "pyarrow/table.pxi":1253
 *         """
 *         arrays = []
 *         if schema is None:             # <<<<<<<<<<<<<<
 *             names = []
 *             for k, v in mapping.items():
 */
  }

  /* "pyarrow/table.pxi":1259
 *                 arrays.append(asarray(v))
 *             return Table.from_arrays(arrays, names, metadata=metadata)
 *         elif isinstance(schema, Schema):             # <<<<<<<<<<<<<<
 *             for field in schema:
 *                 try:
 */
  __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_schema, __pyx_ptype_7pyarrow_3lib_Schema); 
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (likely(__pyx_t_2)) {

    /* "pyarrow/table.pxi":1260
 *             return Table.from_arrays(arrays, names, metadata=metadata)
 *         elif isinstance(schema, Schema):
 *             for field in schema:             # <<<<<<<<<<<<<<
 *                 try:
 *                     v = mapping[field.name]
 */
    if (likely(PyList_CheckExact(__pyx_v_schema)) || PyTuple_CheckExact(__pyx_v_schema)) {
      __pyx_t_11 = __pyx_v_schema; __Pyx_INCREF(__pyx_t_11); __pyx_t_5 = 0;
      __pyx_t_12 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_v_schema); if (unlikely(!__pyx_t_11)) __PYX_ERR(6, 1260, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(6, 1260, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_12)) {
        if (likely(PyList_CheckExact(__pyx_t_11))) {
          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_11)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(6, 1260, __pyx_L1_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_11, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 1260, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        } else {
          if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_11)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(6, 1260, __pyx_L1_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_11, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 1260, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        }
      } else {
        __pyx_t_7 = __pyx_t_12(__pyx_t_11);
        if (unlikely(!__pyx_t_7)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(6, 1260, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_XDECREF_SET(__pyx_v_field, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "pyarrow/table.pxi":1261
 *         elif isinstance(schema, Schema):
 *             for field in schema:
 *                 try:             # <<<<<<<<<<<<<<
 *                     v = mapping[field.name]
 *                 except KeyError:
 */
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
        __Pyx_XGOTREF(__pyx_t_13);
        __Pyx_XGOTREF(__pyx_t_14);
        __Pyx_XGOTREF(__pyx_t_15);
        /*try:*/ {

          /* "pyarrow/table.pxi":1262
 *             for field in schema:
 *                 try:
 *                     v = mapping[field.name]             # <<<<<<<<<<<<<<
 *                 except KeyError:
 *                     try:
 */
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_field, __pyx_n_s_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 1262, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_mapping, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 1262, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_8);
          __pyx_t_8 = 0;

          /* "pyarrow/table.pxi":1261
 *         elif isinstance(schema, Schema):
 *             for field in schema:
 *                 try:             # <<<<<<<<<<<<<<
 *                     v = mapping[field.name]
 *                 except KeyError:
 */
        }
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        goto __pyx_L15_try_end;
        __pyx_L8_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "pyarrow/table.pxi":1263
 *                 try:
 *                     v = mapping[field.name]
 *                 except KeyError:             # <<<<<<<<<<<<<<
 *                     try:
 *                         v = mapping[tobytes(field.name)]
 */
        __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
        if (__pyx_t_6) {
          __Pyx_AddTraceback("pyarrow.lib.Table.from_pydict", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_1) < 0) __PYX_ERR(6, 1263, __pyx_L10_except_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_GOTREF(__pyx_t_1);

          /* "pyarrow/table.pxi":1264
 *                     v = mapping[field.name]
 *                 except KeyError:
 *                     try:             # <<<<<<<<<<<<<<
 *                         v = mapping[tobytes(field.name)]
 *                     except KeyError:
 */
          {
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __Pyx_ExceptionSave(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
            __Pyx_XGOTREF(__pyx_t_16);
            __Pyx_XGOTREF(__pyx_t_17);
            __Pyx_XGOTREF(__pyx_t_18);
            /*try:*/ {

              /* "pyarrow/table.pxi":1265
 *                 except KeyError:
 *                     try:
 *                         v = mapping[tobytes(field.name)]             # <<<<<<<<<<<<<<
 *                     except KeyError:
 *                         present = mapping.keys()
 */
              __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_20)) __PYX_ERR(6, 1265, __pyx_L18_error)
              __Pyx_GOTREF(__pyx_t_20);
              __pyx_t_21 = __Pyx_PyObject_GetAttrStr(__pyx_v_field, __pyx_n_s_name); if (unlikely(!__pyx_t_21)) __PYX_ERR(6, 1265, __pyx_L18_error)
              __Pyx_GOTREF(__pyx_t_21);
              __pyx_t_22 = NULL;
              if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_20))) {
                __pyx_t_22 = PyMethod_GET_SELF(__pyx_t_20);
                if (likely(__pyx_t_22)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_20);
                  __Pyx_INCREF(__pyx_t_22);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_20, function);
                }
              }
              __pyx_t_19 = (__pyx_t_22) ? __Pyx_PyObject_Call2Args(__pyx_t_20, __pyx_t_22, __pyx_t_21) : __Pyx_PyObject_CallOneArg(__pyx_t_20, __pyx_t_21);
              __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
              __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
              if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 1265, __pyx_L18_error)
              __Pyx_GOTREF(__pyx_t_19);
              __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
              __pyx_t_20 = __Pyx_PyObject_GetItem(__pyx_v_mapping, __pyx_t_19); if (unlikely(!__pyx_t_20)) __PYX_ERR(6, 1265, __pyx_L18_error)
              __Pyx_GOTREF(__pyx_t_20);
              __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
              __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_20);
              __pyx_t_20 = 0;

              /* "pyarrow/table.pxi":1264
 *                     v = mapping[field.name]
 *                 except KeyError:
 *                     try:             # <<<<<<<<<<<<<<
 *                         v = mapping[tobytes(field.name)]
 *                     except KeyError:
 */
            }
            __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
            __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
            __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
            goto __pyx_L25_try_end;
            __pyx_L18_error:;
            __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
            __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
            __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
            __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;

            /* "pyarrow/table.pxi":1266
 *                     try:
 *                         v = mapping[tobytes(field.name)]
 *                     except KeyError:             # <<<<<<<<<<<<<<
 *                         present = mapping.keys()
 *                         missing = [n for n in schema.names if n not in present]
 */
            __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
            if (__pyx_t_6) {
              __Pyx_AddTraceback("pyarrow.lib.Table.from_pydict", __pyx_clineno, __pyx_lineno, __pyx_filename);
              if (__Pyx_GetException(&__pyx_t_20, &__pyx_t_19, &__pyx_t_21) < 0) __PYX_ERR(6, 1266, __pyx_L20_except_error)
              __Pyx_GOTREF(__pyx_t_20);
              __Pyx_GOTREF(__pyx_t_19);
              __Pyx_GOTREF(__pyx_t_21);

              /* "pyarrow/table.pxi":1267
 *                         v = mapping[tobytes(field.name)]
 *                     except KeyError:
 *                         present = mapping.keys()             # <<<<<<<<<<<<<<
 *                         missing = [n for n in schema.names if n not in present]
 *                         raise KeyError(
 */
              __pyx_t_23 = __Pyx_PyObject_GetAttrStr(__pyx_v_mapping, __pyx_n_s_keys); if (unlikely(!__pyx_t_23)) __PYX_ERR(6, 1267, __pyx_L20_except_error)
              __Pyx_GOTREF(__pyx_t_23);
              __pyx_t_24 = NULL;
              if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_23))) {
                __pyx_t_24 = PyMethod_GET_SELF(__pyx_t_23);
                if (likely(__pyx_t_24)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_23);
                  __Pyx_INCREF(__pyx_t_24);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_23, function);
                }
              }
              __pyx_t_22 = (__pyx_t_24) ? __Pyx_PyObject_CallOneArg(__pyx_t_23, __pyx_t_24) : __Pyx_PyObject_CallNoArg(__pyx_t_23);
              __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0;
              if (unlikely(!__pyx_t_22)) __PYX_ERR(6, 1267, __pyx_L20_except_error)
              __Pyx_GOTREF(__pyx_t_22);
              __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
              __pyx_v_present = __pyx_t_22;
              __pyx_t_22 = 0;

              /* "pyarrow/table.pxi":1268
 *                     except KeyError:
 *                         present = mapping.keys()
 *                         missing = [n for n in schema.names if n not in present]             # <<<<<<<<<<<<<<
 *                         raise KeyError(
 *                             "The passed mapping doesn't contain the "
 */
              { /* enter inner scope */
                __pyx_t_22 = PyList_New(0); if (unlikely(!__pyx_t_22)) __PYX_ERR(6, 1268, __pyx_L30_error)
                __Pyx_GOTREF(__pyx_t_22);
                __pyx_t_23 = __Pyx_PyObject_GetAttrStr(__pyx_v_schema, __pyx_n_s_names); if (unlikely(!__pyx_t_23)) __PYX_ERR(6, 1268, __pyx_L30_error)
                __Pyx_GOTREF(__pyx_t_23);
                if (likely(PyList_CheckExact(__pyx_t_23)) || PyTuple_CheckExact(__pyx_t_23)) {
                  __pyx_t_24 = __pyx_t_23; __Pyx_INCREF(__pyx_t_24); __pyx_t_4 = 0;
                  __pyx_t_25 = NULL;
                } else {
                  __pyx_t_4 = -1; __pyx_t_24 = PyObject_GetIter(__pyx_t_23); if (unlikely(!__pyx_t_24)) __PYX_ERR(6, 1268, __pyx_L30_error)
                  __Pyx_GOTREF(__pyx_t_24);
                  __pyx_t_25 = Py_TYPE(__pyx_t_24)->tp_iternext; if (unlikely(!__pyx_t_25)) __PYX_ERR(6, 1268, __pyx_L30_error)
                }
                __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
                for (;;) {
                  if (likely(!__pyx_t_25)) {
                    if (likely(PyList_CheckExact(__pyx_t_24))) {
                      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_24)) break;
                      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                      __pyx_t_23 = PyList_GET_ITEM(__pyx_t_24, __pyx_t_4); __Pyx_INCREF(__pyx_t_23); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(6, 1268, __pyx_L30_error)
                      #else
                      __pyx_t_23 = PySequence_ITEM(__pyx_t_24, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_23)) __PYX_ERR(6, 1268, __pyx_L30_error)
                      __Pyx_GOTREF(__pyx_t_23);
                      #endif
                    } else {
                      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_24)) break;
                      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                      __pyx_t_23 = PyTuple_GET_ITEM(__pyx_t_24, __pyx_t_4); __Pyx_INCREF(__pyx_t_23); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(6, 1268, __pyx_L30_error)
                      #else
                      __pyx_t_23 = PySequence_ITEM(__pyx_t_24, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_23)) __PYX_ERR(6, 1268, __pyx_L30_error)
                      __Pyx_GOTREF(__pyx_t_23);
                      #endif
                    }
                  } else {
                    __pyx_t_23 = __pyx_t_25(__pyx_t_24);
                    if (unlikely(!__pyx_t_23)) {
                      PyObject* exc_type = PyErr_Occurred();
                      if (exc_type) {
                        if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                        else __PYX_ERR(6, 1268, __pyx_L30_error)
                      }
                      break;
                    }
                    __Pyx_GOTREF(__pyx_t_23);
                  }
                  __Pyx_XDECREF_SET(__pyx_9genexpr14__pyx_v_n, __pyx_t_23);
                  __pyx_t_23 = 0;
                  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_9genexpr14__pyx_v_n, __pyx_v_present, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 1268, __pyx_L30_error)
                  __pyx_t_3 = (__pyx_t_2 != 0);
                  if (__pyx_t_3) {
                    if (unlikely(__Pyx_ListComp_Append(__pyx_t_22, (PyObject*)__pyx_9genexpr14__pyx_v_n))) __PYX_ERR(6, 1268, __pyx_L30_error)
                  }
                }
                __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
                __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_n); __pyx_9genexpr14__pyx_v_n = 0;
                goto __pyx_L34_exit_scope;
                __pyx_L30_error:;
                __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_n); __pyx_9genexpr14__pyx_v_n = 0;
                goto __pyx_L20_except_error;
                __pyx_L34_exit_scope:;
              } /* exit inner scope */
              __pyx_v_missing = ((PyObject*)__pyx_t_22);
              __pyx_t_22 = 0;

              /* "pyarrow/table.pxi":1271
 *                         raise KeyError(
 *                             "The passed mapping doesn't contain the "
 *                             "following field(s) of the schema: {}".             # <<<<<<<<<<<<<<
 *                             format(', '.join(missing))
 *                         )
 */
              __pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_The_passed_mapping_doesn_t_conta, __pyx_n_s_format); if (unlikely(!__pyx_t_24)) __PYX_ERR(6, 1271, __pyx_L20_except_error)
              __Pyx_GOTREF(__pyx_t_24);

              /* "pyarrow/table.pxi":1272
 *                             "The passed mapping doesn't contain the "
 *                             "following field(s) of the schema: {}".
 *                             format(', '.join(missing))             # <<<<<<<<<<<<<<
 *                         )
 *                 arrays.append(asarray(v, type=field.type))
 */
              __pyx_t_23 = PyUnicode_Join(__pyx_kp_u__169, __pyx_v_missing); if (unlikely(!__pyx_t_23)) __PYX_ERR(6, 1272, __pyx_L20_except_error)
              __Pyx_GOTREF(__pyx_t_23);
              __pyx_t_26 = NULL;
              if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_24))) {
                __pyx_t_26 = PyMethod_GET_SELF(__pyx_t_24);
                if (likely(__pyx_t_26)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_24);
                  __Pyx_INCREF(__pyx_t_26);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_24, function);
                }
              }
              __pyx_t_22 = (__pyx_t_26) ? __Pyx_PyObject_Call2Args(__pyx_t_24, __pyx_t_26, __pyx_t_23) : __Pyx_PyObject_CallOneArg(__pyx_t_24, __pyx_t_23);
              __Pyx_XDECREF(__pyx_t_26); __pyx_t_26 = 0;
              __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
              if (unlikely(!__pyx_t_22)) __PYX_ERR(6, 1272, __pyx_L20_except_error)
              __Pyx_GOTREF(__pyx_t_22);
              __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;

              /* "pyarrow/table.pxi":1269
 *                         present = mapping.keys()
 *                         missing = [n for n in schema.names if n not in present]
 *                         raise KeyError(             # <<<<<<<<<<<<<<
 *                             "The passed mapping doesn't contain the "
 *                             "following field(s) of the schema: {}".
 */
              __pyx_t_24 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_22); if (unlikely(!__pyx_t_24)) __PYX_ERR(6, 1269, __pyx_L20_except_error)
              __Pyx_GOTREF(__pyx_t_24);
              __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
              __Pyx_Raise(__pyx_t_24, 0, 0, 0);
              __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
              __PYX_ERR(6, 1269, __pyx_L20_except_error)
            }
            goto __pyx_L20_except_error;
            __pyx_L20_except_error:;

            /* "pyarrow/table.pxi":1264
 *                     v = mapping[field.name]
 *                 except KeyError:
 *                     try:             # <<<<<<<<<<<<<<
 *                         v = mapping[tobytes(field.name)]
 *                     except KeyError:
 */
            __Pyx_XGIVEREF(__pyx_t_16);
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18);
            goto __pyx_L10_except_error;
            __pyx_L25_try_end:;
          }
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L9_exception_handled;
        }
        goto __pyx_L10_except_error;
        __pyx_L10_except_error:;

        /* "pyarrow/table.pxi":1261
 *         elif isinstance(schema, Schema):
 *             for field in schema:
 *                 try:             # <<<<<<<<<<<<<<
 *                     v = mapping[field.name]
 *                 except KeyError:
 */
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_XGIVEREF(__pyx_t_14);
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15);
        goto __pyx_L1_error;
        __pyx_L9_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_XGIVEREF(__pyx_t_14);
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15);
        __pyx_L15_try_end:;
      }

      /* "pyarrow/table.pxi":1274
 *                             format(', '.join(missing))
 *                         )
 *                 arrays.append(asarray(v, type=field.type))             # <<<<<<<<<<<<<<
 *             # Will raise if metadata is not None
 *             return Table.from_arrays(arrays, schema=schema, metadata=metadata)
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1274, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 1274, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_v_v);
      __Pyx_GIVEREF(__pyx_v_v);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_v);
      __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 1274, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_21 = __Pyx_PyObject_GetAttrStr(__pyx_v_field, __pyx_n_s_type); if (unlikely(!__pyx_t_21)) __PYX_ERR(6, 1274, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_21);
      if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_type, __pyx_t_21) < 0) __PYX_ERR(6, 1274, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
      __pyx_t_21 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_21)) __PYX_ERR(6, 1274, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_21);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_arrays, __pyx_t_21); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(6, 1274, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;

      /* "pyarrow/table.pxi":1260
 *             return Table.from_arrays(arrays, names, metadata=metadata)
 *         elif isinstance(schema, Schema):
 *             for field in schema:             # <<<<<<<<<<<<<<
 *                 try:
 *                     v = mapping[field.name]
 */
    }
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

    /* "pyarrow/table.pxi":1276
 *                 arrays.append(asarray(v, type=field.type))
 *             # Will raise if metadata is not None
 *             return Table.from_arrays(arrays, schema=schema, metadata=metadata)             # <<<<<<<<<<<<<<
 *         else:
 *             raise TypeError('Schema must be an instance of pyarrow.Schema')
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_Table), __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_11)) __PYX_ERR(6, 1276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_21 = PyTuple_New(1); if (unlikely(!__pyx_t_21)) __PYX_ERR(6, 1276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_21);
    __Pyx_INCREF(__pyx_v_arrays);
    __Pyx_GIVEREF(__pyx_v_arrays);
    PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_v_arrays);
    __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 1276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_schema, __pyx_v_schema) < 0) __PYX_ERR(6, 1276, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_metadata, __pyx_v_metadata) < 0) __PYX_ERR(6, 1276, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_21, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 1276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_r = __pyx_t_7;
    __pyx_t_7 = 0;
    goto __pyx_L0;

    /* "pyarrow/table.pxi":1259
 *                 arrays.append(asarray(v))
 *             return Table.from_arrays(arrays, names, metadata=metadata)
 *         elif isinstance(schema, Schema):             # <<<<<<<<<<<<<<
 *             for field in schema:
 *                 try:
 */
  }

  /* "pyarrow/table.pxi":1278
 *             return Table.from_arrays(arrays, schema=schema, metadata=metadata)
 *         else:
 *             raise TypeError('Schema must be an instance of pyarrow.Schema')             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  /*else*/ {
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__170, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 1278, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __PYX_ERR(6, 1278, __pyx_L1_error)
  }

  /* "pyarrow/table.pxi":1234
 * 
 *     @staticmethod
 *     def from_pydict(mapping, schema=None, metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a Table from Arrow arrays or columns
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_XDECREF(__pyx_t_20);
  __Pyx_XDECREF(__pyx_t_21);
  __Pyx_XDECREF(__pyx_t_22);
  __Pyx_XDECREF(__pyx_t_23);
  __Pyx_XDECREF(__pyx_t_24);
  __Pyx_XDECREF(__pyx_t_26);
  __Pyx_AddTraceback("pyarrow.lib.Table.from_pydict", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_arrays);
  __Pyx_XDECREF(__pyx_v_names);
  __Pyx_XDECREF(__pyx_v_k);
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XDECREF(__pyx_v_field);
  __Pyx_XDECREF(__pyx_v_present);
  __Pyx_XDECREF(__pyx_v_missing);
  __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_n);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1281
 * 
 *     @staticmethod
 *     def from_batches(batches, Schema schema=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a Table from a sequence or iterator of Arrow RecordBatches
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_33from_batches(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_32from_batches[] = "Table.from_batches(batches, Schema schema=None)\n\n        Construct a Table from a sequence or iterator of Arrow RecordBatches\n\n        Parameters\n        ----------\n        batches : sequence or iterator of RecordBatch\n            Sequence of RecordBatch to be converted, all schemas must be equal\n        schema : Schema, default None\n            If not passed, will be inferred from the first RecordBatch\n\n        Returns\n        -------\n        table : Table\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_5Table_33from_batches = {"from_batches", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_33from_batches, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_32from_batches};
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_33from_batches(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_batches = 0;
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_batches (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_batches,&__pyx_n_s_schema,0};
    PyObject* values[2] = {0,0};
    values[1] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_Schema *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_batches)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_schema);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_batches") < 0)) __PYX_ERR(6, 1281, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_batches = values[0];
    __pyx_v_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_batches", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 1281, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Table.from_batches", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_schema), __pyx_ptype_7pyarrow_3lib_Schema, 1, "schema", 0))) __PYX_ERR(6, 1281, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_32from_batches(__pyx_v_batches, __pyx_v_schema);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_32from_batches(PyObject *__pyx_v_batches, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema) {
  std::vector<std::shared_ptr< arrow::RecordBatch> >  __pyx_v_c_batches;
  std::shared_ptr< arrow::Table>  __pyx_v_c_table;
  std::shared_ptr< arrow::Schema>  __pyx_v_c_schema;
  struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_batch = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  std::shared_ptr< arrow::Schema>  __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("from_batches", 0);

  /* "pyarrow/table.pxi":1302
 *             RecordBatch batch
 * 
 *         for batch in batches:             # <<<<<<<<<<<<<<
 *             c_batches.push_back(batch.sp_batch)
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_batches)) || PyTuple_CheckExact(__pyx_v_batches)) {
    __pyx_t_1 = __pyx_v_batches; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_batches); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1302, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1302, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(6, 1302, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1302, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(6, 1302, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1302, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(6, 1302, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_RecordBatch))))) __PYX_ERR(6, 1302, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_batch, ((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "pyarrow/table.pxi":1303
 * 
 *         for batch in batches:
 *             c_batches.push_back(batch.sp_batch)             # <<<<<<<<<<<<<<
 * 
 *         if schema is None:
 */
    try {
      __pyx_v_c_batches.push_back(__pyx_v_batch->sp_batch);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(6, 1303, __pyx_L1_error)
    }

    /* "pyarrow/table.pxi":1302
 *             RecordBatch batch
 * 
 *         for batch in batches:             # <<<<<<<<<<<<<<
 *             c_batches.push_back(batch.sp_batch)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":1305
 *             c_batches.push_back(batch.sp_batch)
 * 
 *         if schema is None:             # <<<<<<<<<<<<<<
 *             if c_batches.size() == 0:
 *                 raise ValueError('Must pass schema, or at least '
 */
  __pyx_t_5 = (((PyObject *)__pyx_v_schema) == Py_None);
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {

    /* "pyarrow/table.pxi":1306
 * 
 *         if schema is None:
 *             if c_batches.size() == 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError('Must pass schema, or at least '
 *                                  'one RecordBatch')
 */
    __pyx_t_6 = ((__pyx_v_c_batches.size() == 0) != 0);
    if (unlikely(__pyx_t_6)) {

      /* "pyarrow/table.pxi":1307
 *         if schema is None:
 *             if c_batches.size() == 0:
 *                 raise ValueError('Must pass schema, or at least '             # <<<<<<<<<<<<<<
 *                                  'one RecordBatch')
 *             c_schema = c_batches[0].get().schema()
 */
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__171, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1307, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(6, 1307, __pyx_L1_error)

      /* "pyarrow/table.pxi":1306
 * 
 *         if schema is None:
 *             if c_batches.size() == 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError('Must pass schema, or at least '
 *                                  'one RecordBatch')
 */
    }

    /* "pyarrow/table.pxi":1309
 *                 raise ValueError('Must pass schema, or at least '
 *                                  'one RecordBatch')
 *             c_schema = c_batches[0].get().schema()             # <<<<<<<<<<<<<<
 *         else:
 *             c_schema = schema.sp_schema
 */
    __pyx_v_c_schema = (__pyx_v_c_batches[0]).get()->schema();

    /* "pyarrow/table.pxi":1305
 *             c_batches.push_back(batch.sp_batch)
 * 
 *         if schema is None:             # <<<<<<<<<<<<<<
 *             if c_batches.size() == 0:
 *                 raise ValueError('Must pass schema, or at least '
 */
    goto __pyx_L5;
  }

  /* "pyarrow/table.pxi":1311
 *             c_schema = c_batches[0].get().schema()
 *         else:
 *             c_schema = schema.sp_schema             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  /*else*/ {
    __pyx_t_7 = __pyx_v_schema->sp_schema;
    __pyx_v_c_schema = __pyx_t_7;
  }
  __pyx_L5:;

  /* "pyarrow/table.pxi":1313
 *             c_schema = schema.sp_schema
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CTable.FromRecordBatches(c_schema, c_batches,
 *                                                   &c_table))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":1314
 * 
 *         with nogil:
 *             check_status(CTable.FromRecordBatches(c_schema, c_batches,             # <<<<<<<<<<<<<<
 *                                                   &c_table))
 * 
 */
        __pyx_t_8 = __pyx_f_7pyarrow_3lib_check_status( arrow::Table::FromRecordBatches(__pyx_v_c_schema, __pyx_v_c_batches, (&__pyx_v_c_table))); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(6, 1314, __pyx_L8_error)
      }

      /* "pyarrow/table.pxi":1313
 *             c_schema = schema.sp_schema
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CTable.FromRecordBatches(c_schema, c_batches,
 *                                                   &c_table))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L9;
        }
        __pyx_L8_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L9:;
      }
  }

  /* "pyarrow/table.pxi":1317
 *                                                   &c_table))
 * 
 *         return pyarrow_wrap_table(c_table)             # <<<<<<<<<<<<<<
 * 
 *     def to_batches(self, max_chunksize=None, **kwargs):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table(__pyx_v_c_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1317, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1281
 * 
 *     @staticmethod
 *     def from_batches(batches, Schema schema=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a Table from a sequence or iterator of Arrow RecordBatches
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.Table.from_batches", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_batch);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1319
 *         return pyarrow_wrap_table(c_table)
 * 
 *     def to_batches(self, max_chunksize=None, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Convert Table to list of (contiguous) RecordBatch objects, with maximum
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_35to_batches(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_34to_batches[] = "Table.to_batches(self, max_chunksize=None, **kwargs)\n\n        Convert Table to list of (contiguous) RecordBatch objects, with maximum\n        chunk size\n\n        Parameters\n        ----------\n        max_chunksize : int, default None\n            Maximum size for RecordBatch chunks. Individual chunks may be\n            smaller depending on the chunk layout of individual columns\n\n        Returns\n        -------\n        batches : list of RecordBatch\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_35to_batches(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_max_chunksize = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_batches (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_max_chunksize,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_chunksize);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "to_batches") < 0)) __PYX_ERR(6, 1319, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_max_chunksize = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_batches", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 1319, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("pyarrow.lib.Table.to_batches", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_34to_batches(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), __pyx_v_max_chunksize, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_34to_batches(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_max_chunksize, PyObject *__pyx_v_kwargs) {
  std::unique_ptr<arrow::TableBatchReader>  __pyx_v_reader;
  int64_t __pyx_v_c_max_chunksize;
  PyObject *__pyx_v_result = 0;
  std::shared_ptr< arrow::RecordBatch>  __pyx_v_batch;
  PyObject *__pyx_v_msg = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int64_t __pyx_t_8;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("to_batches", 0);
  __Pyx_INCREF(__pyx_v_max_chunksize);

  /* "pyarrow/table.pxi":1337
 *             unique_ptr[TableBatchReader] reader
 *             int64_t c_max_chunksize
 *             list result = []             # <<<<<<<<<<<<<<
 *             shared_ptr[CRecordBatch] batch
 * 
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":1340
 *             shared_ptr[CRecordBatch] batch
 * 
 *         reader.reset(new TableBatchReader(deref(self.table)))             # <<<<<<<<<<<<<<
 * 
 *         if 'chunksize' in kwargs:
 */
  __pyx_v_reader.reset(new arrow::TableBatchReader((*__pyx_v_self->table)));

  /* "pyarrow/table.pxi":1342
 *         reader.reset(new TableBatchReader(deref(self.table)))
 * 
 *         if 'chunksize' in kwargs:             # <<<<<<<<<<<<<<
 *             max_chunksize = kwargs['chunksize']
 *             msg = ('The parameter chunksize is deprecated for '
 */
  __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_n_u_chunksize, __pyx_v_kwargs, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 1342, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/table.pxi":1343
 * 
 *         if 'chunksize' in kwargs:
 *             max_chunksize = kwargs['chunksize']             # <<<<<<<<<<<<<<
 *             msg = ('The parameter chunksize is deprecated for '
 *                    'pyarrow.Table.to_batches as of 0.15, please use '
 */
    __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_kwargs, __pyx_n_u_chunksize); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1343, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_max_chunksize, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/table.pxi":1344
 *         if 'chunksize' in kwargs:
 *             max_chunksize = kwargs['chunksize']
 *             msg = ('The parameter chunksize is deprecated for '             # <<<<<<<<<<<<<<
 *                    'pyarrow.Table.to_batches as of 0.15, please use '
 *                    'the parameter max_chunksize instead')
 */
    __Pyx_INCREF(__pyx_kp_u_The_parameter_chunksize_is_depre);
    __pyx_v_msg = __pyx_kp_u_The_parameter_chunksize_is_depre;

    /* "pyarrow/table.pxi":1347
 *                    'pyarrow.Table.to_batches as of 0.15, please use '
 *                    'the parameter max_chunksize instead')
 *             warnings.warn(msg, FutureWarning)             # <<<<<<<<<<<<<<
 * 
 *         if max_chunksize is not None:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_warnings); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1347, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_warn); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1347, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_msg, __pyx_builtin_FutureWarning};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1347, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_msg, __pyx_builtin_FutureWarning};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1347, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 1347, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(__pyx_v_msg);
      __Pyx_GIVEREF(__pyx_v_msg);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_msg);
      __Pyx_INCREF(__pyx_builtin_FutureWarning);
      __Pyx_GIVEREF(__pyx_builtin_FutureWarning);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_builtin_FutureWarning);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1347, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/table.pxi":1342
 *         reader.reset(new TableBatchReader(deref(self.table)))
 * 
 *         if 'chunksize' in kwargs:             # <<<<<<<<<<<<<<
 *             max_chunksize = kwargs['chunksize']
 *             msg = ('The parameter chunksize is deprecated for '
 */
  }

  /* "pyarrow/table.pxi":1349
 *             warnings.warn(msg, FutureWarning)
 * 
 *         if max_chunksize is not None:             # <<<<<<<<<<<<<<
 *             c_max_chunksize = max_chunksize
 *             reader.get().set_chunksize(c_max_chunksize)
 */
  __pyx_t_3 = (__pyx_v_max_chunksize != Py_None);
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":1350
 * 
 *         if max_chunksize is not None:
 *             c_max_chunksize = max_chunksize             # <<<<<<<<<<<<<<
 *             reader.get().set_chunksize(c_max_chunksize)
 * 
 */
    __pyx_t_8 = __Pyx_PyInt_As_int64_t(__pyx_v_max_chunksize); if (unlikely((__pyx_t_8 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 1350, __pyx_L1_error)
    __pyx_v_c_max_chunksize = __pyx_t_8;

    /* "pyarrow/table.pxi":1351
 *         if max_chunksize is not None:
 *             c_max_chunksize = max_chunksize
 *             reader.get().set_chunksize(c_max_chunksize)             # <<<<<<<<<<<<<<
 * 
 *         while True:
 */
    __pyx_v_reader.get()->set_chunksize(__pyx_v_c_max_chunksize);

    /* "pyarrow/table.pxi":1349
 *             warnings.warn(msg, FutureWarning)
 * 
 *         if max_chunksize is not None:             # <<<<<<<<<<<<<<
 *             c_max_chunksize = max_chunksize
 *             reader.get().set_chunksize(c_max_chunksize)
 */
  }

  /* "pyarrow/table.pxi":1353
 *             reader.get().set_chunksize(c_max_chunksize)
 * 
 *         while True:             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 check_status(reader.get().ReadNext(&batch))
 */
  while (1) {

    /* "pyarrow/table.pxi":1354
 * 
 *         while True:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(reader.get().ReadNext(&batch))
 * 
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "pyarrow/table.pxi":1355
 *         while True:
 *             with nogil:
 *                 check_status(reader.get().ReadNext(&batch))             # <<<<<<<<<<<<<<
 * 
 *             if batch.get() == NULL:
 */
          __pyx_t_6 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_reader.get()->ReadNext((&__pyx_v_batch))); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(6, 1355, __pyx_L10_error)
        }

        /* "pyarrow/table.pxi":1354
 * 
 *         while True:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(reader.get().ReadNext(&batch))
 * 
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L11;
          }
          __pyx_L10_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L11:;
        }
    }

    /* "pyarrow/table.pxi":1357
 *                 check_status(reader.get().ReadNext(&batch))
 * 
 *             if batch.get() == NULL:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    __pyx_t_2 = ((__pyx_v_batch.get() == NULL) != 0);
    if (__pyx_t_2) {

      /* "pyarrow/table.pxi":1358
 * 
 *             if batch.get() == NULL:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             result.append(pyarrow_wrap_batch(batch))
 */
      goto __pyx_L6_break;

      /* "pyarrow/table.pxi":1357
 *                 check_status(reader.get().ReadNext(&batch))
 * 
 *             if batch.get() == NULL:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    }

    /* "pyarrow/table.pxi":1360
 *                 break
 * 
 *             result.append(pyarrow_wrap_batch(batch))             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_batch(__pyx_v_batch); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1360, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(6, 1360, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L6_break:;

  /* "pyarrow/table.pxi":1362
 *             result.append(pyarrow_wrap_batch(batch))
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def _to_pandas(self, options, categories=None, ignore_metadata=False,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1319
 *         return pyarrow_wrap_table(c_table)
 * 
 *     def to_batches(self, max_chunksize=None, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Convert Table to list of (contiguous) RecordBatch objects, with maximum
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.Table.to_batches", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_XDECREF(__pyx_v_max_chunksize);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1364
 *         return result
 * 
 *     def _to_pandas(self, options, categories=None, ignore_metadata=False,             # <<<<<<<<<<<<<<
 *                    types_mapper=None):
 *         from pyarrow.pandas_compat import table_to_blockmanager
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_37_to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_36_to_pandas[] = "Table._to_pandas(self, options, categories=None, ignore_metadata=False, types_mapper=None)";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_37_to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_options = 0;
  PyObject *__pyx_v_categories = 0;
  PyObject *__pyx_v_ignore_metadata = 0;
  PyObject *__pyx_v_types_mapper = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_to_pandas (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_options,&__pyx_n_s_categories,&__pyx_n_s_ignore_metadata,&__pyx_n_s_types_mapper,0};
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_False);

    /* "pyarrow/table.pxi":1365
 * 
 *     def _to_pandas(self, options, categories=None, ignore_metadata=False,
 *                    types_mapper=None):             # <<<<<<<<<<<<<<
 *         from pyarrow.pandas_compat import table_to_blockmanager
 *         mgr = table_to_blockmanager(
 */
    values[3] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_categories);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ignore_metadata);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_types_mapper);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_to_pandas") < 0)) __PYX_ERR(6, 1364, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_options = values[0];
    __pyx_v_categories = values[1];
    __pyx_v_ignore_metadata = values[2];
    __pyx_v_types_mapper = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_to_pandas", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 1364, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Table._to_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_36_to_pandas(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), __pyx_v_options, __pyx_v_categories, __pyx_v_ignore_metadata, __pyx_v_types_mapper);

  /* "pyarrow/table.pxi":1364
 *         return result
 * 
 *     def _to_pandas(self, options, categories=None, ignore_metadata=False,             # <<<<<<<<<<<<<<
 *                    types_mapper=None):
 *         from pyarrow.pandas_compat import table_to_blockmanager
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_36_to_pandas(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_options, PyObject *__pyx_v_categories, PyObject *__pyx_v_ignore_metadata, PyObject *__pyx_v_types_mapper) {
  PyObject *__pyx_v_table_to_blockmanager = NULL;
  PyObject *__pyx_v_mgr = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("_to_pandas", 0);

  /* "pyarrow/table.pxi":1366
 *     def _to_pandas(self, options, categories=None, ignore_metadata=False,
 *                    types_mapper=None):
 *         from pyarrow.pandas_compat import table_to_blockmanager             # <<<<<<<<<<<<<<
 *         mgr = table_to_blockmanager(
 *             options, self, categories,
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_table_to_blockmanager);
  __Pyx_GIVEREF(__pyx_n_s_table_to_blockmanager);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_table_to_blockmanager);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_pyarrow_pandas_compat, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_table_to_blockmanager); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_table_to_blockmanager = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/table.pxi":1367
 *                    types_mapper=None):
 *         from pyarrow.pandas_compat import table_to_blockmanager
 *         mgr = table_to_blockmanager(             # <<<<<<<<<<<<<<
 *             options, self, categories,
 *             ignore_metadata=ignore_metadata,
 */
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_options);
  __Pyx_GIVEREF(__pyx_v_options);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_options);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_categories);
  __Pyx_GIVEREF(__pyx_v_categories);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_categories);

  /* "pyarrow/table.pxi":1369
 *         mgr = table_to_blockmanager(
 *             options, self, categories,
 *             ignore_metadata=ignore_metadata,             # <<<<<<<<<<<<<<
 *             types_mapper=types_mapper)
 *         return pandas_api.data_frame(mgr)
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ignore_metadata, __pyx_v_ignore_metadata) < 0) __PYX_ERR(6, 1369, __pyx_L1_error)

  /* "pyarrow/table.pxi":1370
 *             options, self, categories,
 *             ignore_metadata=ignore_metadata,
 *             types_mapper=types_mapper)             # <<<<<<<<<<<<<<
 *         return pandas_api.data_frame(mgr)
 * 
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_types_mapper, __pyx_v_types_mapper) < 0) __PYX_ERR(6, 1369, __pyx_L1_error)

  /* "pyarrow/table.pxi":1367
 *                    types_mapper=None):
 *         from pyarrow.pandas_compat import table_to_blockmanager
 *         mgr = table_to_blockmanager(             # <<<<<<<<<<<<<<
 *             options, self, categories,
 *             ignore_metadata=ignore_metadata,
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_table_to_blockmanager, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_mgr = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyarrow/table.pxi":1371
 *             ignore_metadata=ignore_metadata,
 *             types_mapper=types_mapper)
 *         return pandas_api.data_frame(mgr)             # <<<<<<<<<<<<<<
 * 
 *     def to_pydict(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_7pyarrow_3lib_pandas_api), __pyx_n_s_data_frame); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_v_mgr) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_mgr);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1364
 *         return result
 * 
 *     def _to_pandas(self, options, categories=None, ignore_metadata=False,             # <<<<<<<<<<<<<<
 *                    types_mapper=None):
 *         from pyarrow.pandas_compat import table_to_blockmanager
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Table._to_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_table_to_blockmanager);
  __Pyx_XDECREF(__pyx_v_mgr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1373
 *         return pandas_api.data_frame(mgr)
 * 
 *     def to_pydict(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert the Table to a dict or OrderedDict.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_39to_pydict(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_38to_pydict[] = "Table.to_pydict(self)\n\n        Convert the Table to a dict or OrderedDict.\n\n        Returns\n        -------\n        dict\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_39to_pydict(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_pydict (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_38to_pydict(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_38to_pydict(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self) {
  size_t __pyx_v_i;
  size_t __pyx_v_num_columns;
  PyObject *__pyx_v_entries = 0;
  struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_column = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("to_pydict", 0);

  /* "pyarrow/table.pxi":1383
 *         cdef:
 *             size_t i
 *             size_t num_columns = self.table.num_columns()             # <<<<<<<<<<<<<<
 *             list entries = []
 *             ChunkedArray column
 */
  __pyx_v_num_columns = __pyx_v_self->table->num_columns();

  /* "pyarrow/table.pxi":1384
 *             size_t i
 *             size_t num_columns = self.table.num_columns()
 *             list entries = []             # <<<<<<<<<<<<<<
 *             ChunkedArray column
 * 
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_entries = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":1387
 *             ChunkedArray column
 * 
 *         for i in range(num_columns):             # <<<<<<<<<<<<<<
 *             column = self.column(i)
 *             entries.append((self.field(i).name, column.to_pylist()))
 */
  __pyx_t_2 = __pyx_v_num_columns;
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "pyarrow/table.pxi":1388
 * 
 *         for i in range(num_columns):
 *             column = self.column(i)             # <<<<<<<<<<<<<<
 *             entries.append((self.field(i).name, column.to_pylist()))
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_column); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1388, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1388, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1388, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_ChunkedArray))))) __PYX_ERR(6, 1388, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_column, ((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "pyarrow/table.pxi":1389
 *         for i in range(num_columns):
 *             column = self.column(i)
 *             entries.append((self.field(i).name, column.to_pylist()))             # <<<<<<<<<<<<<<
 * 
 *         return ordered_dict(entries)
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_field); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1389, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1389, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1389, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1389, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_column), __pyx_n_s_to_pylist); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1389, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1389, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1389, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_entries, __pyx_t_6); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(6, 1389, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }

  /* "pyarrow/table.pxi":1391
 *             entries.append((self.field(i).name, column.to_pylist()))
 * 
 *         return ordered_dict(entries)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ordered_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v_entries) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_entries);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1373
 *         return pandas_api.data_frame(mgr)
 * 
 *     def to_pydict(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert the Table to a dict or OrderedDict.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.Table.to_pydict", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_entries);
  __Pyx_XDECREF((PyObject *)__pyx_v_column);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1394
 * 
 *     @property
 *     def schema(self):             # <<<<<<<<<<<<<<
 *         """
 *         Schema of the table and its columns
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_6schema_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_6schema_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_6schema___get__(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_6schema___get__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/table.pxi":1402
 *         pyarrow.Schema
 *         """
 *         return pyarrow_wrap_schema(self.table.schema())             # <<<<<<<<<<<<<<
 * 
 *     def field(self, i):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(__pyx_v_self->table->schema()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1402, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1394
 * 
 *     @property
 *     def schema(self):             # <<<<<<<<<<<<<<
 *         """
 *         Schema of the table and its columns
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Table.schema.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1404
 *         return pyarrow_wrap_schema(self.table.schema())
 * 
 *     def field(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Select a schema field by its column name or numeric index.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_41field(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_40field[] = "Table.field(self, i)\n\n        Select a schema field by its column name or numeric index.\n\n        Parameters\n        ----------\n        i : int or string\n\n        Returns\n        -------\n        pyarrow.Field\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_41field(PyObject *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("field (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_40field(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), ((PyObject *)__pyx_v_i));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_40field(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("field", 0);

  /* "pyarrow/table.pxi":1416
 *         pyarrow.Field
 *         """
 *         return self.schema.field(i)             # <<<<<<<<<<<<<<
 * 
 *     def column(self, i):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_schema); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_field); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_i) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_i);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1404
 *         return pyarrow_wrap_schema(self.table.schema())
 * 
 *     def field(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Select a schema field by its column name or numeric index.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Table.field", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1418
 *         return self.schema.field(i)
 * 
 *     def column(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Select a column by its column name, or numeric index.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_43column(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_42column[] = "Table.column(self, i)\n\n        Select a column by its column name, or numeric index.\n\n        Parameters\n        ----------\n        i : int or string\n\n        Returns\n        -------\n        pyarrow.ChunkedArray\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_43column(PyObject *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("column (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_42column(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), ((PyObject *)__pyx_v_i));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_42column(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_v_field_index = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("column", 0);

  /* "pyarrow/table.pxi":1430
 *         pyarrow.ChunkedArray
 *         """
 *         if isinstance(i, six.string_types):             # <<<<<<<<<<<<<<
 *             field_index = self.schema.get_field_index(i)
 *             if field_index < 0:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_six); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_string_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_i, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(6, 1430, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "pyarrow/table.pxi":1431
 *         """
 *         if isinstance(i, six.string_types):
 *             field_index = self.schema.get_field_index(i)             # <<<<<<<<<<<<<<
 *             if field_index < 0:
 *                 raise KeyError("Column {} does not exist in table".format(i))
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_schema); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1431, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get_field_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1431, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_1, __pyx_v_i) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_i);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1431, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_field_index = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pyarrow/table.pxi":1432
 *         if isinstance(i, six.string_types):
 *             field_index = self.schema.get_field_index(i)
 *             if field_index < 0:             # <<<<<<<<<<<<<<
 *                 raise KeyError("Column {} does not exist in table".format(i))
 *             else:
 */
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_field_index, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1432, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(6, 1432, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(__pyx_t_4)) {

      /* "pyarrow/table.pxi":1433
 *             field_index = self.schema.get_field_index(i)
 *             if field_index < 0:
 *                 raise KeyError("Column {} does not exist in table".format(i))             # <<<<<<<<<<<<<<
 *             else:
 *                 return self._column(field_index)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Column_does_not_exist_in_table, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1433, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_1, __pyx_v_i) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_i);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1433, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1433, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __PYX_ERR(6, 1433, __pyx_L1_error)

      /* "pyarrow/table.pxi":1432
 *         if isinstance(i, six.string_types):
 *             field_index = self.schema.get_field_index(i)
 *             if field_index < 0:             # <<<<<<<<<<<<<<
 *                 raise KeyError("Column {} does not exist in table".format(i))
 *             else:
 */
    }

    /* "pyarrow/table.pxi":1435
 *                 raise KeyError("Column {} does not exist in table".format(i))
 *             else:
 *                 return self._column(field_index)             # <<<<<<<<<<<<<<
 *         elif isinstance(i, six.integer_types):
 *             return self._column(i)
 */
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_column_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1435, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      __pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_v_field_index) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_field_index);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1435, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L0;
    }

    /* "pyarrow/table.pxi":1430
 *         pyarrow.ChunkedArray
 *         """
 *         if isinstance(i, six.string_types):             # <<<<<<<<<<<<<<
 *             field_index = self.schema.get_field_index(i)
 *             if field_index < 0:
 */
  }

  /* "pyarrow/table.pxi":1436
 *             else:
 *                 return self._column(field_index)
 *         elif isinstance(i, six.integer_types):             # <<<<<<<<<<<<<<
 *             return self._column(i)
 *         else:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_six); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_integer_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_4 = PyObject_IsInstance(__pyx_v_i, __pyx_t_2); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(6, 1436, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (likely(__pyx_t_3)) {

    /* "pyarrow/table.pxi":1437
 *                 return self._column(field_index)
 *         elif isinstance(i, six.integer_types):
 *             return self._column(i)             # <<<<<<<<<<<<<<
 *         else:
 *             raise TypeError("Index must either be string or integer")
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_column_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1437, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_1, __pyx_v_i) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_i);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1437, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/table.pxi":1436
 *             else:
 *                 return self._column(field_index)
 *         elif isinstance(i, six.integer_types):             # <<<<<<<<<<<<<<
 *             return self._column(i)
 *         else:
 */
  }

  /* "pyarrow/table.pxi":1439
 *             return self._column(i)
 *         else:
 *             raise TypeError("Index must either be string or integer")             # <<<<<<<<<<<<<<
 * 
 *     def _column(self, int i):
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1439, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(6, 1439, __pyx_L1_error)
  }

  /* "pyarrow/table.pxi":1418
 *         return self.schema.field(i)
 * 
 *     def column(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Select a column by its column name, or numeric index.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.Table.column", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_field_index);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1441
 *             raise TypeError("Index must either be string or integer")
 * 
 *     def _column(self, int i):             # <<<<<<<<<<<<<<
 *         """
 *         Select a column by its numeric index.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_45_column(PyObject *__pyx_v_self, PyObject *__pyx_arg_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_44_column[] = "Table._column(self, int i)\n\n        Select a column by its numeric index.\n\n        Parameters\n        ----------\n        i : int\n\n        Returns\n        -------\n        pyarrow.ChunkedArray\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_45_column(PyObject *__pyx_v_self, PyObject *__pyx_arg_i) {
  int __pyx_v_i;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_column (wrapper)", 0);
  assert(__pyx_arg_i); {
    __pyx_v_i = __Pyx_PyInt_As_int(__pyx_arg_i); if (unlikely((__pyx_v_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 1441, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Table._column", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_44_column(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), ((int)__pyx_v_i));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_44_column(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, int __pyx_v_i) {
  int __pyx_v_index;
  struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("_column", 0);

  /* "pyarrow/table.pxi":1453
 *         pyarrow.ChunkedArray
 *         """
 *         cdef int index = <int> _normalize_index(i, self.num_columns)             # <<<<<<<<<<<<<<
 *         cdef ChunkedArray result = pyarrow_wrap_chunked_array(
 *             self.table.column(index))
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_columns); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(6, 1453, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_f_7pyarrow_3lib__normalize_index(__pyx_v_i, __pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1L))) __PYX_ERR(6, 1453, __pyx_L1_error)
  __pyx_v_index = ((int)__pyx_t_3);

  /* "pyarrow/table.pxi":1454
 *         """
 *         cdef int index = <int> _normalize_index(i, self.num_columns)
 *         cdef ChunkedArray result = pyarrow_wrap_chunked_array(             # <<<<<<<<<<<<<<
 *             self.table.column(index))
 *         result._name = self.schema[index].name
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_chunked_array(__pyx_v_self->table->column(__pyx_v_index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1454, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_ChunkedArray))))) __PYX_ERR(6, 1454, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":1456
 *         cdef ChunkedArray result = pyarrow_wrap_chunked_array(
 *             self.table.column(index))
 *         result._name = self.schema[index].name             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_schema); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_result->_name);
  __Pyx_DECREF(__pyx_v_result->_name);
  __pyx_v_result->_name = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":1457
 *             self.table.column(index))
 *         result._name = self.schema[index].name
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def itercolumns(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1441
 *             raise TypeError("Index must either be string or integer")
 * 
 *     def _column(self, int i):             # <<<<<<<<<<<<<<
 *         """
 *         Select a column by its numeric index.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.Table._column", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pyarrow_3lib_5Table_48generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/table.pxi":1459
 *         return result
 * 
 *     def itercolumns(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterator over all columns in their numerical order
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_47itercolumns(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_46itercolumns[] = "Table.itercolumns(self)\n\n        Iterator over all columns in their numerical order\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_47itercolumns(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("itercolumns (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_46itercolumns(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_46itercolumns(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12_itercolumns *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("itercolumns", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12_itercolumns *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_12_itercolumns(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_12_itercolumns, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12_itercolumns *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(6, 1459, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7pyarrow_3lib_5Table_48generator10, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_itercolumns, __pyx_n_s_Table_itercolumns, __pyx_n_s_pyarrow_lib); if (unlikely(!gen)) __PYX_ERR(6, 1459, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.Table.itercolumns", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7pyarrow_3lib_5Table_48generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12_itercolumns *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12_itercolumns *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("itercolumns", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(6, 1459, __pyx_L1_error)

  /* "pyarrow/table.pxi":1463
 *         Iterator over all columns in their numerical order
 *         """
 *         for i in range(self.num_columns):             # <<<<<<<<<<<<<<
 *             yield self._column(i)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_num_columns); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1463, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1463, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(6, 1463, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1463, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(6, 1463, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1463, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(6, 1463, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_i, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/table.pxi":1464
 *         """
 *         for i in range(self.num_columns):
 *             yield self._column(i)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_column_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1464, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_cur_scope->__pyx_v_i) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_cur_scope->__pyx_v_i);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1464, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(6, 1464, __pyx_L1_error)

    /* "pyarrow/table.pxi":1463
 *         Iterator over all columns in their numerical order
 *         """
 *         for i in range(self.num_columns):             # <<<<<<<<<<<<<<
 *             yield self._column(i)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "pyarrow/table.pxi":1459
 *         return result
 * 
 *     def itercolumns(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterator over all columns in their numerical order
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("itercolumns", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1467
 * 
 *     @property
 *     def columns(self):             # <<<<<<<<<<<<<<
 *         """
 *         List of all columns in numerical order
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_7columns_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_7columns_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_7columns___get__(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_7columns___get__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self) {
  PyObject *__pyx_9genexpr15__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/table.pxi":1475
 *         list of pa.ChunkedArray
 *         """
 *         return [self._column(i) for i in range(self.num_columns)]             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1475, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_columns); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1475, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1475, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1475, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1475, __pyx_L5_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_5)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(6, 1475, __pyx_L5_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1475, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(6, 1475, __pyx_L5_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1475, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_5(__pyx_t_2);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(6, 1475, __pyx_L5_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_9genexpr15__pyx_v_i, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_column_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1475, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_9genexpr15__pyx_v_i) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_9genexpr15__pyx_v_i);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1475, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(6, 1475, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_i); __pyx_9genexpr15__pyx_v_i = 0;
    goto __pyx_L8_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_i); __pyx_9genexpr15__pyx_v_i = 0;
    goto __pyx_L1_error;
    __pyx_L8_exit_scope:;
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1467
 * 
 *     @property
 *     def columns(self):             # <<<<<<<<<<<<<<
 *         """
 *         List of all columns in numerical order
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.Table.columns.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1478
 * 
 *     @property
 *     def num_columns(self):             # <<<<<<<<<<<<<<
 *         """
 *         Number of columns in this table
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_11num_columns_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_11num_columns_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_11num_columns___get__(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_11num_columns___get__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/table.pxi":1486
 *         int
 *         """
 *         return self.table.num_columns()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->table->num_columns()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1478
 * 
 *     @property
 *     def num_columns(self):             # <<<<<<<<<<<<<<
 *         """
 *         Number of columns in this table
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Table.num_columns.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1489
 * 
 *     @property
 *     def num_rows(self):             # <<<<<<<<<<<<<<
 *         """
 *         Number of rows in this table.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_8num_rows_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_8num_rows_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_8num_rows___get__(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_8num_rows___get__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/table.pxi":1500
 *         int
 *         """
 *         return self.table.num_rows()             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->table->num_rows()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1489
 * 
 *     @property
 *     def num_rows(self):             # <<<<<<<<<<<<<<
 *         """
 *         Number of rows in this table.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Table.num_rows.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1502
 *         return self.table.num_rows()
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.num_rows
 * 
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_7pyarrow_3lib_5Table_50__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pw_7pyarrow_3lib_5Table_50__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_49__len__(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static Py_ssize_t __pyx_pf_7pyarrow_3lib_5Table_49__len__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "pyarrow/table.pxi":1503
 * 
 *     def __len__(self):
 *         return self.num_rows             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(6, 1503, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1502
 *         return self.table.num_rows()
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.num_rows
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Table.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1506
 * 
 *     @property
 *     def shape(self):             # <<<<<<<<<<<<<<
 *         """
 *         Dimensions of the table: (#rows, #columns)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_5shape_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_5shape___get__(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_5shape___get__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/table.pxi":1514
 *         (int, int)
 *         """
 *         return (self.num_rows, self.num_columns)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_columns); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1506
 * 
 *     @property
 *     def shape(self):             # <<<<<<<<<<<<<<
 *         """
 *         Dimensions of the table: (#rows, #columns)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Table.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1517
 * 
 *     @property
 *     def nbytes(self):             # <<<<<<<<<<<<<<
 *         """
 *         Total number of bytes consumed by the elements of the table.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_6nbytes_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_6nbytes___get__(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_6nbytes___get__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self) {
  PyObject *__pyx_v_size = NULL;
  PyObject *__pyx_v_column = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/table.pxi":1521
 *         Total number of bytes consumed by the elements of the table.
 *         """
 *         size = 0             # <<<<<<<<<<<<<<
 *         for column in self.itercolumns():
 *             size += column.nbytes
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_size = __pyx_int_0;

  /* "pyarrow/table.pxi":1522
 *         """
 *         size = 0
 *         for column in self.itercolumns():             # <<<<<<<<<<<<<<
 *             size += column.nbytes
 *         return size
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_itercolumns); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1522, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1522, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(6, 1522, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1522, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(6, 1522, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1522, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(6, 1522, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_column, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/table.pxi":1523
 *         size = 0
 *         for column in self.itercolumns():
 *             size += column.nbytes             # <<<<<<<<<<<<<<
 *         return size
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_column, __pyx_n_s_nbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1523, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_size, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1523, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_size, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/table.pxi":1522
 *         """
 *         size = 0
 *         for column in self.itercolumns():             # <<<<<<<<<<<<<<
 *             size += column.nbytes
 *         return size
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/table.pxi":1524
 *         for column in self.itercolumns():
 *             size += column.nbytes
 *         return size             # <<<<<<<<<<<<<<
 * 
 *     def __sizeof__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_size);
  __pyx_r = __pyx_v_size;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1517
 * 
 *     @property
 *     def nbytes(self):             # <<<<<<<<<<<<<<
 *         """
 *         Total number of bytes consumed by the elements of the table.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Table.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_size);
  __Pyx_XDECREF(__pyx_v_column);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1526
 *         return size
 * 
 *     def __sizeof__(self):             # <<<<<<<<<<<<<<
 *         return super(Table, self).__sizeof__() + self.nbytes
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_52__sizeof__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_51__sizeof__[] = "Table.__sizeof__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_52__sizeof__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sizeof__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_51__sizeof__(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_51__sizeof__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__sizeof__", 0);

  /* "pyarrow/table.pxi":1527
 * 
 *     def __sizeof__(self):
 *         return super(Table, self).__sizeof__() + self.nbytes             # <<<<<<<<<<<<<<
 * 
 *     def add_column(self, int i, field_, column):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_7pyarrow_3lib_Table));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7pyarrow_3lib_Table));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Table));
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self));
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sizeof); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_nbytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1526
 *         return size
 * 
 *     def __sizeof__(self):             # <<<<<<<<<<<<<<
 *         return super(Table, self).__sizeof__() + self.nbytes
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Table.__sizeof__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1529
 *         return super(Table, self).__sizeof__() + self.nbytes
 * 
 *     def add_column(self, int i, field_, column):             # <<<<<<<<<<<<<<
 *         """
 *         Add column to Table at position. Returns new table
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_54add_column(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_53add_column[] = "Table.add_column(self, int i, field_, column)\n\n        Add column to Table at position. Returns new table\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_54add_column(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_i;
  PyObject *__pyx_v_field_ = 0;
  PyObject *__pyx_v_column = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_column (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_i,&__pyx_n_s_field_3,&__pyx_n_s_column,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field_3)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add_column", 1, 3, 3, 1); __PYX_ERR(6, 1529, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_column)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add_column", 1, 3, 3, 2); __PYX_ERR(6, 1529, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_column") < 0)) __PYX_ERR(6, 1529, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_i = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 1529, __pyx_L3_error)
    __pyx_v_field_ = values[1];
    __pyx_v_column = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_column", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 1529, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Table.add_column", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_53add_column(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), __pyx_v_i, __pyx_v_field_, __pyx_v_column);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_53add_column(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, int __pyx_v_i, PyObject *__pyx_v_field_, PyObject *__pyx_v_column) {
  std::shared_ptr< arrow::Table>  __pyx_v_c_table;
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_c_field = 0;
  struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_c_arr = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("add_column", 0);

  /* "pyarrow/table.pxi":1538
 *             ChunkedArray c_arr
 * 
 *         if isinstance(column, ChunkedArray):             # <<<<<<<<<<<<<<
 *             c_arr = column
 *         else:
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_column, __pyx_ptype_7pyarrow_3lib_ChunkedArray); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":1539
 * 
 *         if isinstance(column, ChunkedArray):
 *             c_arr = column             # <<<<<<<<<<<<<<
 *         else:
 *             c_arr = chunked_array(column)
 */
    if (!(likely(((__pyx_v_column) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_column, __pyx_ptype_7pyarrow_3lib_ChunkedArray))))) __PYX_ERR(6, 1539, __pyx_L1_error)
    __pyx_t_3 = __pyx_v_column;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v_c_arr = ((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/table.pxi":1538
 *             ChunkedArray c_arr
 * 
 *         if isinstance(column, ChunkedArray):             # <<<<<<<<<<<<<<
 *             c_arr = column
 *         else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/table.pxi":1541
 *             c_arr = column
 *         else:
 *             c_arr = chunked_array(column)             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(field_, Field):
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_chunked_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1541, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_column) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_column);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1541, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_ChunkedArray))))) __PYX_ERR(6, 1541, __pyx_L1_error)
    __pyx_v_c_arr = ((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_t_3);
    __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "pyarrow/table.pxi":1543
 *             c_arr = chunked_array(column)
 * 
 *         if isinstance(field_, Field):             # <<<<<<<<<<<<<<
 *             c_field = field_
 *         else:
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_field_, __pyx_ptype_7pyarrow_3lib_Field); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pyarrow/table.pxi":1544
 * 
 *         if isinstance(field_, Field):
 *             c_field = field_             # <<<<<<<<<<<<<<
 *         else:
 *             c_field = field(field_, c_arr.type)
 */
    if (!(likely(((__pyx_v_field_) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_field_, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(6, 1544, __pyx_L1_error)
    __pyx_t_3 = __pyx_v_field_;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v_c_field = ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/table.pxi":1543
 *             c_arr = chunked_array(column)
 * 
 *         if isinstance(field_, Field):             # <<<<<<<<<<<<<<
 *             c_field = field_
 *         else:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/table.pxi":1546
 *             c_field = field_
 *         else:
 *             c_field = field(field_, c_arr.type)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_field); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1546, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_c_arr), __pyx_n_s_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1546, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_field_, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1546, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_field_, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1546, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 1546, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_INCREF(__pyx_v_field_);
      __Pyx_GIVEREF(__pyx_v_field_);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_field_);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1546, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(6, 1546, __pyx_L1_error)
    __pyx_v_c_field = ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_3);
    __pyx_t_3 = 0;
  }
  __pyx_L4:;

  /* "pyarrow/table.pxi":1548
 *             c_field = field(field_, c_arr.type)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.table.AddColumn(i, c_field.sp_field,
 *                                               c_arr.sp_chunked_array,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":1549
 * 
 *         with nogil:
 *             check_status(self.table.AddColumn(i, c_field.sp_field,             # <<<<<<<<<<<<<<
 *                                               c_arr.sp_chunked_array,
 *                                               &c_table))
 */
        __pyx_t_7 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->table->AddColumn(__pyx_v_i, __pyx_v_c_field->sp_field, __pyx_v_c_arr->sp_chunked_array, (&__pyx_v_c_table))); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(6, 1549, __pyx_L6_error)
      }

      /* "pyarrow/table.pxi":1548
 *             c_field = field(field_, c_arr.type)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.table.AddColumn(i, c_field.sp_field,
 *                                               c_arr.sp_chunked_array,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L7;
        }
        __pyx_L6_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L7:;
      }
  }

  /* "pyarrow/table.pxi":1553
 *                                               &c_table))
 * 
 *         return pyarrow_wrap_table(c_table)             # <<<<<<<<<<<<<<
 * 
 *     def append_column(self, field_, column):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table(__pyx_v_c_table); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1553, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1529
 *         return super(Table, self).__sizeof__() + self.nbytes
 * 
 *     def add_column(self, int i, field_, column):             # <<<<<<<<<<<<<<
 *         """
 *         Add column to Table at position. Returns new table
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow.lib.Table.add_column", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_c_field);
  __Pyx_XDECREF((PyObject *)__pyx_v_c_arr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1555
 *         return pyarrow_wrap_table(c_table)
 * 
 *     def append_column(self, field_, column):             # <<<<<<<<<<<<<<
 *         """
 *         Append column at end of columns. Returns new table
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_56append_column(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_55append_column[] = "Table.append_column(self, field_, column)\n\n        Append column at end of columns. Returns new table\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_56append_column(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_field_ = 0;
  PyObject *__pyx_v_column = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("append_column (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field_3,&__pyx_n_s_column,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field_3)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_column)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("append_column", 1, 2, 2, 1); __PYX_ERR(6, 1555, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "append_column") < 0)) __PYX_ERR(6, 1555, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_field_ = values[0];
    __pyx_v_column = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("append_column", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 1555, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Table.append_column", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_55append_column(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), __pyx_v_field_, __pyx_v_column);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_55append_column(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_field_, PyObject *__pyx_v_column) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("append_column", 0);

  /* "pyarrow/table.pxi":1559
 *         Append column at end of columns. Returns new table
 *         """
 *         return self.add_column(self.num_columns, field_, column)             # <<<<<<<<<<<<<<
 * 
 *     def remove_column(self, int i):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_column); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_columns); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_3, __pyx_v_field_, __pyx_v_column};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1559, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_3, __pyx_v_field_, __pyx_v_column};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1559, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1559, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_3);
    __Pyx_INCREF(__pyx_v_field_);
    __Pyx_GIVEREF(__pyx_v_field_);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_field_);
    __Pyx_INCREF(__pyx_v_column);
    __Pyx_GIVEREF(__pyx_v_column);
    PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_column);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1559, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1555
 *         return pyarrow_wrap_table(c_table)
 * 
 *     def append_column(self, field_, column):             # <<<<<<<<<<<<<<
 *         """
 *         Append column at end of columns. Returns new table
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.Table.append_column", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1561
 *         return self.add_column(self.num_columns, field_, column)
 * 
 *     def remove_column(self, int i):             # <<<<<<<<<<<<<<
 *         """
 *         Create new Table with the indicated column removed
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_58remove_column(PyObject *__pyx_v_self, PyObject *__pyx_arg_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_57remove_column[] = "Table.remove_column(self, int i)\n\n        Create new Table with the indicated column removed\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_58remove_column(PyObject *__pyx_v_self, PyObject *__pyx_arg_i) {
  int __pyx_v_i;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("remove_column (wrapper)", 0);
  assert(__pyx_arg_i); {
    __pyx_v_i = __Pyx_PyInt_As_int(__pyx_arg_i); if (unlikely((__pyx_v_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 1561, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Table.remove_column", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_57remove_column(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), ((int)__pyx_v_i));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_57remove_column(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, int __pyx_v_i) {
  std::shared_ptr< arrow::Table>  __pyx_v_c_table;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("remove_column", 0);

  /* "pyarrow/table.pxi":1567
 *         cdef shared_ptr[CTable] c_table
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.table.RemoveColumn(i, &c_table))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":1568
 * 
 *         with nogil:
 *             check_status(self.table.RemoveColumn(i, &c_table))             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_table(c_table)
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->table->RemoveColumn(__pyx_v_i, (&__pyx_v_c_table))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 1568, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":1567
 *         cdef shared_ptr[CTable] c_table
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.table.RemoveColumn(i, &c_table))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/table.pxi":1570
 *             check_status(self.table.RemoveColumn(i, &c_table))
 * 
 *         return pyarrow_wrap_table(c_table)             # <<<<<<<<<<<<<<
 * 
 *     def set_column(self, int i, field_, column):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table(__pyx_v_c_table); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1561
 *         return self.add_column(self.num_columns, field_, column)
 * 
 *     def remove_column(self, int i):             # <<<<<<<<<<<<<<
 *         """
 *         Create new Table with the indicated column removed
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Table.remove_column", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1572
 *         return pyarrow_wrap_table(c_table)
 * 
 *     def set_column(self, int i, field_, column):             # <<<<<<<<<<<<<<
 *         """
 *         Replace column in Table at position. Returns new table
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_60set_column(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_59set_column[] = "Table.set_column(self, int i, field_, column)\n\n        Replace column in Table at position. Returns new table\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_60set_column(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_i;
  PyObject *__pyx_v_field_ = 0;
  PyObject *__pyx_v_column = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_column (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_i,&__pyx_n_s_field_3,&__pyx_n_s_column,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field_3)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_column", 1, 3, 3, 1); __PYX_ERR(6, 1572, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_column)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_column", 1, 3, 3, 2); __PYX_ERR(6, 1572, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_column") < 0)) __PYX_ERR(6, 1572, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_i = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 1572, __pyx_L3_error)
    __pyx_v_field_ = values[1];
    __pyx_v_column = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_column", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 1572, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Table.set_column", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_59set_column(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), __pyx_v_i, __pyx_v_field_, __pyx_v_column);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_59set_column(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, int __pyx_v_i, PyObject *__pyx_v_field_, PyObject *__pyx_v_column) {
  std::shared_ptr< arrow::Table>  __pyx_v_c_table;
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_c_field = 0;
  struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_c_arr = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("set_column", 0);

  /* "pyarrow/table.pxi":1581
 *             ChunkedArray c_arr
 * 
 *         if isinstance(column, ChunkedArray):             # <<<<<<<<<<<<<<
 *             c_arr = column
 *         else:
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_column, __pyx_ptype_7pyarrow_3lib_ChunkedArray); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":1582
 * 
 *         if isinstance(column, ChunkedArray):
 *             c_arr = column             # <<<<<<<<<<<<<<
 *         else:
 *             c_arr = chunked_array(column)
 */
    if (!(likely(((__pyx_v_column) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_column, __pyx_ptype_7pyarrow_3lib_ChunkedArray))))) __PYX_ERR(6, 1582, __pyx_L1_error)
    __pyx_t_3 = __pyx_v_column;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v_c_arr = ((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/table.pxi":1581
 *             ChunkedArray c_arr
 * 
 *         if isinstance(column, ChunkedArray):             # <<<<<<<<<<<<<<
 *             c_arr = column
 *         else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/table.pxi":1584
 *             c_arr = column
 *         else:
 *             c_arr = chunked_array(column)             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(field_, Field):
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_chunked_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1584, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_column) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_column);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1584, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_ChunkedArray))))) __PYX_ERR(6, 1584, __pyx_L1_error)
    __pyx_v_c_arr = ((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_t_3);
    __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "pyarrow/table.pxi":1586
 *             c_arr = chunked_array(column)
 * 
 *         if isinstance(field_, Field):             # <<<<<<<<<<<<<<
 *             c_field = field_
 *         else:
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_field_, __pyx_ptype_7pyarrow_3lib_Field); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pyarrow/table.pxi":1587
 * 
 *         if isinstance(field_, Field):
 *             c_field = field_             # <<<<<<<<<<<<<<
 *         else:
 *             c_field = field(field_, c_arr.type)
 */
    if (!(likely(((__pyx_v_field_) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_field_, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(6, 1587, __pyx_L1_error)
    __pyx_t_3 = __pyx_v_field_;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v_c_field = ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/table.pxi":1586
 *             c_arr = chunked_array(column)
 * 
 *         if isinstance(field_, Field):             # <<<<<<<<<<<<<<
 *             c_field = field_
 *         else:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/table.pxi":1589
 *             c_field = field_
 *         else:
 *             c_field = field(field_, c_arr.type)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_field); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1589, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_c_arr), __pyx_n_s_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1589, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_field_, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1589, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_field_, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1589, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 1589, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_INCREF(__pyx_v_field_);
      __Pyx_GIVEREF(__pyx_v_field_);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_field_);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1589, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(6, 1589, __pyx_L1_error)
    __pyx_v_c_field = ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_3);
    __pyx_t_3 = 0;
  }
  __pyx_L4:;

  /* "pyarrow/table.pxi":1591
 *             c_field = field(field_, c_arr.type)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.table.SetColumn(i, c_field.sp_field,
 *                                               c_arr.sp_chunked_array,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":1592
 * 
 *         with nogil:
 *             check_status(self.table.SetColumn(i, c_field.sp_field,             # <<<<<<<<<<<<<<
 *                                               c_arr.sp_chunked_array,
 *                                               &c_table))
 */
        __pyx_t_7 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->table->SetColumn(__pyx_v_i, __pyx_v_c_field->sp_field, __pyx_v_c_arr->sp_chunked_array, (&__pyx_v_c_table))); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(6, 1592, __pyx_L6_error)
      }

      /* "pyarrow/table.pxi":1591
 *             c_field = field(field_, c_arr.type)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.table.SetColumn(i, c_field.sp_field,
 *                                               c_arr.sp_chunked_array,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L7;
        }
        __pyx_L6_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L7:;
      }
  }

  /* "pyarrow/table.pxi":1596
 *                                               &c_table))
 * 
 *         return pyarrow_wrap_table(c_table)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table(__pyx_v_c_table); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1572
 *         return pyarrow_wrap_table(c_table)
 * 
 *     def set_column(self, int i, field_, column):             # <<<<<<<<<<<<<<
 *         """
 *         Replace column in Table at position. Returns new table
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow.lib.Table.set_column", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_c_field);
  __Pyx_XDECREF((PyObject *)__pyx_v_c_arr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1599
 * 
 *     @property
 *     def column_names(self):             # <<<<<<<<<<<<<<
 *         """
 *         Names of the table's columns
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_12column_names_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_12column_names_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_12column_names___get__(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_12column_names___get__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self) {
  std::vector<std::string>  __pyx_v_names;
  std::string __pyx_9genexpr16__pyx_v_name;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  std::vector<std::string> ::iterator __pyx_t_2;
  std::string __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/table.pxi":1603
 *         Names of the table's columns
 *         """
 *         names = self.table.ColumnNames()             # <<<<<<<<<<<<<<
 *         return [frombytes(name) for name in names]
 * 
 */
  __pyx_v_names = __pyx_v_self->table->ColumnNames();

  /* "pyarrow/table.pxi":1604
 *         """
 *         names = self.table.ColumnNames()
 *         return [frombytes(name) for name in names]             # <<<<<<<<<<<<<<
 * 
 *     def rename_columns(self, names):
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1604, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_v_names.begin();
    for (;;) {
      if (!(__pyx_t_2 != __pyx_v_names.end())) break;
      __pyx_t_3 = *__pyx_t_2;
      ++__pyx_t_2;
      __pyx_9genexpr16__pyx_v_name = __pyx_t_3;
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1604, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_9genexpr16__pyx_v_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1604, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1604, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(6, 1604, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1599
 * 
 *     @property
 *     def column_names(self):             # <<<<<<<<<<<<<<
 *         """
 *         Names of the table's columns
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.Table.column_names.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1606
 *         return [frombytes(name) for name in names]
 * 
 *     def rename_columns(self, names):             # <<<<<<<<<<<<<<
 *         """
 *         Create new table with columns renamed to provided names
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_62rename_columns(PyObject *__pyx_v_self, PyObject *__pyx_v_names); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_61rename_columns[] = "Table.rename_columns(self, names)\n\n        Create new table with columns renamed to provided names\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_62rename_columns(PyObject *__pyx_v_self, PyObject *__pyx_v_names) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rename_columns (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_61rename_columns(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), ((PyObject *)__pyx_v_names));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_61rename_columns(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_names) {
  std::shared_ptr< arrow::Table>  __pyx_v_c_table;
  std::vector<std::string>  __pyx_v_c_names;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  std::string __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("rename_columns", 0);

  /* "pyarrow/table.pxi":1614
 *             vector[c_string] c_names
 * 
 *         for name in names:             # <<<<<<<<<<<<<<
 *             c_names.push_back(tobytes(name))
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_names)) || PyTuple_CheckExact(__pyx_v_names)) {
    __pyx_t_1 = __pyx_v_names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_names); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1614, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1614, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(6, 1614, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1614, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(6, 1614, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1614, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(6, 1614, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/table.pxi":1615
 * 
 *         for name in names:
 *             c_names.push_back(tobytes(name))             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1615, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_name);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1615, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = __pyx_convert_string_from_py_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 1615, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    try {
      __pyx_v_c_names.push_back(__pyx_t_7);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(6, 1615, __pyx_L1_error)
    }

    /* "pyarrow/table.pxi":1614
 *             vector[c_string] c_names
 * 
 *         for name in names:             # <<<<<<<<<<<<<<
 *             c_names.push_back(tobytes(name))
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":1617
 *             c_names.push_back(tobytes(name))
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.table.RenameColumns(c_names, &c_table))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":1618
 * 
 *         with nogil:
 *             check_status(self.table.RenameColumns(c_names, &c_table))             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_table(c_table)
 */
        __pyx_t_8 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->table->RenameColumns(__pyx_v_c_names, (&__pyx_v_c_table))); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(6, 1618, __pyx_L6_error)
      }

      /* "pyarrow/table.pxi":1617
 *             c_names.push_back(tobytes(name))
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.table.RenameColumns(c_names, &c_table))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L7;
        }
        __pyx_L6_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L7:;
      }
  }

  /* "pyarrow/table.pxi":1620
 *             check_status(self.table.RenameColumns(c_names, &c_table))
 * 
 *         return pyarrow_wrap_table(c_table)             # <<<<<<<<<<<<<<
 * 
 *     def drop(self, columns):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table(__pyx_v_c_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1620, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1606
 *         return [frombytes(name) for name in names]
 * 
 *     def rename_columns(self, names):             # <<<<<<<<<<<<<<
 *         """
 *         Create new table with columns renamed to provided names
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.Table.rename_columns", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1622
 *         return pyarrow_wrap_table(c_table)
 * 
 *     def drop(self, columns):             # <<<<<<<<<<<<<<
 *         """
 *         Drop one or more columns and return a new table.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_64drop(PyObject *__pyx_v_self, PyObject *__pyx_v_columns); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_63drop[] = "Table.drop(self, columns)\n\n        Drop one or more columns and return a new table.\n\n        columns: list of str\n\n        Returns pa.Table\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_64drop(PyObject *__pyx_v_self, PyObject *__pyx_v_columns) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("drop (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_63drop(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), ((PyObject *)__pyx_v_columns));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_63drop(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_columns) {
  PyObject *__pyx_v_indices = NULL;
  PyObject *__pyx_v_col = NULL;
  PyObject *__pyx_v_idx = NULL;
  PyObject *__pyx_v_table = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("drop", 0);

  /* "pyarrow/table.pxi":1630
 *         Returns pa.Table
 *         """
 *         indices = []             # <<<<<<<<<<<<<<
 *         for col in columns:
 *             idx = self.schema.get_field_index(col)
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1630, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_indices = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":1631
 *         """
 *         indices = []
 *         for col in columns:             # <<<<<<<<<<<<<<
 *             idx = self.schema.get_field_index(col)
 *             if idx == -1:
 */
  if (likely(PyList_CheckExact(__pyx_v_columns)) || PyTuple_CheckExact(__pyx_v_columns)) {
    __pyx_t_1 = __pyx_v_columns; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_columns); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1631, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1631, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(6, 1631, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1631, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(6, 1631, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1631, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(6, 1631, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_col, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/table.pxi":1632
 *         indices = []
 *         for col in columns:
 *             idx = self.schema.get_field_index(col)             # <<<<<<<<<<<<<<
 *             if idx == -1:
 *                 raise KeyError("Column {!r} not found".format(col))
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_schema); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1632, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get_field_index); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1632, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_col) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_col);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1632, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/table.pxi":1633
 *         for col in columns:
 *             idx = self.schema.get_field_index(col)
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 raise KeyError("Column {!r} not found".format(col))
 *             indices.append(idx)
 */
    __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_v_idx, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1633, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(6, 1633, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(__pyx_t_7)) {

      /* "pyarrow/table.pxi":1634
 *             idx = self.schema.get_field_index(col)
 *             if idx == -1:
 *                 raise KeyError("Column {!r} not found".format(col))             # <<<<<<<<<<<<<<
 *             indices.append(idx)
 * 
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Column_r_not_found, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1634, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_col) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_col);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1634, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1634, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_Raise(__pyx_t_6, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __PYX_ERR(6, 1634, __pyx_L1_error)

      /* "pyarrow/table.pxi":1633
 *         for col in columns:
 *             idx = self.schema.get_field_index(col)
 *             if idx == -1:             # <<<<<<<<<<<<<<
 *                 raise KeyError("Column {!r} not found".format(col))
 *             indices.append(idx)
 */
    }

    /* "pyarrow/table.pxi":1635
 *             if idx == -1:
 *                 raise KeyError("Column {!r} not found".format(col))
 *             indices.append(idx)             # <<<<<<<<<<<<<<
 * 
 *         indices.sort()
 */
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_indices, __pyx_v_idx); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(6, 1635, __pyx_L1_error)

    /* "pyarrow/table.pxi":1631
 *         """
 *         indices = []
 *         for col in columns:             # <<<<<<<<<<<<<<
 *             idx = self.schema.get_field_index(col)
 *             if idx == -1:
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":1637
 *             indices.append(idx)
 * 
 *         indices.sort()             # <<<<<<<<<<<<<<
 *         indices.reverse()
 * 
 */
  __pyx_t_8 = PyList_Sort(__pyx_v_indices); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(6, 1637, __pyx_L1_error)

  /* "pyarrow/table.pxi":1638
 * 
 *         indices.sort()
 *         indices.reverse()             # <<<<<<<<<<<<<<
 * 
 *         table = self
 */
  __pyx_t_8 = PyList_Reverse(__pyx_v_indices); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(6, 1638, __pyx_L1_error)

  /* "pyarrow/table.pxi":1640
 *         indices.reverse()
 * 
 *         table = self             # <<<<<<<<<<<<<<
 *         for idx in indices:
 *             table = table.remove_column(idx)
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_v_table = ((PyObject *)__pyx_v_self);

  /* "pyarrow/table.pxi":1641
 * 
 *         table = self
 *         for idx in indices:             # <<<<<<<<<<<<<<
 *             table = table.remove_column(idx)
 * 
 */
  __pyx_t_1 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(6, 1641, __pyx_L1_error)
    #else
    __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1641, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "pyarrow/table.pxi":1642
 *         table = self
 *         for idx in indices:
 *             table = table.remove_column(idx)             # <<<<<<<<<<<<<<
 * 
 *         return table
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_table, __pyx_n_s_remove_column); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1642, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_idx) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_idx);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1642, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_table, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "pyarrow/table.pxi":1641
 * 
 *         table = self
 *         for idx in indices:             # <<<<<<<<<<<<<<
 *             table = table.remove_column(idx)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":1644
 *             table = table.remove_column(idx)
 * 
 *         return table             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_table);
  __pyx_r = __pyx_v_table;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1622
 *         return pyarrow_wrap_table(c_table)
 * 
 *     def drop(self, columns):             # <<<<<<<<<<<<<<
 *         """
 *         Drop one or more columns and return a new table.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.Table.drop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_indices);
  __Pyx_XDECREF(__pyx_v_col);
  __Pyx_XDECREF(__pyx_v_idx);
  __Pyx_XDECREF(__pyx_v_table);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1647
 * 
 * 
 * def _reconstruct_table(arrays, schema):             # <<<<<<<<<<<<<<
 *     """
 *     Internal: reconstruct pa.Table from pickled components.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_151_reconstruct_table(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_150_reconstruct_table[] = "_reconstruct_table(arrays, schema)\n\n    Internal: reconstruct pa.Table from pickled components.\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_151_reconstruct_table = {"_reconstruct_table", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_151_reconstruct_table, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_150_reconstruct_table};
static PyObject *__pyx_pw_7pyarrow_3lib_151_reconstruct_table(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_arrays = 0;
  PyObject *__pyx_v_schema = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_reconstruct_table (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arrays,&__pyx_n_s_schema,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arrays)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_schema)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_reconstruct_table", 1, 2, 2, 1); __PYX_ERR(6, 1647, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_reconstruct_table") < 0)) __PYX_ERR(6, 1647, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_arrays = values[0];
    __pyx_v_schema = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_reconstruct_table", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 1647, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._reconstruct_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_150_reconstruct_table(__pyx_self, __pyx_v_arrays, __pyx_v_schema);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_150_reconstruct_table(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arrays, PyObject *__pyx_v_schema) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("_reconstruct_table", 0);

  /* "pyarrow/table.pxi":1651
 *     Internal: reconstruct pa.Table from pickled components.
 *     """
 *     return Table.from_arrays(arrays, schema=schema)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_Table), __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_arrays);
  __Pyx_GIVEREF(__pyx_v_arrays);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_arrays);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_schema, __pyx_v_schema) < 0) __PYX_ERR(6, 1651, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1647
 * 
 * 
 * def _reconstruct_table(arrays, schema):             # <<<<<<<<<<<<<<
 *     """
 *     Internal: reconstruct pa.Table from pickled components.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib._reconstruct_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1654
 * 
 * 
 * def record_batch(data, names=None, schema=None, metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create a pyarrow.RecordBatch from another Python data structure or sequence
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_153record_batch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_152record_batch[] = "record_batch(data, names=None, schema=None, metadata=None)\n\n    Create a pyarrow.RecordBatch from another Python data structure or sequence\n    of arrays\n\n    Parameters\n    ----------\n    data : pandas.DataFrame, list\n        A DataFrame or list of arrays or chunked arrays.\n    names : list, default None\n        Column names if list of arrays passed as data. Mutually exclusive with\n        'schema' argument\n    schema : Schema, default None\n        The expected schema of the RecordBatch. If not passed, will be inferred\n        from the data. Mutually exclusive with 'names' argument\n    metadata : dict or Mapping, default None\n        Optional metadata for the schema (if schema not passed).\n\n    Returns\n    -------\n    RecordBatch\n\n    See Also\n    --------\n    RecordBatch.from_arrays, RecordBatch.from_pandas, table\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_153record_batch = {"record_batch", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_153record_batch, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_152record_batch};
static PyObject *__pyx_pw_7pyarrow_3lib_153record_batch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_data = 0;
  PyObject *__pyx_v_names = 0;
  PyObject *__pyx_v_schema = 0;
  PyObject *__pyx_v_metadata = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("record_batch (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_names,&__pyx_n_s_schema,&__pyx_n_s_metadata,0};
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_names);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_schema);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_metadata);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "record_batch") < 0)) __PYX_ERR(6, 1654, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_data = values[0];
    __pyx_v_names = values[1];
    __pyx_v_schema = values[2];
    __pyx_v_metadata = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("record_batch", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 1654, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.record_batch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_152record_batch(__pyx_self, __pyx_v_data, __pyx_v_names, __pyx_v_schema, __pyx_v_metadata);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_152record_batch(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_names, PyObject *__pyx_v_schema, PyObject *__pyx_v_metadata) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("record_batch", 0);
  __Pyx_INCREF(__pyx_v_names);
  __Pyx_INCREF(__pyx_v_schema);

  /* "pyarrow/table.pxi":1681
 *     """
 *     # accept schema as first argument for backwards compatibility / usability
 *     if isinstance(names, Schema) and schema is None:             # <<<<<<<<<<<<<<
 *         schema = names
 *         names = None
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_names, __pyx_ptype_7pyarrow_3lib_Schema); 
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_schema == Py_None);
  __pyx_t_2 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "pyarrow/table.pxi":1682
 *     # accept schema as first argument for backwards compatibility / usability
 *     if isinstance(names, Schema) and schema is None:
 *         schema = names             # <<<<<<<<<<<<<<
 *         names = None
 * 
 */
    __Pyx_INCREF(__pyx_v_names);
    __Pyx_DECREF_SET(__pyx_v_schema, __pyx_v_names);

    /* "pyarrow/table.pxi":1683
 *     if isinstance(names, Schema) and schema is None:
 *         schema = names
 *         names = None             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(data, (list, tuple)):
 */
    __Pyx_INCREF(Py_None);
    __Pyx_DECREF_SET(__pyx_v_names, Py_None);

    /* "pyarrow/table.pxi":1681
 *     """
 *     # accept schema as first argument for backwards compatibility / usability
 *     if isinstance(names, Schema) and schema is None:             # <<<<<<<<<<<<<<
 *         schema = names
 *         names = None
 */
  }

  /* "pyarrow/table.pxi":1685
 *         names = None
 * 
 *     if isinstance(data, (list, tuple)):             # <<<<<<<<<<<<<<
 *         return RecordBatch.from_arrays(data, names=names, schema=schema,
 *                                        metadata=metadata)
 */
  __pyx_t_2 = PyList_Check(__pyx_v_data); 
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_3 = PyTuple_Check(__pyx_v_data); 
  __pyx_t_2 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L7_bool_binop_done:;
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":1686
 * 
 *     if isinstance(data, (list, tuple)):
 *         return RecordBatch.from_arrays(data, names=names, schema=schema,             # <<<<<<<<<<<<<<
 *                                        metadata=metadata)
 *     elif _pandas_api.is_data_frame(data):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_RecordBatch), __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1686, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1686, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_data);
    __Pyx_GIVEREF(__pyx_v_data);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_data);
    __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1686, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_names, __pyx_v_names) < 0) __PYX_ERR(6, 1686, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_schema, __pyx_v_schema) < 0) __PYX_ERR(6, 1686, __pyx_L1_error)

    /* "pyarrow/table.pxi":1687
 *     if isinstance(data, (list, tuple)):
 *         return RecordBatch.from_arrays(data, names=names, schema=schema,
 *                                        metadata=metadata)             # <<<<<<<<<<<<<<
 *     elif _pandas_api.is_data_frame(data):
 *         return RecordBatch.from_pandas(data, schema=schema)
 */
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_metadata, __pyx_v_metadata) < 0) __PYX_ERR(6, 1686, __pyx_L1_error)

    /* "pyarrow/table.pxi":1686
 * 
 *     if isinstance(data, (list, tuple)):
 *         return RecordBatch.from_arrays(data, names=names, schema=schema,             # <<<<<<<<<<<<<<
 *                                        metadata=metadata)
 *     elif _pandas_api.is_data_frame(data):
 */
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 1686, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = __pyx_t_7;
    __pyx_t_7 = 0;
    goto __pyx_L0;

    /* "pyarrow/table.pxi":1685
 *         names = None
 * 
 *     if isinstance(data, (list, tuple)):             # <<<<<<<<<<<<<<
 *         return RecordBatch.from_arrays(data, names=names, schema=schema,
 *                                        metadata=metadata)
 */
  }

  /* "pyarrow/table.pxi":1688
 *         return RecordBatch.from_arrays(data, names=names, schema=schema,
 *                                        metadata=metadata)
 *     elif _pandas_api.is_data_frame(data):             # <<<<<<<<<<<<<<
 *         return RecordBatch.from_pandas(data, schema=schema)
 *     else:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pandas_api); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_is_data_frame); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_7 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_data) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_data);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 1688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 1688, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (likely(__pyx_t_2)) {

    /* "pyarrow/table.pxi":1689
 *                                        metadata=metadata)
 *     elif _pandas_api.is_data_frame(data):
 *         return RecordBatch.from_pandas(data, schema=schema)             # <<<<<<<<<<<<<<
 *     else:
 *         raise TypeError("Expected pandas DataFrame or list of arrays")
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_RecordBatch), __pyx_n_s_from_pandas); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 1689, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1689, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_data);
    __Pyx_GIVEREF(__pyx_v_data);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_data);
    __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1689, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_schema, __pyx_v_schema) < 0) __PYX_ERR(6, 1689, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1689, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "pyarrow/table.pxi":1688
 *         return RecordBatch.from_arrays(data, names=names, schema=schema,
 *                                        metadata=metadata)
 *     elif _pandas_api.is_data_frame(data):             # <<<<<<<<<<<<<<
 *         return RecordBatch.from_pandas(data, schema=schema)
 *     else:
 */
  }

  /* "pyarrow/table.pxi":1691
 *         return RecordBatch.from_pandas(data, schema=schema)
 *     else:
 *         raise TypeError("Expected pandas DataFrame or list of arrays")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__172, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1691, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(6, 1691, __pyx_L1_error)
  }

  /* "pyarrow/table.pxi":1654
 * 
 * 
 * def record_batch(data, names=None, schema=None, metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create a pyarrow.RecordBatch from another Python data structure or sequence
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.record_batch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_names);
  __Pyx_XDECREF(__pyx_v_schema);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1694
 * 
 * 
 * def table(data, names=None, schema=None, metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create a pyarrow.Table from another Python data structure or sequence of
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_155table(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_154table[] = "table(data, names=None, schema=None, metadata=None)\n\n    Create a pyarrow.Table from another Python data structure or sequence of\n    arrays\n\n    Parameters\n    ----------\n    data : pandas.DataFrame, dict, list\n        A DataFrame, mapping of strings to Arrays or Python lists, or list of\n        arrays or chunked arrays.\n    names : list, default None\n        Column names if list of arrays passed as data. Mutually exclusive with\n        'schema' argument.\n    schema : Schema, default None\n        The expected schema of the Arrow Table. If not passed, will be inferred\n        from the data. Mutually exclusive with 'names' argument.\n        If passed, the output will have exactly this schema (raising an error\n        when columns are not found in the data and ignoring additional data not\n        specified in the schema, when data is a dict or DataFrame).\n    metadata : dict or Mapping, default None\n        Optional metadata for the schema (if schema not passed).\n\n    Returns\n    -------\n    Table\n\n    See Also\n    --------\n    Table.from_arrays, Table.from_pandas, Table.from_pydict\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_155table = {"table", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_155table, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_154table};
static PyObject *__pyx_pw_7pyarrow_3lib_155table(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_data = 0;
  PyObject *__pyx_v_names = 0;
  PyObject *__pyx_v_schema = 0;
  PyObject *__pyx_v_metadata = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("table (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_names,&__pyx_n_s_schema,&__pyx_n_s_metadata,0};
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_names);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_schema);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_metadata);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "table") < 0)) __PYX_ERR(6, 1694, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_data = values[0];
    __pyx_v_names = values[1];
    __pyx_v_schema = values[2];
    __pyx_v_metadata = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("table", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 1694, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_154table(__pyx_self, __pyx_v_data, __pyx_v_names, __pyx_v_schema, __pyx_v_metadata);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_154table(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_names, PyObject *__pyx_v_schema, PyObject *__pyx_v_metadata) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("table", 0);
  __Pyx_INCREF(__pyx_v_names);
  __Pyx_INCREF(__pyx_v_schema);

  /* "pyarrow/table.pxi":1725
 *     """
 *     # accept schema as first argument for backwards compatibility / usability
 *     if isinstance(names, Schema) and schema is None:             # <<<<<<<<<<<<<<
 *         schema = names
 *         names = None
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_names, __pyx_ptype_7pyarrow_3lib_Schema); 
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_schema == Py_None);
  __pyx_t_2 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "pyarrow/table.pxi":1726
 *     # accept schema as first argument for backwards compatibility / usability
 *     if isinstance(names, Schema) and schema is None:
 *         schema = names             # <<<<<<<<<<<<<<
 *         names = None
 * 
 */
    __Pyx_INCREF(__pyx_v_names);
    __Pyx_DECREF_SET(__pyx_v_schema, __pyx_v_names);

    /* "pyarrow/table.pxi":1727
 *     if isinstance(names, Schema) and schema is None:
 *         schema = names
 *         names = None             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(data, (list, tuple)):
 */
    __Pyx_INCREF(Py_None);
    __Pyx_DECREF_SET(__pyx_v_names, Py_None);

    /* "pyarrow/table.pxi":1725
 *     """
 *     # accept schema as first argument for backwards compatibility / usability
 *     if isinstance(names, Schema) and schema is None:             # <<<<<<<<<<<<<<
 *         schema = names
 *         names = None
 */
  }

  /* "pyarrow/table.pxi":1729
 *         names = None
 * 
 *     if isinstance(data, (list, tuple)):             # <<<<<<<<<<<<<<
 *         return Table.from_arrays(data, names=names, schema=schema,
 *                                  metadata=metadata)
 */
  __pyx_t_2 = PyList_Check(__pyx_v_data); 
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_3 = PyTuple_Check(__pyx_v_data); 
  __pyx_t_2 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L7_bool_binop_done:;
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":1730
 * 
 *     if isinstance(data, (list, tuple)):
 *         return Table.from_arrays(data, names=names, schema=schema,             # <<<<<<<<<<<<<<
 *                                  metadata=metadata)
 *     elif isinstance(data, dict):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_Table), __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1730, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1730, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_data);
    __Pyx_GIVEREF(__pyx_v_data);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_data);
    __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1730, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_names, __pyx_v_names) < 0) __PYX_ERR(6, 1730, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_schema, __pyx_v_schema) < 0) __PYX_ERR(6, 1730, __pyx_L1_error)

    /* "pyarrow/table.pxi":1731
 *     if isinstance(data, (list, tuple)):
 *         return Table.from_arrays(data, names=names, schema=schema,
 *                                  metadata=metadata)             # <<<<<<<<<<<<<<
 *     elif isinstance(data, dict):
 *         if names is not None:
 */
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_metadata, __pyx_v_metadata) < 0) __PYX_ERR(6, 1730, __pyx_L1_error)

    /* "pyarrow/table.pxi":1730
 * 
 *     if isinstance(data, (list, tuple)):
 *         return Table.from_arrays(data, names=names, schema=schema,             # <<<<<<<<<<<<<<
 *                                  metadata=metadata)
 *     elif isinstance(data, dict):
 */
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 1730, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = __pyx_t_7;
    __pyx_t_7 = 0;
    goto __pyx_L0;

    /* "pyarrow/table.pxi":1729
 *         names = None
 * 
 *     if isinstance(data, (list, tuple)):             # <<<<<<<<<<<<<<
 *         return Table.from_arrays(data, names=names, schema=schema,
 *                                  metadata=metadata)
 */
  }

  /* "pyarrow/table.pxi":1732
 *         return Table.from_arrays(data, names=names, schema=schema,
 *                                  metadata=metadata)
 *     elif isinstance(data, dict):             # <<<<<<<<<<<<<<
 *         if names is not None:
 *             raise ValueError(
 */
  __pyx_t_2 = PyDict_Check(__pyx_v_data); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pyarrow/table.pxi":1733
 *                                  metadata=metadata)
 *     elif isinstance(data, dict):
 *         if names is not None:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 "The 'names' argument is not valid when passing a dictionary")
 */
    __pyx_t_1 = (__pyx_v_names != Py_None);
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (unlikely(__pyx_t_2)) {

      /* "pyarrow/table.pxi":1734
 *     elif isinstance(data, dict):
 *         if names is not None:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 "The 'names' argument is not valid when passing a dictionary")
 *         return Table.from_pydict(data, schema=schema, metadata=metadata)
 */
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__173, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 1734, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_Raise(__pyx_t_7, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __PYX_ERR(6, 1734, __pyx_L1_error)

      /* "pyarrow/table.pxi":1733
 *                                  metadata=metadata)
 *     elif isinstance(data, dict):
 *         if names is not None:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 "The 'names' argument is not valid when passing a dictionary")
 */
    }

    /* "pyarrow/table.pxi":1736
 *             raise ValueError(
 *                 "The 'names' argument is not valid when passing a dictionary")
 *         return Table.from_pydict(data, schema=schema, metadata=metadata)             # <<<<<<<<<<<<<<
 *     elif _pandas_api.is_data_frame(data):
 *         if names is not None or metadata is not None:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_Table), __pyx_n_s_from_pydict); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 1736, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1736, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_data);
    __Pyx_GIVEREF(__pyx_v_data);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_data);
    __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1736, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_schema, __pyx_v_schema) < 0) __PYX_ERR(6, 1736, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_metadata, __pyx_v_metadata) < 0) __PYX_ERR(6, 1736, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1736, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "pyarrow/table.pxi":1732
 *         return Table.from_arrays(data, names=names, schema=schema,
 *                                  metadata=metadata)
 *     elif isinstance(data, dict):             # <<<<<<<<<<<<<<
 *         if names is not None:
 *             raise ValueError(
 */
  }

  /* "pyarrow/table.pxi":1737
 *                 "The 'names' argument is not valid when passing a dictionary")
 *         return Table.from_pydict(data, schema=schema, metadata=metadata)
 *     elif _pandas_api.is_data_frame(data):             # <<<<<<<<<<<<<<
 *         if names is not None or metadata is not None:
 *             raise ValueError(
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pandas_api); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1737, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_is_data_frame); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1737, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_data) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_data);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1737, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 1737, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (likely(__pyx_t_2)) {

    /* "pyarrow/table.pxi":1738
 *         return Table.from_pydict(data, schema=schema, metadata=metadata)
 *     elif _pandas_api.is_data_frame(data):
 *         if names is not None or metadata is not None:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 "The 'names' and 'metadata' arguments are not valid when "
 */
    __pyx_t_1 = (__pyx_v_names != Py_None);
    __pyx_t_3 = (__pyx_t_1 != 0);
    if (!__pyx_t_3) {
    } else {
      __pyx_t_2 = __pyx_t_3;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_3 = (__pyx_v_metadata != Py_None);
    __pyx_t_1 = (__pyx_t_3 != 0);
    __pyx_t_2 = __pyx_t_1;
    __pyx_L11_bool_binop_done:;
    if (unlikely(__pyx_t_2)) {

      /* "pyarrow/table.pxi":1739
 *     elif _pandas_api.is_data_frame(data):
 *         if names is not None or metadata is not None:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 "The 'names' and 'metadata' arguments are not valid when "
 *                 "passing a pandas DataFrame")
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__174, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1739, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(6, 1739, __pyx_L1_error)

      /* "pyarrow/table.pxi":1738
 *         return Table.from_pydict(data, schema=schema, metadata=metadata)
 *     elif _pandas_api.is_data_frame(data):
 *         if names is not None or metadata is not None:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 "The 'names' and 'metadata' arguments are not valid when "
 */
    }

    /* "pyarrow/table.pxi":1742
 *                 "The 'names' and 'metadata' arguments are not valid when "
 *                 "passing a pandas DataFrame")
 *         return Table.from_pandas(data, schema=schema)             # <<<<<<<<<<<<<<
 *     else:
 *         raise TypeError(
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_Table), __pyx_n_s_from_pandas); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1742, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1742, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_data);
    __Pyx_GIVEREF(__pyx_v_data);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_data);
    __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1742, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_schema, __pyx_v_schema) < 0) __PYX_ERR(6, 1742, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 1742, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_7;
    __pyx_t_7 = 0;
    goto __pyx_L0;

    /* "pyarrow/table.pxi":1737
 *                 "The 'names' argument is not valid when passing a dictionary")
 *         return Table.from_pydict(data, schema=schema, metadata=metadata)
 *     elif _pandas_api.is_data_frame(data):             # <<<<<<<<<<<<<<
 *         if names is not None or metadata is not None:
 *             raise ValueError(
 */
  }

  /* "pyarrow/table.pxi":1744
 *         return Table.from_pandas(data, schema=schema)
 *     else:
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             "Expected pandas DataFrame, python dictionary or list of arrays")
 * 
 */
  /*else*/ {
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__175, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 1744, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __PYX_ERR(6, 1744, __pyx_L1_error)
  }

  /* "pyarrow/table.pxi":1694
 * 
 * 
 * def table(data, names=None, schema=None, metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create a pyarrow.Table from another Python data structure or sequence of
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_names);
  __Pyx_XDECREF(__pyx_v_schema);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1748
 * 
 * 
 * def concat_tables(tables, c_bool promote=False, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *     """
 *     Concatenate pyarrow.Table objects.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_157concat_tables(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_156concat_tables[] = "concat_tables(tables, bool promote=False, MemoryPool memory_pool=None)\n\n    Concatenate pyarrow.Table objects.\n\n    If promote==False, a zero-copy concatenation will be performed. The schemas\n    of all the Tables must be the same (except the metadata), otherwise an\n    exception will be raised. The result Table will share the metadata with the\n    first table.\n\n    If promote==True, any null type arrays will be casted to the type of other\n    arrays in the column of the same name. If a table is missing a particular\n    field, null values of the appropriate type will be generated to take the\n    place of the missing field. The new schema will share the metadata with the\n    first table. Each field in the new schema will share the metadata with the\n    first table which has the field defined. Note that type promotions may\n    involve additional allocations on the given ``memory_pool``.\n\n    Parameters\n    ----------\n    tables : iterable of pyarrow.Table objects\n    promote: bool, default False\n        If True, concatenate tables with null-filling and null type promotion.\n    memory_pool : MemoryPool, default None\n        For memory allocations, if required, otherwise use default pool\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_157concat_tables = {"concat_tables", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_157concat_tables, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_156concat_tables};
static PyObject *__pyx_pw_7pyarrow_3lib_157concat_tables(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_tables = 0;
  bool __pyx_v_promote;
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("concat_tables (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tables,&__pyx_n_s_promote,&__pyx_n_s_memory_pool,0};
    PyObject* values[3] = {0,0,0};
    values[2] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tables)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_promote);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "concat_tables") < 0)) __PYX_ERR(6, 1748, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_tables = values[0];
    if (values[1]) {
      __pyx_v_promote = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_promote == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(6, 1748, __pyx_L3_error)
    } else {
      __pyx_v_promote = ((bool)0);
    }
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("concat_tables", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 1748, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.concat_tables", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(6, 1748, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_156concat_tables(__pyx_self, __pyx_v_tables, __pyx_v_promote, __pyx_v_memory_pool);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_156concat_tables(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_tables, bool __pyx_v_promote, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool) {
  std::vector<std::shared_ptr< arrow::Table> >  __pyx_v_c_tables;
  std::shared_ptr< arrow::Table>  __pyx_v_c_result_table;
   arrow::MemoryPool *__pyx_v_pool;
  struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_table = 0;
   arrow::ConcatenateTablesOptions __pyx_v_options;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  std::shared_ptr< arrow::Table>  __pyx_t_5;
  __Pyx_RefNannySetupContext("concat_tables", 0);

  /* "pyarrow/table.pxi":1776
 *         vector[shared_ptr[CTable]] c_tables
 *         shared_ptr[CTable] c_result_table
 *         CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)             # <<<<<<<<<<<<<<
 *         Table table
 *         CConcatenateTablesOptions options = (
 */
  __pyx_v_pool = __pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(__pyx_v_memory_pool);

  /* "pyarrow/table.pxi":1779
 *         Table table
 *         CConcatenateTablesOptions options = (
 *             CConcatenateTablesOptions.Defaults())             # <<<<<<<<<<<<<<
 * 
 *     for table in tables:
 */
  __pyx_v_options =  arrow::ConcatenateTablesOptions::Defaults();

  /* "pyarrow/table.pxi":1781
 *             CConcatenateTablesOptions.Defaults())
 * 
 *     for table in tables:             # <<<<<<<<<<<<<<
 *         c_tables.push_back(table.sp_table)
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_tables)) || PyTuple_CheckExact(__pyx_v_tables)) {
    __pyx_t_1 = __pyx_v_tables; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_tables); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1781, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1781, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(6, 1781, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1781, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(6, 1781, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1781, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(6, 1781, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_Table))))) __PYX_ERR(6, 1781, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_table, ((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "pyarrow/table.pxi":1782
 * 
 *     for table in tables:
 *         c_tables.push_back(table.sp_table)             # <<<<<<<<<<<<<<
 * 
 *     with nogil:
 */
    try {
      __pyx_v_c_tables.push_back(__pyx_v_table->sp_table);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(6, 1782, __pyx_L1_error)
    }

    /* "pyarrow/table.pxi":1781
 *             CConcatenateTablesOptions.Defaults())
 * 
 *     for table in tables:             # <<<<<<<<<<<<<<
 *         c_tables.push_back(table.sp_table)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":1784
 *         c_tables.push_back(table.sp_table)
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         options.unify_schemas = promote
 *         c_result_table = GetResultValue(
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":1785
 * 
 *     with nogil:
 *         options.unify_schemas = promote             # <<<<<<<<<<<<<<
 *         c_result_table = GetResultValue(
 *             ConcatenateTables(c_tables, options, pool))
 */
        __pyx_v_options.unify_schemas = __pyx_v_promote;

        /* "pyarrow/table.pxi":1786
 *     with nogil:
 *         options.unify_schemas = promote
 *         c_result_table = GetResultValue(             # <<<<<<<<<<<<<<
 *             ConcatenateTables(c_tables, options, pool))
 * 
 */
        __pyx_t_5 = arrow::py::GetResultValue<std::shared_ptr< arrow::Table> >(arrow::ConcatenateTables(__pyx_v_c_tables, __pyx_v_options, __pyx_v_pool)); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(6, 1786, __pyx_L6_error)
        __pyx_v_c_result_table = __pyx_t_5;
      }

      /* "pyarrow/table.pxi":1784
 *         c_tables.push_back(table.sp_table)
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         options.unify_schemas = promote
 *         c_result_table = GetResultValue(
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L7;
        }
        __pyx_L6_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L7:;
      }
  }

  /* "pyarrow/table.pxi":1789
 *             ConcatenateTables(c_tables, options, pool))
 * 
 *     return pyarrow_wrap_table(c_result_table)             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table(__pyx_v_c_result_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1789, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1748
 * 
 * 
 * def concat_tables(tables, c_bool promote=False, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *     """
 *     Concatenate pyarrow.Table objects.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.concat_tables", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_table);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":24
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call Tensor's constructor directly, use one "
 *                         "of the `pyarrow.Tensor.from_*` functions instead.")
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_6Tensor_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_6Tensor_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Tensor___init__(((struct __pyx_obj_7pyarrow_3lib_Tensor *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_6Tensor___init__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/tensor.pxi":25
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call Tensor's constructor directly, use one "             # <<<<<<<<<<<<<<
 *                         "of the `pyarrow.Tensor.from_*` functions instead.")
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__176, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(13, 25, __pyx_L1_error)

  /* "pyarrow/tensor.pxi":24
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call Tensor's constructor directly, use one "
 *                         "of the `pyarrow.Tensor.from_*` functions instead.")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Tensor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":28
 *                         "of the `pyarrow.Tensor.from_*` functions instead.")
 * 
 *     cdef void init(self, const shared_ptr[CTensor]& sp_tensor):             # <<<<<<<<<<<<<<
 *         self.sp_tensor = sp_tensor
 *         self.tp = sp_tensor.get()
 */

static void __pyx_f_7pyarrow_3lib_6Tensor_init(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self, std::shared_ptr< arrow::Tensor>  const &__pyx_v_sp_tensor) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/tensor.pxi":29
 * 
 *     cdef void init(self, const shared_ptr[CTensor]& sp_tensor):
 *         self.sp_tensor = sp_tensor             # <<<<<<<<<<<<<<
 *         self.tp = sp_tensor.get()
 *         self.type = pyarrow_wrap_data_type(self.tp.type())
 */
  __pyx_v_self->sp_tensor = __pyx_v_sp_tensor;

  /* "pyarrow/tensor.pxi":30
 *     cdef void init(self, const shared_ptr[CTensor]& sp_tensor):
 *         self.sp_tensor = sp_tensor
 *         self.tp = sp_tensor.get()             # <<<<<<<<<<<<<<
 *         self.type = pyarrow_wrap_data_type(self.tp.type())
 * 
 */
  __pyx_v_self->tp = __pyx_v_sp_tensor.get();

  /* "pyarrow/tensor.pxi":31
 *         self.sp_tensor = sp_tensor
 *         self.tp = sp_tensor.get()
 *         self.type = pyarrow_wrap_data_type(self.tp.type())             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_self->tp->type()); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(13, 31, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->type);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->type));
  __pyx_v_self->type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/tensor.pxi":28
 *                         "of the `pyarrow.Tensor.from_*` functions instead.")
 * 
 *     cdef void init(self, const shared_ptr[CTensor]& sp_tensor):             # <<<<<<<<<<<<<<
 *         self.sp_tensor = sp_tensor
 *         self.tp = sp_tensor.get()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("pyarrow.lib.Tensor.init", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/tensor.pxi":33
 *         self.type = pyarrow_wrap_data_type(self.tp.type())
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return """<pyarrow.Tensor>
 * type: {0.type}
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_3__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Tensor_2__repr__(((struct __pyx_obj_7pyarrow_3lib_Tensor *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_2__repr__(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pyarrow/tensor.pxi":34
 * 
 *     def __repr__(self):
 *         return """<pyarrow.Tensor>             # <<<<<<<<<<<<<<
 * type: {0.type}
 * shape: {0.shape}
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/tensor.pxi":37
 * type: {0.type}
 * shape: {0.shape}
 * strides: {0.strides}""".format(self)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_pyarrow_Tensor_type_0_type_shap, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self));
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":33
 *         self.type = pyarrow_wrap_data_type(self.tp.type())
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return """<pyarrow.Tensor>
 * type: {0.type}
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.Tensor.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":40
 * 
 *     @staticmethod
 *     def from_numpy(obj, dim_names=None):             # <<<<<<<<<<<<<<
 *         cdef:
 *             vector[c_string] c_dim_names
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_5from_numpy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Tensor_4from_numpy[] = "Tensor.from_numpy(obj, dim_names=None)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_6Tensor_5from_numpy = {"from_numpy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_6Tensor_5from_numpy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_6Tensor_4from_numpy};
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_5from_numpy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_obj = 0;
  PyObject *__pyx_v_dim_names = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_numpy (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_dim_names,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dim_names);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_numpy") < 0)) __PYX_ERR(13, 40, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_obj = values[0];
    __pyx_v_dim_names = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_numpy", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(13, 40, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Tensor.from_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Tensor_4from_numpy(__pyx_v_obj, __pyx_v_dim_names);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_4from_numpy(PyObject *__pyx_v_obj, PyObject *__pyx_v_dim_names) {
  std::vector<std::string>  __pyx_v_c_dim_names;
  std::shared_ptr< arrow::Tensor>  __pyx_v_ctensor;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  std::string __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("from_numpy", 0);

  /* "pyarrow/tensor.pxi":45
 *             shared_ptr[CTensor] ctensor
 * 
 *         if dim_names is not None:             # <<<<<<<<<<<<<<
 *             for x in dim_names:
 *                 c_dim_names.push_back(tobytes(x))
 */
  __pyx_t_1 = (__pyx_v_dim_names != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/tensor.pxi":46
 * 
 *         if dim_names is not None:
 *             for x in dim_names:             # <<<<<<<<<<<<<<
 *                 c_dim_names.push_back(tobytes(x))
 * 
 */
    if (likely(PyList_CheckExact(__pyx_v_dim_names)) || PyTuple_CheckExact(__pyx_v_dim_names)) {
      __pyx_t_3 = __pyx_v_dim_names; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_dim_names); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 46, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 46, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_5)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(13, 46, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 46, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        } else {
          if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(13, 46, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 46, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        }
      } else {
        __pyx_t_6 = __pyx_t_5(__pyx_t_3);
        if (unlikely(!__pyx_t_6)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(13, 46, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_6);
      }
      __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "pyarrow/tensor.pxi":47
 *         if dim_names is not None:
 *             for x in dim_names:
 *                 c_dim_names.push_back(tobytes(x))             # <<<<<<<<<<<<<<
 * 
 *         check_status(NdarrayToTensor(c_default_memory_pool(), obj,
 */
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 47, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_v_x) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_x);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 47, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_9 = __pyx_convert_string_from_py_std__in_string(__pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(13, 47, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      try {
        __pyx_v_c_dim_names.push_back(__pyx_t_9);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(13, 47, __pyx_L1_error)
      }

      /* "pyarrow/tensor.pxi":46
 * 
 *         if dim_names is not None:
 *             for x in dim_names:             # <<<<<<<<<<<<<<
 *                 c_dim_names.push_back(tobytes(x))
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "pyarrow/tensor.pxi":45
 *             shared_ptr[CTensor] ctensor
 * 
 *         if dim_names is not None:             # <<<<<<<<<<<<<<
 *             for x in dim_names:
 *                 c_dim_names.push_back(tobytes(x))
 */
  }

  /* "pyarrow/tensor.pxi":49
 *                 c_dim_names.push_back(tobytes(x))
 * 
 *         check_status(NdarrayToTensor(c_default_memory_pool(), obj,             # <<<<<<<<<<<<<<
 *                                      c_dim_names, &ctensor))
 *         return pyarrow_wrap_tensor(ctensor)
 */
  __pyx_t_10 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::NdarrayToTensor( arrow::default_memory_pool(), __pyx_v_obj, __pyx_v_c_dim_names, (&__pyx_v_ctensor))); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(13, 49, __pyx_L1_error)

  /* "pyarrow/tensor.pxi":51
 *         check_status(NdarrayToTensor(c_default_memory_pool(), obj,
 *                                      c_dim_names, &ctensor))
 *         return pyarrow_wrap_tensor(ctensor)             # <<<<<<<<<<<<<<
 * 
 *     def to_numpy(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_tensor(__pyx_v_ctensor); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":40
 * 
 *     @staticmethod
 *     def from_numpy(obj, dim_names=None):             # <<<<<<<<<<<<<<
 *         cdef:
 *             vector[c_string] c_dim_names
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow.lib.Tensor.from_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":53
 *         return pyarrow_wrap_tensor(ctensor)
 * 
 *     def to_numpy(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert arrow::Tensor to numpy.ndarray with zero copy
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_7to_numpy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Tensor_6to_numpy[] = "Tensor.to_numpy(self)\n\n        Convert arrow::Tensor to numpy.ndarray with zero copy\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_7to_numpy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_numpy (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Tensor_6to_numpy(((struct __pyx_obj_7pyarrow_3lib_Tensor *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_6to_numpy(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self) {
  PyObject *__pyx_v_out;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("to_numpy", 0);

  /* "pyarrow/tensor.pxi":59
 *         cdef PyObject* out
 * 
 *         check_status(TensorToNdarray(self.sp_tensor, self, &out))             # <<<<<<<<<<<<<<
 *         return PyObject_to_object(out)
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::TensorToNdarray(__pyx_v_self->sp_tensor, ((PyObject *)__pyx_v_self), (&__pyx_v_out))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(13, 59, __pyx_L1_error)

  /* "pyarrow/tensor.pxi":60
 * 
 *         check_status(TensorToNdarray(self.sp_tensor, self, &out))
 *         return PyObject_to_object(out)             # <<<<<<<<<<<<<<
 * 
 *     def equals(self, Tensor other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_8includes_6common_PyObject_to_object(__pyx_v_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":53
 *         return pyarrow_wrap_tensor(ctensor)
 * 
 *     def to_numpy(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert arrow::Tensor to numpy.ndarray with zero copy
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Tensor.to_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":62
 *         return PyObject_to_object(out)
 * 
 *     def equals(self, Tensor other):             # <<<<<<<<<<<<<<
 *         """
 *         Return true if the tensors contains exactly equal data
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_9equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Tensor_8equals[] = "Tensor.equals(self, Tensor other)\n\n        Return true if the tensors contains exactly equal data\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_9equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("equals (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_7pyarrow_3lib_Tensor, 1, "other", 0))) __PYX_ERR(13, 62, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Tensor_8equals(((struct __pyx_obj_7pyarrow_3lib_Tensor *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_3lib_Tensor *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_8equals(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("equals", 0);

  /* "pyarrow/tensor.pxi":66
 *         Return true if the tensors contains exactly equal data
 *         """
 *         return self.tp.Equals(deref(other.tp))             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->tp->Equals((*__pyx_v_other->tp))); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":62
 *         return PyObject_to_object(out)
 * 
 *     def equals(self, Tensor other):             # <<<<<<<<<<<<<<
 *         """
 *         Return true if the tensors contains exactly equal data
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Tensor.equals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":68
 *         return self.tp.Equals(deref(other.tp))
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         if isinstance(other, Tensor):
 *             return self.equals(other)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_11__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_11__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Tensor_10__eq__(((struct __pyx_obj_7pyarrow_3lib_Tensor *)__pyx_v_self), ((PyObject *)__pyx_v_other));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_10__eq__(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__eq__", 0);

  /* "pyarrow/tensor.pxi":69
 * 
 *     def __eq__(self, other):
 *         if isinstance(other, Tensor):             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         else:
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_7pyarrow_3lib_Tensor); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/tensor.pxi":70
 *     def __eq__(self, other):
 *         if isinstance(other, Tensor):
 *             return self.equals(other)             # <<<<<<<<<<<<<<
 *         else:
 *             return NotImplemented
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_equals); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 70, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_other) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_other);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 70, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "pyarrow/tensor.pxi":69
 * 
 *     def __eq__(self, other):
 *         if isinstance(other, Tensor):             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         else:
 */
  }

  /* "pyarrow/tensor.pxi":72
 *             return self.equals(other)
 *         else:
 *             return NotImplemented             # <<<<<<<<<<<<<<
 * 
 *     def dim_name(self, i):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_builtin_NotImplemented);
    __pyx_r = __pyx_builtin_NotImplemented;
    goto __pyx_L0;
  }

  /* "pyarrow/tensor.pxi":68
 *         return self.tp.Equals(deref(other.tp))
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         if isinstance(other, Tensor):
 *             return self.equals(other)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.Tensor.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":74
 *             return NotImplemented
 * 
 *     def dim_name(self, i):             # <<<<<<<<<<<<<<
 *         return frombytes(self.tp.dim_name(i))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_13dim_name(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Tensor_12dim_name[] = "Tensor.dim_name(self, i)";
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_13dim_name(PyObject *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dim_name (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Tensor_12dim_name(((struct __pyx_obj_7pyarrow_3lib_Tensor *)__pyx_v_self), ((PyObject *)__pyx_v_i));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_12dim_name(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("dim_name", 0);

  /* "pyarrow/tensor.pxi":75
 * 
 *     def dim_name(self, i):
 *         return frombytes(self.tp.dim_name(i))             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_i); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(13, 75, __pyx_L1_error)
  __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_self->tp->dim_name(__pyx_t_3)); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":74
 *             return NotImplemented
 * 
 *     def dim_name(self, i):             # <<<<<<<<<<<<<<
 *         return frombytes(self.tp.dim_name(i))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.Tensor.dim_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":78
 * 
 *     @property
 *     def dim_names(self):             # <<<<<<<<<<<<<<
 *         return [frombytes(x) for x in tuple(self.tp.dim_names())]
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_9dim_names_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_9dim_names_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Tensor_9dim_names___get__(((struct __pyx_obj_7pyarrow_3lib_Tensor *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_9dim_names___get__(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self) {
  PyObject *__pyx_9genexpr17__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/tensor.pxi":79
 *     @property
 *     def dim_names(self):
 *         return [frombytes(x) for x in tuple(self.tp.dim_names())]             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 79, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_convert_vector_to_py_std_3a__3a_string(__pyx_v_self->tp->dim_names()); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 79, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 79, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(13, 79, __pyx_L5_error)
      #else
      __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 79, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_3);
      #endif
      __Pyx_XDECREF_SET(__pyx_9genexpr17__pyx_v_x, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 79, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_9genexpr17__pyx_v_x) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_9genexpr17__pyx_v_x);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 79, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(13, 79, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_9genexpr17__pyx_v_x); __pyx_9genexpr17__pyx_v_x = 0;
    goto __pyx_L8_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_9genexpr17__pyx_v_x); __pyx_9genexpr17__pyx_v_x = 0;
    goto __pyx_L1_error;
    __pyx_L8_exit_scope:;
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":78
 * 
 *     @property
 *     def dim_names(self):             # <<<<<<<<<<<<<<
 *         return [frombytes(x) for x in tuple(self.tp.dim_names())]
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.Tensor.dim_names.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_9genexpr17__pyx_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":82
 * 
 *     @property
 *     def is_mutable(self):             # <<<<<<<<<<<<<<
 *         return self.tp.is_mutable()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_10is_mutable_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_10is_mutable_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Tensor_10is_mutable___get__(((struct __pyx_obj_7pyarrow_3lib_Tensor *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_10is_mutable___get__(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/tensor.pxi":83
 *     @property
 *     def is_mutable(self):
 *         return self.tp.is_mutable()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->tp->is_mutable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":82
 * 
 *     @property
 *     def is_mutable(self):             # <<<<<<<<<<<<<<
 *         return self.tp.is_mutable()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Tensor.is_mutable.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":86
 * 
 *     @property
 *     def is_contiguous(self):             # <<<<<<<<<<<<<<
 *         return self.tp.is_contiguous()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_13is_contiguous_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_13is_contiguous_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Tensor_13is_contiguous___get__(((struct __pyx_obj_7pyarrow_3lib_Tensor *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_13is_contiguous___get__(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/tensor.pxi":87
 *     @property
 *     def is_contiguous(self):
 *         return self.tp.is_contiguous()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->tp->is_contiguous()); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":86
 * 
 *     @property
 *     def is_contiguous(self):             # <<<<<<<<<<<<<<
 *         return self.tp.is_contiguous()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Tensor.is_contiguous.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":90
 * 
 *     @property
 *     def ndim(self):             # <<<<<<<<<<<<<<
 *         return self.tp.ndim()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_4ndim_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Tensor_4ndim___get__(((struct __pyx_obj_7pyarrow_3lib_Tensor *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_4ndim___get__(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/tensor.pxi":91
 *     @property
 *     def ndim(self):
 *         return self.tp.ndim()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->tp->ndim()); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":90
 * 
 *     @property
 *     def ndim(self):             # <<<<<<<<<<<<<<
 *         return self.tp.ndim()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Tensor.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":94
 * 
 *     @property
 *     def size(self):             # <<<<<<<<<<<<<<
 *         return self.tp.size()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_4size_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Tensor_4size___get__(((struct __pyx_obj_7pyarrow_3lib_Tensor *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_4size___get__(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/tensor.pxi":95
 *     @property
 *     def size(self):
 *         return self.tp.size()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->tp->size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":94
 * 
 *     @property
 *     def size(self):             # <<<<<<<<<<<<<<
 *         return self.tp.size()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Tensor.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":98
 * 
 *     @property
 *     def shape(self):             # <<<<<<<<<<<<<<
 *         # Cython knows how to convert a vector[T] to a Python list
 *         return tuple(self.tp.shape())
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_5shape_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Tensor_5shape___get__(((struct __pyx_obj_7pyarrow_3lib_Tensor *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_5shape___get__(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/tensor.pxi":100
 *     def shape(self):
 *         # Cython knows how to convert a vector[T] to a Python list
 *         return tuple(self.tp.shape())             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_vector_to_py_int64_t(__pyx_v_self->tp->shape()); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":98
 * 
 *     @property
 *     def shape(self):             # <<<<<<<<<<<<<<
 *         # Cython knows how to convert a vector[T] to a Python list
 *         return tuple(self.tp.shape())
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Tensor.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":103
 * 
 *     @property
 *     def strides(self):             # <<<<<<<<<<<<<<
 *         return tuple(self.tp.strides())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_7strides_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Tensor_7strides___get__(((struct __pyx_obj_7pyarrow_3lib_Tensor *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_7strides___get__(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/tensor.pxi":104
 *     @property
 *     def strides(self):
 *         return tuple(self.tp.strides())             # <<<<<<<<<<<<<<
 * 
 *     def __getbuffer__(self, cp.Py_buffer* buffer, int flags):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_vector_to_py_int64_t(__pyx_v_self->tp->strides()); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":103
 * 
 *     @property
 *     def strides(self):             # <<<<<<<<<<<<<<
 *         return tuple(self.tp.strides())
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Tensor.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":106
 *         return tuple(self.tp.strides())
 * 
 *     def __getbuffer__(self, cp.Py_buffer* buffer, int flags):             # <<<<<<<<<<<<<<
 *         buffer.buf = <char *> self.tp.data().get().data()
 *         pep3118_format = self.type.pep3118_format
 */

/* Python wrapper */
static CYTHON_UNUSED int __pyx_pw_7pyarrow_3lib_6Tensor_15__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer, int __pyx_v_flags); /*proto*/
static CYTHON_UNUSED int __pyx_pw_7pyarrow_3lib_6Tensor_15__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer, int __pyx_v_flags) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Tensor_14__getbuffer__(((struct __pyx_obj_7pyarrow_3lib_Tensor *)__pyx_v_self), ((Py_buffer *)__pyx_v_buffer), ((int)__pyx_v_flags));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_6Tensor_14__getbuffer__(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self, Py_buffer *__pyx_v_buffer, CYTHON_UNUSED int __pyx_v_flags) {
  PyObject *__pyx_v_pep3118_format = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_UCS4 __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  char *__pyx_t_7;
  if (__pyx_v_buffer == NULL) {
    PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
    return -1;
  }
  __Pyx_RefNannySetupContext("__getbuffer__", 0);
  __pyx_v_buffer->obj = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(__pyx_v_buffer->obj);

  /* "pyarrow/tensor.pxi":107
 * 
 *     def __getbuffer__(self, cp.Py_buffer* buffer, int flags):
 *         buffer.buf = <char *> self.tp.data().get().data()             # <<<<<<<<<<<<<<
 *         pep3118_format = self.type.pep3118_format
 *         if pep3118_format is None:
 */
  __pyx_v_buffer->buf = ((char *)__pyx_v_self->tp->data().get()->data());

  /* "pyarrow/tensor.pxi":108
 *     def __getbuffer__(self, cp.Py_buffer* buffer, int flags):
 *         buffer.buf = <char *> self.tp.data().get().data()
 *         pep3118_format = self.type.pep3118_format             # <<<<<<<<<<<<<<
 *         if pep3118_format is None:
 *             raise NotImplementedError("type %s not supported for buffer "
 */
  __pyx_t_1 = __pyx_v_self->type->pep3118_format;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_pep3118_format = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/tensor.pxi":109
 *         buffer.buf = <char *> self.tp.data().get().data()
 *         pep3118_format = self.type.pep3118_format
 *         if pep3118_format is None:             # <<<<<<<<<<<<<<
 *             raise NotImplementedError("type %s not supported for buffer "
 *                                       "protocol" % (self.type,))
 */
  __pyx_t_2 = (__pyx_v_pep3118_format == ((PyObject*)Py_None));
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (unlikely(__pyx_t_3)) {

    /* "pyarrow/tensor.pxi":110
 *         pep3118_format = self.type.pep3118_format
 *         if pep3118_format is None:
 *             raise NotImplementedError("type %s not supported for buffer "             # <<<<<<<<<<<<<<
 *                                       "protocol" % (self.type,))
 *         buffer.format = pep3118_format
 */
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 110, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = 0;
    __pyx_t_5 = 127;
    __Pyx_INCREF(__pyx_kp_u_type_2);
    __pyx_t_4 += 5;
    __Pyx_GIVEREF(__pyx_kp_u_type_2);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_type_2);

    /* "pyarrow/tensor.pxi":111
 *         if pep3118_format is None:
 *             raise NotImplementedError("type %s not supported for buffer "
 *                                       "protocol" % (self.type,))             # <<<<<<<<<<<<<<
 *         buffer.format = pep3118_format
 *         buffer.itemsize = self.type.bit_width // 8
 */
    __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(((PyObject *)__pyx_v_self->type)), __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 111, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_5;
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_INCREF(__pyx_kp_u_not_supported_for_buffer_protoc);
    __pyx_t_4 += 34;
    __Pyx_GIVEREF(__pyx_kp_u_not_supported_for_buffer_protoc);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_not_supported_for_buffer_protoc);

    /* "pyarrow/tensor.pxi":110
 *         pep3118_format = self.type.pep3118_format
 *         if pep3118_format is None:
 *             raise NotImplementedError("type %s not supported for buffer "             # <<<<<<<<<<<<<<
 *                                       "protocol" % (self.type,))
 *         buffer.format = pep3118_format
 */
    __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 110, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 110, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(13, 110, __pyx_L1_error)

    /* "pyarrow/tensor.pxi":109
 *         buffer.buf = <char *> self.tp.data().get().data()
 *         pep3118_format = self.type.pep3118_format
 *         if pep3118_format is None:             # <<<<<<<<<<<<<<
 *             raise NotImplementedError("type %s not supported for buffer "
 *                                       "protocol" % (self.type,))
 */
  }

  /* "pyarrow/tensor.pxi":112
 *             raise NotImplementedError("type %s not supported for buffer "
 *                                       "protocol" % (self.type,))
 *         buffer.format = pep3118_format             # <<<<<<<<<<<<<<
 *         buffer.itemsize = self.type.bit_width // 8
 *         buffer.internal = NULL
 */
  if (unlikely(__pyx_v_pep3118_format == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
    __PYX_ERR(13, 112, __pyx_L1_error)
  }
  __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_pep3118_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(13, 112, __pyx_L1_error)
  __pyx_v_buffer->format = __pyx_t_7;

  /* "pyarrow/tensor.pxi":113
 *                                       "protocol" % (self.type,))
 *         buffer.format = pep3118_format
 *         buffer.itemsize = self.type.bit_width // 8             # <<<<<<<<<<<<<<
 *         buffer.internal = NULL
 *         buffer.len = self.tp.size() * buffer.itemsize
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->type), __pyx_n_s_bit_width); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyInt_FloorDivideObjC(__pyx_t_1, __pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(13, 113, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_buffer->itemsize = __pyx_t_4;

  /* "pyarrow/tensor.pxi":114
 *         buffer.format = pep3118_format
 *         buffer.itemsize = self.type.bit_width // 8
 *         buffer.internal = NULL             # <<<<<<<<<<<<<<
 *         buffer.len = self.tp.size() * buffer.itemsize
 *         buffer.ndim = self.tp.ndim()
 */
  __pyx_v_buffer->internal = NULL;

  /* "pyarrow/tensor.pxi":115
 *         buffer.itemsize = self.type.bit_width // 8
 *         buffer.internal = NULL
 *         buffer.len = self.tp.size() * buffer.itemsize             # <<<<<<<<<<<<<<
 *         buffer.ndim = self.tp.ndim()
 *         buffer.obj = self
 */
  __pyx_v_buffer->len = (__pyx_v_self->tp->size() * __pyx_v_buffer->itemsize);

  /* "pyarrow/tensor.pxi":116
 *         buffer.internal = NULL
 *         buffer.len = self.tp.size() * buffer.itemsize
 *         buffer.ndim = self.tp.ndim()             # <<<<<<<<<<<<<<
 *         buffer.obj = self
 *         if self.tp.is_mutable():
 */
  __pyx_v_buffer->ndim = __pyx_v_self->tp->ndim();

  /* "pyarrow/tensor.pxi":117
 *         buffer.len = self.tp.size() * buffer.itemsize
 *         buffer.ndim = self.tp.ndim()
 *         buffer.obj = self             # <<<<<<<<<<<<<<
 *         if self.tp.is_mutable():
 *             buffer.readonly = 0
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_GOTREF(__pyx_v_buffer->obj);
  __Pyx_DECREF(__pyx_v_buffer->obj);
  __pyx_v_buffer->obj = ((PyObject *)__pyx_v_self);

  /* "pyarrow/tensor.pxi":118
 *         buffer.ndim = self.tp.ndim()
 *         buffer.obj = self
 *         if self.tp.is_mutable():             # <<<<<<<<<<<<<<
 *             buffer.readonly = 0
 *         else:
 */
  __pyx_t_3 = (__pyx_v_self->tp->is_mutable() != 0);
  if (__pyx_t_3) {

    /* "pyarrow/tensor.pxi":119
 *         buffer.obj = self
 *         if self.tp.is_mutable():
 *             buffer.readonly = 0             # <<<<<<<<<<<<<<
 *         else:
 *             buffer.readonly = 1
 */
    __pyx_v_buffer->readonly = 0;

    /* "pyarrow/tensor.pxi":118
 *         buffer.ndim = self.tp.ndim()
 *         buffer.obj = self
 *         if self.tp.is_mutable():             # <<<<<<<<<<<<<<
 *             buffer.readonly = 0
 *         else:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/tensor.pxi":121
 *             buffer.readonly = 0
 *         else:
 *             buffer.readonly = 1             # <<<<<<<<<<<<<<
 *         # NOTE: This assumes Py_ssize_t == int64_t, and that the shape
 *         # and strides arrays lifetime is tied to the tensor's
 */
  /*else*/ {
    __pyx_v_buffer->readonly = 1;
  }
  __pyx_L4:;

  /* "pyarrow/tensor.pxi":124
 *         # NOTE: This assumes Py_ssize_t == int64_t, and that the shape
 *         # and strides arrays lifetime is tied to the tensor's
 *         buffer.shape = <Py_ssize_t *> &self.tp.shape()[0]             # <<<<<<<<<<<<<<
 *         buffer.strides = <Py_ssize_t *> &self.tp.strides()[0]
 *         buffer.suboffsets = NULL
 */
  __pyx_v_buffer->shape = ((Py_ssize_t *)(&(__pyx_v_self->tp->shape()[0])));

  /* "pyarrow/tensor.pxi":125
 *         # and strides arrays lifetime is tied to the tensor's
 *         buffer.shape = <Py_ssize_t *> &self.tp.shape()[0]
 *         buffer.strides = <Py_ssize_t *> &self.tp.strides()[0]             # <<<<<<<<<<<<<<
 *         buffer.suboffsets = NULL
 * 
 */
  __pyx_v_buffer->strides = ((Py_ssize_t *)(&(__pyx_v_self->tp->strides()[0])));

  /* "pyarrow/tensor.pxi":126
 *         buffer.shape = <Py_ssize_t *> &self.tp.shape()[0]
 *         buffer.strides = <Py_ssize_t *> &self.tp.strides()[0]
 *         buffer.suboffsets = NULL             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_buffer->suboffsets = NULL;

  /* "pyarrow/tensor.pxi":106
 *         return tuple(self.tp.strides())
 * 
 *     def __getbuffer__(self, cp.Py_buffer* buffer, int flags):             # <<<<<<<<<<<<<<
 *         buffer.buf = <char *> self.tp.data().get().data()
 *         pep3118_format = self.type.pep3118_format
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.Tensor.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  if (__pyx_v_buffer->obj != NULL) {
    __Pyx_GOTREF(__pyx_v_buffer->obj);
    __Pyx_DECREF(__pyx_v_buffer->obj); __pyx_v_buffer->obj = 0;
  }
  goto __pyx_L2;
  __pyx_L0:;
  if (__pyx_v_buffer->obj == Py_None) {
    __Pyx_GOTREF(__pyx_v_buffer->obj);
    __Pyx_DECREF(__pyx_v_buffer->obj); __pyx_v_buffer->obj = 0;
  }
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_pep3118_format);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/lib.pxd":292
 * 
 *     cdef readonly:
 *         DataType type             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CTensor]& sp_tensor)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_4type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_4type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Tensor_4type___get__(((struct __pyx_obj_7pyarrow_3lib_Tensor *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_4type___get__(struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->type));
  __pyx_r = ((PyObject *)__pyx_v_self->type);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_tensor,self.tp cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_17__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Tensor_16__reduce_cython__[] = "Tensor.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_17__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Tensor_16__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_Tensor *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_16__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_tensor,self.tp cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_tensor,self.tp cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__177, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_tensor,self.tp cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Tensor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_tensor,self.tp cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_tensor,self.tp cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_19__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Tensor_18__setstate_cython__[] = "Tensor.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_19__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Tensor_18__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_Tensor *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_18__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_tensor,self.tp cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_tensor,self.tp cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__178, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_tensor,self.tp cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_tensor,self.tp cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Tensor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":134
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call SparseCOOTensor's constructor directly, "
 *                         "use one of the `pyarrow.SparseCOOTensor.from_*` "
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_15SparseCOOTensor_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_15SparseCOOTensor_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCOOTensor___init__(((struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_15SparseCOOTensor___init__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/tensor.pxi":135
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call SparseCOOTensor's constructor directly, "             # <<<<<<<<<<<<<<
 *                         "use one of the `pyarrow.SparseCOOTensor.from_*` "
 *                         "functions instead.")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__179, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(13, 135, __pyx_L1_error)

  /* "pyarrow/tensor.pxi":134
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call SparseCOOTensor's constructor directly, "
 *                         "use one of the `pyarrow.SparseCOOTensor.from_*` "
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.SparseCOOTensor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":139
 *                         "functions instead.")
 * 
 *     cdef void init(self, const shared_ptr[CSparseCOOTensor]& sp_sparse_tensor):             # <<<<<<<<<<<<<<
 *         self.sp_sparse_tensor = sp_sparse_tensor
 *         self.stp = sp_sparse_tensor.get()
 */

static void __pyx_f_7pyarrow_3lib_15SparseCOOTensor_init(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *__pyx_v_self, std::shared_ptr< arrow::SparseCOOTensor>  const &__pyx_v_sp_sparse_tensor) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/tensor.pxi":140
 * 
 *     cdef void init(self, const shared_ptr[CSparseCOOTensor]& sp_sparse_tensor):
 *         self.sp_sparse_tensor = sp_sparse_tensor             # <<<<<<<<<<<<<<
 *         self.stp = sp_sparse_tensor.get()
 *         self.type = pyarrow_wrap_data_type(self.stp.type())
 */
  __pyx_v_self->sp_sparse_tensor = __pyx_v_sp_sparse_tensor;

  /* "pyarrow/tensor.pxi":141
 *     cdef void init(self, const shared_ptr[CSparseCOOTensor]& sp_sparse_tensor):
 *         self.sp_sparse_tensor = sp_sparse_tensor
 *         self.stp = sp_sparse_tensor.get()             # <<<<<<<<<<<<<<
 *         self.type = pyarrow_wrap_data_type(self.stp.type())
 * 
 */
  __pyx_v_self->stp = __pyx_v_sp_sparse_tensor.get();

  /* "pyarrow/tensor.pxi":142
 *         self.sp_sparse_tensor = sp_sparse_tensor
 *         self.stp = sp_sparse_tensor.get()
 *         self.type = pyarrow_wrap_data_type(self.stp.type())             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_self->stp->type()); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(13, 142, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->type);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->type));
  __pyx_v_self->type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/tensor.pxi":139
 *                         "functions instead.")
 * 
 *     cdef void init(self, const shared_ptr[CSparseCOOTensor]& sp_sparse_tensor):             # <<<<<<<<<<<<<<
 *         self.sp_sparse_tensor = sp_sparse_tensor
 *         self.stp = sp_sparse_tensor.get()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("pyarrow.lib.SparseCOOTensor.init", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/tensor.pxi":144
 *         self.type = pyarrow_wrap_data_type(self.stp.type())
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return """<pyarrow.SparseCOOTensor>
 * type: {0.type}
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_3__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCOOTensor_2__repr__(((struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_2__repr__(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pyarrow/tensor.pxi":145
 * 
 *     def __repr__(self):
 *         return """<pyarrow.SparseCOOTensor>             # <<<<<<<<<<<<<<
 * type: {0.type}
 * shape: {0.shape}""".format(self)
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/tensor.pxi":147
 *         return """<pyarrow.SparseCOOTensor>
 * type: {0.type}
 * shape: {0.shape}""".format(self)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_pyarrow_SparseCOOTensor_type_0, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self));
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":144
 *         self.type = pyarrow_wrap_data_type(self.stp.type())
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return """<pyarrow.SparseCOOTensor>
 * type: {0.type}
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.SparseCOOTensor.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":150
 * 
 *     @classmethod
 *     def from_dense_numpy(cls, obj, dim_names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Convert numpy.ndarray to arrow::SparseCOOTensor
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_5from_dense_numpy(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15SparseCOOTensor_4from_dense_numpy[] = "SparseCOOTensor.from_dense_numpy(type cls, obj, dim_names=None)\n\n        Convert numpy.ndarray to arrow::SparseCOOTensor\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_5from_dense_numpy(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_obj = 0;
  PyObject *__pyx_v_dim_names = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_dense_numpy (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_dim_names,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dim_names);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_dense_numpy") < 0)) __PYX_ERR(13, 150, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_obj = values[0];
    __pyx_v_dim_names = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_dense_numpy", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(13, 150, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.SparseCOOTensor.from_dense_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCOOTensor_4from_dense_numpy(((PyTypeObject*)__pyx_v_cls), __pyx_v_obj, __pyx_v_dim_names);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_4from_dense_numpy(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_obj, PyObject *__pyx_v_dim_names) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("from_dense_numpy", 0);

  /* "pyarrow/tensor.pxi":154
 *         Convert numpy.ndarray to arrow::SparseCOOTensor
 *         """
 *         return cls.from_tensor(Tensor.from_numpy(obj, dim_names=dim_names))             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_cls), __pyx_n_s_from_tensor); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_Tensor), __pyx_n_s_from_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_obj);
  __Pyx_GIVEREF(__pyx_v_obj);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_obj);
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dim_names, __pyx_v_dim_names) < 0) __PYX_ERR(13, 154, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":150
 * 
 *     @classmethod
 *     def from_dense_numpy(cls, obj, dim_names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Convert numpy.ndarray to arrow::SparseCOOTensor
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.SparseCOOTensor.from_dense_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":157
 * 
 *     @staticmethod
 *     def from_numpy(data, coords, shape, dim_names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Create arrow::SparseCOOTensor from numpy.ndarrays
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_7from_numpy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15SparseCOOTensor_6from_numpy[] = "SparseCOOTensor.from_numpy(data, coords, shape, dim_names=None)\n\n        Create arrow::SparseCOOTensor from numpy.ndarrays\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_15SparseCOOTensor_7from_numpy = {"from_numpy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_7from_numpy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_15SparseCOOTensor_6from_numpy};
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_7from_numpy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_data = 0;
  PyObject *__pyx_v_coords = 0;
  PyObject *__pyx_v_shape = 0;
  PyObject *__pyx_v_dim_names = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_numpy (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_coords,&__pyx_n_s_shape,&__pyx_n_s_dim_names,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coords)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_numpy", 0, 3, 4, 1); __PYX_ERR(13, 157, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_numpy", 0, 3, 4, 2); __PYX_ERR(13, 157, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dim_names);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_numpy") < 0)) __PYX_ERR(13, 157, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_data = values[0];
    __pyx_v_coords = values[1];
    __pyx_v_shape = values[2];
    __pyx_v_dim_names = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_numpy", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(13, 157, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.SparseCOOTensor.from_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCOOTensor_6from_numpy(__pyx_v_data, __pyx_v_coords, __pyx_v_shape, __pyx_v_dim_names);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_6from_numpy(PyObject *__pyx_v_data, PyObject *__pyx_v_coords, PyObject *__pyx_v_shape, PyObject *__pyx_v_dim_names) {
  std::shared_ptr< arrow::SparseCOOTensor>  __pyx_v_csparse_tensor;
  std::vector<int64_t>  __pyx_v_c_shape;
  std::vector<std::string>  __pyx_v_c_dim_names;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int64_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  std::string __pyx_t_10;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("from_numpy", 0);
  __Pyx_INCREF(__pyx_v_coords);

  /* "pyarrow/tensor.pxi":165
 *         cdef vector[c_string] c_dim_names
 * 
 *         for x in shape:             # <<<<<<<<<<<<<<
 *             c_shape.push_back(x)
 *         if dim_names is not None:
 */
  if (likely(PyList_CheckExact(__pyx_v_shape)) || PyTuple_CheckExact(__pyx_v_shape)) {
    __pyx_t_1 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 165, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 165, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(13, 165, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 165, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(13, 165, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 165, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(13, 165, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/tensor.pxi":166
 * 
 *         for x in shape:
 *             c_shape.push_back(x)             # <<<<<<<<<<<<<<
 *         if dim_names is not None:
 *             for x in dim_names:
 */
    __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_v_x); if (unlikely((__pyx_t_5 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(13, 166, __pyx_L1_error)
    try {
      __pyx_v_c_shape.push_back(__pyx_t_5);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(13, 166, __pyx_L1_error)
    }

    /* "pyarrow/tensor.pxi":165
 *         cdef vector[c_string] c_dim_names
 * 
 *         for x in shape:             # <<<<<<<<<<<<<<
 *             c_shape.push_back(x)
 *         if dim_names is not None:
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/tensor.pxi":167
 *         for x in shape:
 *             c_shape.push_back(x)
 *         if dim_names is not None:             # <<<<<<<<<<<<<<
 *             for x in dim_names:
 *                 c_dim_names.push_back(tobytes(x))
 */
  __pyx_t_6 = (__pyx_v_dim_names != Py_None);
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "pyarrow/tensor.pxi":168
 *             c_shape.push_back(x)
 *         if dim_names is not None:
 *             for x in dim_names:             # <<<<<<<<<<<<<<
 *                 c_dim_names.push_back(tobytes(x))
 * 
 */
    if (likely(PyList_CheckExact(__pyx_v_dim_names)) || PyTuple_CheckExact(__pyx_v_dim_names)) {
      __pyx_t_1 = __pyx_v_dim_names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
      __pyx_t_3 = NULL;
    } else {
      __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_dim_names); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 168, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 168, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_3)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(13, 168, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 168, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        } else {
          if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(13, 168, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 168, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        }
      } else {
        __pyx_t_4 = __pyx_t_3(__pyx_t_1);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(13, 168, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "pyarrow/tensor.pxi":169
 *         if dim_names is not None:
 *             for x in dim_names:
 *                 c_dim_names.push_back(tobytes(x))             # <<<<<<<<<<<<<<
 * 
 *         # Enforce precondition for SparseCOOTensor indices
 */
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 169, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
        }
      }
      __pyx_t_4 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_v_x) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_x);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 169, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_10 = __pyx_convert_string_from_py_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(13, 169, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      try {
        __pyx_v_c_dim_names.push_back(__pyx_t_10);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(13, 169, __pyx_L1_error)
      }

      /* "pyarrow/tensor.pxi":168
 *             c_shape.push_back(x)
 *         if dim_names is not None:
 *             for x in dim_names:             # <<<<<<<<<<<<<<
 *                 c_dim_names.push_back(tobytes(x))
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/tensor.pxi":167
 *         for x in shape:
 *             c_shape.push_back(x)
 *         if dim_names is not None:             # <<<<<<<<<<<<<<
 *             for x in dim_names:
 *                 c_dim_names.push_back(tobytes(x))
 */
  }

  /* "pyarrow/tensor.pxi":172
 * 
 *         # Enforce precondition for SparseCOOTensor indices
 *         coords = np.require(coords, dtype='i8', requirements='C')             # <<<<<<<<<<<<<<
 *         if coords.ndim != 2:
 *             raise ValueError("Expected 2-dimensional array for "
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_require); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_coords);
  __Pyx_GIVEREF(__pyx_v_coords);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_coords);
  __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_n_u_i8) < 0) __PYX_ERR(13, 172, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_requirements, __pyx_n_u_C) < 0) __PYX_ERR(13, 172, __pyx_L1_error)
  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(13, 172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF_SET(__pyx_v_coords, __pyx_t_9);
  __pyx_t_9 = 0;

  /* "pyarrow/tensor.pxi":173
 *         # Enforce precondition for SparseCOOTensor indices
 *         coords = np.require(coords, dtype='i8', requirements='C')
 *         if coords.ndim != 2:             # <<<<<<<<<<<<<<
 *             raise ValueError("Expected 2-dimensional array for "
 *                              "SparseCOOTensor indices")
 */
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_coords, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) __PYX_ERR(13, 173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_8 = __Pyx_PyInt_NeObjC(__pyx_t_9, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(13, 173, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(__pyx_t_7)) {

    /* "pyarrow/tensor.pxi":174
 *         coords = np.require(coords, dtype='i8', requirements='C')
 *         if coords.ndim != 2:
 *             raise ValueError("Expected 2-dimensional array for "             # <<<<<<<<<<<<<<
 *                              "SparseCOOTensor indices")
 * 
 */
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__180, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 174, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_Raise(__pyx_t_8, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __PYX_ERR(13, 174, __pyx_L1_error)

    /* "pyarrow/tensor.pxi":173
 *         # Enforce precondition for SparseCOOTensor indices
 *         coords = np.require(coords, dtype='i8', requirements='C')
 *         if coords.ndim != 2:             # <<<<<<<<<<<<<<
 *             raise ValueError("Expected 2-dimensional array for "
 *                              "SparseCOOTensor indices")
 */
  }

  /* "pyarrow/tensor.pxi":177
 *                              "SparseCOOTensor indices")
 * 
 *         check_status(NdarraysToSparseCOOTensor(c_default_memory_pool(),             # <<<<<<<<<<<<<<
 *                                                data, coords, c_shape,
 *                                                c_dim_names, &csparse_tensor))
 */
  __pyx_t_11 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::NdarraysToSparseCOOTensor( arrow::default_memory_pool(), __pyx_v_data, __pyx_v_coords, __pyx_v_c_shape, __pyx_v_c_dim_names, (&__pyx_v_csparse_tensor))); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(13, 177, __pyx_L1_error)

  /* "pyarrow/tensor.pxi":180
 *                                                data, coords, c_shape,
 *                                                c_dim_names, &csparse_tensor))
 *         return pyarrow_wrap_sparse_coo_tensor(csparse_tensor)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_8 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_sparse_coo_tensor(__pyx_v_csparse_tensor); if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_r = __pyx_t_8;
  __pyx_t_8 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":157
 * 
 *     @staticmethod
 *     def from_numpy(data, coords, shape, dim_names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Create arrow::SparseCOOTensor from numpy.ndarrays
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pyarrow.lib.SparseCOOTensor.from_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_coords);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":183
 * 
 *     @staticmethod
 *     def from_scipy(obj, dim_names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Convert scipy.sparse.coo_matrix to arrow::SparseCOOTensor
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_9from_scipy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15SparseCOOTensor_8from_scipy[] = "SparseCOOTensor.from_scipy(obj, dim_names=None)\n\n        Convert scipy.sparse.coo_matrix to arrow::SparseCOOTensor\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_15SparseCOOTensor_9from_scipy = {"from_scipy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_9from_scipy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_15SparseCOOTensor_8from_scipy};
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_9from_scipy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_obj = 0;
  PyObject *__pyx_v_dim_names = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_scipy (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_dim_names,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dim_names);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_scipy") < 0)) __PYX_ERR(13, 183, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_obj = values[0];
    __pyx_v_dim_names = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_scipy", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(13, 183, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.SparseCOOTensor.from_scipy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCOOTensor_8from_scipy(__pyx_v_obj, __pyx_v_dim_names);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_8from_scipy(PyObject *__pyx_v_obj, PyObject *__pyx_v_dim_names) {
  PyObject *__pyx_v_scipy = NULL;
  std::shared_ptr< arrow::SparseCOOTensor>  __pyx_v_csparse_tensor;
  std::vector<int64_t>  __pyx_v_c_shape;
  std::vector<std::string>  __pyx_v_c_dim_names;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_coords = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  int64_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  std::string __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  __Pyx_RefNannySetupContext("from_scipy", 0);

  /* "pyarrow/tensor.pxi":187
 *         Convert scipy.sparse.coo_matrix to arrow::SparseCOOTensor
 *         """
 *         import scipy.sparse             # <<<<<<<<<<<<<<
 *         if not isinstance(obj, scipy.sparse.coo_matrix):
 *             raise TypeError(
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_scipy_sparse, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_scipy = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/tensor.pxi":188
 *         """
 *         import scipy.sparse
 *         if not isinstance(obj, scipy.sparse.coo_matrix):             # <<<<<<<<<<<<<<
 *             raise TypeError(
 *                 "Expected scipy.sparse.coo_matrix, got {}".format(type(obj)))
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_scipy, __pyx_n_s_sparse); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_coo_matrix); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(13, 188, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = ((!(__pyx_t_3 != 0)) != 0);
  if (unlikely(__pyx_t_4)) {

    /* "pyarrow/tensor.pxi":190
 *         if not isinstance(obj, scipy.sparse.coo_matrix):
 *             raise TypeError(
 *                 "Expected scipy.sparse.coo_matrix, got {}".format(type(obj)))             # <<<<<<<<<<<<<<
 * 
 *         cdef shared_ptr[CSparseCOOTensor] csparse_tensor
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Expected_scipy_sparse_coo_matrix, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 190, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, ((PyObject *)Py_TYPE(__pyx_v_obj))) : __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)Py_TYPE(__pyx_v_obj)));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 190, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/tensor.pxi":189
 *         import scipy.sparse
 *         if not isinstance(obj, scipy.sparse.coo_matrix):
 *             raise TypeError(             # <<<<<<<<<<<<<<
 *                 "Expected scipy.sparse.coo_matrix, got {}".format(type(obj)))
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 189, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(13, 189, __pyx_L1_error)

    /* "pyarrow/tensor.pxi":188
 *         """
 *         import scipy.sparse
 *         if not isinstance(obj, scipy.sparse.coo_matrix):             # <<<<<<<<<<<<<<
 *             raise TypeError(
 *                 "Expected scipy.sparse.coo_matrix, got {}".format(type(obj)))
 */
  }

  /* "pyarrow/tensor.pxi":196
 *         cdef vector[c_string] c_dim_names
 * 
 *         for x in obj.shape:             # <<<<<<<<<<<<<<
 *             c_shape.push_back(x)
 *         if dim_names is not None:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 196, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 196, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(13, 196, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 196, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(13, 196, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 196, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_7(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(13, 196, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/tensor.pxi":197
 * 
 *         for x in obj.shape:
 *             c_shape.push_back(x)             # <<<<<<<<<<<<<<
 *         if dim_names is not None:
 *             for x in dim_names:
 */
    __pyx_t_8 = __Pyx_PyInt_As_int64_t(__pyx_v_x); if (unlikely((__pyx_t_8 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(13, 197, __pyx_L1_error)
    try {
      __pyx_v_c_shape.push_back(__pyx_t_8);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(13, 197, __pyx_L1_error)
    }

    /* "pyarrow/tensor.pxi":196
 *         cdef vector[c_string] c_dim_names
 * 
 *         for x in obj.shape:             # <<<<<<<<<<<<<<
 *             c_shape.push_back(x)
 *         if dim_names is not None:
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/tensor.pxi":198
 *         for x in obj.shape:
 *             c_shape.push_back(x)
 *         if dim_names is not None:             # <<<<<<<<<<<<<<
 *             for x in dim_names:
 *                 c_dim_names.push_back(tobytes(x))
 */
  __pyx_t_4 = (__pyx_v_dim_names != Py_None);
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/tensor.pxi":199
 *             c_shape.push_back(x)
 *         if dim_names is not None:
 *             for x in dim_names:             # <<<<<<<<<<<<<<
 *                 c_dim_names.push_back(tobytes(x))
 * 
 */
    if (likely(PyList_CheckExact(__pyx_v_dim_names)) || PyTuple_CheckExact(__pyx_v_dim_names)) {
      __pyx_t_2 = __pyx_v_dim_names; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_dim_names); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 199, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 199, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(13, 199, __pyx_L1_error)
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 199, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(13, 199, __pyx_L1_error)
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 199, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        }
      } else {
        __pyx_t_1 = __pyx_t_7(__pyx_t_2);
        if (unlikely(!__pyx_t_1)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(13, 199, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "pyarrow/tensor.pxi":200
 *         if dim_names is not None:
 *             for x in dim_names:
 *                 c_dim_names.push_back(tobytes(x))             # <<<<<<<<<<<<<<
 * 
 *         coords = np.vstack([obj.row, obj.col]).T
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 200, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_9, __pyx_v_x) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_x);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 200, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_10 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(13, 200, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      try {
        __pyx_v_c_dim_names.push_back(__pyx_t_10);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(13, 200, __pyx_L1_error)
      }

      /* "pyarrow/tensor.pxi":199
 *             c_shape.push_back(x)
 *         if dim_names is not None:
 *             for x in dim_names:             # <<<<<<<<<<<<<<
 *                 c_dim_names.push_back(tobytes(x))
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pyarrow/tensor.pxi":198
 *         for x in obj.shape:
 *             c_shape.push_back(x)
 *         if dim_names is not None:             # <<<<<<<<<<<<<<
 *             for x in dim_names:
 *                 c_dim_names.push_back(tobytes(x))
 */
  }

  /* "pyarrow/tensor.pxi":202
 *                 c_dim_names.push_back(tobytes(x))
 * 
 *         coords = np.vstack([obj.row, obj.col]).T             # <<<<<<<<<<<<<<
 *         coords = np.require(coords, dtype='i8', requirements='C')
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_vstack); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_row); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_col); if (unlikely(!__pyx_t_9)) __PYX_ERR(13, 202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_11 = PyList_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(13, 202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_1);
  PyList_SET_ITEM(__pyx_t_11, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_9);
  PyList_SET_ITEM(__pyx_t_11, 1, __pyx_t_9);
  __pyx_t_1 = 0;
  __pyx_t_9 = 0;
  __pyx_t_9 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_9, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_11);
  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_T); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_coords = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "pyarrow/tensor.pxi":203
 * 
 *         coords = np.vstack([obj.row, obj.col]).T
 *         coords = np.require(coords, dtype='i8', requirements='C')             # <<<<<<<<<<<<<<
 * 
 *         check_status(NdarraysToSparseCOOTensor(c_default_memory_pool(),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_require); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_coords);
  __Pyx_GIVEREF(__pyx_v_coords);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_coords);
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(13, 203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_dtype, __pyx_n_u_i8) < 0) __PYX_ERR(13, 203, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_requirements, __pyx_n_u_C) < 0) __PYX_ERR(13, 203, __pyx_L1_error)
  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(13, 203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF_SET(__pyx_v_coords, __pyx_t_9);
  __pyx_t_9 = 0;

  /* "pyarrow/tensor.pxi":206
 * 
 *         check_status(NdarraysToSparseCOOTensor(c_default_memory_pool(),
 *                      obj.data, coords, c_shape, c_dim_names,             # <<<<<<<<<<<<<<
 *                      &csparse_tensor))
 *         return pyarrow_wrap_sparse_coo_tensor(csparse_tensor)
 */
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_data); if (unlikely(!__pyx_t_9)) __PYX_ERR(13, 206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);

  /* "pyarrow/tensor.pxi":205
 *         coords = np.require(coords, dtype='i8', requirements='C')
 * 
 *         check_status(NdarraysToSparseCOOTensor(c_default_memory_pool(),             # <<<<<<<<<<<<<<
 *                      obj.data, coords, c_shape, c_dim_names,
 *                      &csparse_tensor))
 */
  __pyx_t_12 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::NdarraysToSparseCOOTensor( arrow::default_memory_pool(), __pyx_t_9, __pyx_v_coords, __pyx_v_c_shape, __pyx_v_c_dim_names, (&__pyx_v_csparse_tensor))); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(13, 205, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "pyarrow/tensor.pxi":208
 *                      obj.data, coords, c_shape, c_dim_names,
 *                      &csparse_tensor))
 *         return pyarrow_wrap_sparse_coo_tensor(csparse_tensor)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_9 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_sparse_coo_tensor(__pyx_v_csparse_tensor); if (unlikely(!__pyx_t_9)) __PYX_ERR(13, 208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_r = __pyx_t_9;
  __pyx_t_9 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":183
 * 
 *     @staticmethod
 *     def from_scipy(obj, dim_names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Convert scipy.sparse.coo_matrix to arrow::SparseCOOTensor
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("pyarrow.lib.SparseCOOTensor.from_scipy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_scipy);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_coords);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":211
 * 
 *     @staticmethod
 *     def from_pydata_sparse(obj, dim_names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Convert pydata/sparse.COO to arrow::SparseCOOTensor
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_11from_pydata_sparse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15SparseCOOTensor_10from_pydata_sparse[] = "SparseCOOTensor.from_pydata_sparse(obj, dim_names=None)\n\n        Convert pydata/sparse.COO to arrow::SparseCOOTensor\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_15SparseCOOTensor_11from_pydata_sparse = {"from_pydata_sparse", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_11from_pydata_sparse, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_15SparseCOOTensor_10from_pydata_sparse};
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_11from_pydata_sparse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_obj = 0;
  PyObject *__pyx_v_dim_names = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_pydata_sparse (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_dim_names,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dim_names);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_pydata_sparse") < 0)) __PYX_ERR(13, 211, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_obj = values[0];
    __pyx_v_dim_names = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_pydata_sparse", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(13, 211, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.SparseCOOTensor.from_pydata_sparse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCOOTensor_10from_pydata_sparse(__pyx_v_obj, __pyx_v_dim_names);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_10from_pydata_sparse(PyObject *__pyx_v_obj, PyObject *__pyx_v_dim_names) {
  PyObject *__pyx_v_sparse = NULL;
  std::shared_ptr< arrow::SparseCOOTensor>  __pyx_v_csparse_tensor;
  std::vector<int64_t>  __pyx_v_c_shape;
  std::vector<std::string>  __pyx_v_c_dim_names;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_coords = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  int64_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  std::string __pyx_t_10;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("from_pydata_sparse", 0);

  /* "pyarrow/tensor.pxi":215
 *         Convert pydata/sparse.COO to arrow::SparseCOOTensor
 *         """
 *         import sparse             # <<<<<<<<<<<<<<
 *         if not isinstance(obj, sparse.COO):
 *             raise TypeError(
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_sparse, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_sparse = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/tensor.pxi":216
 *         """
 *         import sparse
 *         if not isinstance(obj, sparse.COO):             # <<<<<<<<<<<<<<
 *             raise TypeError(
 *                 "Expected sparse.COO, got {}".format(type(obj)))
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sparse, __pyx_n_s_COO); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(13, 216, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "pyarrow/tensor.pxi":218
 *         if not isinstance(obj, sparse.COO):
 *             raise TypeError(
 *                 "Expected sparse.COO, got {}".format(type(obj)))             # <<<<<<<<<<<<<<
 * 
 *         cdef shared_ptr[CSparseCOOTensor] csparse_tensor
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Expected_sparse_COO_got, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 218, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)Py_TYPE(__pyx_v_obj))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)Py_TYPE(__pyx_v_obj)));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 218, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/tensor.pxi":217
 *         import sparse
 *         if not isinstance(obj, sparse.COO):
 *             raise TypeError(             # <<<<<<<<<<<<<<
 *                 "Expected sparse.COO, got {}".format(type(obj)))
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(13, 217, __pyx_L1_error)

    /* "pyarrow/tensor.pxi":216
 *         """
 *         import sparse
 *         if not isinstance(obj, sparse.COO):             # <<<<<<<<<<<<<<
 *             raise TypeError(
 *                 "Expected sparse.COO, got {}".format(type(obj)))
 */
  }

  /* "pyarrow/tensor.pxi":224
 *         cdef vector[c_string] c_dim_names
 * 
 *         for x in obj.shape:             # <<<<<<<<<<<<<<
 *             c_shape.push_back(x)
 *         if dim_names is not None:
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_1 = __pyx_t_4; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 224, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 224, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(13, 224, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 224, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(13, 224, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 224, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_7(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(13, 224, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/tensor.pxi":225
 * 
 *         for x in obj.shape:
 *             c_shape.push_back(x)             # <<<<<<<<<<<<<<
 *         if dim_names is not None:
 *             for x in dim_names:
 */
    __pyx_t_8 = __Pyx_PyInt_As_int64_t(__pyx_v_x); if (unlikely((__pyx_t_8 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(13, 225, __pyx_L1_error)
    try {
      __pyx_v_c_shape.push_back(__pyx_t_8);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(13, 225, __pyx_L1_error)
    }

    /* "pyarrow/tensor.pxi":224
 *         cdef vector[c_string] c_dim_names
 * 
 *         for x in obj.shape:             # <<<<<<<<<<<<<<
 *             c_shape.push_back(x)
 *         if dim_names is not None:
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/tensor.pxi":226
 *         for x in obj.shape:
 *             c_shape.push_back(x)
 *         if dim_names is not None:             # <<<<<<<<<<<<<<
 *             for x in dim_names:
 *                 c_dim_names.push_back(tobytes(x))
 */
  __pyx_t_3 = (__pyx_v_dim_names != Py_None);
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/tensor.pxi":227
 *             c_shape.push_back(x)
 *         if dim_names is not None:
 *             for x in dim_names:             # <<<<<<<<<<<<<<
 *                 c_dim_names.push_back(tobytes(x))
 * 
 */
    if (likely(PyList_CheckExact(__pyx_v_dim_names)) || PyTuple_CheckExact(__pyx_v_dim_names)) {
      __pyx_t_1 = __pyx_v_dim_names; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_dim_names); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 227, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 227, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(13, 227, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 227, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(13, 227, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 227, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        }
      } else {
        __pyx_t_4 = __pyx_t_7(__pyx_t_1);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(13, 227, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "pyarrow/tensor.pxi":228
 *         if dim_names is not None:
 *             for x in dim_names:
 *                 c_dim_names.push_back(tobytes(x))             # <<<<<<<<<<<<<<
 * 
 *         coords = np.require(obj.coords.T, dtype='i8', requirements='C')
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 228, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_9, __pyx_v_x) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_x);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 228, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_10 = __pyx_convert_string_from_py_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(13, 228, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      try {
        __pyx_v_c_dim_names.push_back(__pyx_t_10);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(13, 228, __pyx_L1_error)
      }

      /* "pyarrow/tensor.pxi":227
 *             c_shape.push_back(x)
 *         if dim_names is not None:
 *             for x in dim_names:             # <<<<<<<<<<<<<<
 *                 c_dim_names.push_back(tobytes(x))
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/tensor.pxi":226
 *         for x in obj.shape:
 *             c_shape.push_back(x)
 *         if dim_names is not None:             # <<<<<<<<<<<<<<
 *             for x in dim_names:
 *                 c_dim_names.push_back(tobytes(x))
 */
  }

  /* "pyarrow/tensor.pxi":230
 *                 c_dim_names.push_back(tobytes(x))
 * 
 *         coords = np.require(obj.coords.T, dtype='i8', requirements='C')             # <<<<<<<<<<<<<<
 * 
 *         check_status(NdarraysToSparseCOOTensor(c_default_memory_pool(),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_require); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_coords); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_T); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_n_u_i8) < 0) __PYX_ERR(13, 230, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_requirements, __pyx_n_u_C) < 0) __PYX_ERR(13, 230, __pyx_L1_error)
  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(13, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_coords = __pyx_t_9;
  __pyx_t_9 = 0;

  /* "pyarrow/tensor.pxi":233
 * 
 *         check_status(NdarraysToSparseCOOTensor(c_default_memory_pool(),
 *                      obj.data, coords, c_shape, c_dim_names,             # <<<<<<<<<<<<<<
 *                      &csparse_tensor))
 *         return pyarrow_wrap_sparse_coo_tensor(csparse_tensor)
 */
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_data); if (unlikely(!__pyx_t_9)) __PYX_ERR(13, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);

  /* "pyarrow/tensor.pxi":232
 *         coords = np.require(obj.coords.T, dtype='i8', requirements='C')
 * 
 *         check_status(NdarraysToSparseCOOTensor(c_default_memory_pool(),             # <<<<<<<<<<<<<<
 *                      obj.data, coords, c_shape, c_dim_names,
 *                      &csparse_tensor))
 */
  __pyx_t_11 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::NdarraysToSparseCOOTensor( arrow::default_memory_pool(), __pyx_t_9, __pyx_v_coords, __pyx_v_c_shape, __pyx_v_c_dim_names, (&__pyx_v_csparse_tensor))); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(13, 232, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "pyarrow/tensor.pxi":235
 *                      obj.data, coords, c_shape, c_dim_names,
 *                      &csparse_tensor))
 *         return pyarrow_wrap_sparse_coo_tensor(csparse_tensor)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_9 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_sparse_coo_tensor(__pyx_v_csparse_tensor); if (unlikely(!__pyx_t_9)) __PYX_ERR(13, 235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_r = __pyx_t_9;
  __pyx_t_9 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":211
 * 
 *     @staticmethod
 *     def from_pydata_sparse(obj, dim_names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Convert pydata/sparse.COO to arrow::SparseCOOTensor
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pyarrow.lib.SparseCOOTensor.from_pydata_sparse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_sparse);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_coords);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":238
 * 
 *     @staticmethod
 *     def from_tensor(obj):             # <<<<<<<<<<<<<<
 *         """
 *         Convert arrow::Tensor to arrow::SparseCOOTensor
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_13from_tensor(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15SparseCOOTensor_12from_tensor[] = "SparseCOOTensor.from_tensor(obj)\n\n        Convert arrow::Tensor to arrow::SparseCOOTensor\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_15SparseCOOTensor_13from_tensor = {"from_tensor", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_13from_tensor, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_15SparseCOOTensor_12from_tensor};
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_13from_tensor(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_obj = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_tensor (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_tensor") < 0)) __PYX_ERR(13, 238, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_obj = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_tensor", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(13, 238, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.SparseCOOTensor.from_tensor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCOOTensor_12from_tensor(__pyx_v_obj);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_12from_tensor(PyObject *__pyx_v_obj) {
  std::shared_ptr< arrow::SparseCOOTensor>  __pyx_v_csparse_tensor;
  std::shared_ptr< arrow::Tensor>  __pyx_v_ctensor;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("from_tensor", 0);

  /* "pyarrow/tensor.pxi":243
 *         """
 *         cdef shared_ptr[CSparseCOOTensor] csparse_tensor
 *         cdef shared_ptr[CTensor] ctensor = pyarrow_unwrap_tensor(obj)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_v_ctensor = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_tensor(__pyx_v_obj);

  /* "pyarrow/tensor.pxi":245
 *         cdef shared_ptr[CTensor] ctensor = pyarrow_unwrap_tensor(obj)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(TensorToSparseCOOTensor(ctensor, &csparse_tensor))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/tensor.pxi":246
 * 
 *         with nogil:
 *             check_status(TensorToSparseCOOTensor(ctensor, &csparse_tensor))             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_sparse_coo_tensor(csparse_tensor)
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::TensorToSparseCOOTensor(__pyx_v_ctensor, (&__pyx_v_csparse_tensor))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(13, 246, __pyx_L4_error)
      }

      /* "pyarrow/tensor.pxi":245
 *         cdef shared_ptr[CTensor] ctensor = pyarrow_unwrap_tensor(obj)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(TensorToSparseCOOTensor(ctensor, &csparse_tensor))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/tensor.pxi":248
 *             check_status(TensorToSparseCOOTensor(ctensor, &csparse_tensor))
 * 
 *         return pyarrow_wrap_sparse_coo_tensor(csparse_tensor)             # <<<<<<<<<<<<<<
 * 
 *     def to_numpy(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_sparse_coo_tensor(__pyx_v_csparse_tensor); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":238
 * 
 *     @staticmethod
 *     def from_tensor(obj):             # <<<<<<<<<<<<<<
 *         """
 *         Convert arrow::Tensor to arrow::SparseCOOTensor
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.SparseCOOTensor.from_tensor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":250
 *         return pyarrow_wrap_sparse_coo_tensor(csparse_tensor)
 * 
 *     def to_numpy(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert arrow::SparseCOOTensor to numpy.ndarrays with zero copy
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_15to_numpy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15SparseCOOTensor_14to_numpy[] = "SparseCOOTensor.to_numpy(self)\n\n        Convert arrow::SparseCOOTensor to numpy.ndarrays with zero copy\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_15to_numpy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_numpy (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCOOTensor_14to_numpy(((struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_14to_numpy(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *__pyx_v_self) {
  PyObject *__pyx_v_out_data;
  PyObject *__pyx_v_out_coords;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("to_numpy", 0);

  /* "pyarrow/tensor.pxi":257
 *         cdef PyObject* out_coords
 * 
 *         check_status(SparseCOOTensorToNdarray(self.sp_sparse_tensor, self,             # <<<<<<<<<<<<<<
 *                                               &out_data, &out_coords))
 *         return PyObject_to_object(out_data), PyObject_to_object(out_coords)
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::SparseCOOTensorToNdarray(__pyx_v_self->sp_sparse_tensor, ((PyObject *)__pyx_v_self), (&__pyx_v_out_data), (&__pyx_v_out_coords))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(13, 257, __pyx_L1_error)

  /* "pyarrow/tensor.pxi":259
 *         check_status(SparseCOOTensorToNdarray(self.sp_sparse_tensor, self,
 *                                               &out_data, &out_coords))
 *         return PyObject_to_object(out_data), PyObject_to_object(out_coords)             # <<<<<<<<<<<<<<
 * 
 *     def to_scipy(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_8includes_6common_PyObject_to_object(__pyx_v_out_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_f_7pyarrow_8includes_6common_PyObject_to_object(__pyx_v_out_coords); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":250
 *         return pyarrow_wrap_sparse_coo_tensor(csparse_tensor)
 * 
 *     def to_numpy(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert arrow::SparseCOOTensor to numpy.ndarrays with zero copy
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.SparseCOOTensor.to_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":261
 *         return PyObject_to_object(out_data), PyObject_to_object(out_coords)
 * 
 *     def to_scipy(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert arrow::SparseCOOTensor to scipy.sparse.coo_matrix
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_17to_scipy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15SparseCOOTensor_16to_scipy[] = "SparseCOOTensor.to_scipy(self)\n\n        Convert arrow::SparseCOOTensor to scipy.sparse.coo_matrix\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_17to_scipy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_scipy (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCOOTensor_16to_scipy(((struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_16to_scipy(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *__pyx_v_self) {
  PyObject *__pyx_v_coo_matrix = NULL;
  PyObject *__pyx_v_out_data;
  PyObject *__pyx_v_out_coords;
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_v_coords = NULL;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("to_scipy", 0);

  /* "pyarrow/tensor.pxi":265
 *         Convert arrow::SparseCOOTensor to scipy.sparse.coo_matrix
 *         """
 *         from scipy.sparse import coo_matrix             # <<<<<<<<<<<<<<
 *         cdef PyObject* out_data
 *         cdef PyObject* out_coords
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_coo_matrix);
  __Pyx_GIVEREF(__pyx_n_s_coo_matrix);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_coo_matrix);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_scipy_sparse, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_coo_matrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_coo_matrix = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/tensor.pxi":269
 *         cdef PyObject* out_coords
 * 
 *         check_status(SparseCOOTensorToNdarray(self.sp_sparse_tensor, self,             # <<<<<<<<<<<<<<
 *                                               &out_data, &out_coords))
 *         data = PyObject_to_object(out_data)
 */
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::SparseCOOTensorToNdarray(__pyx_v_self->sp_sparse_tensor, ((PyObject *)__pyx_v_self), (&__pyx_v_out_data), (&__pyx_v_out_coords))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(13, 269, __pyx_L1_error)

  /* "pyarrow/tensor.pxi":271
 *         check_status(SparseCOOTensorToNdarray(self.sp_sparse_tensor, self,
 *                                               &out_data, &out_coords))
 *         data = PyObject_to_object(out_data)             # <<<<<<<<<<<<<<
 *         coords = PyObject_to_object(out_coords)
 *         result = coo_matrix((data[:, 0], (coords[:, 0], coords[:, 1])),
 */
  __pyx_t_2 = __pyx_f_7pyarrow_8includes_6common_PyObject_to_object(__pyx_v_out_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_data = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/tensor.pxi":272
 *                                               &out_data, &out_coords))
 *         data = PyObject_to_object(out_data)
 *         coords = PyObject_to_object(out_coords)             # <<<<<<<<<<<<<<
 *         result = coo_matrix((data[:, 0], (coords[:, 0], coords[:, 1])),
 *                             shape=self.shape)
 */
  __pyx_t_2 = __pyx_f_7pyarrow_8includes_6common_PyObject_to_object(__pyx_v_out_coords); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 272, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_coords = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/tensor.pxi":273
 *         data = PyObject_to_object(out_data)
 *         coords = PyObject_to_object(out_coords)
 *         result = coo_matrix((data[:, 0], (coords[:, 0], coords[:, 1])),             # <<<<<<<<<<<<<<
 *                             shape=self.shape)
 *         return result
 */
  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_data, __pyx_tuple__182); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_coords, __pyx_tuple__182); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_coords, __pyx_tuple__183); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
  __pyx_t_2 = 0;
  __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyarrow/tensor.pxi":274
 *         coords = PyObject_to_object(out_coords)
 *         result = coo_matrix((data[:, 0], (coords[:, 0], coords[:, 1])),
 *                             shape=self.shape)             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_shape, __pyx_t_2) < 0) __PYX_ERR(13, 274, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/tensor.pxi":273
 *         data = PyObject_to_object(out_data)
 *         coords = PyObject_to_object(out_coords)
 *         result = coo_matrix((data[:, 0], (coords[:, 0], coords[:, 1])),             # <<<<<<<<<<<<<<
 *                             shape=self.shape)
 *         return result
 */
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_coo_matrix, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/tensor.pxi":275
 *         result = coo_matrix((data[:, 0], (coords[:, 0], coords[:, 1])),
 *                             shape=self.shape)
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def to_pydata_sparse(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":261
 *         return PyObject_to_object(out_data), PyObject_to_object(out_coords)
 * 
 *     def to_scipy(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert arrow::SparseCOOTensor to scipy.sparse.coo_matrix
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.SparseCOOTensor.to_scipy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_coo_matrix);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_coords);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":277
 *         return result
 * 
 *     def to_pydata_sparse(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert arrow::SparseCOOTensor to pydata/sparse.COO
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_19to_pydata_sparse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15SparseCOOTensor_18to_pydata_sparse[] = "SparseCOOTensor.to_pydata_sparse(self)\n\n        Convert arrow::SparseCOOTensor to pydata/sparse.COO\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_19to_pydata_sparse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_pydata_sparse (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCOOTensor_18to_pydata_sparse(((struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_18to_pydata_sparse(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *__pyx_v_self) {
  PyObject *__pyx_v_COO = NULL;
  PyObject *__pyx_v_out_data;
  PyObject *__pyx_v_out_coords;
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_v_coords = NULL;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("to_pydata_sparse", 0);

  /* "pyarrow/tensor.pxi":281
 *         Convert arrow::SparseCOOTensor to pydata/sparse.COO
 *         """
 *         from sparse import COO             # <<<<<<<<<<<<<<
 *         cdef PyObject* out_data
 *         cdef PyObject* out_coords
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_COO);
  __Pyx_GIVEREF(__pyx_n_s_COO);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_COO);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_sparse, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_COO); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_COO = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/tensor.pxi":285
 *         cdef PyObject* out_coords
 * 
 *         check_status(SparseCOOTensorToNdarray(self.sp_sparse_tensor, self,             # <<<<<<<<<<<<<<
 *                                               &out_data, &out_coords))
 *         data = PyObject_to_object(out_data)
 */
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::SparseCOOTensorToNdarray(__pyx_v_self->sp_sparse_tensor, ((PyObject *)__pyx_v_self), (&__pyx_v_out_data), (&__pyx_v_out_coords))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(13, 285, __pyx_L1_error)

  /* "pyarrow/tensor.pxi":287
 *         check_status(SparseCOOTensorToNdarray(self.sp_sparse_tensor, self,
 *                                               &out_data, &out_coords))
 *         data = PyObject_to_object(out_data)             # <<<<<<<<<<<<<<
 *         coords = PyObject_to_object(out_coords)
 *         result = COO(data=data[:, 0], coords=coords.T, shape=self.shape)
 */
  __pyx_t_2 = __pyx_f_7pyarrow_8includes_6common_PyObject_to_object(__pyx_v_out_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_data = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/tensor.pxi":288
 *                                               &out_data, &out_coords))
 *         data = PyObject_to_object(out_data)
 *         coords = PyObject_to_object(out_coords)             # <<<<<<<<<<<<<<
 *         result = COO(data=data[:, 0], coords=coords.T, shape=self.shape)
 *         return result
 */
  __pyx_t_2 = __pyx_f_7pyarrow_8includes_6common_PyObject_to_object(__pyx_v_out_coords); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_coords = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/tensor.pxi":289
 *         data = PyObject_to_object(out_data)
 *         coords = PyObject_to_object(out_coords)
 *         result = COO(data=data[:, 0], coords=coords.T, shape=self.shape)             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_data, __pyx_tuple__182); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_data, __pyx_t_1) < 0) __PYX_ERR(13, 289, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_coords, __pyx_n_s_T); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_coords, __pyx_t_1) < 0) __PYX_ERR(13, 289, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_shape, __pyx_t_1) < 0) __PYX_ERR(13, 289, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_COO, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/tensor.pxi":290
 *         coords = PyObject_to_object(out_coords)
 *         result = COO(data=data[:, 0], coords=coords.T, shape=self.shape)
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def to_tensor(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":277
 *         return result
 * 
 *     def to_pydata_sparse(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert arrow::SparseCOOTensor to pydata/sparse.COO
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.SparseCOOTensor.to_pydata_sparse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_COO);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_coords);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":292
 *         return result
 * 
 *     def to_tensor(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert arrow::SparseCOOTensor to arrow::Tensor
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_21to_tensor(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15SparseCOOTensor_20to_tensor[] = "SparseCOOTensor.to_tensor(self)\n\n        Convert arrow::SparseCOOTensor to arrow::Tensor\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_21to_tensor(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_tensor (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCOOTensor_20to_tensor(((struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_20to_tensor(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *__pyx_v_self) {
  std::shared_ptr< arrow::Tensor>  __pyx_v_ctensor;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("to_tensor", 0);

  /* "pyarrow/tensor.pxi":298
 * 
 *         cdef shared_ptr[CTensor] ctensor
 *         check_status(self.stp.ToTensor(&ctensor))             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_tensor(ctensor)
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->stp->ToTensor((&__pyx_v_ctensor))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(13, 298, __pyx_L1_error)

  /* "pyarrow/tensor.pxi":300
 *         check_status(self.stp.ToTensor(&ctensor))
 * 
 *         return pyarrow_wrap_tensor(ctensor)             # <<<<<<<<<<<<<<
 * 
 *     def equals(self, SparseCOOTensor other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_tensor(__pyx_v_ctensor); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":292
 *         return result
 * 
 *     def to_tensor(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert arrow::SparseCOOTensor to arrow::Tensor
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.SparseCOOTensor.to_tensor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":302
 *         return pyarrow_wrap_tensor(ctensor)
 * 
 *     def equals(self, SparseCOOTensor other):             # <<<<<<<<<<<<<<
 *         """
 *         Return true if sparse tensors contains exactly equal data
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_23equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15SparseCOOTensor_22equals[] = "SparseCOOTensor.equals(self, SparseCOOTensor other)\n\n        Return true if sparse tensors contains exactly equal data\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_23equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("equals (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_7pyarrow_3lib_SparseCOOTensor, 1, "other", 0))) __PYX_ERR(13, 302, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCOOTensor_22equals(((struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_22equals(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("equals", 0);

  /* "pyarrow/tensor.pxi":306
 *         Return true if sparse tensors contains exactly equal data
 *         """
 *         return self.stp.Equals(deref(other.stp))             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->stp->Equals((*__pyx_v_other->stp))); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":302
 *         return pyarrow_wrap_tensor(ctensor)
 * 
 *     def equals(self, SparseCOOTensor other):             # <<<<<<<<<<<<<<
 *         """
 *         Return true if sparse tensors contains exactly equal data
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.SparseCOOTensor.equals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":308
 *         return self.stp.Equals(deref(other.stp))
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         if isinstance(other, SparseCOOTensor):
 *             return self.equals(other)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_25__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_25__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCOOTensor_24__eq__(((struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *)__pyx_v_self), ((PyObject *)__pyx_v_other));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_24__eq__(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__eq__", 0);

  /* "pyarrow/tensor.pxi":309
 * 
 *     def __eq__(self, other):
 *         if isinstance(other, SparseCOOTensor):             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         else:
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_7pyarrow_3lib_SparseCOOTensor); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/tensor.pxi":310
 *     def __eq__(self, other):
 *         if isinstance(other, SparseCOOTensor):
 *             return self.equals(other)             # <<<<<<<<<<<<<<
 *         else:
 *             return NotImplemented
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_equals); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 310, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_other) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_other);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 310, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "pyarrow/tensor.pxi":309
 * 
 *     def __eq__(self, other):
 *         if isinstance(other, SparseCOOTensor):             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         else:
 */
  }

  /* "pyarrow/tensor.pxi":312
 *             return self.equals(other)
 *         else:
 *             return NotImplemented             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_builtin_NotImplemented);
    __pyx_r = __pyx_builtin_NotImplemented;
    goto __pyx_L0;
  }

  /* "pyarrow/tensor.pxi":308
 *         return self.stp.Equals(deref(other.stp))
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         if isinstance(other, SparseCOOTensor):
 *             return self.equals(other)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.SparseCOOTensor.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":315
 * 
 *     @property
 *     def is_mutable(self):             # <<<<<<<<<<<<<<
 *         return self.stp.is_mutable()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_10is_mutable_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_10is_mutable_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCOOTensor_10is_mutable___get__(((struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_10is_mutable___get__(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/tensor.pxi":316
 *     @property
 *     def is_mutable(self):
 *         return self.stp.is_mutable()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->stp->is_mutable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":315
 * 
 *     @property
 *     def is_mutable(self):             # <<<<<<<<<<<<<<
 *         return self.stp.is_mutable()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.SparseCOOTensor.is_mutable.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":319
 * 
 *     @property
 *     def ndim(self):             # <<<<<<<<<<<<<<
 *         return self.stp.ndim()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_4ndim_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCOOTensor_4ndim___get__(((struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_4ndim___get__(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/tensor.pxi":320
 *     @property
 *     def ndim(self):
 *         return self.stp.ndim()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->stp->ndim()); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":319
 * 
 *     @property
 *     def ndim(self):             # <<<<<<<<<<<<<<
 *         return self.stp.ndim()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.SparseCOOTensor.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":323
 * 
 *     @property
 *     def shape(self):             # <<<<<<<<<<<<<<
 *         # Cython knows how to convert a vector[T] to a Python list
 *         return tuple(self.stp.shape())
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_5shape_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCOOTensor_5shape___get__(((struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_5shape___get__(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/tensor.pxi":325
 *     def shape(self):
 *         # Cython knows how to convert a vector[T] to a Python list
 *         return tuple(self.stp.shape())             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_vector_to_py_int64_t(__pyx_v_self->stp->shape()); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 325, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 325, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":323
 * 
 *     @property
 *     def shape(self):             # <<<<<<<<<<<<<<
 *         # Cython knows how to convert a vector[T] to a Python list
 *         return tuple(self.stp.shape())
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.SparseCOOTensor.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":328
 * 
 *     @property
 *     def size(self):             # <<<<<<<<<<<<<<
 *         return self.stp.size()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_4size_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCOOTensor_4size___get__(((struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_4size___get__(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/tensor.pxi":329
 *     @property
 *     def size(self):
 *         return self.stp.size()             # <<<<<<<<<<<<<<
 * 
 *     def dim_name(self, i):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->stp->size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":328
 * 
 *     @property
 *     def size(self):             # <<<<<<<<<<<<<<
 *         return self.stp.size()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.SparseCOOTensor.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":331
 *         return self.stp.size()
 * 
 *     def dim_name(self, i):             # <<<<<<<<<<<<<<
 *         return frombytes(self.stp.dim_name(i))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_27dim_name(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15SparseCOOTensor_26dim_name[] = "SparseCOOTensor.dim_name(self, i)";
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_27dim_name(PyObject *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dim_name (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCOOTensor_26dim_name(((struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *)__pyx_v_self), ((PyObject *)__pyx_v_i));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_26dim_name(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("dim_name", 0);

  /* "pyarrow/tensor.pxi":332
 * 
 *     def dim_name(self, i):
 *         return frombytes(self.stp.dim_name(i))             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_i); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(13, 332, __pyx_L1_error)
  __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_self->stp->dim_name(__pyx_t_3)); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":331
 *         return self.stp.size()
 * 
 *     def dim_name(self, i):             # <<<<<<<<<<<<<<
 *         return frombytes(self.stp.dim_name(i))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.SparseCOOTensor.dim_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":335
 * 
 *     @property
 *     def dim_names(self):             # <<<<<<<<<<<<<<
 *         return tuple(frombytes(x) for x in tuple(self.stp.dim_names()))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_9dim_names_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_9dim_names_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCOOTensor_9dim_names___get__(((struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pyarrow_3lib_15SparseCOOTensor_9dim_names_7__get___2generator13(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/tensor.pxi":336
 *     @property
 *     def dim_names(self):
 *         return tuple(frombytes(x) for x in tuple(self.stp.dim_names()))             # <<<<<<<<<<<<<<
 * 
 *     @property
 */

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_9dim_names_7__get___genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_genexpr *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_14_genexpr(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_14_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(13, 336, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13___get__ *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7pyarrow_3lib_15SparseCOOTensor_9dim_names_7__get___2generator13, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_SparseCOOTensor___get___locals_g, __pyx_n_s_pyarrow_lib); if (unlikely(!gen)) __PYX_ERR(13, 336, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.SparseCOOTensor.dim_names.__get__.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7pyarrow_3lib_15SparseCOOTensor_9dim_names_7__get___2generator13(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(13, 336, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(13, 336, __pyx_L1_error) }
  __pyx_t_1 = __pyx_convert_vector_to_py_std_3a__3a_string(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->stp->dim_names()); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(13, 336, __pyx_L1_error)
    #else
    __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 336, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_x);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_x, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 336, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_cur_scope->__pyx_v_x) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_cur_scope->__pyx_v_x);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 336, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(13, 336, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":335
 * 
 *     @property
 *     def dim_names(self):             # <<<<<<<<<<<<<<
 *         return tuple(frombytes(x) for x in tuple(self.stp.dim_names()))
 * 
 */

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_9dim_names___get__(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13___get__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13___get__ *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_13___get__(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_13___get__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13___get__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(13, 335, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);

  /* "pyarrow/tensor.pxi":336
 *     @property
 *     def dim_names(self):
 *         return tuple(frombytes(x) for x in tuple(self.stp.dim_names()))             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_pf_7pyarrow_3lib_15SparseCOOTensor_9dim_names_7__get___genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":335
 * 
 *     @property
 *     def dim_names(self):             # <<<<<<<<<<<<<<
 *         return tuple(frombytes(x) for x in tuple(self.stp.dim_names()))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.SparseCOOTensor.dim_names.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":339
 * 
 *     @property
 *     def non_zero_length(self):             # <<<<<<<<<<<<<<
 *         return self.stp.non_zero_length()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_15non_zero_length_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_15non_zero_length_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCOOTensor_15non_zero_length___get__(((struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_15non_zero_length___get__(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/tensor.pxi":340
 *     @property
 *     def non_zero_length(self):
 *         return self.stp.non_zero_length()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->stp->non_zero_length()); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":339
 * 
 *     @property
 *     def non_zero_length(self):             # <<<<<<<<<<<<<<
 *         return self.stp.non_zero_length()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.SparseCOOTensor.non_zero_length.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/lib.pxd":314
 * 
 *     cdef readonly:
 *         DataType type             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CSparseCOOTensor]& sp_sparse_tensor)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_4type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_4type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCOOTensor_4type___get__(((struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_4type___get__(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->type));
  __pyx_r = ((PyObject *)__pyx_v_self->type);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_29__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15SparseCOOTensor_28__reduce_cython__[] = "SparseCOOTensor.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_29__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCOOTensor_28__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_28__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__184, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.SparseCOOTensor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_31__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15SparseCOOTensor_30__setstate_cython__[] = "SparseCOOTensor.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_31__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCOOTensor_30__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCOOTensor_30__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__185, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.SparseCOOTensor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":348
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call SparseCSRMatrix's constructor directly, "
 *                         "use one of the `pyarrow.SparseCSRMatrix.from_*` "
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCSRMatrix___init__(((struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_15SparseCSRMatrix___init__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/tensor.pxi":349
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call SparseCSRMatrix's constructor directly, "             # <<<<<<<<<<<<<<
 *                         "use one of the `pyarrow.SparseCSRMatrix.from_*` "
 *                         "functions instead.")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__186, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(13, 349, __pyx_L1_error)

  /* "pyarrow/tensor.pxi":348
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call SparseCSRMatrix's constructor directly, "
 *                         "use one of the `pyarrow.SparseCSRMatrix.from_*` "
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.SparseCSRMatrix.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":353
 *                         "functions instead.")
 * 
 *     cdef void init(self, const shared_ptr[CSparseCSRMatrix]& sp_sparse_tensor):             # <<<<<<<<<<<<<<
 *         self.sp_sparse_tensor = sp_sparse_tensor
 *         self.stp = sp_sparse_tensor.get()
 */

static void __pyx_f_7pyarrow_3lib_15SparseCSRMatrix_init(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *__pyx_v_self, std::shared_ptr< arrow::SparseCSRMatrix>  const &__pyx_v_sp_sparse_tensor) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/tensor.pxi":354
 * 
 *     cdef void init(self, const shared_ptr[CSparseCSRMatrix]& sp_sparse_tensor):
 *         self.sp_sparse_tensor = sp_sparse_tensor             # <<<<<<<<<<<<<<
 *         self.stp = sp_sparse_tensor.get()
 *         self.type = pyarrow_wrap_data_type(self.stp.type())
 */
  __pyx_v_self->sp_sparse_tensor = __pyx_v_sp_sparse_tensor;

  /* "pyarrow/tensor.pxi":355
 *     cdef void init(self, const shared_ptr[CSparseCSRMatrix]& sp_sparse_tensor):
 *         self.sp_sparse_tensor = sp_sparse_tensor
 *         self.stp = sp_sparse_tensor.get()             # <<<<<<<<<<<<<<
 *         self.type = pyarrow_wrap_data_type(self.stp.type())
 * 
 */
  __pyx_v_self->stp = __pyx_v_sp_sparse_tensor.get();

  /* "pyarrow/tensor.pxi":356
 *         self.sp_sparse_tensor = sp_sparse_tensor
 *         self.stp = sp_sparse_tensor.get()
 *         self.type = pyarrow_wrap_data_type(self.stp.type())             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_self->stp->type()); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(13, 356, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->type);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->type));
  __pyx_v_self->type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/tensor.pxi":353
 *                         "functions instead.")
 * 
 *     cdef void init(self, const shared_ptr[CSparseCSRMatrix]& sp_sparse_tensor):             # <<<<<<<<<<<<<<
 *         self.sp_sparse_tensor = sp_sparse_tensor
 *         self.stp = sp_sparse_tensor.get()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("pyarrow.lib.SparseCSRMatrix.init", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/tensor.pxi":358
 *         self.type = pyarrow_wrap_data_type(self.stp.type())
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return """<pyarrow.SparseCSRMatrix>
 * type: {0.type}
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_3__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_2__repr__(((struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_2__repr__(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pyarrow/tensor.pxi":359
 * 
 *     def __repr__(self):
 *         return """<pyarrow.SparseCSRMatrix>             # <<<<<<<<<<<<<<
 * type: {0.type}
 * shape: {0.shape}""".format(self)
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/tensor.pxi":361
 *         return """<pyarrow.SparseCSRMatrix>
 * type: {0.type}
 * shape: {0.shape}""".format(self)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_pyarrow_SparseCSRMatrix_type_0, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self));
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":358
 *         self.type = pyarrow_wrap_data_type(self.stp.type())
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return """<pyarrow.SparseCSRMatrix>
 * type: {0.type}
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.SparseCSRMatrix.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":364
 * 
 *     @classmethod
 *     def from_dense_numpy(cls, obj, dim_names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Convert numpy.ndarray to arrow::SparseCSRMatrix
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_5from_dense_numpy(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15SparseCSRMatrix_4from_dense_numpy[] = "SparseCSRMatrix.from_dense_numpy(type cls, obj, dim_names=None)\n\n        Convert numpy.ndarray to arrow::SparseCSRMatrix\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_5from_dense_numpy(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_obj = 0;
  PyObject *__pyx_v_dim_names = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_dense_numpy (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_dim_names,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dim_names);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_dense_numpy") < 0)) __PYX_ERR(13, 364, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_obj = values[0];
    __pyx_v_dim_names = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_dense_numpy", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(13, 364, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.SparseCSRMatrix.from_dense_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_4from_dense_numpy(((PyTypeObject*)__pyx_v_cls), __pyx_v_obj, __pyx_v_dim_names);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_4from_dense_numpy(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_obj, PyObject *__pyx_v_dim_names) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("from_dense_numpy", 0);

  /* "pyarrow/tensor.pxi":368
 *         Convert numpy.ndarray to arrow::SparseCSRMatrix
 *         """
 *         return cls.from_tensor(Tensor.from_numpy(obj, dim_names=dim_names))             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_cls), __pyx_n_s_from_tensor); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_Tensor), __pyx_n_s_from_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_obj);
  __Pyx_GIVEREF(__pyx_v_obj);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_obj);
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dim_names, __pyx_v_dim_names) < 0) __PYX_ERR(13, 368, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":364
 * 
 *     @classmethod
 *     def from_dense_numpy(cls, obj, dim_names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Convert numpy.ndarray to arrow::SparseCSRMatrix
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.SparseCSRMatrix.from_dense_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":371
 * 
 *     @staticmethod
 *     def from_numpy(data, indptr, indices, shape, dim_names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Create arrow::SparseCSRMatrix from numpy.ndarrays
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_7from_numpy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15SparseCSRMatrix_6from_numpy[] = "SparseCSRMatrix.from_numpy(data, indptr, indices, shape, dim_names=None)\n\n        Create arrow::SparseCSRMatrix from numpy.ndarrays\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_15SparseCSRMatrix_7from_numpy = {"from_numpy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_7from_numpy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_15SparseCSRMatrix_6from_numpy};
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_7from_numpy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_data = 0;
  PyObject *__pyx_v_indptr = 0;
  PyObject *__pyx_v_indices = 0;
  PyObject *__pyx_v_shape = 0;
  PyObject *__pyx_v_dim_names = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_numpy (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_indptr,&__pyx_n_s_indices,&__pyx_n_s_shape,&__pyx_n_s_dim_names,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[4] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indptr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_numpy", 0, 4, 5, 1); __PYX_ERR(13, 371, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_numpy", 0, 4, 5, 2); __PYX_ERR(13, 371, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_numpy", 0, 4, 5, 3); __PYX_ERR(13, 371, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dim_names);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_numpy") < 0)) __PYX_ERR(13, 371, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_data = values[0];
    __pyx_v_indptr = values[1];
    __pyx_v_indices = values[2];
    __pyx_v_shape = values[3];
    __pyx_v_dim_names = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_numpy", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(13, 371, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.SparseCSRMatrix.from_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_6from_numpy(__pyx_v_data, __pyx_v_indptr, __pyx_v_indices, __pyx_v_shape, __pyx_v_dim_names);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_6from_numpy(PyObject *__pyx_v_data, PyObject *__pyx_v_indptr, PyObject *__pyx_v_indices, PyObject *__pyx_v_shape, PyObject *__pyx_v_dim_names) {
  std::shared_ptr< arrow::SparseCSRMatrix>  __pyx_v_csparse_tensor;
  std::vector<int64_t>  __pyx_v_c_shape;
  std::vector<std::string>  __pyx_v_c_dim_names;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int64_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  std::string __pyx_t_10;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("from_numpy", 0);
  __Pyx_INCREF(__pyx_v_indptr);
  __Pyx_INCREF(__pyx_v_indices);

  /* "pyarrow/tensor.pxi":379
 *         cdef vector[c_string] c_dim_names
 * 
 *         for x in shape:             # <<<<<<<<<<<<<<
 *             c_shape.push_back(x)
 *         if dim_names is not None:
 */
  if (likely(PyList_CheckExact(__pyx_v_shape)) || PyTuple_CheckExact(__pyx_v_shape)) {
    __pyx_t_1 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 379, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 379, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(13, 379, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 379, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(13, 379, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 379, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(13, 379, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/tensor.pxi":380
 * 
 *         for x in shape:
 *             c_shape.push_back(x)             # <<<<<<<<<<<<<<
 *         if dim_names is not None:
 *             for x in dim_names:
 */
    __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_v_x); if (unlikely((__pyx_t_5 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(13, 380, __pyx_L1_error)
    try {
      __pyx_v_c_shape.push_back(__pyx_t_5);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(13, 380, __pyx_L1_error)
    }

    /* "pyarrow/tensor.pxi":379
 *         cdef vector[c_string] c_dim_names
 * 
 *         for x in shape:             # <<<<<<<<<<<<<<
 *             c_shape.push_back(x)
 *         if dim_names is not None:
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/tensor.pxi":381
 *         for x in shape:
 *             c_shape.push_back(x)
 *         if dim_names is not None:             # <<<<<<<<<<<<<<
 *             for x in dim_names:
 *                 c_dim_names.push_back(tobytes(x))
 */
  __pyx_t_6 = (__pyx_v_dim_names != Py_None);
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "pyarrow/tensor.pxi":382
 *             c_shape.push_back(x)
 *         if dim_names is not None:
 *             for x in dim_names:             # <<<<<<<<<<<<<<
 *                 c_dim_names.push_back(tobytes(x))
 * 
 */
    if (likely(PyList_CheckExact(__pyx_v_dim_names)) || PyTuple_CheckExact(__pyx_v_dim_names)) {
      __pyx_t_1 = __pyx_v_dim_names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
      __pyx_t_3 = NULL;
    } else {
      __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_dim_names); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 382, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_3)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(13, 382, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 382, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        } else {
          if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(13, 382, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 382, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        }
      } else {
        __pyx_t_4 = __pyx_t_3(__pyx_t_1);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(13, 382, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "pyarrow/tensor.pxi":383
 *         if dim_names is not None:
 *             for x in dim_names:
 *                 c_dim_names.push_back(tobytes(x))             # <<<<<<<<<<<<<<
 * 
 *         # Enforce precondition for SparseCSRMatrix indices
 */
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 383, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
        }
      }
      __pyx_t_4 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_v_x) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_x);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 383, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_10 = __pyx_convert_string_from_py_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(13, 383, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      try {
        __pyx_v_c_dim_names.push_back(__pyx_t_10);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(13, 383, __pyx_L1_error)
      }

      /* "pyarrow/tensor.pxi":382
 *             c_shape.push_back(x)
 *         if dim_names is not None:
 *             for x in dim_names:             # <<<<<<<<<<<<<<
 *                 c_dim_names.push_back(tobytes(x))
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/tensor.pxi":381
 *         for x in shape:
 *             c_shape.push_back(x)
 *         if dim_names is not None:             # <<<<<<<<<<<<<<
 *             for x in dim_names:
 *                 c_dim_names.push_back(tobytes(x))
 */
  }

  /* "pyarrow/tensor.pxi":386
 * 
 *         # Enforce precondition for SparseCSRMatrix indices
 *         indptr = np.require(indptr, dtype='i8')             # <<<<<<<<<<<<<<
 *         indices = np.require(indices, dtype='i8')
 *         if indptr.ndim != 1:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_require); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_indptr);
  __Pyx_GIVEREF(__pyx_v_indptr);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_indptr);
  __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_n_u_i8) < 0) __PYX_ERR(13, 386, __pyx_L1_error)
  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(13, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF_SET(__pyx_v_indptr, __pyx_t_9);
  __pyx_t_9 = 0;

  /* "pyarrow/tensor.pxi":387
 *         # Enforce precondition for SparseCSRMatrix indices
 *         indptr = np.require(indptr, dtype='i8')
 *         indices = np.require(indices, dtype='i8')             # <<<<<<<<<<<<<<
 *         if indptr.ndim != 1:
 *             raise ValueError("Expected 1-dimensional array for "
 */
  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(13, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_require); if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(13, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_INCREF(__pyx_v_indices);
  __Pyx_GIVEREF(__pyx_v_indices);
  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_indices);
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_u_i8) < 0) __PYX_ERR(13, 387, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_9, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_indices, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyarrow/tensor.pxi":388
 *         indptr = np.require(indptr, dtype='i8')
 *         indices = np.require(indices, dtype='i8')
 *         if indptr.ndim != 1:             # <<<<<<<<<<<<<<
 *             raise ValueError("Expected 1-dimensional array for "
 *                              "SparseCSRMatrix indptr")
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_indptr, __pyx_n_s_ndim); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyInt_NeObjC(__pyx_t_4, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(13, 388, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_7)) {

    /* "pyarrow/tensor.pxi":389
 *         indices = np.require(indices, dtype='i8')
 *         if indptr.ndim != 1:
 *             raise ValueError("Expected 1-dimensional array for "             # <<<<<<<<<<<<<<
 *                              "SparseCSRMatrix indptr")
 *         if indices.ndim != 1:
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__187, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 389, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(13, 389, __pyx_L1_error)

    /* "pyarrow/tensor.pxi":388
 *         indptr = np.require(indptr, dtype='i8')
 *         indices = np.require(indices, dtype='i8')
 *         if indptr.ndim != 1:             # <<<<<<<<<<<<<<
 *             raise ValueError("Expected 1-dimensional array for "
 *                              "SparseCSRMatrix indptr")
 */
  }

  /* "pyarrow/tensor.pxi":391
 *             raise ValueError("Expected 1-dimensional array for "
 *                              "SparseCSRMatrix indptr")
 *         if indices.ndim != 1:             # <<<<<<<<<<<<<<
 *             raise ValueError("Expected 1-dimensional array for "
 *                              "SparseCSRMatrix indices")
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_indices, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(13, 391, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(__pyx_t_7)) {

    /* "pyarrow/tensor.pxi":392
 *                              "SparseCSRMatrix indptr")
 *         if indices.ndim != 1:
 *             raise ValueError("Expected 1-dimensional array for "             # <<<<<<<<<<<<<<
 *                              "SparseCSRMatrix indices")
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__188, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 392, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(13, 392, __pyx_L1_error)

    /* "pyarrow/tensor.pxi":391
 *             raise ValueError("Expected 1-dimensional array for "
 *                              "SparseCSRMatrix indptr")
 *         if indices.ndim != 1:             # <<<<<<<<<<<<<<
 *             raise ValueError("Expected 1-dimensional array for "
 *                              "SparseCSRMatrix indices")
 */
  }

  /* "pyarrow/tensor.pxi":395
 *                              "SparseCSRMatrix indices")
 * 
 *         check_status(NdarraysToSparseCSRMatrix(c_default_memory_pool(),             # <<<<<<<<<<<<<<
 *                                                data, indptr, indices, c_shape,
 *                                                c_dim_names, &csparse_tensor))
 */
  __pyx_t_11 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::NdarraysToSparseCSRMatrix( arrow::default_memory_pool(), __pyx_v_data, __pyx_v_indptr, __pyx_v_indices, __pyx_v_c_shape, __pyx_v_c_dim_names, (&__pyx_v_csparse_tensor))); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(13, 395, __pyx_L1_error)

  /* "pyarrow/tensor.pxi":398
 *                                                data, indptr, indices, c_shape,
 *                                                c_dim_names, &csparse_tensor))
 *         return pyarrow_wrap_sparse_csr_matrix(csparse_tensor)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_sparse_csr_matrix(__pyx_v_csparse_tensor); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":371
 * 
 *     @staticmethod
 *     def from_numpy(data, indptr, indices, shape, dim_names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Create arrow::SparseCSRMatrix from numpy.ndarrays
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pyarrow.lib.SparseCSRMatrix.from_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_indptr);
  __Pyx_XDECREF(__pyx_v_indices);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":401
 * 
 *     @staticmethod
 *     def from_scipy(obj, dim_names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Convert scipy.sparse.csr_matrix to arrow::SparseCSRMatrix
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_9from_scipy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15SparseCSRMatrix_8from_scipy[] = "SparseCSRMatrix.from_scipy(obj, dim_names=None)\n\n        Convert scipy.sparse.csr_matrix to arrow::SparseCSRMatrix\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_15SparseCSRMatrix_9from_scipy = {"from_scipy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_9from_scipy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_15SparseCSRMatrix_8from_scipy};
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_9from_scipy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_obj = 0;
  PyObject *__pyx_v_dim_names = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_scipy (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_dim_names,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dim_names);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_scipy") < 0)) __PYX_ERR(13, 401, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_obj = values[0];
    __pyx_v_dim_names = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_scipy", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(13, 401, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.SparseCSRMatrix.from_scipy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_8from_scipy(__pyx_v_obj, __pyx_v_dim_names);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_8from_scipy(PyObject *__pyx_v_obj, PyObject *__pyx_v_dim_names) {
  PyObject *__pyx_v_scipy = NULL;
  std::shared_ptr< arrow::SparseCSRMatrix>  __pyx_v_csparse_tensor;
  std::vector<int64_t>  __pyx_v_c_shape;
  std::vector<std::string>  __pyx_v_c_dim_names;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_indptr = NULL;
  PyObject *__pyx_v_indices = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  int64_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  std::string __pyx_t_10;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("from_scipy", 0);

  /* "pyarrow/tensor.pxi":405
 *         Convert scipy.sparse.csr_matrix to arrow::SparseCSRMatrix
 *         """
 *         import scipy.sparse             # <<<<<<<<<<<<<<
 *         if not isinstance(obj, scipy.sparse.csr_matrix):
 *             raise TypeError(
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_scipy_sparse, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_scipy = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/tensor.pxi":406
 *         """
 *         import scipy.sparse
 *         if not isinstance(obj, scipy.sparse.csr_matrix):             # <<<<<<<<<<<<<<
 *             raise TypeError(
 *                 "Expected scipy.sparse.csr_matrix, got {}".format(type(obj)))
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_scipy, __pyx_n_s_sparse); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_csr_matrix); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(13, 406, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = ((!(__pyx_t_3 != 0)) != 0);
  if (unlikely(__pyx_t_4)) {

    /* "pyarrow/tensor.pxi":408
 *         if not isinstance(obj, scipy.sparse.csr_matrix):
 *             raise TypeError(
 *                 "Expected scipy.sparse.csr_matrix, got {}".format(type(obj)))             # <<<<<<<<<<<<<<
 * 
 *         cdef shared_ptr[CSparseCSRMatrix] csparse_tensor
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Expected_scipy_sparse_csr_matrix, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 408, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, ((PyObject *)Py_TYPE(__pyx_v_obj))) : __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)Py_TYPE(__pyx_v_obj)));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 408, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/tensor.pxi":407
 *         import scipy.sparse
 *         if not isinstance(obj, scipy.sparse.csr_matrix):
 *             raise TypeError(             # <<<<<<<<<<<<<<
 *                 "Expected scipy.sparse.csr_matrix, got {}".format(type(obj)))
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 407, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(13, 407, __pyx_L1_error)

    /* "pyarrow/tensor.pxi":406
 *         """
 *         import scipy.sparse
 *         if not isinstance(obj, scipy.sparse.csr_matrix):             # <<<<<<<<<<<<<<
 *             raise TypeError(
 *                 "Expected scipy.sparse.csr_matrix, got {}".format(type(obj)))
 */
  }

  /* "pyarrow/tensor.pxi":414
 *         cdef vector[c_string] c_dim_names
 * 
 *         for x in obj.shape:             # <<<<<<<<<<<<<<
 *             c_shape.push_back(x)
 *         if dim_names is not None:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 414, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 414, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(13, 414, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 414, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(13, 414, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 414, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_7(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(13, 414, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/tensor.pxi":415
 * 
 *         for x in obj.shape:
 *             c_shape.push_back(x)             # <<<<<<<<<<<<<<
 *         if dim_names is not None:
 *             for x in dim_names:
 */
    __pyx_t_8 = __Pyx_PyInt_As_int64_t(__pyx_v_x); if (unlikely((__pyx_t_8 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(13, 415, __pyx_L1_error)
    try {
      __pyx_v_c_shape.push_back(__pyx_t_8);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(13, 415, __pyx_L1_error)
    }

    /* "pyarrow/tensor.pxi":414
 *         cdef vector[c_string] c_dim_names
 * 
 *         for x in obj.shape:             # <<<<<<<<<<<<<<
 *             c_shape.push_back(x)
 *         if dim_names is not None:
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/tensor.pxi":416
 *         for x in obj.shape:
 *             c_shape.push_back(x)
 *         if dim_names is not None:             # <<<<<<<<<<<<<<
 *             for x in dim_names:
 *                 c_dim_names.push_back(tobytes(x))
 */
  __pyx_t_4 = (__pyx_v_dim_names != Py_None);
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/tensor.pxi":417
 *             c_shape.push_back(x)
 *         if dim_names is not None:
 *             for x in dim_names:             # <<<<<<<<<<<<<<
 *                 c_dim_names.push_back(tobytes(x))
 * 
 */
    if (likely(PyList_CheckExact(__pyx_v_dim_names)) || PyTuple_CheckExact(__pyx_v_dim_names)) {
      __pyx_t_2 = __pyx_v_dim_names; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_dim_names); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 417, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 417, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(13, 417, __pyx_L1_error)
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 417, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(13, 417, __pyx_L1_error)
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 417, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        }
      } else {
        __pyx_t_1 = __pyx_t_7(__pyx_t_2);
        if (unlikely(!__pyx_t_1)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(13, 417, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "pyarrow/tensor.pxi":418
 *         if dim_names is not None:
 *             for x in dim_names:
 *                 c_dim_names.push_back(tobytes(x))             # <<<<<<<<<<<<<<
 * 
 *         # Enforce precondition for CSparseCSRMatrix indices
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 418, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_9, __pyx_v_x) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_x);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 418, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_10 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(13, 418, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      try {
        __pyx_v_c_dim_names.push_back(__pyx_t_10);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(13, 418, __pyx_L1_error)
      }

      /* "pyarrow/tensor.pxi":417
 *             c_shape.push_back(x)
 *         if dim_names is not None:
 *             for x in dim_names:             # <<<<<<<<<<<<<<
 *                 c_dim_names.push_back(tobytes(x))
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pyarrow/tensor.pxi":416
 *         for x in obj.shape:
 *             c_shape.push_back(x)
 *         if dim_names is not None:             # <<<<<<<<<<<<<<
 *             for x in dim_names:
 *                 c_dim_names.push_back(tobytes(x))
 */
  }

  /* "pyarrow/tensor.pxi":421
 * 
 *         # Enforce precondition for CSparseCSRMatrix indices
 *         indptr = np.require(obj.indptr, dtype='i8')             # <<<<<<<<<<<<<<
 *         indices = np.require(obj.indices, dtype='i8')
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_require); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_indptr); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_u_i8) < 0) __PYX_ERR(13, 421, __pyx_L1_error)
  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(13, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_indptr = __pyx_t_9;
  __pyx_t_9 = 0;

  /* "pyarrow/tensor.pxi":422
 *         # Enforce precondition for CSparseCSRMatrix indices
 *         indptr = np.require(obj.indptr, dtype='i8')
 *         indices = np.require(obj.indices, dtype='i8')             # <<<<<<<<<<<<<<
 * 
 *         check_status(NdarraysToSparseCSRMatrix(c_default_memory_pool(),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(13, 422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_require); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_indices); if (unlikely(!__pyx_t_9)) __PYX_ERR(13, 422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_9);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9);
  __pyx_t_9 = 0;
  __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(13, 422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_n_u_i8) < 0) __PYX_ERR(13, 422, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_v_indices = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/tensor.pxi":425
 * 
 *         check_status(NdarraysToSparseCSRMatrix(c_default_memory_pool(),
 *                      obj.data, indptr, indices, c_shape,             # <<<<<<<<<<<<<<
 *                      c_dim_names, &csparse_tensor))
 *         return pyarrow_wrap_sparse_csr_matrix(csparse_tensor)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyarrow/tensor.pxi":424
 *         indices = np.require(obj.indices, dtype='i8')
 * 
 *         check_status(NdarraysToSparseCSRMatrix(c_default_memory_pool(),             # <<<<<<<<<<<<<<
 *                      obj.data, indptr, indices, c_shape,
 *                      c_dim_names, &csparse_tensor))
 */
  __pyx_t_11 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::NdarraysToSparseCSRMatrix( arrow::default_memory_pool(), __pyx_t_1, __pyx_v_indptr, __pyx_v_indices, __pyx_v_c_shape, __pyx_v_c_dim_names, (&__pyx_v_csparse_tensor))); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(13, 424, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/tensor.pxi":427
 *                      obj.data, indptr, indices, c_shape,
 *                      c_dim_names, &csparse_tensor))
 *         return pyarrow_wrap_sparse_csr_matrix(csparse_tensor)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_sparse_csr_matrix(__pyx_v_csparse_tensor); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 427, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":401
 * 
 *     @staticmethod
 *     def from_scipy(obj, dim_names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Convert scipy.sparse.csr_matrix to arrow::SparseCSRMatrix
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pyarrow.lib.SparseCSRMatrix.from_scipy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_scipy);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_indptr);
  __Pyx_XDECREF(__pyx_v_indices);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":430
 * 
 *     @staticmethod
 *     def from_tensor(obj):             # <<<<<<<<<<<<<<
 *         """
 *         Convert arrow::Tensor to arrow::SparseCSRMatrix
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_11from_tensor(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15SparseCSRMatrix_10from_tensor[] = "SparseCSRMatrix.from_tensor(obj)\n\n        Convert arrow::Tensor to arrow::SparseCSRMatrix\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_15SparseCSRMatrix_11from_tensor = {"from_tensor", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_11from_tensor, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_15SparseCSRMatrix_10from_tensor};
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_11from_tensor(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_obj = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_tensor (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_tensor") < 0)) __PYX_ERR(13, 430, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_obj = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_tensor", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(13, 430, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.SparseCSRMatrix.from_tensor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_10from_tensor(__pyx_v_obj);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_10from_tensor(PyObject *__pyx_v_obj) {
  std::shared_ptr< arrow::SparseCSRMatrix>  __pyx_v_csparse_tensor;
  std::shared_ptr< arrow::Tensor>  __pyx_v_ctensor;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("from_tensor", 0);

  /* "pyarrow/tensor.pxi":435
 *         """
 *         cdef shared_ptr[CSparseCSRMatrix] csparse_tensor
 *         cdef shared_ptr[CTensor] ctensor = pyarrow_unwrap_tensor(obj)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_v_ctensor = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_tensor(__pyx_v_obj);

  /* "pyarrow/tensor.pxi":437
 *         cdef shared_ptr[CTensor] ctensor = pyarrow_unwrap_tensor(obj)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(TensorToSparseCSRMatrix(ctensor, &csparse_tensor))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/tensor.pxi":438
 * 
 *         with nogil:
 *             check_status(TensorToSparseCSRMatrix(ctensor, &csparse_tensor))             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_sparse_csr_matrix(csparse_tensor)
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::TensorToSparseCSRMatrix(__pyx_v_ctensor, (&__pyx_v_csparse_tensor))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(13, 438, __pyx_L4_error)
      }

      /* "pyarrow/tensor.pxi":437
 *         cdef shared_ptr[CTensor] ctensor = pyarrow_unwrap_tensor(obj)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(TensorToSparseCSRMatrix(ctensor, &csparse_tensor))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/tensor.pxi":440
 *             check_status(TensorToSparseCSRMatrix(ctensor, &csparse_tensor))
 * 
 *         return pyarrow_wrap_sparse_csr_matrix(csparse_tensor)             # <<<<<<<<<<<<<<
 * 
 *     def to_numpy(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_sparse_csr_matrix(__pyx_v_csparse_tensor); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 440, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":430
 * 
 *     @staticmethod
 *     def from_tensor(obj):             # <<<<<<<<<<<<<<
 *         """
 *         Convert arrow::Tensor to arrow::SparseCSRMatrix
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.SparseCSRMatrix.from_tensor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":442
 *         return pyarrow_wrap_sparse_csr_matrix(csparse_tensor)
 * 
 *     def to_numpy(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert arrow::SparseCSRMatrix to numpy.ndarrays with zero copy
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_13to_numpy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15SparseCSRMatrix_12to_numpy[] = "SparseCSRMatrix.to_numpy(self)\n\n        Convert arrow::SparseCSRMatrix to numpy.ndarrays with zero copy\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_13to_numpy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_numpy (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_12to_numpy(((struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_12to_numpy(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *__pyx_v_self) {
  PyObject *__pyx_v_out_data;
  PyObject *__pyx_v_out_indptr;
  PyObject *__pyx_v_out_indices;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("to_numpy", 0);

  /* "pyarrow/tensor.pxi":450
 *         cdef PyObject* out_indices
 * 
 *         check_status(SparseCSRMatrixToNdarray(self.sp_sparse_tensor, self,             # <<<<<<<<<<<<<<
 *                                               &out_data, &out_indptr,
 *                                               &out_indices))
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::SparseCSRMatrixToNdarray(__pyx_v_self->sp_sparse_tensor, ((PyObject *)__pyx_v_self), (&__pyx_v_out_data), (&__pyx_v_out_indptr), (&__pyx_v_out_indices))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(13, 450, __pyx_L1_error)

  /* "pyarrow/tensor.pxi":453
 *                                               &out_data, &out_indptr,
 *                                               &out_indices))
 *         return (PyObject_to_object(out_data), PyObject_to_object(out_indptr),             # <<<<<<<<<<<<<<
 *                 PyObject_to_object(out_indices))
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_8includes_6common_PyObject_to_object(__pyx_v_out_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_f_7pyarrow_8includes_6common_PyObject_to_object(__pyx_v_out_indptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "pyarrow/tensor.pxi":454
 *                                               &out_indices))
 *         return (PyObject_to_object(out_data), PyObject_to_object(out_indptr),
 *                 PyObject_to_object(out_indices))             # <<<<<<<<<<<<<<
 * 
 *     def to_scipy(self):
 */
  __pyx_t_4 = __pyx_f_7pyarrow_8includes_6common_PyObject_to_object(__pyx_v_out_indices); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 454, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "pyarrow/tensor.pxi":453
 *                                               &out_data, &out_indptr,
 *                                               &out_indices))
 *         return (PyObject_to_object(out_data), PyObject_to_object(out_indptr),             # <<<<<<<<<<<<<<
 *                 PyObject_to_object(out_indices))
 * 
 */
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":442
 *         return pyarrow_wrap_sparse_csr_matrix(csparse_tensor)
 * 
 *     def to_numpy(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert arrow::SparseCSRMatrix to numpy.ndarrays with zero copy
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.SparseCSRMatrix.to_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":456
 *                 PyObject_to_object(out_indices))
 * 
 *     def to_scipy(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert arrow::SparseCSRMatrix to scipy.sparse.csr_matrix
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_15to_scipy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15SparseCSRMatrix_14to_scipy[] = "SparseCSRMatrix.to_scipy(self)\n\n        Convert arrow::SparseCSRMatrix to scipy.sparse.csr_matrix\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_15to_scipy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_scipy (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_14to_scipy(((struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_14to_scipy(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *__pyx_v_self) {
  PyObject *__pyx_v_csr_matrix = NULL;
  PyObject *__pyx_v_out_data;
  PyObject *__pyx_v_out_indptr;
  PyObject *__pyx_v_out_indices;
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_v_indptr = NULL;
  PyObject *__pyx_v_indices = NULL;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("to_scipy", 0);

  /* "pyarrow/tensor.pxi":460
 *         Convert arrow::SparseCSRMatrix to scipy.sparse.csr_matrix
 *         """
 *         from scipy.sparse import csr_matrix             # <<<<<<<<<<<<<<
 *         cdef PyObject* out_data
 *         cdef PyObject* out_indptr
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_csr_matrix);
  __Pyx_GIVEREF(__pyx_n_s_csr_matrix);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_csr_matrix);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_scipy_sparse, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_csr_matrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_csr_matrix = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/tensor.pxi":465
 *         cdef PyObject* out_indices
 * 
 *         check_status(SparseCSRMatrixToNdarray(self.sp_sparse_tensor, self,             # <<<<<<<<<<<<<<
 *                      &out_data, &out_indptr, &out_indices))
 * 
 */
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::SparseCSRMatrixToNdarray(__pyx_v_self->sp_sparse_tensor, ((PyObject *)__pyx_v_self), (&__pyx_v_out_data), (&__pyx_v_out_indptr), (&__pyx_v_out_indices))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(13, 465, __pyx_L1_error)

  /* "pyarrow/tensor.pxi":468
 *                      &out_data, &out_indptr, &out_indices))
 * 
 *         data = PyObject_to_object(out_data)             # <<<<<<<<<<<<<<
 *         indptr = PyObject_to_object(out_indptr)
 *         indices = PyObject_to_object(out_indices)
 */
  __pyx_t_2 = __pyx_f_7pyarrow_8includes_6common_PyObject_to_object(__pyx_v_out_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_data = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/tensor.pxi":469
 * 
 *         data = PyObject_to_object(out_data)
 *         indptr = PyObject_to_object(out_indptr)             # <<<<<<<<<<<<<<
 *         indices = PyObject_to_object(out_indices)
 *         result = csr_matrix((data[:, 0], indices, indptr), shape=self.shape)
 */
  __pyx_t_2 = __pyx_f_7pyarrow_8includes_6common_PyObject_to_object(__pyx_v_out_indptr); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_indptr = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/tensor.pxi":470
 *         data = PyObject_to_object(out_data)
 *         indptr = PyObject_to_object(out_indptr)
 *         indices = PyObject_to_object(out_indices)             # <<<<<<<<<<<<<<
 *         result = csr_matrix((data[:, 0], indices, indptr), shape=self.shape)
 *         return result
 */
  __pyx_t_2 = __pyx_f_7pyarrow_8includes_6common_PyObject_to_object(__pyx_v_out_indices); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 470, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_indices = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/tensor.pxi":471
 *         indptr = PyObject_to_object(out_indptr)
 *         indices = PyObject_to_object(out_indices)
 *         result = csr_matrix((data[:, 0], indices, indptr), shape=self.shape)             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_data, __pyx_tuple__182); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_indices);
  __Pyx_GIVEREF(__pyx_v_indices);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_indices);
  __Pyx_INCREF(__pyx_v_indptr);
  __Pyx_GIVEREF(__pyx_v_indptr);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_indptr);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_shape, __pyx_t_4) < 0) __PYX_ERR(13, 471, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_csr_matrix, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pyarrow/tensor.pxi":472
 *         indices = PyObject_to_object(out_indices)
 *         result = csr_matrix((data[:, 0], indices, indptr), shape=self.shape)
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def to_tensor(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":456
 *                 PyObject_to_object(out_indices))
 * 
 *     def to_scipy(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert arrow::SparseCSRMatrix to scipy.sparse.csr_matrix
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.SparseCSRMatrix.to_scipy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_csr_matrix);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_indptr);
  __Pyx_XDECREF(__pyx_v_indices);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":474
 *         return result
 * 
 *     def to_tensor(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert arrow::SparseCSRMatrix to arrow::Tensor
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_17to_tensor(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15SparseCSRMatrix_16to_tensor[] = "SparseCSRMatrix.to_tensor(self)\n\n        Convert arrow::SparseCSRMatrix to arrow::Tensor\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_17to_tensor(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_tensor (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_16to_tensor(((struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_16to_tensor(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *__pyx_v_self) {
  std::shared_ptr< arrow::Tensor>  __pyx_v_ctensor;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("to_tensor", 0);

  /* "pyarrow/tensor.pxi":480
 * 
 *         cdef shared_ptr[CTensor] ctensor
 *         check_status(self.stp.ToTensor(&ctensor))             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_tensor(ctensor)
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->stp->ToTensor((&__pyx_v_ctensor))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(13, 480, __pyx_L1_error)

  /* "pyarrow/tensor.pxi":482
 *         check_status(self.stp.ToTensor(&ctensor))
 * 
 *         return pyarrow_wrap_tensor(ctensor)             # <<<<<<<<<<<<<<
 * 
 *     def equals(self, SparseCSRMatrix other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_tensor(__pyx_v_ctensor); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 482, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":474
 *         return result
 * 
 *     def to_tensor(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert arrow::SparseCSRMatrix to arrow::Tensor
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.SparseCSRMatrix.to_tensor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":484
 *         return pyarrow_wrap_tensor(ctensor)
 * 
 *     def equals(self, SparseCSRMatrix other):             # <<<<<<<<<<<<<<
 *         """
 *         Return true if sparse tensors contains exactly equal data
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_19equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15SparseCSRMatrix_18equals[] = "SparseCSRMatrix.equals(self, SparseCSRMatrix other)\n\n        Return true if sparse tensors contains exactly equal data\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_19equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("equals (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_7pyarrow_3lib_SparseCSRMatrix, 1, "other", 0))) __PYX_ERR(13, 484, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_18equals(((struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_18equals(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("equals", 0);

  /* "pyarrow/tensor.pxi":488
 *         Return true if sparse tensors contains exactly equal data
 *         """
 *         return self.stp.Equals(deref(other.stp))             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->stp->Equals((*__pyx_v_other->stp))); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":484
 *         return pyarrow_wrap_tensor(ctensor)
 * 
 *     def equals(self, SparseCSRMatrix other):             # <<<<<<<<<<<<<<
 *         """
 *         Return true if sparse tensors contains exactly equal data
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.SparseCSRMatrix.equals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":490
 *         return self.stp.Equals(deref(other.stp))
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         if isinstance(other, SparseCSRMatrix):
 *             return self.equals(other)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_21__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_21__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_20__eq__(((struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_other));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_20__eq__(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__eq__", 0);

  /* "pyarrow/tensor.pxi":491
 * 
 *     def __eq__(self, other):
 *         if isinstance(other, SparseCSRMatrix):             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         else:
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_7pyarrow_3lib_SparseCSRMatrix); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/tensor.pxi":492
 *     def __eq__(self, other):
 *         if isinstance(other, SparseCSRMatrix):
 *             return self.equals(other)             # <<<<<<<<<<<<<<
 *         else:
 *             return NotImplemented
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_equals); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 492, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_other) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_other);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 492, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "pyarrow/tensor.pxi":491
 * 
 *     def __eq__(self, other):
 *         if isinstance(other, SparseCSRMatrix):             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         else:
 */
  }

  /* "pyarrow/tensor.pxi":494
 *             return self.equals(other)
 *         else:
 *             return NotImplemented             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_builtin_NotImplemented);
    __pyx_r = __pyx_builtin_NotImplemented;
    goto __pyx_L0;
  }

  /* "pyarrow/tensor.pxi":490
 *         return self.stp.Equals(deref(other.stp))
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         if isinstance(other, SparseCSRMatrix):
 *             return self.equals(other)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.SparseCSRMatrix.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":497
 * 
 *     @property
 *     def is_mutable(self):             # <<<<<<<<<<<<<<
 *         return self.stp.is_mutable()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_10is_mutable_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_10is_mutable_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_10is_mutable___get__(((struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_10is_mutable___get__(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/tensor.pxi":498
 *     @property
 *     def is_mutable(self):
 *         return self.stp.is_mutable()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->stp->is_mutable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":497
 * 
 *     @property
 *     def is_mutable(self):             # <<<<<<<<<<<<<<
 *         return self.stp.is_mutable()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.SparseCSRMatrix.is_mutable.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":501
 * 
 *     @property
 *     def ndim(self):             # <<<<<<<<<<<<<<
 *         return self.stp.ndim()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_4ndim_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_4ndim___get__(((struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_4ndim___get__(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/tensor.pxi":502
 *     @property
 *     def ndim(self):
 *         return self.stp.ndim()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->stp->ndim()); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":501
 * 
 *     @property
 *     def ndim(self):             # <<<<<<<<<<<<<<
 *         return self.stp.ndim()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.SparseCSRMatrix.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":505
 * 
 *     @property
 *     def shape(self):             # <<<<<<<<<<<<<<
 *         # Cython knows how to convert a vector[T] to a Python list
 *         return tuple(self.stp.shape())
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_5shape_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_5shape___get__(((struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_5shape___get__(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/tensor.pxi":507
 *     def shape(self):
 *         # Cython knows how to convert a vector[T] to a Python list
 *         return tuple(self.stp.shape())             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_vector_to_py_int64_t(__pyx_v_self->stp->shape()); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":505
 * 
 *     @property
 *     def shape(self):             # <<<<<<<<<<<<<<
 *         # Cython knows how to convert a vector[T] to a Python list
 *         return tuple(self.stp.shape())
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.SparseCSRMatrix.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":510
 * 
 *     @property
 *     def size(self):             # <<<<<<<<<<<<<<
 *         return self.stp.size()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_4size_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_4size___get__(((struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_4size___get__(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/tensor.pxi":511
 *     @property
 *     def size(self):
 *         return self.stp.size()             # <<<<<<<<<<<<<<
 * 
 *     def dim_name(self, i):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->stp->size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":510
 * 
 *     @property
 *     def size(self):             # <<<<<<<<<<<<<<
 *         return self.stp.size()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.SparseCSRMatrix.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":513
 *         return self.stp.size()
 * 
 *     def dim_name(self, i):             # <<<<<<<<<<<<<<
 *         return frombytes(self.stp.dim_name(i))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_23dim_name(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15SparseCSRMatrix_22dim_name[] = "SparseCSRMatrix.dim_name(self, i)";
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_23dim_name(PyObject *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dim_name (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_22dim_name(((struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_i));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_22dim_name(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("dim_name", 0);

  /* "pyarrow/tensor.pxi":514
 * 
 *     def dim_name(self, i):
 *         return frombytes(self.stp.dim_name(i))             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_i); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(13, 514, __pyx_L1_error)
  __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_self->stp->dim_name(__pyx_t_3)); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":513
 *         return self.stp.size()
 * 
 *     def dim_name(self, i):             # <<<<<<<<<<<<<<
 *         return frombytes(self.stp.dim_name(i))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.SparseCSRMatrix.dim_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":517
 * 
 *     @property
 *     def dim_names(self):             # <<<<<<<<<<<<<<
 *         return tuple(frombytes(x) for x in tuple(self.stp.dim_names()))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_9dim_names_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_9dim_names_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_9dim_names___get__(((struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pyarrow_3lib_15SparseCSRMatrix_9dim_names_7__get___2generator14(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/tensor.pxi":518
 *     @property
 *     def dim_names(self):
 *         return tuple(frombytes(x) for x in tuple(self.stp.dim_names()))             # <<<<<<<<<<<<<<
 * 
 *     @property
 */

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_9dim_names_7__get___genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_16_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_16_genexpr *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_16_genexpr(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_16_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_16_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(13, 518, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_15___get__ *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7pyarrow_3lib_15SparseCSRMatrix_9dim_names_7__get___2generator14, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_SparseCSRMatrix___get___locals_g, __pyx_n_s_pyarrow_lib); if (unlikely(!gen)) __PYX_ERR(13, 518, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.SparseCSRMatrix.dim_names.__get__.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7pyarrow_3lib_15SparseCSRMatrix_9dim_names_7__get___2generator14(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_16_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_16_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(13, 518, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(13, 518, __pyx_L1_error) }
  __pyx_t_1 = __pyx_convert_vector_to_py_std_3a__3a_string(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->stp->dim_names()); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(13, 518, __pyx_L1_error)
    #else
    __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 518, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_x);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_x, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 518, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_cur_scope->__pyx_v_x) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_cur_scope->__pyx_v_x);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 518, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(13, 518, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":517
 * 
 *     @property
 *     def dim_names(self):             # <<<<<<<<<<<<<<
 *         return tuple(frombytes(x) for x in tuple(self.stp.dim_names()))
 * 
 */

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_9dim_names___get__(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_15___get__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_15___get__ *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_15___get__(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_15___get__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_15___get__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(13, 517, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);

  /* "pyarrow/tensor.pxi":518
 *     @property
 *     def dim_names(self):
 *         return tuple(frombytes(x) for x in tuple(self.stp.dim_names()))             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_9dim_names_7__get___genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":517
 * 
 *     @property
 *     def dim_names(self):             # <<<<<<<<<<<<<<
 *         return tuple(frombytes(x) for x in tuple(self.stp.dim_names()))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.SparseCSRMatrix.dim_names.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/tensor.pxi":521
 * 
 *     @property
 *     def non_zero_length(self):             # <<<<<<<<<<<<<<
 *         return self.stp.non_zero_length()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_15non_zero_length_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_15non_zero_length_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_15non_zero_length___get__(((struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_15non_zero_length___get__(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/tensor.pxi":522
 *     @property
 *     def non_zero_length(self):
 *         return self.stp.non_zero_length()             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->stp->non_zero_length()); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/tensor.pxi":521
 * 
 *     @property
 *     def non_zero_length(self):             # <<<<<<<<<<<<<<
 *         return self.stp.non_zero_length()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.SparseCSRMatrix.non_zero_length.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/lib.pxd":303
 * 
 *     cdef readonly:
 *         DataType type             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CSparseCSRMatrix]& sp_sparse_tensor)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_4type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_4type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_4type___get__(((struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_4type___get__(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->type));
  __pyx_r = ((PyObject *)__pyx_v_self->type);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_25__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15SparseCSRMatrix_24__reduce_cython__[] = "SparseCSRMatrix.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_25__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_24__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_24__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__189, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.SparseCSRMatrix.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_27__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15SparseCSRMatrix_26__setstate_cython__[] = "SparseCSRMatrix.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_27__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_26__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15SparseCSRMatrix_26__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__190, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.SparseCSRMatrix.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/compute.pxi":23
 *     __slots__ = ()  # avoid mistakingly creating attributes
 * 
 *     def __init__(self, allow_int_overflow=None,             # <<<<<<<<<<<<<<
 *                  allow_time_truncate=None, allow_time_overflow=None,
 *                  allow_float_truncate=None, allow_invalid_utf8=None):
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_11CastOptions_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_11CastOptions_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_allow_int_overflow = 0;
  PyObject *__pyx_v_allow_time_truncate = 0;
  PyObject *__pyx_v_allow_time_overflow = 0;
  PyObject *__pyx_v_allow_float_truncate = 0;
  PyObject *__pyx_v_allow_invalid_utf8 = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_allow_int_overflow,&__pyx_n_s_allow_time_truncate,&__pyx_n_s_allow_time_overflow,&__pyx_n_s_allow_float_truncate,&__pyx_n_s_allow_invalid_utf8,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[0] = ((PyObject *)Py_None);

    /* "pyarrow/compute.pxi":24
 * 
 *     def __init__(self, allow_int_overflow=None,
 *                  allow_time_truncate=None, allow_time_overflow=None,             # <<<<<<<<<<<<<<
 *                  allow_float_truncate=None, allow_invalid_utf8=None):
 *         if allow_int_overflow is not None:
 */
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_None);

    /* "pyarrow/compute.pxi":25
 *     def __init__(self, allow_int_overflow=None,
 *                  allow_time_truncate=None, allow_time_overflow=None,
 *                  allow_float_truncate=None, allow_invalid_utf8=None):             # <<<<<<<<<<<<<<
 *         if allow_int_overflow is not None:
 *             self.allow_int_overflow = allow_int_overflow
 */
    values[3] = ((PyObject *)Py_None);
    values[4] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allow_int_overflow);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allow_time_truncate);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allow_time_overflow);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allow_float_truncate);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allow_invalid_utf8);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(14, 23, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_allow_int_overflow = values[0];
    __pyx_v_allow_time_truncate = values[1];
    __pyx_v_allow_time_overflow = values[2];
    __pyx_v_allow_float_truncate = values[3];
    __pyx_v_allow_invalid_utf8 = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(14, 23, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.CastOptions.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_11CastOptions___init__(((struct __pyx_obj_7pyarrow_3lib_CastOptions *)__pyx_v_self), __pyx_v_allow_int_overflow, __pyx_v_allow_time_truncate, __pyx_v_allow_time_overflow, __pyx_v_allow_float_truncate, __pyx_v_allow_invalid_utf8);

  /* "pyarrow/compute.pxi":23
 *     __slots__ = ()  # avoid mistakingly creating attributes
 * 
 *     def __init__(self, allow_int_overflow=None,             # <<<<<<<<<<<<<<
 *                  allow_time_truncate=None, allow_time_overflow=None,
 *                  allow_float_truncate=None, allow_invalid_utf8=None):
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_11CastOptions___init__(struct __pyx_obj_7pyarrow_3lib_CastOptions *__pyx_v_self, PyObject *__pyx_v_allow_int_overflow, PyObject *__pyx_v_allow_time_truncate, PyObject *__pyx_v_allow_time_overflow, PyObject *__pyx_v_allow_float_truncate, PyObject *__pyx_v_allow_invalid_utf8) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/compute.pxi":26
 *                  allow_time_truncate=None, allow_time_overflow=None,
 *                  allow_float_truncate=None, allow_invalid_utf8=None):
 *         if allow_int_overflow is not None:             # <<<<<<<<<<<<<<
 *             self.allow_int_overflow = allow_int_overflow
 *         if allow_time_truncate is not None:
 */
  __pyx_t_1 = (__pyx_v_allow_int_overflow != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/compute.pxi":27
 *                  allow_float_truncate=None, allow_invalid_utf8=None):
 *         if allow_int_overflow is not None:
 *             self.allow_int_overflow = allow_int_overflow             # <<<<<<<<<<<<<<
 *         if allow_time_truncate is not None:
 *             self.allow_time_truncate = allow_time_truncate
 */
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_allow_int_overflow, __pyx_v_allow_int_overflow) < 0) __PYX_ERR(14, 27, __pyx_L1_error)

    /* "pyarrow/compute.pxi":26
 *                  allow_time_truncate=None, allow_time_overflow=None,
 *                  allow_float_truncate=None, allow_invalid_utf8=None):
 *         if allow_int_overflow is not None:             # <<<<<<<<<<<<<<
 *             self.allow_int_overflow = allow_int_overflow
 *         if allow_time_truncate is not None:
 */
  }

  /* "pyarrow/compute.pxi":28
 *         if allow_int_overflow is not None:
 *             self.allow_int_overflow = allow_int_overflow
 *         if allow_time_truncate is not None:             # <<<<<<<<<<<<<<
 *             self.allow_time_truncate = allow_time_truncate
 *         if allow_time_overflow is not None:
 */
  __pyx_t_2 = (__pyx_v_allow_time_truncate != Py_None);
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pyarrow/compute.pxi":29
 *             self.allow_int_overflow = allow_int_overflow
 *         if allow_time_truncate is not None:
 *             self.allow_time_truncate = allow_time_truncate             # <<<<<<<<<<<<<<
 *         if allow_time_overflow is not None:
 *             self.allow_time_overflow = allow_time_overflow
 */
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_allow_time_truncate, __pyx_v_allow_time_truncate) < 0) __PYX_ERR(14, 29, __pyx_L1_error)

    /* "pyarrow/compute.pxi":28
 *         if allow_int_overflow is not None:
 *             self.allow_int_overflow = allow_int_overflow
 *         if allow_time_truncate is not None:             # <<<<<<<<<<<<<<
 *             self.allow_time_truncate = allow_time_truncate
 *         if allow_time_overflow is not None:
 */
  }

  /* "pyarrow/compute.pxi":30
 *         if allow_time_truncate is not None:
 *             self.allow_time_truncate = allow_time_truncate
 *         if allow_time_overflow is not None:             # <<<<<<<<<<<<<<
 *             self.allow_time_overflow = allow_time_overflow
 *         if allow_float_truncate is not None:
 */
  __pyx_t_1 = (__pyx_v_allow_time_overflow != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/compute.pxi":31
 *             self.allow_time_truncate = allow_time_truncate
 *         if allow_time_overflow is not None:
 *             self.allow_time_overflow = allow_time_overflow             # <<<<<<<<<<<<<<
 *         if allow_float_truncate is not None:
 *             self.allow_float_truncate = allow_float_truncate
 */
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_allow_time_overflow, __pyx_v_allow_time_overflow) < 0) __PYX_ERR(14, 31, __pyx_L1_error)

    /* "pyarrow/compute.pxi":30
 *         if allow_time_truncate is not None:
 *             self.allow_time_truncate = allow_time_truncate
 *         if allow_time_overflow is not None:             # <<<<<<<<<<<<<<
 *             self.allow_time_overflow = allow_time_overflow
 *         if allow_float_truncate is not None:
 */
  }

  /* "pyarrow/compute.pxi":32
 *         if allow_time_overflow is not None:
 *             self.allow_time_overflow = allow_time_overflow
 *         if allow_float_truncate is not None:             # <<<<<<<<<<<<<<
 *             self.allow_float_truncate = allow_float_truncate
 *         if allow_invalid_utf8 is not None:
 */
  __pyx_t_2 = (__pyx_v_allow_float_truncate != Py_None);
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pyarrow/compute.pxi":33
 *             self.allow_time_overflow = allow_time_overflow
 *         if allow_float_truncate is not None:
 *             self.allow_float_truncate = allow_float_truncate             # <<<<<<<<<<<<<<
 *         if allow_invalid_utf8 is not None:
 *             self.allow_invalid_utf8 = allow_invalid_utf8
 */
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_allow_float_truncate, __pyx_v_allow_float_truncate) < 0) __PYX_ERR(14, 33, __pyx_L1_error)

    /* "pyarrow/compute.pxi":32
 *         if allow_time_overflow is not None:
 *             self.allow_time_overflow = allow_time_overflow
 *         if allow_float_truncate is not None:             # <<<<<<<<<<<<<<
 *             self.allow_float_truncate = allow_float_truncate
 *         if allow_invalid_utf8 is not None:
 */
  }

  /* "pyarrow/compute.pxi":34
 *         if allow_float_truncate is not None:
 *             self.allow_float_truncate = allow_float_truncate
 *         if allow_invalid_utf8 is not None:             # <<<<<<<<<<<<<<
 *             self.allow_invalid_utf8 = allow_invalid_utf8
 * 
 */
  __pyx_t_1 = (__pyx_v_allow_invalid_utf8 != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/compute.pxi":35
 *             self.allow_float_truncate = allow_float_truncate
 *         if allow_invalid_utf8 is not None:
 *             self.allow_invalid_utf8 = allow_invalid_utf8             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_allow_invalid_utf8, __pyx_v_allow_invalid_utf8) < 0) __PYX_ERR(14, 35, __pyx_L1_error)

    /* "pyarrow/compute.pxi":34
 *         if allow_float_truncate is not None:
 *             self.allow_float_truncate = allow_float_truncate
 *         if allow_invalid_utf8 is not None:             # <<<<<<<<<<<<<<
 *             self.allow_invalid_utf8 = allow_invalid_utf8
 * 
 */
  }

  /* "pyarrow/compute.pxi":23
 *     __slots__ = ()  # avoid mistakingly creating attributes
 * 
 *     def __init__(self, allow_int_overflow=None,             # <<<<<<<<<<<<<<
 *                  allow_time_truncate=None, allow_time_overflow=None,
 *                  allow_float_truncate=None, allow_invalid_utf8=None):
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.CastOptions.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/compute.pxi":38
 * 
 *     @staticmethod
 *     cdef wrap(CCastOptions options):             # <<<<<<<<<<<<<<
 *         cdef CastOptions self = CastOptions.__new__(CastOptions)
 *         self.options = options
 */

static PyObject *__pyx_f_7pyarrow_3lib_11CastOptions_wrap( arrow::compute::CastOptions __pyx_v_options) {
  struct __pyx_obj_7pyarrow_3lib_CastOptions *__pyx_v_self = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("wrap", 0);

  /* "pyarrow/compute.pxi":39
 *     @staticmethod
 *     cdef wrap(CCastOptions options):
 *         cdef CastOptions self = CastOptions.__new__(CastOptions)             # <<<<<<<<<<<<<<
 *         self.options = options
 *         return self
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_CastOptions(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_CastOptions), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 39, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_self = ((struct __pyx_obj_7pyarrow_3lib_CastOptions *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/compute.pxi":40
 *     cdef wrap(CCastOptions options):
 *         cdef CastOptions self = CastOptions.__new__(CastOptions)
 *         self.options = options             # <<<<<<<<<<<<<<
 *         return self
 * 
 */
  __pyx_v_self->options = __pyx_v_options;

  /* "pyarrow/compute.pxi":41
 *         cdef CastOptions self = CastOptions.__new__(CastOptions)
 *         self.options = options
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pyarrow/compute.pxi":38
 * 
 *     @staticmethod
 *     cdef wrap(CCastOptions options):             # <<<<<<<<<<<<<<
 *         cdef CastOptions self = CastOptions.__new__(CastOptions)
 *         self.options = options
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.CastOptions.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/compute.pxi":44
 * 
 *     @staticmethod
 *     def safe():             # <<<<<<<<<<<<<<
 *         return CastOptions.wrap(CCastOptions.Safe())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11CastOptions_3safe(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11CastOptions_2safe[] = "CastOptions.safe()";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_11CastOptions_3safe = {"safe", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_11CastOptions_3safe, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_11CastOptions_2safe};
static PyObject *__pyx_pw_7pyarrow_3lib_11CastOptions_3safe(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("safe (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("safe", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "safe", 0))) return NULL;
  __pyx_r = __pyx_pf_7pyarrow_3lib_11CastOptions_2safe();

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11CastOptions_2safe(void) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("safe", 0);

  /* "pyarrow/compute.pxi":45
 *     @staticmethod
 *     def safe():
 *         return CastOptions.wrap(CCastOptions.Safe())             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_11CastOptions_wrap( arrow::compute::CastOptions::Safe()); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/compute.pxi":44
 * 
 *     @staticmethod
 *     def safe():             # <<<<<<<<<<<<<<
 *         return CastOptions.wrap(CCastOptions.Safe())
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.CastOptions.safe", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/compute.pxi":48
 * 
 *     @staticmethod
 *     def unsafe():             # <<<<<<<<<<<<<<
 *         return CastOptions.wrap(CCastOptions.Unsafe())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11CastOptions_5unsafe(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11CastOptions_4unsafe[] = "CastOptions.unsafe()";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_11CastOptions_5unsafe = {"unsafe", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_11CastOptions_5unsafe, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_11CastOptions_4unsafe};
static PyObject *__pyx_pw_7pyarrow_3lib_11CastOptions_5unsafe(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("unsafe (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("unsafe", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "unsafe", 0))) return NULL;
  __pyx_r = __pyx_pf_7pyarrow_3lib_11CastOptions_4unsafe();

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11CastOptions_4unsafe(void) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("unsafe", 0);

  /* "pyarrow/compute.pxi":49
 *     @staticmethod
 *     def unsafe():
 *         return CastOptions.wrap(CCastOptions.Unsafe())             # <<<<<<<<<<<<<<
 * 
 *     cdef inline CCastOptions unwrap(self) nogil:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_11CastOptions_wrap( arrow::compute::CastOptions::Unsafe()); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/compute.pxi":48
 * 
 *     @staticmethod
 *     def unsafe():             # <<<<<<<<<<<<<<
 *         return CastOptions.wrap(CCastOptions.Unsafe())
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.CastOptions.unsafe", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/compute.pxi":51
 *         return CastOptions.wrap(CCastOptions.Unsafe())
 * 
 *     cdef inline CCastOptions unwrap(self) nogil:             # <<<<<<<<<<<<<<
 *         return self.options
 * 
 */

static CYTHON_INLINE  arrow::compute::CastOptions __pyx_f_7pyarrow_3lib_11CastOptions_unwrap(struct __pyx_obj_7pyarrow_3lib_CastOptions *__pyx_v_self) {
   arrow::compute::CastOptions __pyx_r;

  /* "pyarrow/compute.pxi":52
 * 
 *     cdef inline CCastOptions unwrap(self) nogil:
 *         return self.options             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_r = __pyx_v_self->options;
  goto __pyx_L0;

  /* "pyarrow/compute.pxi":51
 *         return CastOptions.wrap(CCastOptions.Unsafe())
 * 
 *     cdef inline CCastOptions unwrap(self) nogil:             # <<<<<<<<<<<<<<
 *         return self.options
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "pyarrow/compute.pxi":55
 * 
 *     @property
 *     def allow_int_overflow(self):             # <<<<<<<<<<<<<<
 *         return self.options.allow_int_overflow
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11CastOptions_18allow_int_overflow_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_11CastOptions_18allow_int_overflow_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11CastOptions_18allow_int_overflow___get__(((struct __pyx_obj_7pyarrow_3lib_CastOptions *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11CastOptions_18allow_int_overflow___get__(struct __pyx_obj_7pyarrow_3lib_CastOptions *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/compute.pxi":56
 *     @property
 *     def allow_int_overflow(self):
 *         return self.options.allow_int_overflow             # <<<<<<<<<<<<<<
 * 
 *     @allow_int_overflow.setter
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->options.allow_int_overflow); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/compute.pxi":55
 * 
 *     @property
 *     def allow_int_overflow(self):             # <<<<<<<<<<<<<<
 *         return self.options.allow_int_overflow
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.CastOptions.allow_int_overflow.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/compute.pxi":59
 * 
 *     @allow_int_overflow.setter
 *     def allow_int_overflow(self, bint flag):             # <<<<<<<<<<<<<<
 *         self.options.allow_int_overflow = flag
 * 
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_11CastOptions_18allow_int_overflow_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_flag); /*proto*/
static int __pyx_pw_7pyarrow_3lib_11CastOptions_18allow_int_overflow_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_flag) {
  int __pyx_v_flag;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  assert(__pyx_arg_flag); {
    __pyx_v_flag = __Pyx_PyObject_IsTrue(__pyx_arg_flag); if (unlikely((__pyx_v_flag == (int)-1) && PyErr_Occurred())) __PYX_ERR(14, 59, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.CastOptions.allow_int_overflow.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_11CastOptions_18allow_int_overflow_2__set__(((struct __pyx_obj_7pyarrow_3lib_CastOptions *)__pyx_v_self), ((int)__pyx_v_flag));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_11CastOptions_18allow_int_overflow_2__set__(struct __pyx_obj_7pyarrow_3lib_CastOptions *__pyx_v_self, int __pyx_v_flag) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "pyarrow/compute.pxi":60
 *     @allow_int_overflow.setter
 *     def allow_int_overflow(self, bint flag):
 *         self.options.allow_int_overflow = flag             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_v_self->options.allow_int_overflow = __pyx_v_flag;

  /* "pyarrow/compute.pxi":59
 * 
 *     @allow_int_overflow.setter
 *     def allow_int_overflow(self, bint flag):             # <<<<<<<<<<<<<<
 *         self.options.allow_int_overflow = flag
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/compute.pxi":63
 * 
 *     @property
 *     def allow_time_truncate(self):             # <<<<<<<<<<<<<<
 *         return self.options.allow_time_truncate
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11CastOptions_19allow_time_truncate_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_11CastOptions_19allow_time_truncate_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11CastOptions_19allow_time_truncate___get__(((struct __pyx_obj_7pyarrow_3lib_CastOptions *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11CastOptions_19allow_time_truncate___get__(struct __pyx_obj_7pyarrow_3lib_CastOptions *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/compute.pxi":64
 *     @property
 *     def allow_time_truncate(self):
 *         return self.options.allow_time_truncate             # <<<<<<<<<<<<<<
 * 
 *     @allow_time_truncate.setter
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->options.allow_time_truncate); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/compute.pxi":63
 * 
 *     @property
 *     def allow_time_truncate(self):             # <<<<<<<<<<<<<<
 *         return self.options.allow_time_truncate
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.CastOptions.allow_time_truncate.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/compute.pxi":67
 * 
 *     @allow_time_truncate.setter
 *     def allow_time_truncate(self, bint flag):             # <<<<<<<<<<<<<<
 *         self.options.allow_time_truncate = flag
 * 
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_11CastOptions_19allow_time_truncate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_flag); /*proto*/
static int __pyx_pw_7pyarrow_3lib_11CastOptions_19allow_time_truncate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_flag) {
  int __pyx_v_flag;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  assert(__pyx_arg_flag); {
    __pyx_v_flag = __Pyx_PyObject_IsTrue(__pyx_arg_flag); if (unlikely((__pyx_v_flag == (int)-1) && PyErr_Occurred())) __PYX_ERR(14, 67, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.CastOptions.allow_time_truncate.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_11CastOptions_19allow_time_truncate_2__set__(((struct __pyx_obj_7pyarrow_3lib_CastOptions *)__pyx_v_self), ((int)__pyx_v_flag));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_11CastOptions_19allow_time_truncate_2__set__(struct __pyx_obj_7pyarrow_3lib_CastOptions *__pyx_v_self, int __pyx_v_flag) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "pyarrow/compute.pxi":68
 *     @allow_time_truncate.setter
 *     def allow_time_truncate(self, bint flag):
 *         self.options.allow_time_truncate = flag             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_v_self->options.allow_time_truncate = __pyx_v_flag;

  /* "pyarrow/compute.pxi":67
 * 
 *     @allow_time_truncate.setter
 *     def allow_time_truncate(self, bint flag):             # <<<<<<<<<<<<<<
 *         self.options.allow_time_truncate = flag
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/compute.pxi":71
 * 
 *     @property
 *     def allow_time_overflow(self):             # <<<<<<<<<<<<<<
 *         return self.options.allow_time_overflow
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11CastOptions_19allow_time_overflow_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_11CastOptions_19allow_time_overflow_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11CastOptions_19allow_time_overflow___get__(((struct __pyx_obj_7pyarrow_3lib_CastOptions *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11CastOptions_19allow_time_overflow___get__(struct __pyx_obj_7pyarrow_3lib_CastOptions *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/compute.pxi":72
 *     @property
 *     def allow_time_overflow(self):
 *         return self.options.allow_time_overflow             # <<<<<<<<<<<<<<
 * 
 *     @allow_time_overflow.setter
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->options.allow_time_overflow); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/compute.pxi":71
 * 
 *     @property
 *     def allow_time_overflow(self):             # <<<<<<<<<<<<<<
 *         return self.options.allow_time_overflow
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.CastOptions.allow_time_overflow.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/compute.pxi":75
 * 
 *     @allow_time_overflow.setter
 *     def allow_time_overflow(self, bint flag):             # <<<<<<<<<<<<<<
 *         self.options.allow_time_overflow = flag
 * 
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_11CastOptions_19allow_time_overflow_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_flag); /*proto*/
static int __pyx_pw_7pyarrow_3lib_11CastOptions_19allow_time_overflow_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_flag) {
  int __pyx_v_flag;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  assert(__pyx_arg_flag); {
    __pyx_v_flag = __Pyx_PyObject_IsTrue(__pyx_arg_flag); if (unlikely((__pyx_v_flag == (int)-1) && PyErr_Occurred())) __PYX_ERR(14, 75, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.CastOptions.allow_time_overflow.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_11CastOptions_19allow_time_overflow_2__set__(((struct __pyx_obj_7pyarrow_3lib_CastOptions *)__pyx_v_self), ((int)__pyx_v_flag));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_11CastOptions_19allow_time_overflow_2__set__(struct __pyx_obj_7pyarrow_3lib_CastOptions *__pyx_v_self, int __pyx_v_flag) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "pyarrow/compute.pxi":76
 *     @allow_time_overflow.setter
 *     def allow_time_overflow(self, bint flag):
 *         self.options.allow_time_overflow = flag             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_v_self->options.allow_time_overflow = __pyx_v_flag;

  /* "pyarrow/compute.pxi":75
 * 
 *     @allow_time_overflow.setter
 *     def allow_time_overflow(self, bint flag):             # <<<<<<<<<<<<<<
 *         self.options.allow_time_overflow = flag
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/compute.pxi":79
 * 
 *     @property
 *     def allow_float_truncate(self):             # <<<<<<<<<<<<<<
 *         return self.options.allow_float_truncate
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11CastOptions_20allow_float_truncate_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_11CastOptions_20allow_float_truncate_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11CastOptions_20allow_float_truncate___get__(((struct __pyx_obj_7pyarrow_3lib_CastOptions *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11CastOptions_20allow_float_truncate___get__(struct __pyx_obj_7pyarrow_3lib_CastOptions *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/compute.pxi":80
 *     @property
 *     def allow_float_truncate(self):
 *         return self.options.allow_float_truncate             # <<<<<<<<<<<<<<
 * 
 *     @allow_float_truncate.setter
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->options.allow_float_truncate); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/compute.pxi":79
 * 
 *     @property
 *     def allow_float_truncate(self):             # <<<<<<<<<<<<<<
 *         return self.options.allow_float_truncate
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.CastOptions.allow_float_truncate.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/compute.pxi":83
 * 
 *     @allow_float_truncate.setter
 *     def allow_float_truncate(self, bint flag):             # <<<<<<<<<<<<<<
 *         self.options.allow_float_truncate = flag
 * 
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_11CastOptions_20allow_float_truncate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_flag); /*proto*/
static int __pyx_pw_7pyarrow_3lib_11CastOptions_20allow_float_truncate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_flag) {
  int __pyx_v_flag;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  assert(__pyx_arg_flag); {
    __pyx_v_flag = __Pyx_PyObject_IsTrue(__pyx_arg_flag); if (unlikely((__pyx_v_flag == (int)-1) && PyErr_Occurred())) __PYX_ERR(14, 83, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.CastOptions.allow_float_truncate.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_11CastOptions_20allow_float_truncate_2__set__(((struct __pyx_obj_7pyarrow_3lib_CastOptions *)__pyx_v_self), ((int)__pyx_v_flag));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_11CastOptions_20allow_float_truncate_2__set__(struct __pyx_obj_7pyarrow_3lib_CastOptions *__pyx_v_self, int __pyx_v_flag) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "pyarrow/compute.pxi":84
 *     @allow_float_truncate.setter
 *     def allow_float_truncate(self, bint flag):
 *         self.options.allow_float_truncate = flag             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_v_self->options.allow_float_truncate = __pyx_v_flag;

  /* "pyarrow/compute.pxi":83
 * 
 *     @allow_float_truncate.setter
 *     def allow_float_truncate(self, bint flag):             # <<<<<<<<<<<<<<
 *         self.options.allow_float_truncate = flag
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/compute.pxi":87
 * 
 *     @property
 *     def allow_invalid_utf8(self):             # <<<<<<<<<<<<<<
 *         return self.options.allow_invalid_utf8
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11CastOptions_18allow_invalid_utf8_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_11CastOptions_18allow_invalid_utf8_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11CastOptions_18allow_invalid_utf8___get__(((struct __pyx_obj_7pyarrow_3lib_CastOptions *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11CastOptions_18allow_invalid_utf8___get__(struct __pyx_obj_7pyarrow_3lib_CastOptions *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/compute.pxi":88
 *     @property
 *     def allow_invalid_utf8(self):
 *         return self.options.allow_invalid_utf8             # <<<<<<<<<<<<<<
 * 
 *     @allow_invalid_utf8.setter
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->options.allow_invalid_utf8); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/compute.pxi":87
 * 
 *     @property
 *     def allow_invalid_utf8(self):             # <<<<<<<<<<<<<<
 *         return self.options.allow_invalid_utf8
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.CastOptions.allow_invalid_utf8.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/compute.pxi":91
 * 
 *     @allow_invalid_utf8.setter
 *     def allow_invalid_utf8(self, bint flag):             # <<<<<<<<<<<<<<
 *         self.options.allow_invalid_utf8 = flag
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_11CastOptions_18allow_invalid_utf8_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_flag); /*proto*/
static int __pyx_pw_7pyarrow_3lib_11CastOptions_18allow_invalid_utf8_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_flag) {
  int __pyx_v_flag;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  assert(__pyx_arg_flag); {
    __pyx_v_flag = __Pyx_PyObject_IsTrue(__pyx_arg_flag); if (unlikely((__pyx_v_flag == (int)-1) && PyErr_Occurred())) __PYX_ERR(14, 91, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.CastOptions.allow_invalid_utf8.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_11CastOptions_18allow_invalid_utf8_2__set__(((struct __pyx_obj_7pyarrow_3lib_CastOptions *)__pyx_v_self), ((int)__pyx_v_flag));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_11CastOptions_18allow_invalid_utf8_2__set__(struct __pyx_obj_7pyarrow_3lib_CastOptions *__pyx_v_self, int __pyx_v_flag) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "pyarrow/compute.pxi":92
 *     @allow_invalid_utf8.setter
 *     def allow_invalid_utf8(self, bint flag):
 *         self.options.allow_invalid_utf8 = flag             # <<<<<<<<<<<<<<
 */
  __pyx_v_self->options.allow_invalid_utf8 = __pyx_v_flag;

  /* "pyarrow/compute.pxi":91
 * 
 *     @allow_invalid_utf8.setter
 *     def allow_invalid_utf8(self, bint flag):             # <<<<<<<<<<<<<<
 *         self.options.allow_invalid_utf8 = flag
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.options cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11CastOptions_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11CastOptions_6__reduce_cython__[] = "CastOptions.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11CastOptions_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11CastOptions_6__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_CastOptions *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11CastOptions_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_CastOptions *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.options cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.options cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__191, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.options cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.CastOptions.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.options cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.options cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11CastOptions_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11CastOptions_8__setstate_cython__[] = "CastOptions.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11CastOptions_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_11CastOptions_8__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_CastOptions *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_11CastOptions_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_CastOptions *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.options cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.options cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__192, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.options cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.options cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.CastOptions.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":62
 *     """
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.own_file = False
 *         self.is_readable = False
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_10NativeFile_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_10NativeFile_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile___cinit__(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_10NativeFile___cinit__(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/io.pxi":63
 * 
 *     def __cinit__(self):
 *         self.own_file = False             # <<<<<<<<<<<<<<
 *         self.is_readable = False
 *         self.is_writable = False
 */
  __pyx_v_self->own_file = 0;

  /* "pyarrow/io.pxi":64
 *     def __cinit__(self):
 *         self.own_file = False
 *         self.is_readable = False             # <<<<<<<<<<<<<<
 *         self.is_writable = False
 *         self.is_seekable = False
 */
  __pyx_v_self->is_readable = 0;

  /* "pyarrow/io.pxi":65
 *         self.own_file = False
 *         self.is_readable = False
 *         self.is_writable = False             # <<<<<<<<<<<<<<
 *         self.is_seekable = False
 * 
 */
  __pyx_v_self->is_writable = 0;

  /* "pyarrow/io.pxi":66
 *         self.is_readable = False
 *         self.is_writable = False
 *         self.is_seekable = False             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_v_self->is_seekable = 0;

  /* "pyarrow/io.pxi":62
 *     """
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.own_file = False
 *         self.is_readable = False
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":68
 *         self.is_seekable = False
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self.own_file:
 *             self.close()
 */

/* Python wrapper */
static void __pyx_pw_7pyarrow_3lib_10NativeFile_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7pyarrow_3lib_10NativeFile_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_7pyarrow_3lib_10NativeFile_2__dealloc__(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_7pyarrow_3lib_10NativeFile_2__dealloc__(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pyarrow/io.pxi":69
 * 
 *     def __dealloc__(self):
 *         if self.own_file:             # <<<<<<<<<<<<<<
 *             self.close()
 * 
 */
  __pyx_t_1 = (__pyx_v_self->own_file != 0);
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":70
 *     def __dealloc__(self):
 *         if self.own_file:
 *             self.close()             # <<<<<<<<<<<<<<
 * 
 *     def __enter__(self):
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 70, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 70, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pyarrow/io.pxi":69
 * 
 *     def __dealloc__(self):
 *         if self.own_file:             # <<<<<<<<<<<<<<
 *             self.close()
 * 
 */
  }

  /* "pyarrow/io.pxi":68
 *         self.is_seekable = False
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self.own_file:
 *             self.close()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("pyarrow.lib.NativeFile.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/io.pxi":72
 *             self.close()
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_5__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_4__enter__[] = "NativeFile.__enter__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_5__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_4__enter__(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_4__enter__(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__", 0);

  /* "pyarrow/io.pxi":73
 * 
 *     def __enter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __exit__(self, exc_type, exc_value, tb):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pyarrow/io.pxi":72
 *             self.close()
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":75
 *         return self
 * 
 *     def __exit__(self, exc_type, exc_value, tb):             # <<<<<<<<<<<<<<
 *         self.close()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_7__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_6__exit__[] = "NativeFile.__exit__(self, exc_type, exc_value, tb)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_7__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_exc_type = 0;
  CYTHON_UNUSED PyObject *__pyx_v_exc_value = 0;
  CYTHON_UNUSED PyObject *__pyx_v_tb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exc_type,&__pyx_n_s_exc_value,&__pyx_n_s_tb,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(7, 75, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(7, 75, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) __PYX_ERR(7, 75, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_exc_type = values[0];
    __pyx_v_exc_value = values[1];
    __pyx_v_tb = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 75, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_6__exit__(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), __pyx_v_exc_type, __pyx_v_exc_value, __pyx_v_tb);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_6__exit__(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc_type, CYTHON_UNUSED PyObject *__pyx_v_exc_value, CYTHON_UNUSED PyObject *__pyx_v_tb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__exit__", 0);

  /* "pyarrow/io.pxi":76
 * 
 *     def __exit__(self, exc_type, exc_value, tb):
 *         self.close()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":75
 *         return self
 * 
 *     def __exit__(self, exc_type, exc_value, tb):             # <<<<<<<<<<<<<<
 *         self.close()
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":79
 * 
 *     @property
 *     def mode(self):             # <<<<<<<<<<<<<<
 *         """
 *         The file mode. Currently instances of NativeFile may support:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_4mode_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_4mode_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_4mode___get__(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_4mode___get__(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/io.pxi":88
 *         """
 *         # Emulate built-in file modes
 *         if self.is_readable and self.is_writable:             # <<<<<<<<<<<<<<
 *             return 'rb+'
 *         elif self.is_readable:
 */
  __pyx_t_2 = (__pyx_v_self->is_readable != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_self->is_writable != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":89
 *         # Emulate built-in file modes
 *         if self.is_readable and self.is_writable:
 *             return 'rb+'             # <<<<<<<<<<<<<<
 *         elif self.is_readable:
 *             return 'rb'
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_kp_u_rb);
    __pyx_r = __pyx_kp_u_rb;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":88
 *         """
 *         # Emulate built-in file modes
 *         if self.is_readable and self.is_writable:             # <<<<<<<<<<<<<<
 *             return 'rb+'
 *         elif self.is_readable:
 */
  }

  /* "pyarrow/io.pxi":90
 *         if self.is_readable and self.is_writable:
 *             return 'rb+'
 *         elif self.is_readable:             # <<<<<<<<<<<<<<
 *             return 'rb'
 *         elif self.is_writable:
 */
  __pyx_t_1 = (__pyx_v_self->is_readable != 0);
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":91
 *             return 'rb+'
 *         elif self.is_readable:
 *             return 'rb'             # <<<<<<<<<<<<<<
 *         elif self.is_writable:
 *             return 'wb'
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_rb_2);
    __pyx_r = __pyx_n_u_rb_2;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":90
 *         if self.is_readable and self.is_writable:
 *             return 'rb+'
 *         elif self.is_readable:             # <<<<<<<<<<<<<<
 *             return 'rb'
 *         elif self.is_writable:
 */
  }

  /* "pyarrow/io.pxi":92
 *         elif self.is_readable:
 *             return 'rb'
 *         elif self.is_writable:             # <<<<<<<<<<<<<<
 *             return 'wb'
 *         else:
 */
  __pyx_t_1 = (__pyx_v_self->is_writable != 0);
  if (likely(__pyx_t_1)) {

    /* "pyarrow/io.pxi":93
 *             return 'rb'
 *         elif self.is_writable:
 *             return 'wb'             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError('File object is malformed, has no mode')
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_wb);
    __pyx_r = __pyx_n_u_wb;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":92
 *         elif self.is_readable:
 *             return 'rb'
 *         elif self.is_writable:             # <<<<<<<<<<<<<<
 *             return 'wb'
 *         else:
 */
  }

  /* "pyarrow/io.pxi":95
 *             return 'wb'
 *         else:
 *             raise ValueError('File object is malformed, has no mode')             # <<<<<<<<<<<<<<
 * 
 *     def readable(self):
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__193, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 95, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(7, 95, __pyx_L1_error)
  }

  /* "pyarrow/io.pxi":79
 * 
 *     @property
 *     def mode(self):             # <<<<<<<<<<<<<<
 *         """
 *         The file mode. Currently instances of NativeFile may support:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.mode.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":97
 *             raise ValueError('File object is malformed, has no mode')
 * 
 *     def readable(self):             # <<<<<<<<<<<<<<
 *         self._assert_open()
 *         return self.is_readable
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_9readable(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_8readable[] = "NativeFile.readable(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_9readable(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("readable (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_8readable(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_8readable(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("readable", 0);

  /* "pyarrow/io.pxi":98
 * 
 *     def readable(self):
 *         self._assert_open()             # <<<<<<<<<<<<<<
 *         return self.is_readable
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":99
 *     def readable(self):
 *         self._assert_open()
 *         return self.is_readable             # <<<<<<<<<<<<<<
 * 
 *     def writable(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->is_readable); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":97
 *             raise ValueError('File object is malformed, has no mode')
 * 
 *     def readable(self):             # <<<<<<<<<<<<<<
 *         self._assert_open()
 *         return self.is_readable
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.readable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":101
 *         return self.is_readable
 * 
 *     def writable(self):             # <<<<<<<<<<<<<<
 *         self._assert_open()
 *         return self.is_writable
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_11writable(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_10writable[] = "NativeFile.writable(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_11writable(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("writable (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_10writable(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_10writable(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("writable", 0);

  /* "pyarrow/io.pxi":102
 * 
 *     def writable(self):
 *         self._assert_open()             # <<<<<<<<<<<<<<
 *         return self.is_writable
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":103
 *     def writable(self):
 *         self._assert_open()
 *         return self.is_writable             # <<<<<<<<<<<<<<
 * 
 *     def seekable(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->is_writable); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":101
 *         return self.is_readable
 * 
 *     def writable(self):             # <<<<<<<<<<<<<<
 *         self._assert_open()
 *         return self.is_writable
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.writable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":105
 *         return self.is_writable
 * 
 *     def seekable(self):             # <<<<<<<<<<<<<<
 *         self._assert_open()
 *         return self.is_seekable
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_13seekable(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_12seekable[] = "NativeFile.seekable(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_13seekable(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("seekable (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_12seekable(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_12seekable(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("seekable", 0);

  /* "pyarrow/io.pxi":106
 * 
 *     def seekable(self):
 *         self._assert_open()             # <<<<<<<<<<<<<<
 *         return self.is_seekable
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":107
 *     def seekable(self):
 *         self._assert_open()
 *         return self.is_seekable             # <<<<<<<<<<<<<<
 * 
 *     def isatty(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->is_seekable); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":105
 *         return self.is_writable
 * 
 *     def seekable(self):             # <<<<<<<<<<<<<<
 *         self._assert_open()
 *         return self.is_seekable
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.seekable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":109
 *         return self.is_seekable
 * 
 *     def isatty(self):             # <<<<<<<<<<<<<<
 *         self._assert_open()
 *         return False
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_15isatty(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_14isatty[] = "NativeFile.isatty(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_15isatty(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("isatty (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_14isatty(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_14isatty(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("isatty", 0);

  /* "pyarrow/io.pxi":110
 * 
 *     def isatty(self):
 *         self._assert_open()             # <<<<<<<<<<<<<<
 *         return False
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":111
 *     def isatty(self):
 *         self._assert_open()
 *         return False             # <<<<<<<<<<<<<<
 * 
 *     def fileno(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_False);
  __pyx_r = Py_False;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":109
 *         return self.is_seekable
 * 
 *     def isatty(self):             # <<<<<<<<<<<<<<
 *         self._assert_open()
 *         return False
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.isatty", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":113
 *         return False
 * 
 *     def fileno(self):             # <<<<<<<<<<<<<<
 *         """
 *         NOT IMPLEMENTED
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_17fileno(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_16fileno[] = "NativeFile.fileno(self)\n\n        NOT IMPLEMENTED\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_17fileno(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fileno (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_16fileno(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_16fileno(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("fileno", 0);

  /* "pyarrow/io.pxi":117
 *         NOT IMPLEMENTED
 *         """
 *         raise UnsupportedOperation()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_UnsupportedOperation); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(7, 117, __pyx_L1_error)

  /* "pyarrow/io.pxi":113
 *         return False
 * 
 *     def fileno(self):             # <<<<<<<<<<<<<<
 *         """
 *         NOT IMPLEMENTED
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.fileno", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":120
 * 
 *     @property
 *     def closed(self):             # <<<<<<<<<<<<<<
 *         if self.is_readable:
 *             return self.input_stream.get().closed()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_6closed_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_6closed_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_6closed___get__(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_6closed___get__(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/io.pxi":121
 *     @property
 *     def closed(self):
 *         if self.is_readable:             # <<<<<<<<<<<<<<
 *             return self.input_stream.get().closed()
 *         elif self.is_writable:
 */
  __pyx_t_1 = (__pyx_v_self->is_readable != 0);
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":122
 *     def closed(self):
 *         if self.is_readable:
 *             return self.input_stream.get().closed()             # <<<<<<<<<<<<<<
 *         elif self.is_writable:
 *             return self.output_stream.get().closed()
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->input_stream.get()->closed()); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 122, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":121
 *     @property
 *     def closed(self):
 *         if self.is_readable:             # <<<<<<<<<<<<<<
 *             return self.input_stream.get().closed()
 *         elif self.is_writable:
 */
  }

  /* "pyarrow/io.pxi":123
 *         if self.is_readable:
 *             return self.input_stream.get().closed()
 *         elif self.is_writable:             # <<<<<<<<<<<<<<
 *             return self.output_stream.get().closed()
 *         else:
 */
  __pyx_t_1 = (__pyx_v_self->is_writable != 0);
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":124
 *             return self.input_stream.get().closed()
 *         elif self.is_writable:
 *             return self.output_stream.get().closed()             # <<<<<<<<<<<<<<
 *         else:
 *             return True
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->output_stream.get()->closed()); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 124, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":123
 *         if self.is_readable:
 *             return self.input_stream.get().closed()
 *         elif self.is_writable:             # <<<<<<<<<<<<<<
 *             return self.output_stream.get().closed()
 *         else:
 */
  }

  /* "pyarrow/io.pxi":126
 *             return self.output_stream.get().closed()
 *         else:
 *             return True             # <<<<<<<<<<<<<<
 * 
 *     def close(self):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;
  }

  /* "pyarrow/io.pxi":120
 * 
 *     @property
 *     def closed(self):             # <<<<<<<<<<<<<<
 *         if self.is_readable:
 *             return self.input_stream.get().closed()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.closed.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":128
 *             return True
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         if not self.closed:
 *             with nogil:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_19close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_18close[] = "NativeFile.close(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_19close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("close (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_18close(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_18close(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("close", 0);

  /* "pyarrow/io.pxi":129
 * 
 *     def close(self):
 *         if not self.closed:             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 if self.is_readable:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_closed); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(7, 129, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = ((!__pyx_t_2) != 0);
  if (__pyx_t_3) {

    /* "pyarrow/io.pxi":130
 *     def close(self):
 *         if not self.closed:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 if self.is_readable:
 *                     check_status(self.input_stream.get().Close())
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "pyarrow/io.pxi":131
 *         if not self.closed:
 *             with nogil:
 *                 if self.is_readable:             # <<<<<<<<<<<<<<
 *                     check_status(self.input_stream.get().Close())
 *                 else:
 */
          __pyx_t_3 = (__pyx_v_self->is_readable != 0);
          if (__pyx_t_3) {

            /* "pyarrow/io.pxi":132
 *             with nogil:
 *                 if self.is_readable:
 *                     check_status(self.input_stream.get().Close())             # <<<<<<<<<<<<<<
 *                 else:
 *                     check_status(self.output_stream.get().Close())
 */
            __pyx_t_4 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->input_stream.get()->Close()); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(7, 132, __pyx_L5_error)

            /* "pyarrow/io.pxi":131
 *         if not self.closed:
 *             with nogil:
 *                 if self.is_readable:             # <<<<<<<<<<<<<<
 *                     check_status(self.input_stream.get().Close())
 *                 else:
 */
            goto __pyx_L7;
          }

          /* "pyarrow/io.pxi":134
 *                     check_status(self.input_stream.get().Close())
 *                 else:
 *                     check_status(self.output_stream.get().Close())             # <<<<<<<<<<<<<<
 * 
 *     cdef set_random_access_file(self, shared_ptr[CRandomAccessFile] handle):
 */
          /*else*/ {
            __pyx_t_4 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->output_stream.get()->Close()); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(7, 134, __pyx_L5_error)
          }
          __pyx_L7:;
        }

        /* "pyarrow/io.pxi":130
 *     def close(self):
 *         if not self.closed:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 if self.is_readable:
 *                     check_status(self.input_stream.get().Close())
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L6;
          }
          __pyx_L5_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L6:;
        }
    }

    /* "pyarrow/io.pxi":129
 * 
 *     def close(self):
 *         if not self.closed:             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 if self.is_readable:
 */
  }

  /* "pyarrow/io.pxi":128
 *             return True
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         if not self.closed:
 *             with nogil:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.close", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":136
 *                     check_status(self.output_stream.get().Close())
 * 
 *     cdef set_random_access_file(self, shared_ptr[CRandomAccessFile] handle):             # <<<<<<<<<<<<<<
 *         self.input_stream = <shared_ptr[CInputStream]> handle
 *         self.random_access = handle
 */

static PyObject *__pyx_f_7pyarrow_3lib_10NativeFile_set_random_access_file(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, std::shared_ptr< arrow::io::RandomAccessFile>  __pyx_v_handle) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_random_access_file", 0);

  /* "pyarrow/io.pxi":137
 * 
 *     cdef set_random_access_file(self, shared_ptr[CRandomAccessFile] handle):
 *         self.input_stream = <shared_ptr[CInputStream]> handle             # <<<<<<<<<<<<<<
 *         self.random_access = handle
 *         self.is_seekable = True
 */
  __pyx_v_self->input_stream = ((std::shared_ptr< arrow::io::InputStream> )__pyx_v_handle);

  /* "pyarrow/io.pxi":138
 *     cdef set_random_access_file(self, shared_ptr[CRandomAccessFile] handle):
 *         self.input_stream = <shared_ptr[CInputStream]> handle
 *         self.random_access = handle             # <<<<<<<<<<<<<<
 *         self.is_seekable = True
 * 
 */
  __pyx_v_self->random_access = __pyx_v_handle;

  /* "pyarrow/io.pxi":139
 *         self.input_stream = <shared_ptr[CInputStream]> handle
 *         self.random_access = handle
 *         self.is_seekable = True             # <<<<<<<<<<<<<<
 * 
 *     cdef set_input_stream(self, shared_ptr[CInputStream] handle):
 */
  __pyx_v_self->is_seekable = 1;

  /* "pyarrow/io.pxi":136
 *                     check_status(self.output_stream.get().Close())
 * 
 *     cdef set_random_access_file(self, shared_ptr[CRandomAccessFile] handle):             # <<<<<<<<<<<<<<
 *         self.input_stream = <shared_ptr[CInputStream]> handle
 *         self.random_access = handle
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":141
 *         self.is_seekable = True
 * 
 *     cdef set_input_stream(self, shared_ptr[CInputStream] handle):             # <<<<<<<<<<<<<<
 *         self.input_stream = handle
 *         self.random_access.reset()
 */

static PyObject *__pyx_f_7pyarrow_3lib_10NativeFile_set_input_stream(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, std::shared_ptr< arrow::io::InputStream>  __pyx_v_handle) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_input_stream", 0);

  /* "pyarrow/io.pxi":142
 * 
 *     cdef set_input_stream(self, shared_ptr[CInputStream] handle):
 *         self.input_stream = handle             # <<<<<<<<<<<<<<
 *         self.random_access.reset()
 *         self.is_seekable = False
 */
  __pyx_v_self->input_stream = __pyx_v_handle;

  /* "pyarrow/io.pxi":143
 *     cdef set_input_stream(self, shared_ptr[CInputStream] handle):
 *         self.input_stream = handle
 *         self.random_access.reset()             # <<<<<<<<<<<<<<
 *         self.is_seekable = False
 * 
 */
  __pyx_v_self->random_access.reset();

  /* "pyarrow/io.pxi":144
 *         self.input_stream = handle
 *         self.random_access.reset()
 *         self.is_seekable = False             # <<<<<<<<<<<<<<
 * 
 *     cdef set_output_stream(self, shared_ptr[COutputStream] handle):
 */
  __pyx_v_self->is_seekable = 0;

  /* "pyarrow/io.pxi":141
 *         self.is_seekable = True
 * 
 *     cdef set_input_stream(self, shared_ptr[CInputStream] handle):             # <<<<<<<<<<<<<<
 *         self.input_stream = handle
 *         self.random_access.reset()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":146
 *         self.is_seekable = False
 * 
 *     cdef set_output_stream(self, shared_ptr[COutputStream] handle):             # <<<<<<<<<<<<<<
 *         self.output_stream = handle
 * 
 */

static PyObject *__pyx_f_7pyarrow_3lib_10NativeFile_set_output_stream(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, std::shared_ptr< arrow::io::OutputStream>  __pyx_v_handle) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_output_stream", 0);

  /* "pyarrow/io.pxi":147
 * 
 *     cdef set_output_stream(self, shared_ptr[COutputStream] handle):
 *         self.output_stream = handle             # <<<<<<<<<<<<<<
 * 
 *     cdef shared_ptr[CRandomAccessFile] get_random_access_file(self) except *:
 */
  __pyx_v_self->output_stream = __pyx_v_handle;

  /* "pyarrow/io.pxi":146
 *         self.is_seekable = False
 * 
 *     cdef set_output_stream(self, shared_ptr[COutputStream] handle):             # <<<<<<<<<<<<<<
 *         self.output_stream = handle
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":149
 *         self.output_stream = handle
 * 
 *     cdef shared_ptr[CRandomAccessFile] get_random_access_file(self) except *:             # <<<<<<<<<<<<<<
 *         self._assert_readable()
 *         self._assert_seekable()
 */

static std::shared_ptr< arrow::io::RandomAccessFile>  __pyx_f_7pyarrow_3lib_10NativeFile_get_random_access_file(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  std::shared_ptr< arrow::io::RandomAccessFile>  __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("get_random_access_file", 0);

  /* "pyarrow/io.pxi":150
 * 
 *     cdef shared_ptr[CRandomAccessFile] get_random_access_file(self) except *:
 *         self._assert_readable()             # <<<<<<<<<<<<<<
 *         self._assert_seekable()
 *         return self.random_access
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_readable); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":151
 *     cdef shared_ptr[CRandomAccessFile] get_random_access_file(self) except *:
 *         self._assert_readable()
 *         self._assert_seekable()             # <<<<<<<<<<<<<<
 *         return self.random_access
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_seekable); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":152
 *         self._assert_readable()
 *         self._assert_seekable()
 *         return self.random_access             # <<<<<<<<<<<<<<
 * 
 *     cdef shared_ptr[CInputStream] get_input_stream(self) except *:
 */
  __pyx_r = __pyx_v_self->random_access;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":149
 *         self.output_stream = handle
 * 
 *     cdef shared_ptr[CRandomAccessFile] get_random_access_file(self) except *:             # <<<<<<<<<<<<<<
 *         self._assert_readable()
 *         self._assert_seekable()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.get_random_access_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":154
 *         return self.random_access
 * 
 *     cdef shared_ptr[CInputStream] get_input_stream(self) except *:             # <<<<<<<<<<<<<<
 *         self._assert_readable()
 *         return self.input_stream
 */

static std::shared_ptr< arrow::io::InputStream>  __pyx_f_7pyarrow_3lib_10NativeFile_get_input_stream(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  std::shared_ptr< arrow::io::InputStream>  __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("get_input_stream", 0);

  /* "pyarrow/io.pxi":155
 * 
 *     cdef shared_ptr[CInputStream] get_input_stream(self) except *:
 *         self._assert_readable()             # <<<<<<<<<<<<<<
 *         return self.input_stream
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_readable); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":156
 *     cdef shared_ptr[CInputStream] get_input_stream(self) except *:
 *         self._assert_readable()
 *         return self.input_stream             # <<<<<<<<<<<<<<
 * 
 *     cdef shared_ptr[COutputStream] get_output_stream(self) except *:
 */
  __pyx_r = __pyx_v_self->input_stream;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":154
 *         return self.random_access
 * 
 *     cdef shared_ptr[CInputStream] get_input_stream(self) except *:             # <<<<<<<<<<<<<<
 *         self._assert_readable()
 *         return self.input_stream
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.get_input_stream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":158
 *         return self.input_stream
 * 
 *     cdef shared_ptr[COutputStream] get_output_stream(self) except *:             # <<<<<<<<<<<<<<
 *         self._assert_writable()
 *         return self.output_stream
 */

static std::shared_ptr< arrow::io::OutputStream>  __pyx_f_7pyarrow_3lib_10NativeFile_get_output_stream(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  std::shared_ptr< arrow::io::OutputStream>  __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("get_output_stream", 0);

  /* "pyarrow/io.pxi":159
 * 
 *     cdef shared_ptr[COutputStream] get_output_stream(self) except *:
 *         self._assert_writable()             # <<<<<<<<<<<<<<
 *         return self.output_stream
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_writable); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":160
 *     cdef shared_ptr[COutputStream] get_output_stream(self) except *:
 *         self._assert_writable()
 *         return self.output_stream             # <<<<<<<<<<<<<<
 * 
 *     def _assert_open(self):
 */
  __pyx_r = __pyx_v_self->output_stream;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":158
 *         return self.input_stream
 * 
 *     cdef shared_ptr[COutputStream] get_output_stream(self) except *:             # <<<<<<<<<<<<<<
 *         self._assert_writable()
 *         return self.output_stream
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.get_output_stream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":162
 *         return self.output_stream
 * 
 *     def _assert_open(self):             # <<<<<<<<<<<<<<
 *         if self.closed:
 *             raise ValueError("I/O operation on closed file")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_21_assert_open(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_20_assert_open[] = "NativeFile._assert_open(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_21_assert_open(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_assert_open (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_20_assert_open(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_20_assert_open(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("_assert_open", 0);

  /* "pyarrow/io.pxi":163
 * 
 *     def _assert_open(self):
 *         if self.closed:             # <<<<<<<<<<<<<<
 *             raise ValueError("I/O operation on closed file")
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_closed); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(7, 163, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/io.pxi":164
 *     def _assert_open(self):
 *         if self.closed:
 *             raise ValueError("I/O operation on closed file")             # <<<<<<<<<<<<<<
 * 
 *     def _assert_readable(self):
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__194, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 164, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(7, 164, __pyx_L1_error)

    /* "pyarrow/io.pxi":163
 * 
 *     def _assert_open(self):
 *         if self.closed:             # <<<<<<<<<<<<<<
 *             raise ValueError("I/O operation on closed file")
 * 
 */
  }

  /* "pyarrow/io.pxi":162
 *         return self.output_stream
 * 
 *     def _assert_open(self):             # <<<<<<<<<<<<<<
 *         if self.closed:
 *             raise ValueError("I/O operation on closed file")
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile._assert_open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":166
 *             raise ValueError("I/O operation on closed file")
 * 
 *     def _assert_readable(self):             # <<<<<<<<<<<<<<
 *         self._assert_open()
 *         if not self.is_readable:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_23_assert_readable(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_22_assert_readable[] = "NativeFile._assert_readable(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_23_assert_readable(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_assert_readable (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_22_assert_readable(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_22_assert_readable(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("_assert_readable", 0);

  /* "pyarrow/io.pxi":167
 * 
 *     def _assert_readable(self):
 *         self._assert_open()             # <<<<<<<<<<<<<<
 *         if not self.is_readable:
 *             # XXX UnsupportedOperation
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":168
 *     def _assert_readable(self):
 *         self._assert_open()
 *         if not self.is_readable:             # <<<<<<<<<<<<<<
 *             # XXX UnsupportedOperation
 *             raise IOError("only valid on readonly files")
 */
  __pyx_t_4 = ((!(__pyx_v_self->is_readable != 0)) != 0);
  if (unlikely(__pyx_t_4)) {

    /* "pyarrow/io.pxi":170
 *         if not self.is_readable:
 *             # XXX UnsupportedOperation
 *             raise IOError("only valid on readonly files")             # <<<<<<<<<<<<<<
 * 
 *     def _assert_writable(self):
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__195, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 170, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(7, 170, __pyx_L1_error)

    /* "pyarrow/io.pxi":168
 *     def _assert_readable(self):
 *         self._assert_open()
 *         if not self.is_readable:             # <<<<<<<<<<<<<<
 *             # XXX UnsupportedOperation
 *             raise IOError("only valid on readonly files")
 */
  }

  /* "pyarrow/io.pxi":166
 *             raise ValueError("I/O operation on closed file")
 * 
 *     def _assert_readable(self):             # <<<<<<<<<<<<<<
 *         self._assert_open()
 *         if not self.is_readable:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile._assert_readable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":172
 *             raise IOError("only valid on readonly files")
 * 
 *     def _assert_writable(self):             # <<<<<<<<<<<<<<
 *         self._assert_open()
 *         if not self.is_writable:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_25_assert_writable(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_24_assert_writable[] = "NativeFile._assert_writable(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_25_assert_writable(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_assert_writable (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_24_assert_writable(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_24_assert_writable(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("_assert_writable", 0);

  /* "pyarrow/io.pxi":173
 * 
 *     def _assert_writable(self):
 *         self._assert_open()             # <<<<<<<<<<<<<<
 *         if not self.is_writable:
 *             raise IOError("only valid on writable files")
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":174
 *     def _assert_writable(self):
 *         self._assert_open()
 *         if not self.is_writable:             # <<<<<<<<<<<<<<
 *             raise IOError("only valid on writable files")
 * 
 */
  __pyx_t_4 = ((!(__pyx_v_self->is_writable != 0)) != 0);
  if (unlikely(__pyx_t_4)) {

    /* "pyarrow/io.pxi":175
 *         self._assert_open()
 *         if not self.is_writable:
 *             raise IOError("only valid on writable files")             # <<<<<<<<<<<<<<
 * 
 *     def _assert_seekable(self):
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__196, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 175, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(7, 175, __pyx_L1_error)

    /* "pyarrow/io.pxi":174
 *     def _assert_writable(self):
 *         self._assert_open()
 *         if not self.is_writable:             # <<<<<<<<<<<<<<
 *             raise IOError("only valid on writable files")
 * 
 */
  }

  /* "pyarrow/io.pxi":172
 *             raise IOError("only valid on readonly files")
 * 
 *     def _assert_writable(self):             # <<<<<<<<<<<<<<
 *         self._assert_open()
 *         if not self.is_writable:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile._assert_writable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":177
 *             raise IOError("only valid on writable files")
 * 
 *     def _assert_seekable(self):             # <<<<<<<<<<<<<<
 *         self._assert_open()
 *         if not self.is_seekable:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_27_assert_seekable(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_26_assert_seekable[] = "NativeFile._assert_seekable(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_27_assert_seekable(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_assert_seekable (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_26_assert_seekable(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_26_assert_seekable(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("_assert_seekable", 0);

  /* "pyarrow/io.pxi":178
 * 
 *     def _assert_seekable(self):
 *         self._assert_open()             # <<<<<<<<<<<<<<
 *         if not self.is_seekable:
 *             raise IOError("only valid on seekable files")
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":179
 *     def _assert_seekable(self):
 *         self._assert_open()
 *         if not self.is_seekable:             # <<<<<<<<<<<<<<
 *             raise IOError("only valid on seekable files")
 * 
 */
  __pyx_t_4 = ((!(__pyx_v_self->is_seekable != 0)) != 0);
  if (unlikely(__pyx_t_4)) {

    /* "pyarrow/io.pxi":180
 *         self._assert_open()
 *         if not self.is_seekable:
 *             raise IOError("only valid on seekable files")             # <<<<<<<<<<<<<<
 * 
 *     def size(self):
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__197, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 180, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(7, 180, __pyx_L1_error)

    /* "pyarrow/io.pxi":179
 *     def _assert_seekable(self):
 *         self._assert_open()
 *         if not self.is_seekable:             # <<<<<<<<<<<<<<
 *             raise IOError("only valid on seekable files")
 * 
 */
  }

  /* "pyarrow/io.pxi":177
 *             raise IOError("only valid on writable files")
 * 
 *     def _assert_seekable(self):             # <<<<<<<<<<<<<<
 *         self._assert_open()
 *         if not self.is_seekable:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile._assert_seekable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":182
 *             raise IOError("only valid on seekable files")
 * 
 *     def size(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return file size
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_29size(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_28size[] = "NativeFile.size(self)\n\n        Return file size\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_29size(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("size (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_28size(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_28size(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  int64_t __pyx_v_size;
  std::shared_ptr< arrow::io::RandomAccessFile>  __pyx_v_handle;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr< arrow::io::RandomAccessFile>  __pyx_t_1;
  int64_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("size", 0);

  /* "pyarrow/io.pxi":188
 *         cdef int64_t size
 * 
 *         handle = self.get_random_access_file()             # <<<<<<<<<<<<<<
 *         with nogil:
 *             size = GetResultValue(handle.get().GetSize())
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_self->__pyx_vtab)->get_random_access_file(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 188, __pyx_L1_error)
  __pyx_v_handle = __pyx_t_1;

  /* "pyarrow/io.pxi":189
 * 
 *         handle = self.get_random_access_file()
 *         with nogil:             # <<<<<<<<<<<<<<
 *             size = GetResultValue(handle.get().GetSize())
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":190
 *         handle = self.get_random_access_file()
 *         with nogil:
 *             size = GetResultValue(handle.get().GetSize())             # <<<<<<<<<<<<<<
 * 
 *         return size
 */
        __pyx_t_2 = arrow::py::GetResultValue<int64_t>(__pyx_v_handle.get()->GetSize()); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(7, 190, __pyx_L4_error)
        __pyx_v_size = __pyx_t_2;
      }

      /* "pyarrow/io.pxi":189
 * 
 *         handle = self.get_random_access_file()
 *         with nogil:             # <<<<<<<<<<<<<<
 *             size = GetResultValue(handle.get().GetSize())
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io.pxi":192
 *             size = GetResultValue(handle.get().GetSize())
 * 
 *         return size             # <<<<<<<<<<<<<<
 * 
 *     def tell(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":182
 *             raise IOError("only valid on seekable files")
 * 
 *     def size(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return file size
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.size", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":194
 *         return size
 * 
 *     def tell(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return current stream position
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_31tell(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_30tell[] = "NativeFile.tell(self)\n\n        Return current stream position\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_31tell(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tell (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_30tell(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_30tell(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  int64_t __pyx_v_position;
  std::shared_ptr< arrow::io::RandomAccessFile>  __pyx_v_rd_handle;
  std::shared_ptr< arrow::io::OutputStream>  __pyx_v_wr_handle;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  std::shared_ptr< arrow::io::RandomAccessFile>  __pyx_t_2;
  int64_t __pyx_t_3;
  std::shared_ptr< arrow::io::OutputStream>  __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("tell", 0);

  /* "pyarrow/io.pxi":200
 *         cdef int64_t position
 * 
 *         if self.is_readable:             # <<<<<<<<<<<<<<
 *             rd_handle = self.get_random_access_file()
 *             with nogil:
 */
  __pyx_t_1 = (__pyx_v_self->is_readable != 0);
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":201
 * 
 *         if self.is_readable:
 *             rd_handle = self.get_random_access_file()             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 position = GetResultValue(rd_handle.get().Tell())
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_self->__pyx_vtab)->get_random_access_file(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 201, __pyx_L1_error)
    __pyx_v_rd_handle = __pyx_t_2;

    /* "pyarrow/io.pxi":202
 *         if self.is_readable:
 *             rd_handle = self.get_random_access_file()
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 position = GetResultValue(rd_handle.get().Tell())
 *         else:
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "pyarrow/io.pxi":203
 *             rd_handle = self.get_random_access_file()
 *             with nogil:
 *                 position = GetResultValue(rd_handle.get().Tell())             # <<<<<<<<<<<<<<
 *         else:
 *             wr_handle = self.get_output_stream()
 */
          __pyx_t_3 = arrow::py::GetResultValue<int64_t>(__pyx_v_rd_handle.get()->Tell()); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(7, 203, __pyx_L5_error)
          __pyx_v_position = __pyx_t_3;
        }

        /* "pyarrow/io.pxi":202
 *         if self.is_readable:
 *             rd_handle = self.get_random_access_file()
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 position = GetResultValue(rd_handle.get().Tell())
 *         else:
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L6;
          }
          __pyx_L5_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L6:;
        }
    }

    /* "pyarrow/io.pxi":200
 *         cdef int64_t position
 * 
 *         if self.is_readable:             # <<<<<<<<<<<<<<
 *             rd_handle = self.get_random_access_file()
 *             with nogil:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/io.pxi":205
 *                 position = GetResultValue(rd_handle.get().Tell())
 *         else:
 *             wr_handle = self.get_output_stream()             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 position = GetResultValue(wr_handle.get().Tell())
 */
  /*else*/ {
    __pyx_t_4 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_self->__pyx_vtab)->get_output_stream(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 205, __pyx_L1_error)
    __pyx_v_wr_handle = __pyx_t_4;

    /* "pyarrow/io.pxi":206
 *         else:
 *             wr_handle = self.get_output_stream()
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 position = GetResultValue(wr_handle.get().Tell())
 * 
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "pyarrow/io.pxi":207
 *             wr_handle = self.get_output_stream()
 *             with nogil:
 *                 position = GetResultValue(wr_handle.get().Tell())             # <<<<<<<<<<<<<<
 * 
 *         return position
 */
          __pyx_t_3 = arrow::py::GetResultValue<int64_t>(__pyx_v_wr_handle.get()->Tell()); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(7, 207, __pyx_L8_error)
          __pyx_v_position = __pyx_t_3;
        }

        /* "pyarrow/io.pxi":206
 *         else:
 *             wr_handle = self.get_output_stream()
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 position = GetResultValue(wr_handle.get().Tell())
 * 
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L9;
          }
          __pyx_L8_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L9:;
        }
    }
  }
  __pyx_L3:;

  /* "pyarrow/io.pxi":209
 *                 position = GetResultValue(wr_handle.get().Tell())
 * 
 *         return position             # <<<<<<<<<<<<<<
 * 
 *     def seek(self, int64_t position, int whence=0):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_position); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":194
 *         return size
 * 
 *     def tell(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return current stream position
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.tell", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":211
 *         return position
 * 
 *     def seek(self, int64_t position, int whence=0):             # <<<<<<<<<<<<<<
 *         """
 *         Change current file stream position
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_33seek(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_32seek[] = "NativeFile.seek(self, int64_t position, int whence=0)\n\n        Change current file stream position\n\n        Parameters\n        ----------\n        position : int\n            Byte offset, interpreted relative to value of whence argument\n        whence : int, default 0\n            Point of reference for seek offset\n\n        Notes\n        -----\n        Values of whence:\n        * 0 -- start of stream (the default); offset should be zero or positive\n        * 1 -- current stream position; offset may be negative\n        * 2 -- end of stream; offset is usually negative\n\n        Returns\n        -------\n        new_position : the new absolute stream position\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_33seek(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int64_t __pyx_v_position;
  int __pyx_v_whence;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("seek (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_position,&__pyx_n_s_whence,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_position)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_whence);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "seek") < 0)) __PYX_ERR(7, 211, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_position = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_position == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 211, __pyx_L3_error)
    if (values[1]) {
      __pyx_v_whence = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_whence == (int)-1) && PyErr_Occurred())) __PYX_ERR(7, 211, __pyx_L3_error)
    } else {
      __pyx_v_whence = ((int)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("seek", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 211, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.seek", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_32seek(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), __pyx_v_position, __pyx_v_whence);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_32seek(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, int64_t __pyx_v_position, int __pyx_v_whence) {
  int64_t __pyx_v_offset;
  std::shared_ptr< arrow::io::RandomAccessFile>  __pyx_v_handle;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr< arrow::io::RandomAccessFile>  __pyx_t_1;
  int64_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("seek", 0);

  /* "pyarrow/io.pxi":234
 *         """
 *         cdef int64_t offset
 *         handle = self.get_random_access_file()             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_self->__pyx_vtab)->get_random_access_file(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 234, __pyx_L1_error)
  __pyx_v_handle = __pyx_t_1;

  /* "pyarrow/io.pxi":236
 *         handle = self.get_random_access_file()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             if whence == 0:
 *                 offset = position
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":237
 * 
 *         with nogil:
 *             if whence == 0:             # <<<<<<<<<<<<<<
 *                 offset = position
 *             elif whence == 1:
 */
        switch (__pyx_v_whence) {
          case 0:

          /* "pyarrow/io.pxi":238
 *         with nogil:
 *             if whence == 0:
 *                 offset = position             # <<<<<<<<<<<<<<
 *             elif whence == 1:
 *                 offset = GetResultValue(handle.get().Tell())
 */
          __pyx_v_offset = __pyx_v_position;

          /* "pyarrow/io.pxi":237
 * 
 *         with nogil:
 *             if whence == 0:             # <<<<<<<<<<<<<<
 *                 offset = position
 *             elif whence == 1:
 */
          break;
          case 1:

          /* "pyarrow/io.pxi":240
 *                 offset = position
 *             elif whence == 1:
 *                 offset = GetResultValue(handle.get().Tell())             # <<<<<<<<<<<<<<
 *                 offset = offset + position
 *             elif whence == 2:
 */
          __pyx_t_2 = arrow::py::GetResultValue<int64_t>(__pyx_v_handle.get()->Tell()); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(7, 240, __pyx_L4_error)
          __pyx_v_offset = __pyx_t_2;

          /* "pyarrow/io.pxi":241
 *             elif whence == 1:
 *                 offset = GetResultValue(handle.get().Tell())
 *                 offset = offset + position             # <<<<<<<<<<<<<<
 *             elif whence == 2:
 *                 offset = GetResultValue(handle.get().GetSize())
 */
          __pyx_v_offset = (__pyx_v_offset + __pyx_v_position);

          /* "pyarrow/io.pxi":239
 *             if whence == 0:
 *                 offset = position
 *             elif whence == 1:             # <<<<<<<<<<<<<<
 *                 offset = GetResultValue(handle.get().Tell())
 *                 offset = offset + position
 */
          break;
          case 2:

          /* "pyarrow/io.pxi":243
 *                 offset = offset + position
 *             elif whence == 2:
 *                 offset = GetResultValue(handle.get().GetSize())             # <<<<<<<<<<<<<<
 *                 offset = offset + position
 *             else:
 */
          __pyx_t_2 = arrow::py::GetResultValue<int64_t>(__pyx_v_handle.get()->GetSize()); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(7, 243, __pyx_L4_error)
          __pyx_v_offset = __pyx_t_2;

          /* "pyarrow/io.pxi":244
 *             elif whence == 2:
 *                 offset = GetResultValue(handle.get().GetSize())
 *                 offset = offset + position             # <<<<<<<<<<<<<<
 *             else:
 *                 with gil:
 */
          __pyx_v_offset = (__pyx_v_offset + __pyx_v_position);

          /* "pyarrow/io.pxi":242
 *                 offset = GetResultValue(handle.get().Tell())
 *                 offset = offset + position
 *             elif whence == 2:             # <<<<<<<<<<<<<<
 *                 offset = GetResultValue(handle.get().GetSize())
 *                 offset = offset + position
 */
          break;
          default:

          /* "pyarrow/io.pxi":246
 *                 offset = offset + position
 *             else:
 *                 with gil:             # <<<<<<<<<<<<<<
 *                     raise ValueError("Invalid value of whence: {0}"
 *                                      .format(whence))
 */
          {
              #ifdef WITH_THREAD
              PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
              #endif
              /*try:*/ {

                /* "pyarrow/io.pxi":248
 *                 with gil:
 *                     raise ValueError("Invalid value of whence: {0}"
 *                                      .format(whence))             # <<<<<<<<<<<<<<
 *             check_status(handle.get().Seek(offset))
 * 
 */
                __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Invalid_value_of_whence_0, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 248, __pyx_L7_error)
                __Pyx_GOTREF(__pyx_t_4);
                __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_whence); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 248, __pyx_L7_error)
                __Pyx_GOTREF(__pyx_t_5);
                __pyx_t_6 = NULL;
                if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
                  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
                  if (likely(__pyx_t_6)) {
                    PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
                    __Pyx_INCREF(__pyx_t_6);
                    __Pyx_INCREF(function);
                    __Pyx_DECREF_SET(__pyx_t_4, function);
                  }
                }
                __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
                __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
                __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 248, __pyx_L7_error)
                __Pyx_GOTREF(__pyx_t_3);
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

                /* "pyarrow/io.pxi":247
 *             else:
 *                 with gil:
 *                     raise ValueError("Invalid value of whence: {0}"             # <<<<<<<<<<<<<<
 *                                      .format(whence))
 *             check_status(handle.get().Seek(offset))
 */
                __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 247, __pyx_L7_error)
                __Pyx_GOTREF(__pyx_t_4);
                __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                __Pyx_Raise(__pyx_t_4, 0, 0, 0);
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                __PYX_ERR(7, 247, __pyx_L7_error)
              }

              /* "pyarrow/io.pxi":246
 *                 offset = offset + position
 *             else:
 *                 with gil:             # <<<<<<<<<<<<<<
 *                     raise ValueError("Invalid value of whence: {0}"
 *                                      .format(whence))
 */
              /*finally:*/ {
                __pyx_L7_error: {
                  #ifdef WITH_THREAD
                  __Pyx_PyGILState_Release(__pyx_gilstate_save);
                  #endif
                  goto __pyx_L4_error;
                }
              }
          }
          break;
        }

        /* "pyarrow/io.pxi":249
 *                     raise ValueError("Invalid value of whence: {0}"
 *                                      .format(whence))
 *             check_status(handle.get().Seek(offset))             # <<<<<<<<<<<<<<
 * 
 *         return self.tell()
 */
        __pyx_t_7 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_handle.get()->Seek(__pyx_v_offset)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(7, 249, __pyx_L4_error)
      }

      /* "pyarrow/io.pxi":236
 *         handle = self.get_random_access_file()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             if whence == 0:
 *                 offset = position
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io.pxi":251
 *             check_status(handle.get().Seek(offset))
 * 
 *         return self.tell()             # <<<<<<<<<<<<<<
 * 
 *     def flush(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tell); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":211
 *         return position
 * 
 *     def seek(self, int64_t position, int whence=0):             # <<<<<<<<<<<<<<
 *         """
 *         Change current file stream position
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.seek", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":253
 *         return self.tell()
 * 
 *     def flush(self):             # <<<<<<<<<<<<<<
 *         """
 *         Flush the stream, if applicable.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_35flush(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_34flush[] = "NativeFile.flush(self)\n\n        Flush the stream, if applicable.\n\n        An error is raised if stream is not writable.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_35flush(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flush (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_34flush(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_34flush(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  std::shared_ptr< arrow::io::OutputStream>  __pyx_v_handle;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  std::shared_ptr< arrow::io::OutputStream>  __pyx_t_5;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("flush", 0);

  /* "pyarrow/io.pxi":259
 *         An error is raised if stream is not writable.
 *         """
 *         self._assert_open()             # <<<<<<<<<<<<<<
 *         # For IOBase compatibility, flush() on an input stream is a no-op
 *         if self.is_writable:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":261
 *         self._assert_open()
 *         # For IOBase compatibility, flush() on an input stream is a no-op
 *         if self.is_writable:             # <<<<<<<<<<<<<<
 *             handle = self.get_output_stream()
 *             with nogil:
 */
  __pyx_t_4 = (__pyx_v_self->is_writable != 0);
  if (__pyx_t_4) {

    /* "pyarrow/io.pxi":262
 *         # For IOBase compatibility, flush() on an input stream is a no-op
 *         if self.is_writable:
 *             handle = self.get_output_stream()             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 check_status(handle.get().Flush())
 */
    __pyx_t_5 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_self->__pyx_vtab)->get_output_stream(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 262, __pyx_L1_error)
    __pyx_v_handle = __pyx_t_5;

    /* "pyarrow/io.pxi":263
 *         if self.is_writable:
 *             handle = self.get_output_stream()
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(handle.get().Flush())
 * 
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "pyarrow/io.pxi":264
 *             handle = self.get_output_stream()
 *             with nogil:
 *                 check_status(handle.get().Flush())             # <<<<<<<<<<<<<<
 * 
 *     def write(self, data):
 */
          __pyx_t_6 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_handle.get()->Flush()); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(7, 264, __pyx_L5_error)
        }

        /* "pyarrow/io.pxi":263
 *         if self.is_writable:
 *             handle = self.get_output_stream()
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(handle.get().Flush())
 * 
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L6;
          }
          __pyx_L5_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L6:;
        }
    }

    /* "pyarrow/io.pxi":261
 *         self._assert_open()
 *         # For IOBase compatibility, flush() on an input stream is a no-op
 *         if self.is_writable:             # <<<<<<<<<<<<<<
 *             handle = self.get_output_stream()
 *             with nogil:
 */
  }

  /* "pyarrow/io.pxi":253
 *         return self.tell()
 * 
 *     def flush(self):             # <<<<<<<<<<<<<<
 *         """
 *         Flush the stream, if applicable.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.flush", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":266
 *                 check_status(handle.get().Flush())
 * 
 *     def write(self, data):             # <<<<<<<<<<<<<<
 *         """
 *         Write byte from any object implementing buffer protocol (bytes,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_37write(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_36write[] = "NativeFile.write(self, data)\n\n        Write byte from any object implementing buffer protocol (bytes,\n        bytearray, ndarray, pyarrow.Buffer)\n\n        Parameters\n        ----------\n        data : bytes-like object or exporter of buffer protocol\n\n        Returns\n        -------\n        nbytes : number of bytes written\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_37write(PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_36write(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), ((PyObject *)__pyx_v_data));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_36write(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_data) {
  std::shared_ptr< arrow::io::OutputStream>  __pyx_v_handle;
  std::shared_ptr< arrow::Buffer>  __pyx_v_buf;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::shared_ptr< arrow::io::OutputStream>  __pyx_t_4;
  std::shared_ptr< arrow::Buffer>  __pyx_t_5;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("write", 0);

  /* "pyarrow/io.pxi":279
 *         nbytes : number of bytes written
 *         """
 *         self._assert_writable()             # <<<<<<<<<<<<<<
 *         handle = self.get_output_stream()
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_writable); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":280
 *         """
 *         self._assert_writable()
 *         handle = self.get_output_stream()             # <<<<<<<<<<<<<<
 * 
 *         cdef shared_ptr[CBuffer] buf = as_c_buffer(data)
 */
  __pyx_t_4 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_self->__pyx_vtab)->get_output_stream(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 280, __pyx_L1_error)
  __pyx_v_handle = __pyx_t_4;

  /* "pyarrow/io.pxi":282
 *         handle = self.get_output_stream()
 * 
 *         cdef shared_ptr[CBuffer] buf = as_c_buffer(data)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_t_5 = __pyx_f_7pyarrow_3lib_as_c_buffer(__pyx_v_data); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 282, __pyx_L1_error)
  __pyx_v_buf = __pyx_t_5;

  /* "pyarrow/io.pxi":284
 *         cdef shared_ptr[CBuffer] buf = as_c_buffer(data)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(handle.get().WriteBuffer(buf))
 *         return buf.get().size()
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":285
 * 
 *         with nogil:
 *             check_status(handle.get().WriteBuffer(buf))             # <<<<<<<<<<<<<<
 *         return buf.get().size()
 * 
 */
        __pyx_t_6 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_handle.get()-> Write(__pyx_v_buf)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(7, 285, __pyx_L4_error)
      }

      /* "pyarrow/io.pxi":284
 *         cdef shared_ptr[CBuffer] buf = as_c_buffer(data)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(handle.get().WriteBuffer(buf))
 *         return buf.get().size()
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io.pxi":286
 *         with nogil:
 *             check_status(handle.get().WriteBuffer(buf))
 *         return buf.get().size()             # <<<<<<<<<<<<<<
 * 
 *     def read(self, nbytes=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_buf.get()->size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":266
 *                 check_status(handle.get().Flush())
 * 
 *     def write(self, data):             # <<<<<<<<<<<<<<
 *         """
 *         Write byte from any object implementing buffer protocol (bytes,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":288
 *         return buf.get().size()
 * 
 *     def read(self, nbytes=None):             # <<<<<<<<<<<<<<
 *         """
 *         Read indicated number of bytes from file, or read all remaining bytes
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_39read(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_38read[] = "NativeFile.read(self, nbytes=None)\n\n        Read indicated number of bytes from file, or read all remaining bytes\n        if no argument passed\n\n        Parameters\n        ----------\n        nbytes : int, default None\n\n        Returns\n        -------\n        data : bytes\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_39read(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_nbytes = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nbytes,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nbytes);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read") < 0)) __PYX_ERR(7, 288, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_nbytes = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("read", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 288, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.read", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_38read(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), __pyx_v_nbytes);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_38read(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_nbytes) {
  int64_t __pyx_v_c_nbytes;
  int64_t __pyx_v_bytes_read;
  PyObject *__pyx_v_obj;
  long __pyx_v_bs;
  PyObject *__pyx_v_chunks = NULL;
  PyObject *__pyx_v_chunk = NULL;
  std::shared_ptr< arrow::io::InputStream>  __pyx_v_handle;
  uint8_t *__pyx_v_buf;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int64_t __pyx_t_8;
  std::shared_ptr< arrow::io::InputStream>  __pyx_t_9;
  PyObject *__pyx_t_10;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("read", 0);

  /* "pyarrow/io.pxi":303
 *         cdef:
 *             int64_t c_nbytes
 *             int64_t bytes_read = 0             # <<<<<<<<<<<<<<
 *             PyObject* obj
 * 
 */
  __pyx_v_bytes_read = 0;

  /* "pyarrow/io.pxi":306
 *             PyObject* obj
 * 
 *         if nbytes is None:             # <<<<<<<<<<<<<<
 *             if not self.is_seekable:
 *                 # Cannot get file size => read chunkwise
 */
  __pyx_t_1 = (__pyx_v_nbytes == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/io.pxi":307
 * 
 *         if nbytes is None:
 *             if not self.is_seekable:             # <<<<<<<<<<<<<<
 *                 # Cannot get file size => read chunkwise
 *                 bs = 16384
 */
    __pyx_t_2 = ((!(__pyx_v_self->is_seekable != 0)) != 0);
    if (__pyx_t_2) {

      /* "pyarrow/io.pxi":309
 *             if not self.is_seekable:
 *                 # Cannot get file size => read chunkwise
 *                 bs = 16384             # <<<<<<<<<<<<<<
 *                 chunks = []
 *                 while True:
 */
      __pyx_v_bs = 0x4000;

      /* "pyarrow/io.pxi":310
 *                 # Cannot get file size => read chunkwise
 *                 bs = 16384
 *                 chunks = []             # <<<<<<<<<<<<<<
 *                 while True:
 *                     chunk = self.read(bs)
 */
      __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 310, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_v_chunks = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;

      /* "pyarrow/io.pxi":311
 *                 bs = 16384
 *                 chunks = []
 *                 while True:             # <<<<<<<<<<<<<<
 *                     chunk = self.read(bs)
 *                     if not chunk:
 */
      while (1) {

        /* "pyarrow/io.pxi":312
 *                 chunks = []
 *                 while True:
 *                     chunk = self.read(bs)             # <<<<<<<<<<<<<<
 *                     if not chunk:
 *                         break
 */
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 312, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_v_bs); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 312, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 312, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF_SET(__pyx_v_chunk, __pyx_t_3);
        __pyx_t_3 = 0;

        /* "pyarrow/io.pxi":313
 *                 while True:
 *                     chunk = self.read(bs)
 *                     if not chunk:             # <<<<<<<<<<<<<<
 *                         break
 *                     chunks.append(chunk)
 */
        __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_chunk); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(7, 313, __pyx_L1_error)
        __pyx_t_1 = ((!__pyx_t_2) != 0);
        if (__pyx_t_1) {

          /* "pyarrow/io.pxi":314
 *                     chunk = self.read(bs)
 *                     if not chunk:
 *                         break             # <<<<<<<<<<<<<<
 *                     chunks.append(chunk)
 *                 return b"".join(chunks)
 */
          goto __pyx_L6_break;

          /* "pyarrow/io.pxi":313
 *                 while True:
 *                     chunk = self.read(bs)
 *                     if not chunk:             # <<<<<<<<<<<<<<
 *                         break
 *                     chunks.append(chunk)
 */
        }

        /* "pyarrow/io.pxi":315
 *                     if not chunk:
 *                         break
 *                     chunks.append(chunk)             # <<<<<<<<<<<<<<
 *                 return b"".join(chunks)
 * 
 */
        __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_chunks, __pyx_v_chunk); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(7, 315, __pyx_L1_error)
      }
      __pyx_L6_break:;

      /* "pyarrow/io.pxi":316
 *                         break
 *                     chunks.append(chunk)
 *                 return b"".join(chunks)             # <<<<<<<<<<<<<<
 * 
 *             c_nbytes = self.size() - self.tell()
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyBytes_Join(__pyx_kp_b__198, __pyx_v_chunks); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 316, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "pyarrow/io.pxi":307
 * 
 *         if nbytes is None:
 *             if not self.is_seekable:             # <<<<<<<<<<<<<<
 *                 # Cannot get file size => read chunkwise
 *                 bs = 16384
 */
    }

    /* "pyarrow/io.pxi":318
 *                 return b"".join(chunks)
 * 
 *             c_nbytes = self.size() - self.tell()             # <<<<<<<<<<<<<<
 *         else:
 *             c_nbytes = nbytes
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tell); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_Subtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_8 = __Pyx_PyInt_As_int64_t(__pyx_t_5); if (unlikely((__pyx_t_8 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 318, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_c_nbytes = __pyx_t_8;

    /* "pyarrow/io.pxi":306
 *             PyObject* obj
 * 
 *         if nbytes is None:             # <<<<<<<<<<<<<<
 *             if not self.is_seekable:
 *                 # Cannot get file size => read chunkwise
 */
    goto __pyx_L3;
  }

  /* "pyarrow/io.pxi":320
 *             c_nbytes = self.size() - self.tell()
 *         else:
 *             c_nbytes = nbytes             # <<<<<<<<<<<<<<
 * 
 *         handle = self.get_input_stream()
 */
  /*else*/ {
    __pyx_t_8 = __Pyx_PyInt_As_int64_t(__pyx_v_nbytes); if (unlikely((__pyx_t_8 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 320, __pyx_L1_error)
    __pyx_v_c_nbytes = __pyx_t_8;
  }
  __pyx_L3:;

  /* "pyarrow/io.pxi":322
 *             c_nbytes = nbytes
 * 
 *         handle = self.get_input_stream()             # <<<<<<<<<<<<<<
 * 
 *         # Allocate empty write space
 */
  __pyx_t_9 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_self->__pyx_vtab)->get_input_stream(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 322, __pyx_L1_error)
  __pyx_v_handle = __pyx_t_9;

  /* "pyarrow/io.pxi":325
 * 
 *         # Allocate empty write space
 *         obj = PyBytes_FromStringAndSizeNative(NULL, c_nbytes)             # <<<<<<<<<<<<<<
 * 
 *         cdef uint8_t* buf = <uint8_t*> cp.PyBytes_AS_STRING(<object> obj)
 */
  __pyx_t_10 =  PyBytes_FromStringAndSize(NULL, __pyx_v_c_nbytes); if (unlikely(__pyx_t_10 == ((PyObject *)NULL))) __PYX_ERR(7, 325, __pyx_L1_error)
  __pyx_v_obj = __pyx_t_10;

  /* "pyarrow/io.pxi":327
 *         obj = PyBytes_FromStringAndSizeNative(NULL, c_nbytes)
 * 
 *         cdef uint8_t* buf = <uint8_t*> cp.PyBytes_AS_STRING(<object> obj)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             bytes_read = GetResultValue(handle.get().Read(c_nbytes, buf))
 */
  __pyx_v_buf = ((uint8_t *)PyBytes_AS_STRING(((PyObject *)__pyx_v_obj)));

  /* "pyarrow/io.pxi":328
 * 
 *         cdef uint8_t* buf = <uint8_t*> cp.PyBytes_AS_STRING(<object> obj)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             bytes_read = GetResultValue(handle.get().Read(c_nbytes, buf))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":329
 *         cdef uint8_t* buf = <uint8_t*> cp.PyBytes_AS_STRING(<object> obj)
 *         with nogil:
 *             bytes_read = GetResultValue(handle.get().Read(c_nbytes, buf))             # <<<<<<<<<<<<<<
 * 
 *         if bytes_read < c_nbytes:
 */
        __pyx_t_8 = arrow::py::GetResultValue<int64_t>(__pyx_v_handle.get()->Read(__pyx_v_c_nbytes, __pyx_v_buf)); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(7, 329, __pyx_L9_error)
        __pyx_v_bytes_read = __pyx_t_8;
      }

      /* "pyarrow/io.pxi":328
 * 
 *         cdef uint8_t* buf = <uint8_t*> cp.PyBytes_AS_STRING(<object> obj)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             bytes_read = GetResultValue(handle.get().Read(c_nbytes, buf))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L10;
        }
        __pyx_L9_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L10:;
      }
  }

  /* "pyarrow/io.pxi":331
 *             bytes_read = GetResultValue(handle.get().Read(c_nbytes, buf))
 * 
 *         if bytes_read < c_nbytes:             # <<<<<<<<<<<<<<
 *             cp._PyBytes_Resize(&obj, <Py_ssize_t> bytes_read)
 * 
 */
  __pyx_t_1 = ((__pyx_v_bytes_read < __pyx_v_c_nbytes) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":332
 * 
 *         if bytes_read < c_nbytes:
 *             cp._PyBytes_Resize(&obj, <Py_ssize_t> bytes_read)             # <<<<<<<<<<<<<<
 * 
 *         return PyObject_to_object(obj)
 */
    __pyx_t_11 = _PyBytes_Resize((&__pyx_v_obj), ((Py_ssize_t)__pyx_v_bytes_read)); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(7, 332, __pyx_L1_error)

    /* "pyarrow/io.pxi":331
 *             bytes_read = GetResultValue(handle.get().Read(c_nbytes, buf))
 * 
 *         if bytes_read < c_nbytes:             # <<<<<<<<<<<<<<
 *             cp._PyBytes_Resize(&obj, <Py_ssize_t> bytes_read)
 * 
 */
  }

  /* "pyarrow/io.pxi":334
 *             cp._PyBytes_Resize(&obj, <Py_ssize_t> bytes_read)
 * 
 *         return PyObject_to_object(obj)             # <<<<<<<<<<<<<<
 * 
 *     def read_at(self, nbytes, offset):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __pyx_f_7pyarrow_8includes_6common_PyObject_to_object(__pyx_v_obj); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":288
 *         return buf.get().size()
 * 
 *     def read(self, nbytes=None):             # <<<<<<<<<<<<<<
 *         """
 *         Read indicated number of bytes from file, or read all remaining bytes
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.read", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_chunks);
  __Pyx_XDECREF(__pyx_v_chunk);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":336
 *         return PyObject_to_object(obj)
 * 
 *     def read_at(self, nbytes, offset):             # <<<<<<<<<<<<<<
 *         """
 *         Read indicated number of bytes at offset from the file
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_41read_at(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_40read_at[] = "NativeFile.read_at(self, nbytes, offset)\n\n        Read indicated number of bytes at offset from the file\n\n        Parameters\n        ----------\n        nbytes : int\n        offset : int\n\n        Returns\n        -------\n        data : bytes\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_41read_at(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_nbytes = 0;
  PyObject *__pyx_v_offset = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_at (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nbytes,&__pyx_n_s_offset,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nbytes)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offset)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("read_at", 1, 2, 2, 1); __PYX_ERR(7, 336, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_at") < 0)) __PYX_ERR(7, 336, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_nbytes = values[0];
    __pyx_v_offset = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("read_at", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 336, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.read_at", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_40read_at(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), __pyx_v_nbytes, __pyx_v_offset);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_40read_at(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_nbytes, PyObject *__pyx_v_offset) {
  int64_t __pyx_v_c_nbytes;
  int64_t __pyx_v_c_offset;
  int64_t __pyx_v_bytes_read;
  PyObject *__pyx_v_obj;
  std::shared_ptr< arrow::io::RandomAccessFile>  __pyx_v_handle;
  uint8_t *__pyx_v_buf;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int64_t __pyx_t_1;
  std::shared_ptr< arrow::io::RandomAccessFile>  __pyx_t_2;
  PyObject *__pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("read_at", 0);

  /* "pyarrow/io.pxi":352
 *             int64_t c_nbytes
 *             int64_t c_offset
 *             int64_t bytes_read = 0             # <<<<<<<<<<<<<<
 *             PyObject* obj
 * 
 */
  __pyx_v_bytes_read = 0;

  /* "pyarrow/io.pxi":355
 *             PyObject* obj
 * 
 *         c_nbytes = nbytes             # <<<<<<<<<<<<<<
 * 
 *         c_offset = offset
 */
  __pyx_t_1 = __Pyx_PyInt_As_int64_t(__pyx_v_nbytes); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 355, __pyx_L1_error)
  __pyx_v_c_nbytes = __pyx_t_1;

  /* "pyarrow/io.pxi":357
 *         c_nbytes = nbytes
 * 
 *         c_offset = offset             # <<<<<<<<<<<<<<
 * 
 *         handle = self.get_random_access_file()
 */
  __pyx_t_1 = __Pyx_PyInt_As_int64_t(__pyx_v_offset); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 357, __pyx_L1_error)
  __pyx_v_c_offset = __pyx_t_1;

  /* "pyarrow/io.pxi":359
 *         c_offset = offset
 * 
 *         handle = self.get_random_access_file()             # <<<<<<<<<<<<<<
 * 
 *         # Allocate empty write space
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_self->__pyx_vtab)->get_random_access_file(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 359, __pyx_L1_error)
  __pyx_v_handle = __pyx_t_2;

  /* "pyarrow/io.pxi":362
 * 
 *         # Allocate empty write space
 *         obj = PyBytes_FromStringAndSizeNative(NULL, c_nbytes)             # <<<<<<<<<<<<<<
 * 
 *         cdef uint8_t* buf = <uint8_t*> cp.PyBytes_AS_STRING(<object> obj)
 */
  __pyx_t_3 =  PyBytes_FromStringAndSize(NULL, __pyx_v_c_nbytes); if (unlikely(__pyx_t_3 == ((PyObject *)NULL))) __PYX_ERR(7, 362, __pyx_L1_error)
  __pyx_v_obj = __pyx_t_3;

  /* "pyarrow/io.pxi":364
 *         obj = PyBytes_FromStringAndSizeNative(NULL, c_nbytes)
 * 
 *         cdef uint8_t* buf = <uint8_t*> cp.PyBytes_AS_STRING(<object> obj)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             bytes_read = GetResultValue(handle.get().
 */
  __pyx_v_buf = ((uint8_t *)PyBytes_AS_STRING(((PyObject *)__pyx_v_obj)));

  /* "pyarrow/io.pxi":365
 * 
 *         cdef uint8_t* buf = <uint8_t*> cp.PyBytes_AS_STRING(<object> obj)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             bytes_read = GetResultValue(handle.get().
 *                                         ReadAt(c_offset, c_nbytes, buf))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":366
 *         cdef uint8_t* buf = <uint8_t*> cp.PyBytes_AS_STRING(<object> obj)
 *         with nogil:
 *             bytes_read = GetResultValue(handle.get().             # <<<<<<<<<<<<<<
 *                                         ReadAt(c_offset, c_nbytes, buf))
 * 
 */
        __pyx_t_1 = arrow::py::GetResultValue<int64_t>(__pyx_v_handle.get()->ReadAt(__pyx_v_c_offset, __pyx_v_c_nbytes, __pyx_v_buf)); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(7, 366, __pyx_L4_error)
        __pyx_v_bytes_read = __pyx_t_1;
      }

      /* "pyarrow/io.pxi":365
 * 
 *         cdef uint8_t* buf = <uint8_t*> cp.PyBytes_AS_STRING(<object> obj)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             bytes_read = GetResultValue(handle.get().
 *                                         ReadAt(c_offset, c_nbytes, buf))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io.pxi":369
 *                                         ReadAt(c_offset, c_nbytes, buf))
 * 
 *         if bytes_read < c_nbytes:             # <<<<<<<<<<<<<<
 *             cp._PyBytes_Resize(&obj, <Py_ssize_t> bytes_read)
 * 
 */
  __pyx_t_4 = ((__pyx_v_bytes_read < __pyx_v_c_nbytes) != 0);
  if (__pyx_t_4) {

    /* "pyarrow/io.pxi":370
 * 
 *         if bytes_read < c_nbytes:
 *             cp._PyBytes_Resize(&obj, <Py_ssize_t> bytes_read)             # <<<<<<<<<<<<<<
 * 
 *         return PyObject_to_object(obj)
 */
    __pyx_t_5 = _PyBytes_Resize((&__pyx_v_obj), ((Py_ssize_t)__pyx_v_bytes_read)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(7, 370, __pyx_L1_error)

    /* "pyarrow/io.pxi":369
 *                                         ReadAt(c_offset, c_nbytes, buf))
 * 
 *         if bytes_read < c_nbytes:             # <<<<<<<<<<<<<<
 *             cp._PyBytes_Resize(&obj, <Py_ssize_t> bytes_read)
 * 
 */
  }

  /* "pyarrow/io.pxi":372
 *             cp._PyBytes_Resize(&obj, <Py_ssize_t> bytes_read)
 * 
 *         return PyObject_to_object(obj)             # <<<<<<<<<<<<<<
 * 
 *     def read1(self, nbytes=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = __pyx_f_7pyarrow_8includes_6common_PyObject_to_object(__pyx_v_obj); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":336
 *         return PyObject_to_object(obj)
 * 
 *     def read_at(self, nbytes, offset):             # <<<<<<<<<<<<<<
 *         """
 *         Read indicated number of bytes at offset from the file
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.read_at", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":374
 *         return PyObject_to_object(obj)
 * 
 *     def read1(self, nbytes=None):             # <<<<<<<<<<<<<<
 *         """Read and return up to n bytes.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_43read1(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_42read1[] = "NativeFile.read1(self, nbytes=None)\nRead and return up to n bytes.\n\n        Alias for read, needed to match the IOBase interface.";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_43read1(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_nbytes = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read1 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nbytes,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nbytes);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read1") < 0)) __PYX_ERR(7, 374, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_nbytes = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("read1", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 374, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.read1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_42read1(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), __pyx_v_nbytes);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_42read1(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_nbytes) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("read1", 0);

  /* "pyarrow/io.pxi":378
 * 
 *         Alias for read, needed to match the IOBase interface."""
 *         return self.read(nbytes=None)             # <<<<<<<<<<<<<<
 * 
 *     def readall(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_nbytes, Py_None) < 0) __PYX_ERR(7, 378, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":374
 *         return PyObject_to_object(obj)
 * 
 *     def read1(self, nbytes=None):             # <<<<<<<<<<<<<<
 *         """Read and return up to n bytes.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.read1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":380
 *         return self.read(nbytes=None)
 * 
 *     def readall(self):             # <<<<<<<<<<<<<<
 *         return self.read()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_45readall(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_44readall[] = "NativeFile.readall(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_45readall(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("readall (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_44readall(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_44readall(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("readall", 0);

  /* "pyarrow/io.pxi":381
 * 
 *     def readall(self):
 *         return self.read()             # <<<<<<<<<<<<<<
 * 
 *     def readinto(self, b):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":380
 *         return self.read(nbytes=None)
 * 
 *     def readall(self):             # <<<<<<<<<<<<<<
 *         return self.read()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.readall", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":383
 *         return self.read()
 * 
 *     def readinto(self, b):             # <<<<<<<<<<<<<<
 *         """
 *         Read into the supplied buffer
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_47readinto(PyObject *__pyx_v_self, PyObject *__pyx_v_b); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_46readinto[] = "NativeFile.readinto(self, b)\n\n        Read into the supplied buffer\n\n        Parameters\n        -----------\n        b: any python object supporting buffer interface\n\n        Returns\n        --------\n        number of bytes written\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_47readinto(PyObject *__pyx_v_self, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("readinto (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_46readinto(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), ((PyObject *)__pyx_v_b));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_46readinto(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_b) {
  int64_t __pyx_v_bytes_read;
  uint8_t *__pyx_v_buf;
  struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_py_buf = 0;
  int64_t __pyx_v_buf_len;
  std::shared_ptr< arrow::io::InputStream>  __pyx_v_handle;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr< arrow::io::InputStream>  __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int64_t __pyx_t_5;
  __Pyx_RefNannySetupContext("readinto", 0);

  /* "pyarrow/io.pxi":402
 *             int64_t buf_len
 * 
 *         handle = self.get_input_stream()             # <<<<<<<<<<<<<<
 * 
 *         py_buf = py_buffer(b)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_self->__pyx_vtab)->get_input_stream(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 402, __pyx_L1_error)
  __pyx_v_handle = __pyx_t_1;

  /* "pyarrow/io.pxi":404
 *         handle = self.get_input_stream()
 * 
 *         py_buf = py_buffer(b)             # <<<<<<<<<<<<<<
 *         buf_len = py_buf.size
 *         buf = py_buf.buffer.get().mutable_data()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_py_buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_b) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_b);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7pyarrow_3lib_Buffer))))) __PYX_ERR(7, 404, __pyx_L1_error)
  __pyx_v_py_buf = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/io.pxi":405
 * 
 *         py_buf = py_buffer(b)
 *         buf_len = py_buf.size             # <<<<<<<<<<<<<<
 *         buf = py_buf.buffer.get().mutable_data()
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_py_buf), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 405, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_buf_len = __pyx_t_5;

  /* "pyarrow/io.pxi":406
 *         py_buf = py_buffer(b)
 *         buf_len = py_buf.size
 *         buf = py_buf.buffer.get().mutable_data()             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_v_buf = __pyx_v_py_buf->buffer.get()->mutable_data();

  /* "pyarrow/io.pxi":408
 *         buf = py_buf.buffer.get().mutable_data()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             bytes_read = GetResultValue(handle.get().Read(buf_len, buf))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":409
 * 
 *         with nogil:
 *             bytes_read = GetResultValue(handle.get().Read(buf_len, buf))             # <<<<<<<<<<<<<<
 * 
 *         return bytes_read
 */
        __pyx_t_5 = arrow::py::GetResultValue<int64_t>(__pyx_v_handle.get()->Read(__pyx_v_buf_len, __pyx_v_buf)); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(7, 409, __pyx_L4_error)
        __pyx_v_bytes_read = __pyx_t_5;
      }

      /* "pyarrow/io.pxi":408
 *         buf = py_buf.buffer.get().mutable_data()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             bytes_read = GetResultValue(handle.get().Read(buf_len, buf))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io.pxi":411
 *             bytes_read = GetResultValue(handle.get().Read(buf_len, buf))
 * 
 *         return bytes_read             # <<<<<<<<<<<<<<
 * 
 *     def readline(self, size=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_bytes_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 411, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":383
 *         return self.read()
 * 
 *     def readinto(self, b):             # <<<<<<<<<<<<<<
 *         """
 *         Read into the supplied buffer
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.readinto", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_py_buf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":413
 *         return bytes_read
 * 
 *     def readline(self, size=None):             # <<<<<<<<<<<<<<
 *         """NOT IMPLEMENTED. Read and return a line of bytes from the file.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_49readline(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_48readline[] = "NativeFile.readline(self, size=None)\nNOT IMPLEMENTED. Read and return a line of bytes from the file.\n\n        If size is specified, read at most size bytes.\n\n        Line terminator is always b\"\\n\".\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_49readline(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_size = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("readline (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "readline") < 0)) __PYX_ERR(7, 413, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_size = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("readline", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 413, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.readline", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_48readline(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), __pyx_v_size);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_48readline(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_size) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("readline", 0);

  /* "pyarrow/io.pxi":421
 *         """
 * 
 *         raise UnsupportedOperation()             # <<<<<<<<<<<<<<
 * 
 *     def readlines(self, hint=None):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_UnsupportedOperation); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(7, 421, __pyx_L1_error)

  /* "pyarrow/io.pxi":413
 *         return bytes_read
 * 
 *     def readline(self, size=None):             # <<<<<<<<<<<<<<
 *         """NOT IMPLEMENTED. Read and return a line of bytes from the file.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.readline", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":423
 *         raise UnsupportedOperation()
 * 
 *     def readlines(self, hint=None):             # <<<<<<<<<<<<<<
 *         """NOT IMPLEMENTED. Read lines of the file
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_51readlines(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_50readlines[] = "NativeFile.readlines(self, hint=None)\nNOT IMPLEMENTED. Read lines of the file\n\n        Parameters\n        -----------\n\n        hint: int maximum number of bytes read until we stop\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_51readlines(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_hint = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("readlines (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hint,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hint);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "readlines") < 0)) __PYX_ERR(7, 423, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_hint = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("readlines", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 423, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.readlines", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_50readlines(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), __pyx_v_hint);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_50readlines(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_hint) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("readlines", 0);

  /* "pyarrow/io.pxi":432
 *         """
 * 
 *         raise UnsupportedOperation()             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_UnsupportedOperation); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(7, 432, __pyx_L1_error)

  /* "pyarrow/io.pxi":423
 *         raise UnsupportedOperation()
 * 
 *     def readlines(self, hint=None):             # <<<<<<<<<<<<<<
 *         """NOT IMPLEMENTED. Read lines of the file
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.readlines", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":434
 *         raise UnsupportedOperation()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         self._assert_readable()
 *         return self
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_53__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_53__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_52__iter__(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_52__iter__(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "pyarrow/io.pxi":435
 * 
 *     def __iter__(self):
 *         self._assert_readable()             # <<<<<<<<<<<<<<
 *         return self
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_readable); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":436
 *     def __iter__(self):
 *         self._assert_readable()
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pyarrow/io.pxi":434
 *         raise UnsupportedOperation()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         self._assert_readable()
 *         return self
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":438
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         line = self.readline()
 *         if not line:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_55__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_55__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_54__next__(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_54__next__(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  PyObject *__pyx_v_line = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "pyarrow/io.pxi":439
 * 
 *     def __next__(self):
 *         line = self.readline()             # <<<<<<<<<<<<<<
 *         if not line:
 *             raise StopIteration
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_readline); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_line = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":440
 *     def __next__(self):
 *         line = self.readline()
 *         if not line:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 *         return line
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_line); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(7, 440, __pyx_L1_error)
  __pyx_t_5 = ((!__pyx_t_4) != 0);
  if (unlikely(__pyx_t_5)) {

    /* "pyarrow/io.pxi":441
 *         line = self.readline()
 *         if not line:
 *             raise StopIteration             # <<<<<<<<<<<<<<
 *         return line
 * 
 */
    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
    __PYX_ERR(7, 441, __pyx_L1_error)

    /* "pyarrow/io.pxi":440
 *     def __next__(self):
 *         line = self.readline()
 *         if not line:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 *         return line
 */
  }

  /* "pyarrow/io.pxi":442
 *         if not line:
 *             raise StopIteration
 *         return line             # <<<<<<<<<<<<<<
 * 
 *     def read_buffer(self, nbytes=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_line);
  __pyx_r = __pyx_v_line;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":438
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         line = self.readline()
 *         if not line:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_line);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":444
 *         return line
 * 
 *     def read_buffer(self, nbytes=None):             # <<<<<<<<<<<<<<
 *         cdef:
 *             int64_t c_nbytes
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_57read_buffer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_56read_buffer[] = "NativeFile.read_buffer(self, nbytes=None)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_57read_buffer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_nbytes = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_buffer (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nbytes,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nbytes);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_buffer") < 0)) __PYX_ERR(7, 444, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_nbytes = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("read_buffer", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 444, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.read_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_56read_buffer(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), __pyx_v_nbytes);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_56read_buffer(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_nbytes) {
  int64_t __pyx_v_c_nbytes;
  CYTHON_UNUSED int64_t __pyx_v_bytes_read;
  std::shared_ptr< arrow::Buffer>  __pyx_v_output;
  std::shared_ptr< arrow::io::InputStream>  __pyx_v_handle;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr< arrow::io::InputStream>  __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int64_t __pyx_t_9;
  std::shared_ptr< arrow::Buffer>  __pyx_t_10;
  __Pyx_RefNannySetupContext("read_buffer", 0);

  /* "pyarrow/io.pxi":447
 *         cdef:
 *             int64_t c_nbytes
 *             int64_t bytes_read = 0             # <<<<<<<<<<<<<<
 *             shared_ptr[CBuffer] output
 * 
 */
  __pyx_v_bytes_read = 0;

  /* "pyarrow/io.pxi":450
 *             shared_ptr[CBuffer] output
 * 
 *         handle = self.get_input_stream()             # <<<<<<<<<<<<<<
 * 
 *         if nbytes is None:
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_self->__pyx_vtab)->get_input_stream(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 450, __pyx_L1_error)
  __pyx_v_handle = __pyx_t_1;

  /* "pyarrow/io.pxi":452
 *         handle = self.get_input_stream()
 * 
 *         if nbytes is None:             # <<<<<<<<<<<<<<
 *             if not self.is_seekable:
 *                 # Cannot get file size => read chunkwise
 */
  __pyx_t_2 = (__pyx_v_nbytes == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/io.pxi":453
 * 
 *         if nbytes is None:
 *             if not self.is_seekable:             # <<<<<<<<<<<<<<
 *                 # Cannot get file size => read chunkwise
 *                 return py_buffer(self.read())
 */
    __pyx_t_3 = ((!(__pyx_v_self->is_seekable != 0)) != 0);
    if (__pyx_t_3) {

      /* "pyarrow/io.pxi":455
 *             if not self.is_seekable:
 *                 # Cannot get file size => read chunkwise
 *                 return py_buffer(self.read())             # <<<<<<<<<<<<<<
 *             c_nbytes = self.size() - self.tell()
 *         else:
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_py_buffer); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 455, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 455, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 455, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 455, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;

      /* "pyarrow/io.pxi":453
 * 
 *         if nbytes is None:
 *             if not self.is_seekable:             # <<<<<<<<<<<<<<
 *                 # Cannot get file size => read chunkwise
 *                 return py_buffer(self.read())
 */
    }

    /* "pyarrow/io.pxi":456
 *                 # Cannot get file size => read chunkwise
 *                 return py_buffer(self.read())
 *             c_nbytes = self.size() - self.tell()             # <<<<<<<<<<<<<<
 *         else:
 *             c_nbytes = nbytes
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 456, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 456, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tell); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 456, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 456, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 456, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_9 = __Pyx_PyInt_As_int64_t(__pyx_t_6); if (unlikely((__pyx_t_9 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 456, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_c_nbytes = __pyx_t_9;

    /* "pyarrow/io.pxi":452
 *         handle = self.get_input_stream()
 * 
 *         if nbytes is None:             # <<<<<<<<<<<<<<
 *             if not self.is_seekable:
 *                 # Cannot get file size => read chunkwise
 */
    goto __pyx_L3;
  }

  /* "pyarrow/io.pxi":458
 *             c_nbytes = self.size() - self.tell()
 *         else:
 *             c_nbytes = nbytes             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  /*else*/ {
    __pyx_t_9 = __Pyx_PyInt_As_int64_t(__pyx_v_nbytes); if (unlikely((__pyx_t_9 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 458, __pyx_L1_error)
    __pyx_v_c_nbytes = __pyx_t_9;
  }
  __pyx_L3:;

  /* "pyarrow/io.pxi":460
 *             c_nbytes = nbytes
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             output = GetResultValue(handle.get().ReadBuffer(c_nbytes))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":461
 * 
 *         with nogil:
 *             output = GetResultValue(handle.get().ReadBuffer(c_nbytes))             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_buffer(output)
 */
        __pyx_t_10 = arrow::py::GetResultValue<std::shared_ptr< arrow::Buffer> >(__pyx_v_handle.get()-> Read(__pyx_v_c_nbytes)); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(7, 461, __pyx_L6_error)
        __pyx_v_output = __pyx_t_10;
      }

      /* "pyarrow/io.pxi":460
 *             c_nbytes = nbytes
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             output = GetResultValue(handle.get().ReadBuffer(c_nbytes))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L7;
        }
        __pyx_L6_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L7:;
      }
  }

  /* "pyarrow/io.pxi":463
 *             output = GetResultValue(handle.get().ReadBuffer(c_nbytes))
 * 
 *         return pyarrow_wrap_buffer(output)             # <<<<<<<<<<<<<<
 * 
 *     def truncate(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_output); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":444
 *         return line
 * 
 *     def read_buffer(self, nbytes=None):             # <<<<<<<<<<<<<<
 *         cdef:
 *             int64_t c_nbytes
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.read_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":465
 *         return pyarrow_wrap_buffer(output)
 * 
 *     def truncate(self):             # <<<<<<<<<<<<<<
 *         """
 *         NOT IMPLEMENTED
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_59truncate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_58truncate[] = "NativeFile.truncate(self)\n\n        NOT IMPLEMENTED\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_59truncate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("truncate (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_58truncate(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_58truncate(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("truncate", 0);

  /* "pyarrow/io.pxi":469
 *         NOT IMPLEMENTED
 *         """
 *         raise UnsupportedOperation()             # <<<<<<<<<<<<<<
 * 
 *     def writelines(self, lines):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_UnsupportedOperation); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(7, 469, __pyx_L1_error)

  /* "pyarrow/io.pxi":465
 *         return pyarrow_wrap_buffer(output)
 * 
 *     def truncate(self):             # <<<<<<<<<<<<<<
 *         """
 *         NOT IMPLEMENTED
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":471
 *         raise UnsupportedOperation()
 * 
 *     def writelines(self, lines):             # <<<<<<<<<<<<<<
 *         self._assert_writable()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_61writelines(PyObject *__pyx_v_self, PyObject *__pyx_v_lines); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_60writelines[] = "NativeFile.writelines(self, lines)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_61writelines(PyObject *__pyx_v_self, PyObject *__pyx_v_lines) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("writelines (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_60writelines(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), ((PyObject *)__pyx_v_lines));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_60writelines(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_lines) {
  PyObject *__pyx_v_line = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("writelines", 0);

  /* "pyarrow/io.pxi":472
 * 
 *     def writelines(self, lines):
 *         self._assert_writable()             # <<<<<<<<<<<<<<
 * 
 *         for line in lines:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_writable); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":474
 *         self._assert_writable()
 * 
 *         for line in lines:             # <<<<<<<<<<<<<<
 *             self.write(line)
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_lines)) || PyTuple_CheckExact(__pyx_v_lines)) {
    __pyx_t_1 = __pyx_v_lines; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_lines); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 474, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 474, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(7, 474, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 474, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(7, 474, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 474, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(7, 474, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/io.pxi":475
 * 
 *         for line in lines:
 *             self.write(line)             # <<<<<<<<<<<<<<
 * 
 *     def download(self, stream_or_path, buffer_size=None):
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 475, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_v_line) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_line);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 475, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pyarrow/io.pxi":474
 *         self._assert_writable()
 * 
 *         for line in lines:             # <<<<<<<<<<<<<<
 *             self.write(line)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":471
 *         raise UnsupportedOperation()
 * 
 *     def writelines(self, lines):             # <<<<<<<<<<<<<<
 *         self._assert_writable()
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.writelines", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_line);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":477
 *             self.write(line)
 * 
 *     def download(self, stream_or_path, buffer_size=None):             # <<<<<<<<<<<<<<
 *         """
 *         Read file completely to local path (rather than reading completely into
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_63download(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_62download[] = "NativeFile.download(self, stream_or_path, buffer_size=None)\n\n        Read file completely to local path (rather than reading completely into\n        memory). First seeks to the beginning of the file.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_63download(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_stream_or_path = 0;
  PyObject *__pyx_v_buffer_size = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("download (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stream_or_path,&__pyx_n_s_buffer_size,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stream_or_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffer_size);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "download") < 0)) __PYX_ERR(7, 477, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_stream_or_path = values[0];
    __pyx_v_buffer_size = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("download", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 477, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.download", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_62download(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), __pyx_v_stream_or_path, __pyx_v_buffer_size);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":495
 *             stream = open(stream_or_path, 'wb')
 * 
 *             def cleanup():             # <<<<<<<<<<<<<<
 *                 stream.close()
 *         else:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_8download_1cleanup(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7pyarrow_3lib_10NativeFile_8download_1cleanup = {"cleanup", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_8download_1cleanup, METH_NOARGS, 0};
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_8download_1cleanup(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cleanup (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_8download_cleanup(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_8download_cleanup(PyObject *__pyx_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_17_download *__pyx_cur_scope;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_17_download *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("cleanup", 0);
  __pyx_outer_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_17_download *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "pyarrow/io.pxi":496
 * 
 *             def cleanup():
 *                 stream.close()             # <<<<<<<<<<<<<<
 *         else:
 *             stream = stream_or_path
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_stream)) { __Pyx_RaiseClosureNameError("stream"); __PYX_ERR(7, 496, __pyx_L1_error) }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_stream, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":495
 *             stream = open(stream_or_path, 'wb')
 * 
 *             def cleanup():             # <<<<<<<<<<<<<<
 *                 stream.close()
 *         else:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.download.cleanup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":500
 *             stream = stream_or_path
 * 
 *             def cleanup():             # <<<<<<<<<<<<<<
 *                 pass
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_8download_3cleanup(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7pyarrow_3lib_10NativeFile_8download_3cleanup = {"cleanup", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_8download_3cleanup, METH_NOARGS, 0};
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_8download_3cleanup(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cleanup (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_8download_2cleanup(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_8download_2cleanup(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cleanup", 0);

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":506
 *         exc_info = None
 * 
 *         def bg_write():             # <<<<<<<<<<<<<<
 *             try:
 *                 while not done or write_queue.qsize() > 0:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_8download_5bg_write(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7pyarrow_3lib_10NativeFile_8download_5bg_write = {"bg_write", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_8download_5bg_write, METH_NOARGS, 0};
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_8download_5bg_write(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bg_write (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_8download_4bg_write(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_8download_4bg_write(PyObject *__pyx_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_17_download *__pyx_cur_scope;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_17_download *__pyx_outer_scope;
  PyObject *__pyx_v_buf = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_e = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_exc_info = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_t_16;
  char const *__pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  char const *__pyx_t_21;
  __Pyx_RefNannySetupContext("bg_write", 0);
  __pyx_outer_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_17_download *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "pyarrow/io.pxi":507
 * 
 *         def bg_write():
 *             try:             # <<<<<<<<<<<<<<
 *                 while not done or write_queue.qsize() > 0:
 *                     try:
 */
  /*try:*/ {
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_3);
      /*try:*/ {

        /* "pyarrow/io.pxi":508
 *         def bg_write():
 *             try:
 *                 while not done or write_queue.qsize() > 0:             # <<<<<<<<<<<<<<
 *                     try:
 *                         buf = write_queue.get(timeout=0.01)
 */
        while (1) {
          __pyx_t_5 = ((!(__pyx_cur_scope->__pyx_v_done != 0)) != 0);
          if (!__pyx_t_5) {
          } else {
            __pyx_t_4 = __pyx_t_5;
            goto __pyx_L14_bool_binop_done;
          }
          if (unlikely(!__pyx_cur_scope->__pyx_v_write_queue)) { __Pyx_RaiseClosureNameError("write_queue"); __PYX_ERR(7, 508, __pyx_L6_error) }
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_write_queue, __pyx_n_s_qsize); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 508, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_8 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
            __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
            if (likely(__pyx_t_8)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
              __Pyx_INCREF(__pyx_t_8);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_7, function);
            }
          }
          __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 508, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 508, __pyx_L6_error)
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(7, 508, __pyx_L6_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_4 = __pyx_t_5;
          __pyx_L14_bool_binop_done:;
          if (!__pyx_t_4) break;

          /* "pyarrow/io.pxi":509
 *             try:
 *                 while not done or write_queue.qsize() > 0:
 *                     try:             # <<<<<<<<<<<<<<
 *                         buf = write_queue.get(timeout=0.01)
 *                     except QueueEmpty:
 */
          {
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
            __Pyx_XGOTREF(__pyx_t_9);
            __Pyx_XGOTREF(__pyx_t_10);
            __Pyx_XGOTREF(__pyx_t_11);
            /*try:*/ {

              /* "pyarrow/io.pxi":510
 *                 while not done or write_queue.qsize() > 0:
 *                     try:
 *                         buf = write_queue.get(timeout=0.01)             # <<<<<<<<<<<<<<
 *                     except QueueEmpty:
 *                         continue
 */
              if (unlikely(!__pyx_cur_scope->__pyx_v_write_queue)) { __Pyx_RaiseClosureNameError("write_queue"); __PYX_ERR(7, 510, __pyx_L16_error) }
              __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_write_queue, __pyx_n_s_get); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 510, __pyx_L16_error)
              __Pyx_GOTREF(__pyx_t_7);
              __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 510, __pyx_L16_error)
              __Pyx_GOTREF(__pyx_t_6);
              if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_timeout, __pyx_float_0_01) < 0) __PYX_ERR(7, 510, __pyx_L16_error)
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 510, __pyx_L16_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
              __Pyx_XDECREF_SET(__pyx_v_buf, __pyx_t_8);
              __pyx_t_8 = 0;

              /* "pyarrow/io.pxi":509
 *             try:
 *                 while not done or write_queue.qsize() > 0:
 *                     try:             # <<<<<<<<<<<<<<
 *                         buf = write_queue.get(timeout=0.01)
 *                     except QueueEmpty:
 */
            }
            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            goto __pyx_L23_try_end;
            __pyx_L16_error:;
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

            /* "pyarrow/io.pxi":511
 *                     try:
 *                         buf = write_queue.get(timeout=0.01)
 *                     except QueueEmpty:             # <<<<<<<<<<<<<<
 *                         continue
 *                     stream.write(buf)
 */
            __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_6, &__pyx_t_7);
            __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_QueueEmpty); if (unlikely(!__pyx_t_12)) __PYX_ERR(7, 511, __pyx_L18_except_error)
            __Pyx_GOTREF(__pyx_t_12);
            __pyx_t_13 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_8, __pyx_t_12);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_ErrRestore(__pyx_t_8, __pyx_t_6, __pyx_t_7);
            __pyx_t_8 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0;
            if (__pyx_t_13) {
              __Pyx_AddTraceback("pyarrow.lib.NativeFile.download.bg_write", __pyx_clineno, __pyx_lineno, __pyx_filename);
              if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_6, &__pyx_t_8) < 0) __PYX_ERR(7, 511, __pyx_L18_except_error)
              __Pyx_GOTREF(__pyx_t_7);
              __Pyx_GOTREF(__pyx_t_6);
              __Pyx_GOTREF(__pyx_t_8);

              /* "pyarrow/io.pxi":512
 *                         buf = write_queue.get(timeout=0.01)
 *                     except QueueEmpty:
 *                         continue             # <<<<<<<<<<<<<<
 *                     stream.write(buf)
 *             except Exception as e:
 */
              goto __pyx_L25_except_continue;
              __pyx_L25_except_continue:;
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              goto __pyx_L22_try_continue;
            }
            goto __pyx_L18_except_error;
            __pyx_L18_except_error:;

            /* "pyarrow/io.pxi":509
 *             try:
 *                 while not done or write_queue.qsize() > 0:
 *                     try:             # <<<<<<<<<<<<<<
 *                         buf = write_queue.get(timeout=0.01)
 *                     except QueueEmpty:
 */
            __Pyx_XGIVEREF(__pyx_t_9);
            __Pyx_XGIVEREF(__pyx_t_10);
            __Pyx_XGIVEREF(__pyx_t_11);
            __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
            goto __pyx_L6_error;
            __pyx_L22_try_continue:;
            __Pyx_XGIVEREF(__pyx_t_9);
            __Pyx_XGIVEREF(__pyx_t_10);
            __Pyx_XGIVEREF(__pyx_t_11);
            __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
            goto __pyx_L12_continue;
            __pyx_L23_try_end:;
          }

          /* "pyarrow/io.pxi":513
 *                     except QueueEmpty:
 *                         continue
 *                     stream.write(buf)             # <<<<<<<<<<<<<<
 *             except Exception as e:
 *                 exc_info = sys.exc_info()
 */
          if (unlikely(!__pyx_cur_scope->__pyx_v_stream)) { __Pyx_RaiseClosureNameError("stream"); __PYX_ERR(7, 513, __pyx_L6_error) }
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_stream, __pyx_n_s_write); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 513, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_7 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
            __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
            if (likely(__pyx_t_7)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
              __Pyx_INCREF(__pyx_t_7);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_6, function);
            }
          }
          __pyx_t_8 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_buf) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_buf);
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 513, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_L12_continue:;
        }

        /* "pyarrow/io.pxi":507
 * 
 *         def bg_write():
 *             try:             # <<<<<<<<<<<<<<
 *                 while not done or write_queue.qsize() > 0:
 *                     try:
 */
      }
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L11_try_end;
      __pyx_L6_error:;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "pyarrow/io.pxi":514
 *                         continue
 *                     stream.write(buf)
 *             except Exception as e:             # <<<<<<<<<<<<<<
 *                 exc_info = sys.exc_info()
 *             finally:
 */
      __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
      if (__pyx_t_13) {
        __Pyx_AddTraceback("pyarrow.lib.NativeFile.download.bg_write", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(7, 514, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_6);
        __pyx_v_e = __pyx_t_6;
        /*try:*/ {

          /* "pyarrow/io.pxi":515
 *                     stream.write(buf)
 *             except Exception as e:
 *                 exc_info = sys.exc_info()             # <<<<<<<<<<<<<<
 *             finally:
 *                 cleanup()
 */
          __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_sys); if (unlikely(!__pyx_t_14)) __PYX_ERR(7, 515, __pyx_L31_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_15)) __PYX_ERR(7, 515, __pyx_L31_error)
          __Pyx_GOTREF(__pyx_t_15);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_14 = NULL;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) {
            __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_15);
            if (likely(__pyx_t_14)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
              __Pyx_INCREF(__pyx_t_14);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_15, function);
            }
          }
          __pyx_t_12 = (__pyx_t_14) ? __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_14) : __Pyx_PyObject_CallNoArg(__pyx_t_15);
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (unlikely(!__pyx_t_12)) __PYX_ERR(7, 515, __pyx_L31_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          __pyx_v_exc_info = __pyx_t_12;
          __pyx_t_12 = 0;
        }

        /* "pyarrow/io.pxi":514
 *                         continue
 *                     stream.write(buf)
 *             except Exception as e:             # <<<<<<<<<<<<<<
 *                 exc_info = sys.exc_info()
 *             finally:
 */
        /*finally:*/ {
          /*normal exit:*/{
            __Pyx_DECREF(__pyx_v_e);
            __pyx_v_e = NULL;
            goto __pyx_L32;
          }
          __pyx_L31_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
            if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
            if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
            __Pyx_XGOTREF(__pyx_t_11);
            __Pyx_XGOTREF(__pyx_t_10);
            __Pyx_XGOTREF(__pyx_t_9);
            __Pyx_XGOTREF(__pyx_t_18);
            __Pyx_XGOTREF(__pyx_t_19);
            __Pyx_XGOTREF(__pyx_t_20);
            __pyx_t_13 = __pyx_lineno; __pyx_t_16 = __pyx_clineno; __pyx_t_17 = __pyx_filename;
            {
              __Pyx_DECREF(__pyx_v_e);
              __pyx_v_e = NULL;
            }
            if (PY_MAJOR_VERSION >= 3) {
              __Pyx_XGIVEREF(__pyx_t_18);
              __Pyx_XGIVEREF(__pyx_t_19);
              __Pyx_XGIVEREF(__pyx_t_20);
              __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
            }
            __Pyx_XGIVEREF(__pyx_t_11);
            __Pyx_XGIVEREF(__pyx_t_10);
            __Pyx_XGIVEREF(__pyx_t_9);
            __Pyx_ErrRestore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
            __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
            __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_16; __pyx_filename = __pyx_t_17;
            goto __pyx_L8_except_error;
          }
          __pyx_L32:;
        }
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L7_exception_handled;
      }
      goto __pyx_L8_except_error;
      __pyx_L8_except_error:;

      /* "pyarrow/io.pxi":507
 * 
 *         def bg_write():
 *             try:             # <<<<<<<<<<<<<<
 *                 while not done or write_queue.qsize() > 0:
 *                     try:
 */
      __Pyx_XGIVEREF(__pyx_t_1);
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
      goto __pyx_L4_error;
      __pyx_L7_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_1);
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
      __pyx_L11_try_end:;
    }
  }

  /* "pyarrow/io.pxi":517
 *                 exc_info = sys.exc_info()
 *             finally:
 *                 cleanup()             # <<<<<<<<<<<<<<
 * 
 *         self.seek(0)
 */
  /*finally:*/ {
    /*normal exit:*/{
      if (unlikely(!__pyx_cur_scope->__pyx_v_cleanup)) { __Pyx_RaiseClosureNameError("cleanup"); __PYX_ERR(7, 517, __pyx_L1_error) }
      __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_cur_scope->__pyx_v_cleanup); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 517, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L5;
    }
    __pyx_L4_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_19, &__pyx_t_18);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1) < 0)) __Pyx_ErrFetch(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_20);
      __Pyx_XGOTREF(__pyx_t_19);
      __Pyx_XGOTREF(__pyx_t_18);
      __pyx_t_16 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_21 = __pyx_filename;
      {
        if (unlikely(!__pyx_cur_scope->__pyx_v_cleanup)) { __Pyx_RaiseClosureNameError("cleanup"); __PYX_ERR(7, 517, __pyx_L38_error) }
        __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_cur_scope->__pyx_v_cleanup); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 517, __pyx_L38_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_20);
        __Pyx_XGIVEREF(__pyx_t_19);
        __Pyx_XGIVEREF(__pyx_t_18);
        __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18);
      }
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_1);
      __Pyx_ErrRestore(__pyx_t_3, __pyx_t_2, __pyx_t_1);
      __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0;
      __pyx_lineno = __pyx_t_16; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_21;
      goto __pyx_L1_error;
      __pyx_L38_error:;
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_20);
        __Pyx_XGIVEREF(__pyx_t_19);
        __Pyx_XGIVEREF(__pyx_t_18);
        __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18);
      }
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0;
      goto __pyx_L1_error;
    }
    __pyx_L5:;
  }

  /* "pyarrow/io.pxi":506
 *         exc_info = None
 * 
 *         def bg_write():             # <<<<<<<<<<<<<<
 *             try:
 *                 while not done or write_queue.qsize() > 0:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.download.bg_write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_buf);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XDECREF(__pyx_v_exc_info);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":477
 *             self.write(line)
 * 
 *     def download(self, stream_or_path, buffer_size=None):             # <<<<<<<<<<<<<<
 *         """
 *         Read file completely to local path (rather than reading completely into
 */

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_62download(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_stream_or_path, PyObject *__pyx_v_buffer_size) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_17_download *__pyx_cur_scope;
  int64_t __pyx_v_bytes_read;
  uint8_t *__pyx_v_buf;
  std::shared_ptr< arrow::io::InputStream>  __pyx_v_handle;
  PyObject *__pyx_v_exc_info = NULL;
  PyObject *__pyx_v_bg_write = 0;
  PyObject *__pyx_v_writer_thread = NULL;
  int64_t __pyx_v_total_bytes;
  int32_t __pyx_v_c_buffer_size;
  PyObject *__pyx_v_pybuf = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr< arrow::io::InputStream>  __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  size_t __pyx_t_7;
  int32_t __pyx_t_8;
  int64_t __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  char const *__pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  __Pyx_RefNannySetupContext("download", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_17_download *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_17_download(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_17_download, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_17_download *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(7, 477, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __Pyx_INCREF(__pyx_v_buffer_size);

  /* "pyarrow/io.pxi":483
 *         """
 *         cdef:
 *             int64_t bytes_read = 0             # <<<<<<<<<<<<<<
 *             uint8_t* buf
 * 
 */
  __pyx_v_bytes_read = 0;

  /* "pyarrow/io.pxi":486
 *             uint8_t* buf
 * 
 *         handle = self.get_input_stream()             # <<<<<<<<<<<<<<
 * 
 *         buffer_size = buffer_size or DEFAULT_BUFFER_SIZE
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_self->__pyx_vtab)->get_input_stream(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 486, __pyx_L1_error)
  __pyx_v_handle = __pyx_t_1;

  /* "pyarrow/io.pxi":488
 *         handle = self.get_input_stream()
 * 
 *         buffer_size = buffer_size or DEFAULT_BUFFER_SIZE             # <<<<<<<<<<<<<<
 * 
 *         write_queue = Queue(50)
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_buffer_size); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(7, 488, __pyx_L1_error)
  if (!__pyx_t_3) {
  } else {
    __Pyx_INCREF(__pyx_v_buffer_size);
    __pyx_t_2 = __pyx_v_buffer_size;
    goto __pyx_L3_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_DEFAULT_BUFFER_SIZE); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_2 = __pyx_t_4;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_L3_bool_binop_done:;
  __Pyx_DECREF_SET(__pyx_v_buffer_size, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/io.pxi":490
 *         buffer_size = buffer_size or DEFAULT_BUFFER_SIZE
 * 
 *         write_queue = Queue(50)             # <<<<<<<<<<<<<<
 * 
 *         if not hasattr(stream_or_path, 'read'):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Queue); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 490, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_int_50) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_int_50);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 490, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_cur_scope->__pyx_v_write_queue = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/io.pxi":492
 *         write_queue = Queue(50)
 * 
 *         if not hasattr(stream_or_path, 'read'):             # <<<<<<<<<<<<<<
 *             stream = open(stream_or_path, 'wb')
 * 
 */
  __pyx_t_3 = __Pyx_HasAttr(__pyx_v_stream_or_path, __pyx_n_u_read); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 492, __pyx_L1_error)
  __pyx_t_6 = ((!(__pyx_t_3 != 0)) != 0);
  if (__pyx_t_6) {

    /* "pyarrow/io.pxi":493
 * 
 *         if not hasattr(stream_or_path, 'read'):
 *             stream = open(stream_or_path, 'wb')             # <<<<<<<<<<<<<<
 * 
 *             def cleanup():
 */
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 493, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_stream_or_path);
    __Pyx_GIVEREF(__pyx_v_stream_or_path);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_stream_or_path);
    __Pyx_INCREF(__pyx_n_u_wb);
    __Pyx_GIVEREF(__pyx_n_u_wb);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_u_wb);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 493, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_cur_scope->__pyx_v_stream = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "pyarrow/io.pxi":495
 *             stream = open(stream_or_path, 'wb')
 * 
 *             def cleanup():             # <<<<<<<<<<<<<<
 *                 stream.close()
 *         else:
 */
    __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_10NativeFile_8download_1cleanup, 0, __pyx_n_s_download_locals_cleanup, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pyarrow_lib, __pyx_d, ((PyObject *)__pyx_codeobj__199)); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 495, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_cur_scope->__pyx_v_cleanup = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "pyarrow/io.pxi":492
 *         write_queue = Queue(50)
 * 
 *         if not hasattr(stream_or_path, 'read'):             # <<<<<<<<<<<<<<
 *             stream = open(stream_or_path, 'wb')
 * 
 */
    goto __pyx_L5;
  }

  /* "pyarrow/io.pxi":498
 *                 stream.close()
 *         else:
 *             stream = stream_or_path             # <<<<<<<<<<<<<<
 * 
 *             def cleanup():
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_v_stream_or_path);
    __Pyx_GIVEREF(__pyx_v_stream_or_path);
    __pyx_cur_scope->__pyx_v_stream = __pyx_v_stream_or_path;

    /* "pyarrow/io.pxi":500
 *             stream = stream_or_path
 * 
 *             def cleanup():             # <<<<<<<<<<<<<<
 *                 pass
 * 
 */
    __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_10NativeFile_8download_3cleanup, 0, __pyx_n_s_download_locals_cleanup, NULL, __pyx_n_s_pyarrow_lib, __pyx_d, ((PyObject *)__pyx_codeobj__200)); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 500, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_cur_scope->__pyx_v_cleanup = __pyx_t_4;
    __pyx_t_4 = 0;
  }
  __pyx_L5:;

  /* "pyarrow/io.pxi":503
 *                 pass
 * 
 *         done = False             # <<<<<<<<<<<<<<
 *         exc_info = None
 * 
 */
  __pyx_cur_scope->__pyx_v_done = 0;

  /* "pyarrow/io.pxi":504
 * 
 *         done = False
 *         exc_info = None             # <<<<<<<<<<<<<<
 * 
 *         def bg_write():
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_exc_info = Py_None;

  /* "pyarrow/io.pxi":506
 *         exc_info = None
 * 
 *         def bg_write():             # <<<<<<<<<<<<<<
 *             try:
 *                 while not done or write_queue.qsize() > 0:
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_10NativeFile_8download_5bg_write, 0, __pyx_n_s_download_locals_bg_write, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pyarrow_lib, __pyx_d, ((PyObject *)__pyx_codeobj__202)); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_bg_write = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pyarrow/io.pxi":519
 *                 cleanup()
 * 
 *         self.seek(0)             # <<<<<<<<<<<<<<
 * 
 *         writer_thread = threading.Thread(target=bg_write)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_seek); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_int_0);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/io.pxi":521
 *         self.seek(0)
 * 
 *         writer_thread = threading.Thread(target=bg_write)             # <<<<<<<<<<<<<<
 * 
 *         # This isn't ideal -- PyBytes_FromStringAndSize copies the data from
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_threading); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Thread); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_target, __pyx_v_bg_write) < 0) __PYX_ERR(7, 521, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_writer_thread = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "pyarrow/io.pxi":525
 *         # This isn't ideal -- PyBytes_FromStringAndSize copies the data from
 *         # the passed buffer, so it's hard for us to avoid doubling the memory
 *         buf = <uint8_t*> malloc(buffer_size)             # <<<<<<<<<<<<<<
 *         if buf == NULL:
 *             raise MemoryError("Failed to allocate {0} bytes"
 */
  __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_v_buffer_size); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(7, 525, __pyx_L1_error)
  __pyx_v_buf = ((uint8_t *)malloc(__pyx_t_7));

  /* "pyarrow/io.pxi":526
 *         # the passed buffer, so it's hard for us to avoid doubling the memory
 *         buf = <uint8_t*> malloc(buffer_size)
 *         if buf == NULL:             # <<<<<<<<<<<<<<
 *             raise MemoryError("Failed to allocate {0} bytes"
 *                               .format(buffer_size))
 */
  __pyx_t_6 = ((__pyx_v_buf == NULL) != 0);
  if (unlikely(__pyx_t_6)) {

    /* "pyarrow/io.pxi":528
 *         if buf == NULL:
 *             raise MemoryError("Failed to allocate {0} bytes"
 *                               .format(buffer_size))             # <<<<<<<<<<<<<<
 * 
 *         writer_thread.start()
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Failed_to_allocate_0_bytes, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 528, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_5 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_2, __pyx_v_buffer_size) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_buffer_size);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 528, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/io.pxi":527
 *         buf = <uint8_t*> malloc(buffer_size)
 *         if buf == NULL:
 *             raise MemoryError("Failed to allocate {0} bytes"             # <<<<<<<<<<<<<<
 *                               .format(buffer_size))
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_MemoryError, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(7, 527, __pyx_L1_error)

    /* "pyarrow/io.pxi":526
 *         # the passed buffer, so it's hard for us to avoid doubling the memory
 *         buf = <uint8_t*> malloc(buffer_size)
 *         if buf == NULL:             # <<<<<<<<<<<<<<
 *             raise MemoryError("Failed to allocate {0} bytes"
 *                               .format(buffer_size))
 */
  }

  /* "pyarrow/io.pxi":530
 *                               .format(buffer_size))
 * 
 *         writer_thread.start()             # <<<<<<<<<<<<<<
 * 
 *         cdef int64_t total_bytes = 0
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_writer_thread, __pyx_n_s_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/io.pxi":532
 *         writer_thread.start()
 * 
 *         cdef int64_t total_bytes = 0             # <<<<<<<<<<<<<<
 *         cdef int32_t c_buffer_size = buffer_size
 * 
 */
  __pyx_v_total_bytes = 0;

  /* "pyarrow/io.pxi":533
 * 
 *         cdef int64_t total_bytes = 0
 *         cdef int32_t c_buffer_size = buffer_size             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
  __pyx_t_8 = __Pyx_PyInt_As_int32_t(__pyx_v_buffer_size); if (unlikely((__pyx_t_8 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 533, __pyx_L1_error)
  __pyx_v_c_buffer_size = __pyx_t_8;

  /* "pyarrow/io.pxi":535
 *         cdef int32_t c_buffer_size = buffer_size
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             while True:
 *                 with nogil:
 */
  /*try:*/ {

    /* "pyarrow/io.pxi":536
 * 
 *         try:
 *             while True:             # <<<<<<<<<<<<<<
 *                 with nogil:
 *                     bytes_read = GetResultValue(
 */
    while (1) {

      /* "pyarrow/io.pxi":537
 *         try:
 *             while True:
 *                 with nogil:             # <<<<<<<<<<<<<<
 *                     bytes_read = GetResultValue(
 *                         handle.get().Read(c_buffer_size, buf))
 */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          __Pyx_FastGIL_Remember();
          #endif
          /*try:*/ {

            /* "pyarrow/io.pxi":538
 *             while True:
 *                 with nogil:
 *                     bytes_read = GetResultValue(             # <<<<<<<<<<<<<<
 *                         handle.get().Read(c_buffer_size, buf))
 * 
 */
            __pyx_t_9 = arrow::py::GetResultValue<int64_t>(__pyx_v_handle.get()->Read(__pyx_v_c_buffer_size, __pyx_v_buf)); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(7, 538, __pyx_L15_error)
            __pyx_v_bytes_read = __pyx_t_9;
          }

          /* "pyarrow/io.pxi":537
 *         try:
 *             while True:
 *                 with nogil:             # <<<<<<<<<<<<<<
 *                     bytes_read = GetResultValue(
 *                         handle.get().Read(c_buffer_size, buf))
 */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              __Pyx_FastGIL_Forget();
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L16;
            }
            __pyx_L15_error: {
              #ifdef WITH_THREAD
              __Pyx_FastGIL_Forget();
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L8_error;
            }
            __pyx_L16:;
          }
      }

      /* "pyarrow/io.pxi":541
 *                         handle.get().Read(c_buffer_size, buf))
 * 
 *                 total_bytes += bytes_read             # <<<<<<<<<<<<<<
 * 
 *                 # EOF
 */
      __pyx_v_total_bytes = (__pyx_v_total_bytes + __pyx_v_bytes_read);

      /* "pyarrow/io.pxi":544
 * 
 *                 # EOF
 *                 if bytes_read == 0:             # <<<<<<<<<<<<<<
 *                     break
 * 
 */
      __pyx_t_6 = ((__pyx_v_bytes_read == 0) != 0);
      if (__pyx_t_6) {

        /* "pyarrow/io.pxi":545
 *                 # EOF
 *                 if bytes_read == 0:
 *                     break             # <<<<<<<<<<<<<<
 * 
 *                 pybuf = cp.PyBytes_FromStringAndSize(<const char*>buf,
 */
        goto __pyx_L11_break;

        /* "pyarrow/io.pxi":544
 * 
 *                 # EOF
 *                 if bytes_read == 0:             # <<<<<<<<<<<<<<
 *                     break
 * 
 */
      }

      /* "pyarrow/io.pxi":547
 *                     break
 * 
 *                 pybuf = cp.PyBytes_FromStringAndSize(<const char*>buf,             # <<<<<<<<<<<<<<
 *                                                      bytes_read)
 * 
 */
      __pyx_t_4 = PyBytes_FromStringAndSize(((char const *)__pyx_v_buf), __pyx_v_bytes_read); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 547, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_pybuf, ((PyObject*)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "pyarrow/io.pxi":550
 *                                                      bytes_read)
 * 
 *                 if writer_thread.is_alive():             # <<<<<<<<<<<<<<
 *                     while write_queue.full():
 *                         time.sleep(0.01)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_writer_thread, __pyx_n_s_is_alive); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 550, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 550, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(7, 550, __pyx_L8_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {

        /* "pyarrow/io.pxi":551
 * 
 *                 if writer_thread.is_alive():
 *                     while write_queue.full():             # <<<<<<<<<<<<<<
 *                         time.sleep(0.01)
 *                 else:
 */
        while (1) {
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_write_queue, __pyx_n_s_full); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 551, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_2 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
            __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
            if (likely(__pyx_t_2)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
              __Pyx_INCREF(__pyx_t_2);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_5, function);
            }
          }
          __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 551, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(7, 551, __pyx_L8_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (!__pyx_t_6) break;

          /* "pyarrow/io.pxi":552
 *                 if writer_thread.is_alive():
 *                     while write_queue.full():
 *                         time.sleep(0.01)             # <<<<<<<<<<<<<<
 *                 else:
 *                     break
 */
          __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_time); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 552, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_sleep); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 552, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = NULL;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
            if (likely(__pyx_t_5)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_5);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
            }
          }
          __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_float_0_01) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_float_0_01);
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 552, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }

        /* "pyarrow/io.pxi":550
 *                                                      bytes_read)
 * 
 *                 if writer_thread.is_alive():             # <<<<<<<<<<<<<<
 *                     while write_queue.full():
 *                         time.sleep(0.01)
 */
        goto __pyx_L18;
      }

      /* "pyarrow/io.pxi":554
 *                         time.sleep(0.01)
 *                 else:
 *                     break             # <<<<<<<<<<<<<<
 * 
 *                 write_queue.put_nowait(pybuf)
 */
      /*else*/ {
        goto __pyx_L11_break;
      }
      __pyx_L18:;

      /* "pyarrow/io.pxi":556
 *                     break
 * 
 *                 write_queue.put_nowait(pybuf)             # <<<<<<<<<<<<<<
 *         finally:
 *             free(buf)
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_write_queue, __pyx_n_s_put_nowait); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 556, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_v_pybuf) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_pybuf);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 556, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_L11_break:;
  }

  /* "pyarrow/io.pxi":558
 *                 write_queue.put_nowait(pybuf)
 *         finally:
 *             free(buf)             # <<<<<<<<<<<<<<
 *             done = True
 * 
 */
  /*finally:*/ {
    /*normal exit:*/{
      free(__pyx_v_buf);

      /* "pyarrow/io.pxi":559
 *         finally:
 *             free(buf)
 *             done = True             # <<<<<<<<<<<<<<
 * 
 *         writer_thread.join()
 */
      __pyx_cur_scope->__pyx_v_done = 1;
      goto __pyx_L9;
    }
    __pyx_L8_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
      __Pyx_XGOTREF(__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_15);
      __Pyx_XGOTREF(__pyx_t_16);
      __Pyx_XGOTREF(__pyx_t_17);
      __Pyx_XGOTREF(__pyx_t_18);
      __pyx_t_10 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename;
      {

        /* "pyarrow/io.pxi":558
 *                 write_queue.put_nowait(pybuf)
 *         finally:
 *             free(buf)             # <<<<<<<<<<<<<<
 *             done = True
 * 
 */
        free(__pyx_v_buf);

        /* "pyarrow/io.pxi":559
 *         finally:
 *             free(buf)
 *             done = True             # <<<<<<<<<<<<<<
 * 
 *         writer_thread.join()
 */
        __pyx_cur_scope->__pyx_v_done = 1;
      }
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_16);
        __Pyx_XGIVEREF(__pyx_t_17);
        __Pyx_XGIVEREF(__pyx_t_18);
        __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18);
      }
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_XGIVEREF(__pyx_t_15);
      __Pyx_ErrRestore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
      __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
      __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12;
      goto __pyx_L1_error;
    }
    __pyx_L9:;
  }

  /* "pyarrow/io.pxi":561
 *             done = True
 * 
 *         writer_thread.join()             # <<<<<<<<<<<<<<
 *         if exc_info is not None:
 *             raise exc_info[0], exc_info[1], exc_info[2]
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_writer_thread, __pyx_n_s_join); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/io.pxi":562
 * 
 *         writer_thread.join()
 *         if exc_info is not None:             # <<<<<<<<<<<<<<
 *             raise exc_info[0], exc_info[1], exc_info[2]
 * 
 */
  __pyx_t_6 = (__pyx_v_exc_info != Py_None);
  __pyx_t_3 = (__pyx_t_6 != 0);
  if (unlikely(__pyx_t_3)) {

    /* "pyarrow/io.pxi":563
 *         writer_thread.join()
 *         if exc_info is not None:
 *             raise exc_info[0], exc_info[1], exc_info[2]             # <<<<<<<<<<<<<<
 * 
 *     def upload(self, stream, buffer_size=None):
 */
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_exc_info, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 563, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 563, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_exc_info, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 563, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_Raise(__pyx_t_4, __pyx_t_2, __pyx_t_5, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(7, 563, __pyx_L1_error)

    /* "pyarrow/io.pxi":562
 * 
 *         writer_thread.join()
 *         if exc_info is not None:             # <<<<<<<<<<<<<<
 *             raise exc_info[0], exc_info[1], exc_info[2]
 * 
 */
  }

  /* "pyarrow/io.pxi":477
 *             self.write(line)
 * 
 *     def download(self, stream_or_path, buffer_size=None):             # <<<<<<<<<<<<<<
 *         """
 *         Read file completely to local path (rather than reading completely into
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.download", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_exc_info);
  __Pyx_XDECREF(__pyx_v_bg_write);
  __Pyx_XDECREF(__pyx_v_writer_thread);
  __Pyx_XDECREF(__pyx_v_pybuf);
  __Pyx_XDECREF(__pyx_v_buffer_size);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":565
 *             raise exc_info[0], exc_info[1], exc_info[2]
 * 
 *     def upload(self, stream, buffer_size=None):             # <<<<<<<<<<<<<<
 *         """
 *         Pipe file-like object to file
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_65upload(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_64upload[] = "NativeFile.upload(self, stream, buffer_size=None)\n\n        Pipe file-like object to file\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_65upload(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_stream = 0;
  PyObject *__pyx_v_buffer_size = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("upload (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stream,&__pyx_n_s_buffer_size,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stream)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffer_size);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "upload") < 0)) __PYX_ERR(7, 565, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_stream = values[0];
    __pyx_v_buffer_size = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("upload", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 565, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.upload", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_64upload(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), __pyx_v_stream, __pyx_v_buffer_size);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":577
 *         exc_info = None
 * 
 *         def bg_write():             # <<<<<<<<<<<<<<
 *             try:
 *                 while not done or write_queue.qsize() > 0:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_6upload_1bg_write(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7pyarrow_3lib_10NativeFile_6upload_1bg_write = {"bg_write", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_6upload_1bg_write, METH_NOARGS, 0};
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_6upload_1bg_write(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bg_write (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_6upload_bg_write(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_6upload_bg_write(PyObject *__pyx_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_18_upload *__pyx_cur_scope;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_18_upload *__pyx_outer_scope;
  PyObject *__pyx_v_buf = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_e = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_exc_info = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_t_16;
  char const *__pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("bg_write", 0);
  __pyx_outer_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_18_upload *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "pyarrow/io.pxi":578
 * 
 *         def bg_write():
 *             try:             # <<<<<<<<<<<<<<
 *                 while not done or write_queue.qsize() > 0:
 *                     try:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "pyarrow/io.pxi":579
 *         def bg_write():
 *             try:
 *                 while not done or write_queue.qsize() > 0:             # <<<<<<<<<<<<<<
 *                     try:
 *                         buf = write_queue.get(timeout=0.01)
 */
      while (1) {
        __pyx_t_5 = ((!(__pyx_cur_scope->__pyx_v_done != 0)) != 0);
        if (!__pyx_t_5) {
        } else {
          __pyx_t_4 = __pyx_t_5;
          goto __pyx_L11_bool_binop_done;
        }
        if (unlikely(!__pyx_cur_scope->__pyx_v_write_queue)) { __Pyx_RaiseClosureNameError("write_queue"); __PYX_ERR(7, 579, __pyx_L3_error) }
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_write_queue, __pyx_n_s_qsize); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 579, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
          }
        }
        __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 579, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 579, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(7, 579, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_4 = __pyx_t_5;
        __pyx_L11_bool_binop_done:;
        if (!__pyx_t_4) break;

        /* "pyarrow/io.pxi":580
 *             try:
 *                 while not done or write_queue.qsize() > 0:
 *                     try:             # <<<<<<<<<<<<<<
 *                         buf = write_queue.get(timeout=0.01)
 *                     except QueueEmpty:
 */
        {
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
          __Pyx_XGOTREF(__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_10);
          __Pyx_XGOTREF(__pyx_t_11);
          /*try:*/ {

            /* "pyarrow/io.pxi":581
 *                 while not done or write_queue.qsize() > 0:
 *                     try:
 *                         buf = write_queue.get(timeout=0.01)             # <<<<<<<<<<<<<<
 *                     except QueueEmpty:
 *                         continue
 */
            if (unlikely(!__pyx_cur_scope->__pyx_v_write_queue)) { __Pyx_RaiseClosureNameError("write_queue"); __PYX_ERR(7, 581, __pyx_L13_error) }
            __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_write_queue, __pyx_n_s_get); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 581, __pyx_L13_error)
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 581, __pyx_L13_error)
            __Pyx_GOTREF(__pyx_t_6);
            if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_timeout, __pyx_float_0_01) < 0) __PYX_ERR(7, 581, __pyx_L13_error)
            __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 581, __pyx_L13_error)
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_XDECREF_SET(__pyx_v_buf, __pyx_t_8);
            __pyx_t_8 = 0;

            /* "pyarrow/io.pxi":580
 *             try:
 *                 while not done or write_queue.qsize() > 0:
 *                     try:             # <<<<<<<<<<<<<<
 *                         buf = write_queue.get(timeout=0.01)
 *                     except QueueEmpty:
 */
          }
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          goto __pyx_L20_try_end;
          __pyx_L13_error:;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

          /* "pyarrow/io.pxi":582
 *                     try:
 *                         buf = write_queue.get(timeout=0.01)
 *                     except QueueEmpty:             # <<<<<<<<<<<<<<
 *                         continue
 * 
 */
          __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_6, &__pyx_t_7);
          __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_QueueEmpty); if (unlikely(!__pyx_t_12)) __PYX_ERR(7, 582, __pyx_L15_except_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_13 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_8, __pyx_t_12);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_ErrRestore(__pyx_t_8, __pyx_t_6, __pyx_t_7);
          __pyx_t_8 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0;
          if (__pyx_t_13) {
            __Pyx_AddTraceback("pyarrow.lib.NativeFile.upload.bg_write", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_6, &__pyx_t_8) < 0) __PYX_ERR(7, 582, __pyx_L15_except_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_GOTREF(__pyx_t_8);

            /* "pyarrow/io.pxi":583
 *                         buf = write_queue.get(timeout=0.01)
 *                     except QueueEmpty:
 *                         continue             # <<<<<<<<<<<<<<
 * 
 *                     self.write(buf)
 */
            goto __pyx_L22_except_continue;
            __pyx_L22_except_continue:;
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            goto __pyx_L19_try_continue;
          }
          goto __pyx_L15_except_error;
          __pyx_L15_except_error:;

          /* "pyarrow/io.pxi":580
 *             try:
 *                 while not done or write_queue.qsize() > 0:
 *                     try:             # <<<<<<<<<<<<<<
 *                         buf = write_queue.get(timeout=0.01)
 *                     except QueueEmpty:
 */
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
          goto __pyx_L3_error;
          __pyx_L19_try_continue:;
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
          goto __pyx_L9_continue;
          __pyx_L20_try_end:;
        }

        /* "pyarrow/io.pxi":585
 *                         continue
 * 
 *                     self.write(buf)             # <<<<<<<<<<<<<<
 * 
 *             except Exception as e:
 */
        if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(7, 585, __pyx_L3_error) }
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_write); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 585, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        __pyx_t_8 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_buf) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_buf);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 585, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_L9_continue:;
      }

      /* "pyarrow/io.pxi":578
 * 
 *         def bg_write():
 *             try:             # <<<<<<<<<<<<<<
 *                 while not done or write_queue.qsize() > 0:
 *                     try:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "pyarrow/io.pxi":587
 *                     self.write(buf)
 * 
 *             except Exception as e:             # <<<<<<<<<<<<<<
 *                 exc_info = sys.exc_info()
 * 
 */
    __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_13) {
      __Pyx_AddTraceback("pyarrow.lib.NativeFile.upload.bg_write", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(7, 587, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_e = __pyx_t_6;
      /*try:*/ {

        /* "pyarrow/io.pxi":588
 * 
 *             except Exception as e:
 *                 exc_info = sys.exc_info()             # <<<<<<<<<<<<<<
 * 
 *         writer_thread = threading.Thread(target=bg_write)
 */
        __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_sys); if (unlikely(!__pyx_t_14)) __PYX_ERR(7, 588, __pyx_L28_error)
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_15)) __PYX_ERR(7, 588, __pyx_L28_error)
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_14 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) {
          __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_15);
          if (likely(__pyx_t_14)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
            __Pyx_INCREF(__pyx_t_14);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_15, function);
          }
        }
        __pyx_t_12 = (__pyx_t_14) ? __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_14) : __Pyx_PyObject_CallNoArg(__pyx_t_15);
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        if (unlikely(!__pyx_t_12)) __PYX_ERR(7, 588, __pyx_L28_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __pyx_v_exc_info = __pyx_t_12;
        __pyx_t_12 = 0;
      }

      /* "pyarrow/io.pxi":587
 *                     self.write(buf)
 * 
 *             except Exception as e:             # <<<<<<<<<<<<<<
 *                 exc_info = sys.exc_info()
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_e);
          __pyx_v_e = NULL;
          goto __pyx_L29;
        }
        __pyx_L28_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_11);
          __Pyx_XGOTREF(__pyx_t_10);
          __Pyx_XGOTREF(__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_13 = __pyx_lineno; __pyx_t_16 = __pyx_clineno; __pyx_t_17 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_e);
            __pyx_v_e = NULL;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_ErrRestore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
          __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_16; __pyx_filename = __pyx_t_17;
          goto __pyx_L5_except_error;
        }
        __pyx_L29:;
      }
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/io.pxi":578
 * 
 *         def bg_write():
 *             try:             # <<<<<<<<<<<<<<
 *                 while not done or write_queue.qsize() > 0:
 *                     try:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "pyarrow/io.pxi":577
 *         exc_info = None
 * 
 *         def bg_write():             # <<<<<<<<<<<<<<
 *             try:
 *                 while not done or write_queue.qsize() > 0:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.upload.bg_write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_buf);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XDECREF(__pyx_v_exc_info);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":565
 *             raise exc_info[0], exc_info[1], exc_info[2]
 * 
 *     def upload(self, stream, buffer_size=None):             # <<<<<<<<<<<<<<
 *         """
 *         Pipe file-like object to file
 */

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_64upload(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_stream, PyObject *__pyx_v_buffer_size) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_18_upload *__pyx_cur_scope;
  PyObject *__pyx_v_exc_info = NULL;
  PyObject *__pyx_v_bg_write = 0;
  PyObject *__pyx_v_writer_thread = NULL;
  PyObject *__pyx_v_buf = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  char const *__pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  __Pyx_RefNannySetupContext("upload", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_18_upload *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_18_upload(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_18_upload, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_18_upload *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(7, 565, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_INCREF(__pyx_v_buffer_size);

  /* "pyarrow/io.pxi":569
 *         Pipe file-like object to file
 *         """
 *         write_queue = Queue(50)             # <<<<<<<<<<<<<<
 *         self._assert_writable()
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Queue); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 569, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_int_50) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_int_50);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 569, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_write_queue = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":570
 *         """
 *         write_queue = Queue(50)
 *         self._assert_writable()             # <<<<<<<<<<<<<<
 * 
 *         buffer_size = buffer_size or DEFAULT_BUFFER_SIZE
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_assert_writable); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":572
 *         self._assert_writable()
 * 
 *         buffer_size = buffer_size or DEFAULT_BUFFER_SIZE             # <<<<<<<<<<<<<<
 * 
 *         done = False
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_buffer_size); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(7, 572, __pyx_L1_error)
  if (!__pyx_t_4) {
  } else {
    __Pyx_INCREF(__pyx_v_buffer_size);
    __pyx_t_1 = __pyx_v_buffer_size;
    goto __pyx_L3_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DEFAULT_BUFFER_SIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_1 = __pyx_t_2;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_L3_bool_binop_done:;
  __Pyx_DECREF_SET(__pyx_v_buffer_size, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":574
 *         buffer_size = buffer_size or DEFAULT_BUFFER_SIZE
 * 
 *         done = False             # <<<<<<<<<<<<<<
 *         exc_info = None
 * 
 */
  __pyx_cur_scope->__pyx_v_done = 0;

  /* "pyarrow/io.pxi":575
 * 
 *         done = False
 *         exc_info = None             # <<<<<<<<<<<<<<
 * 
 *         def bg_write():
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_exc_info = Py_None;

  /* "pyarrow/io.pxi":577
 *         exc_info = None
 * 
 *         def bg_write():             # <<<<<<<<<<<<<<
 *             try:
 *                 while not done or write_queue.qsize() > 0:
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_10NativeFile_6upload_1bg_write, 0, __pyx_n_s_upload_locals_bg_write, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pyarrow_lib, __pyx_d, ((PyObject *)__pyx_codeobj__204)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_bg_write = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":590
 *                 exc_info = sys.exc_info()
 * 
 *         writer_thread = threading.Thread(target=bg_write)             # <<<<<<<<<<<<<<
 *         writer_thread.start()
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_threading); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Thread); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_target, __pyx_v_bg_write) < 0) __PYX_ERR(7, 590, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_writer_thread = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyarrow/io.pxi":591
 * 
 *         writer_thread = threading.Thread(target=bg_write)
 *         writer_thread.start()             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_writer_thread, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/io.pxi":593
 *         writer_thread.start()
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             while True:
 *                 buf = stream.read(buffer_size)
 */
  /*try:*/ {

    /* "pyarrow/io.pxi":594
 * 
 *         try:
 *             while True:             # <<<<<<<<<<<<<<
 *                 buf = stream.read(buffer_size)
 *                 if not buf:
 */
    while (1) {

      /* "pyarrow/io.pxi":595
 *         try:
 *             while True:
 *                 buf = stream.read(buffer_size)             # <<<<<<<<<<<<<<
 *                 if not buf:
 *                     break
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_stream, __pyx_n_s_read); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 595, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_v_buffer_size) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_buffer_size);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 595, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF_SET(__pyx_v_buf, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "pyarrow/io.pxi":596
 *             while True:
 *                 buf = stream.read(buffer_size)
 *                 if not buf:             # <<<<<<<<<<<<<<
 *                     break
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_buf); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(7, 596, __pyx_L6_error)
      __pyx_t_5 = ((!__pyx_t_4) != 0);
      if (__pyx_t_5) {

        /* "pyarrow/io.pxi":597
 *                 buf = stream.read(buffer_size)
 *                 if not buf:
 *                     break             # <<<<<<<<<<<<<<
 * 
 *                 if writer_thread.is_alive():
 */
        goto __pyx_L9_break;

        /* "pyarrow/io.pxi":596
 *             while True:
 *                 buf = stream.read(buffer_size)
 *                 if not buf:             # <<<<<<<<<<<<<<
 *                     break
 * 
 */
      }

      /* "pyarrow/io.pxi":599
 *                     break
 * 
 *                 if writer_thread.is_alive():             # <<<<<<<<<<<<<<
 *                     while write_queue.full():
 *                         time.sleep(0.01)
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_writer_thread, __pyx_n_s_is_alive); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 599, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 599, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(7, 599, __pyx_L6_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_5) {

        /* "pyarrow/io.pxi":600
 * 
 *                 if writer_thread.is_alive():
 *                     while write_queue.full():             # <<<<<<<<<<<<<<
 *                         time.sleep(0.01)
 *                 else:
 */
        while (1) {
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_write_queue, __pyx_n_s_full); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 600, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_2 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_2)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_2);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
            }
          }
          __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 600, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(7, 600, __pyx_L6_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (!__pyx_t_5) break;

          /* "pyarrow/io.pxi":601
 *                 if writer_thread.is_alive():
 *                     while write_queue.full():
 *                         time.sleep(0.01)             # <<<<<<<<<<<<<<
 *                 else:
 *                     break
 */
          __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 601, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sleep); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 601, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = NULL;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
            if (likely(__pyx_t_1)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_1);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
            }
          }
          __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_float_0_01) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_float_0_01);
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 601, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }

        /* "pyarrow/io.pxi":599
 *                     break
 * 
 *                 if writer_thread.is_alive():             # <<<<<<<<<<<<<<
 *                     while write_queue.full():
 *                         time.sleep(0.01)
 */
        goto __pyx_L11;
      }

      /* "pyarrow/io.pxi":603
 *                         time.sleep(0.01)
 *                 else:
 *                     break             # <<<<<<<<<<<<<<
 * 
 *                 write_queue.put_nowait(buf)
 */
      /*else*/ {
        goto __pyx_L9_break;
      }
      __pyx_L11:;

      /* "pyarrow/io.pxi":605
 *                     break
 * 
 *                 write_queue.put_nowait(buf)             # <<<<<<<<<<<<<<
 *         finally:
 *             done = True
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_write_queue, __pyx_n_s_put_nowait); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 605, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_v_buf) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_buf);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 605, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_L9_break:;
  }

  /* "pyarrow/io.pxi":607
 *                 write_queue.put_nowait(buf)
 *         finally:
 *             done = True             # <<<<<<<<<<<<<<
 * 
 *         writer_thread.join()
 */
  /*finally:*/ {
    /*normal exit:*/{
      __pyx_cur_scope->__pyx_v_done = 1;
      goto __pyx_L7;
    }
    __pyx_L6_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_14);
      __pyx_t_6 = __pyx_lineno; __pyx_t_7 = __pyx_clineno; __pyx_t_8 = __pyx_filename;
      {
        __pyx_cur_scope->__pyx_v_done = 1;
      }
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_XGIVEREF(__pyx_t_14);
        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
      }
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0;
      __pyx_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_8;
      goto __pyx_L1_error;
    }
    __pyx_L7:;
  }

  /* "pyarrow/io.pxi":609
 *             done = True
 * 
 *         writer_thread.join()             # <<<<<<<<<<<<<<
 *         if exc_info is not None:
 *             raise exc_info[0], exc_info[1], exc_info[2]
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_writer_thread, __pyx_n_s_join); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/io.pxi":610
 * 
 *         writer_thread.join()
 *         if exc_info is not None:             # <<<<<<<<<<<<<<
 *             raise exc_info[0], exc_info[1], exc_info[2]
 * 
 */
  __pyx_t_5 = (__pyx_v_exc_info != Py_None);
  __pyx_t_4 = (__pyx_t_5 != 0);
  if (unlikely(__pyx_t_4)) {

    /* "pyarrow/io.pxi":611
 *         writer_thread.join()
 *         if exc_info is not None:
 *             raise exc_info[0], exc_info[1], exc_info[2]             # <<<<<<<<<<<<<<
 * 
 * BufferedIOBase.register(NativeFile)
 */
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_exc_info, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 611, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 611, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_exc_info, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 611, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_3, __pyx_t_2, __pyx_t_1, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(7, 611, __pyx_L1_error)

    /* "pyarrow/io.pxi":610
 * 
 *         writer_thread.join()
 *         if exc_info is not None:             # <<<<<<<<<<<<<<
 *             raise exc_info[0], exc_info[1], exc_info[2]
 * 
 */
  }

  /* "pyarrow/io.pxi":565
 *             raise exc_info[0], exc_info[1], exc_info[2]
 * 
 *     def upload(self, stream, buffer_size=None):             # <<<<<<<<<<<<<<
 *         """
 *         Pipe file-like object to file
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.upload", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_exc_info);
  __Pyx_XDECREF(__pyx_v_bg_write);
  __Pyx_XDECREF(__pyx_v_writer_thread);
  __Pyx_XDECREF(__pyx_v_buf);
  __Pyx_XDECREF(__pyx_v_buffer_size);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_67__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_66__reduce_cython__[] = "NativeFile.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_67__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_66__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_66__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__205, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_69__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_68__setstate_cython__[] = "NativeFile.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_69__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_68__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_68__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__206, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.NativeFile.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":633
 *         object handle
 * 
 *     def __cinit__(self, handle, mode=None):             # <<<<<<<<<<<<<<
 *         self.handle = handle
 * 
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_10PythonFile_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_10PythonFile_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_handle = 0;
  PyObject *__pyx_v_mode = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_mode,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(7, 633, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_handle = values[0];
    __pyx_v_mode = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 633, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.PythonFile.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_10PythonFile___cinit__(((struct __pyx_obj_7pyarrow_3lib_PythonFile *)__pyx_v_self), __pyx_v_handle, __pyx_v_mode);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_10PythonFile___cinit__(struct __pyx_obj_7pyarrow_3lib_PythonFile *__pyx_v_self, PyObject *__pyx_v_handle, PyObject *__pyx_v_mode) {
  PyObject *__pyx_v_inferred_mode = NULL;
  PyObject *__pyx_v_kind = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  Py_ssize_t __pyx_t_17;
  Py_UCS4 __pyx_t_18;
  PyObject *__pyx_t_19 = NULL;
  int __pyx_t_20;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/io.pxi":634
 * 
 *     def __cinit__(self, handle, mode=None):
 *         self.handle = handle             # <<<<<<<<<<<<<<
 * 
 *         if mode is None:
 */
  __Pyx_INCREF(__pyx_v_handle);
  __Pyx_GIVEREF(__pyx_v_handle);
  __Pyx_GOTREF(__pyx_v_self->handle);
  __Pyx_DECREF(__pyx_v_self->handle);
  __pyx_v_self->handle = __pyx_v_handle;

  /* "pyarrow/io.pxi":636
 *         self.handle = handle
 * 
 *         if mode is None:             # <<<<<<<<<<<<<<
 *             try:
 *                 inferred_mode = handle.mode
 */
  __pyx_t_1 = (__pyx_v_mode == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/io.pxi":637
 * 
 *         if mode is None:
 *             try:             # <<<<<<<<<<<<<<
 *                 inferred_mode = handle.mode
 *             except AttributeError:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);
      /*try:*/ {

        /* "pyarrow/io.pxi":638
 *         if mode is None:
 *             try:
 *                 inferred_mode = handle.mode             # <<<<<<<<<<<<<<
 *             except AttributeError:
 *                 # Not all file-like objects have a mode attribute
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_handle, __pyx_n_s_mode); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 638, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_v_inferred_mode = __pyx_t_6;
        __pyx_t_6 = 0;

        /* "pyarrow/io.pxi":637
 * 
 *         if mode is None:
 *             try:             # <<<<<<<<<<<<<<
 *                 inferred_mode = handle.mode
 *             except AttributeError:
 */
      }
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L9_try_end;
      __pyx_L4_error:;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "pyarrow/io.pxi":639
 *             try:
 *                 inferred_mode = handle.mode
 *             except AttributeError:             # <<<<<<<<<<<<<<
 *                 # Not all file-like objects have a mode attribute
 *                 # (e.g. BytesIO)
 */
      __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
      if (__pyx_t_7) {
        __Pyx_AddTraceback("pyarrow.lib.PythonFile.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(7, 639, __pyx_L6_except_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GOTREF(__pyx_t_9);

        /* "pyarrow/io.pxi":642
 *                 # Not all file-like objects have a mode attribute
 *                 # (e.g. BytesIO)
 *                 try:             # <<<<<<<<<<<<<<
 *                     inferred_mode = 'w' if handle.writable() else 'r'
 *                 except AttributeError:
 */
        {
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
          __Pyx_XGOTREF(__pyx_t_10);
          __Pyx_XGOTREF(__pyx_t_11);
          __Pyx_XGOTREF(__pyx_t_12);
          /*try:*/ {

            /* "pyarrow/io.pxi":643
 *                 # (e.g. BytesIO)
 *                 try:
 *                     inferred_mode = 'w' if handle.writable() else 'r'             # <<<<<<<<<<<<<<
 *                 except AttributeError:
 *                     raise ValueError("could not infer open mode for file-like "
 */
            __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_handle, __pyx_n_s_writable); if (unlikely(!__pyx_t_15)) __PYX_ERR(7, 643, __pyx_L12_error)
            __Pyx_GOTREF(__pyx_t_15);
            __pyx_t_16 = NULL;
            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_15))) {
              __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_15);
              if (likely(__pyx_t_16)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
                __Pyx_INCREF(__pyx_t_16);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_15, function);
              }
            }
            __pyx_t_14 = (__pyx_t_16) ? __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_16) : __Pyx_PyObject_CallNoArg(__pyx_t_15);
            __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
            if (unlikely(!__pyx_t_14)) __PYX_ERR(7, 643, __pyx_L12_error)
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
            __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(7, 643, __pyx_L12_error)
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            if (__pyx_t_2) {
              __Pyx_INCREF(__pyx_n_u_w);
              __pyx_t_13 = __pyx_n_u_w;
            } else {
              __Pyx_INCREF(__pyx_n_u_r);
              __pyx_t_13 = __pyx_n_u_r;
            }
            __Pyx_XDECREF_SET(__pyx_v_inferred_mode, __pyx_t_13);
            __pyx_t_13 = 0;

            /* "pyarrow/io.pxi":642
 *                 # Not all file-like objects have a mode attribute
 *                 # (e.g. BytesIO)
 *                 try:             # <<<<<<<<<<<<<<
 *                     inferred_mode = 'w' if handle.writable() else 'r'
 *                 except AttributeError:
 */
          }
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          goto __pyx_L19_try_end;
          __pyx_L12_error:;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;

          /* "pyarrow/io.pxi":644
 *                 try:
 *                     inferred_mode = 'w' if handle.writable() else 'r'
 *                 except AttributeError:             # <<<<<<<<<<<<<<
 *                     raise ValueError("could not infer open mode for file-like "
 *                                      "object %r, please pass it explicitly"
 */
          __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
          if (__pyx_t_7) {
            __Pyx_AddTraceback("pyarrow.lib.PythonFile.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0) __PYX_ERR(7, 644, __pyx_L14_except_error)
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_GOTREF(__pyx_t_15);

            /* "pyarrow/io.pxi":645
 *                     inferred_mode = 'w' if handle.writable() else 'r'
 *                 except AttributeError:
 *                     raise ValueError("could not infer open mode for file-like "             # <<<<<<<<<<<<<<
 *                                      "object %r, please pass it explicitly"
 *                                      % (handle,))
 */
            __pyx_t_16 = PyTuple_New(3); if (unlikely(!__pyx_t_16)) __PYX_ERR(7, 645, __pyx_L14_except_error)
            __Pyx_GOTREF(__pyx_t_16);
            __pyx_t_17 = 0;
            __pyx_t_18 = 127;
            __Pyx_INCREF(__pyx_kp_u_could_not_infer_open_mode_for_fi);
            __pyx_t_17 += 47;
            __Pyx_GIVEREF(__pyx_kp_u_could_not_infer_open_mode_for_fi);
            PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_kp_u_could_not_infer_open_mode_for_fi);

            /* "pyarrow/io.pxi":647
 *                     raise ValueError("could not infer open mode for file-like "
 *                                      "object %r, please pass it explicitly"
 *                                      % (handle,))             # <<<<<<<<<<<<<<
 *         else:
 *             inferred_mode = mode
 */
            __pyx_t_19 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_handle), __pyx_empty_unicode); if (unlikely(!__pyx_t_19)) __PYX_ERR(7, 647, __pyx_L14_except_error)
            __Pyx_GOTREF(__pyx_t_19);
            __pyx_t_18 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_19) > __pyx_t_18) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_19) : __pyx_t_18;
            __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_19);
            __Pyx_GIVEREF(__pyx_t_19);
            PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_19);
            __pyx_t_19 = 0;
            __Pyx_INCREF(__pyx_kp_u_please_pass_it_explicitly);
            __pyx_t_17 += 27;
            __Pyx_GIVEREF(__pyx_kp_u_please_pass_it_explicitly);
            PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_kp_u_please_pass_it_explicitly);

            /* "pyarrow/io.pxi":645
 *                     inferred_mode = 'w' if handle.writable() else 'r'
 *                 except AttributeError:
 *                     raise ValueError("could not infer open mode for file-like "             # <<<<<<<<<<<<<<
 *                                      "object %r, please pass it explicitly"
 *                                      % (handle,))
 */
            __pyx_t_19 = __Pyx_PyUnicode_Join(__pyx_t_16, 3, __pyx_t_17, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(7, 645, __pyx_L14_except_error)
            __Pyx_GOTREF(__pyx_t_19);
            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            __pyx_t_16 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_19); if (unlikely(!__pyx_t_16)) __PYX_ERR(7, 645, __pyx_L14_except_error)
            __Pyx_GOTREF(__pyx_t_16);
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            __Pyx_Raise(__pyx_t_16, 0, 0, 0);
            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            __PYX_ERR(7, 645, __pyx_L14_except_error)
          }
          goto __pyx_L14_except_error;
          __pyx_L14_except_error:;

          /* "pyarrow/io.pxi":642
 *                 # Not all file-like objects have a mode attribute
 *                 # (e.g. BytesIO)
 *                 try:             # <<<<<<<<<<<<<<
 *                     inferred_mode = 'w' if handle.writable() else 'r'
 *                 except AttributeError:
 */
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_XGIVEREF(__pyx_t_12);
          __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
          goto __pyx_L6_except_error;
          __pyx_L19_try_end:;
        }
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L5_exception_handled;
      }
      goto __pyx_L6_except_error;
      __pyx_L6_except_error:;

      /* "pyarrow/io.pxi":637
 * 
 *         if mode is None:
 *             try:             # <<<<<<<<<<<<<<
 *                 inferred_mode = handle.mode
 *             except AttributeError:
 */
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      goto __pyx_L1_error;
      __pyx_L5_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      __pyx_L9_try_end:;
    }

    /* "pyarrow/io.pxi":636
 *         self.handle = handle
 * 
 *         if mode is None:             # <<<<<<<<<<<<<<
 *             try:
 *                 inferred_mode = handle.mode
 */
    goto __pyx_L3;
  }

  /* "pyarrow/io.pxi":649
 *                                      % (handle,))
 *         else:
 *             inferred_mode = mode             # <<<<<<<<<<<<<<
 * 
 *         if inferred_mode.startswith('w'):
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_v_mode);
    __pyx_v_inferred_mode = __pyx_v_mode;
  }
  __pyx_L3:;

  /* "pyarrow/io.pxi":651
 *             inferred_mode = mode
 * 
 *         if inferred_mode.startswith('w'):             # <<<<<<<<<<<<<<
 *             kind = 'w'
 *         elif inferred_mode.startswith('r'):
 */
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_inferred_mode, __pyx_n_s_startswith); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
    }
  }
  __pyx_t_9 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_6, __pyx_n_u_w) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_n_u_w);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(7, 651, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (__pyx_t_2) {

    /* "pyarrow/io.pxi":652
 * 
 *         if inferred_mode.startswith('w'):
 *             kind = 'w'             # <<<<<<<<<<<<<<
 *         elif inferred_mode.startswith('r'):
 *             kind = 'r'
 */
    __Pyx_INCREF(__pyx_n_u_w);
    __pyx_v_kind = __pyx_n_u_w;

    /* "pyarrow/io.pxi":651
 *             inferred_mode = mode
 * 
 *         if inferred_mode.startswith('w'):             # <<<<<<<<<<<<<<
 *             kind = 'w'
 *         elif inferred_mode.startswith('r'):
 */
    goto __pyx_L22;
  }

  /* "pyarrow/io.pxi":653
 *         if inferred_mode.startswith('w'):
 *             kind = 'w'
 *         elif inferred_mode.startswith('r'):             # <<<<<<<<<<<<<<
 *             kind = 'r'
 *         else:
 */
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_inferred_mode, __pyx_n_s_startswith); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
    }
  }
  __pyx_t_9 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_6, __pyx_n_u_r) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_n_u_r);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(7, 653, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (likely(__pyx_t_2)) {

    /* "pyarrow/io.pxi":654
 *             kind = 'w'
 *         elif inferred_mode.startswith('r'):
 *             kind = 'r'             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError('Invalid file mode: {0}'.format(mode))
 */
    __Pyx_INCREF(__pyx_n_u_r);
    __pyx_v_kind = __pyx_n_u_r;

    /* "pyarrow/io.pxi":653
 *         if inferred_mode.startswith('w'):
 *             kind = 'w'
 *         elif inferred_mode.startswith('r'):             # <<<<<<<<<<<<<<
 *             kind = 'r'
 *         else:
 */
    goto __pyx_L22;
  }

  /* "pyarrow/io.pxi":656
 *             kind = 'r'
 *         else:
 *             raise ValueError('Invalid file mode: {0}'.format(mode))             # <<<<<<<<<<<<<<
 * 
 *         # If mode was given, check it matches the given file
 */
  /*else*/ {
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Invalid_file_mode_0, __pyx_n_s_format); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 656, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    __pyx_t_9 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_6, __pyx_v_mode) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_mode);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 656, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 656, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_Raise(__pyx_t_8, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __PYX_ERR(7, 656, __pyx_L1_error)
  }
  __pyx_L22:;

  /* "pyarrow/io.pxi":659
 * 
 *         # If mode was given, check it matches the given file
 *         if mode is not None:             # <<<<<<<<<<<<<<
 *             if isinstance(handle, IOBase):
 *                 # Python 3 IO object
 */
  __pyx_t_2 = (__pyx_v_mode != Py_None);
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":660
 *         # If mode was given, check it matches the given file
 *         if mode is not None:
 *             if isinstance(handle, IOBase):             # <<<<<<<<<<<<<<
 *                 # Python 3 IO object
 *                 if kind == 'r':
 */
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_IOBase); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 660, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_1 = PyObject_IsInstance(__pyx_v_handle, __pyx_t_8); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 660, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "pyarrow/io.pxi":662
 *             if isinstance(handle, IOBase):
 *                 # Python 3 IO object
 *                 if kind == 'r':             # <<<<<<<<<<<<<<
 *                     if not handle.readable():
 *                         raise TypeError("readable file expected")
 */
      __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_kind, __pyx_n_u_r, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(7, 662, __pyx_L1_error)
      __pyx_t_1 = (__pyx_t_2 != 0);
      if (__pyx_t_1) {

        /* "pyarrow/io.pxi":663
 *                 # Python 3 IO object
 *                 if kind == 'r':
 *                     if not handle.readable():             # <<<<<<<<<<<<<<
 *                         raise TypeError("readable file expected")
 *                 else:
 */
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_handle, __pyx_n_s_readable); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 663, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_6 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_9, function);
          }
        }
        __pyx_t_8 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_9);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 663, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(7, 663, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_2 = ((!__pyx_t_1) != 0);
        if (unlikely(__pyx_t_2)) {

          /* "pyarrow/io.pxi":664
 *                 if kind == 'r':
 *                     if not handle.readable():
 *                         raise TypeError("readable file expected")             # <<<<<<<<<<<<<<
 *                 else:
 *                     if not handle.writable():
 */
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__207, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 664, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_Raise(__pyx_t_8, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __PYX_ERR(7, 664, __pyx_L1_error)

          /* "pyarrow/io.pxi":663
 *                 # Python 3 IO object
 *                 if kind == 'r':
 *                     if not handle.readable():             # <<<<<<<<<<<<<<
 *                         raise TypeError("readable file expected")
 *                 else:
 */
        }

        /* "pyarrow/io.pxi":662
 *             if isinstance(handle, IOBase):
 *                 # Python 3 IO object
 *                 if kind == 'r':             # <<<<<<<<<<<<<<
 *                     if not handle.readable():
 *                         raise TypeError("readable file expected")
 */
        goto __pyx_L25;
      }

      /* "pyarrow/io.pxi":666
 *                         raise TypeError("readable file expected")
 *                 else:
 *                     if not handle.writable():             # <<<<<<<<<<<<<<
 *                         raise TypeError("writable file expected")
 *             elif file_type is not None and isinstance(handle, file_type):
 */
      /*else*/ {
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_handle, __pyx_n_s_writable); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 666, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_6 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_9, function);
          }
        }
        __pyx_t_8 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_9);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 666, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(7, 666, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_1 = ((!__pyx_t_2) != 0);
        if (unlikely(__pyx_t_1)) {

          /* "pyarrow/io.pxi":667
 *                 else:
 *                     if not handle.writable():
 *                         raise TypeError("writable file expected")             # <<<<<<<<<<<<<<
 *             elif file_type is not None and isinstance(handle, file_type):
 *                 # Python 2 file type
 */
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__208, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 667, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_Raise(__pyx_t_8, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __PYX_ERR(7, 667, __pyx_L1_error)

          /* "pyarrow/io.pxi":666
 *                         raise TypeError("readable file expected")
 *                 else:
 *                     if not handle.writable():             # <<<<<<<<<<<<<<
 *                         raise TypeError("writable file expected")
 *             elif file_type is not None and isinstance(handle, file_type):
 */
        }
      }
      __pyx_L25:;

      /* "pyarrow/io.pxi":660
 *         # If mode was given, check it matches the given file
 *         if mode is not None:
 *             if isinstance(handle, IOBase):             # <<<<<<<<<<<<<<
 *                 # Python 3 IO object
 *                 if kind == 'r':
 */
      goto __pyx_L24;
    }

    /* "pyarrow/io.pxi":668
 *                     if not handle.writable():
 *                         raise TypeError("writable file expected")
 *             elif file_type is not None and isinstance(handle, file_type):             # <<<<<<<<<<<<<<
 *                 # Python 2 file type
 *                 if kind == 'r':
 */
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_file_type); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 668, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_2 = (__pyx_t_8 != Py_None);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_20 = (__pyx_t_2 != 0);
    if (__pyx_t_20) {
    } else {
      __pyx_t_1 = __pyx_t_20;
      goto __pyx_L28_bool_binop_done;
    }
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_file_type); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 668, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_20 = PyObject_IsInstance(__pyx_v_handle, __pyx_t_8); if (unlikely(__pyx_t_20 == ((int)-1))) __PYX_ERR(7, 668, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_2 = (__pyx_t_20 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L28_bool_binop_done:;
    if (__pyx_t_1) {

      /* "pyarrow/io.pxi":670
 *             elif file_type is not None and isinstance(handle, file_type):
 *                 # Python 2 file type
 *                 if kind == 'r':             # <<<<<<<<<<<<<<
 *                     if 'r' not in handle.mode and '+' not in handle.mode:
 *                         raise TypeError("readable file expected")
 */
      __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_kind, __pyx_n_u_r, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(7, 670, __pyx_L1_error)
      __pyx_t_2 = (__pyx_t_1 != 0);
      if (__pyx_t_2) {

        /* "pyarrow/io.pxi":671
 *                 # Python 2 file type
 *                 if kind == 'r':
 *                     if 'r' not in handle.mode and '+' not in handle.mode:             # <<<<<<<<<<<<<<
 *                         raise TypeError("readable file expected")
 *                 else:
 */
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_handle, __pyx_n_s_mode); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 671, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_n_u_r, __pyx_t_8, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(7, 671, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_20 = (__pyx_t_1 != 0);
        if (__pyx_t_20) {
        } else {
          __pyx_t_2 = __pyx_t_20;
          goto __pyx_L32_bool_binop_done;
        }
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_handle, __pyx_n_s_mode); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 671, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_20 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__27, __pyx_t_8, Py_NE)); if (unlikely(__pyx_t_20 < 0)) __PYX_ERR(7, 671, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_1 = (__pyx_t_20 != 0);
        __pyx_t_2 = __pyx_t_1;
        __pyx_L32_bool_binop_done:;
        if (unlikely(__pyx_t_2)) {

          /* "pyarrow/io.pxi":672
 *                 if kind == 'r':
 *                     if 'r' not in handle.mode and '+' not in handle.mode:
 *                         raise TypeError("readable file expected")             # <<<<<<<<<<<<<<
 *                 else:
 *                     if 'w' not in handle.mode and '+' not in handle.mode:
 */
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__207, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 672, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_Raise(__pyx_t_8, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __PYX_ERR(7, 672, __pyx_L1_error)

          /* "pyarrow/io.pxi":671
 *                 # Python 2 file type
 *                 if kind == 'r':
 *                     if 'r' not in handle.mode and '+' not in handle.mode:             # <<<<<<<<<<<<<<
 *                         raise TypeError("readable file expected")
 *                 else:
 */
        }

        /* "pyarrow/io.pxi":670
 *             elif file_type is not None and isinstance(handle, file_type):
 *                 # Python 2 file type
 *                 if kind == 'r':             # <<<<<<<<<<<<<<
 *                     if 'r' not in handle.mode and '+' not in handle.mode:
 *                         raise TypeError("readable file expected")
 */
        goto __pyx_L30;
      }

      /* "pyarrow/io.pxi":674
 *                         raise TypeError("readable file expected")
 *                 else:
 *                     if 'w' not in handle.mode and '+' not in handle.mode:             # <<<<<<<<<<<<<<
 *                         raise TypeError("writable file expected")
 *             # (other duck-typed file-like objects are possible)
 */
      /*else*/ {
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_handle, __pyx_n_s_mode); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 674, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_n_u_w, __pyx_t_8, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(7, 674, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_20 = (__pyx_t_1 != 0);
        if (__pyx_t_20) {
        } else {
          __pyx_t_2 = __pyx_t_20;
          goto __pyx_L35_bool_binop_done;
        }
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_handle, __pyx_n_s_mode); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 674, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_20 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__27, __pyx_t_8, Py_NE)); if (unlikely(__pyx_t_20 < 0)) __PYX_ERR(7, 674, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_1 = (__pyx_t_20 != 0);
        __pyx_t_2 = __pyx_t_1;
        __pyx_L35_bool_binop_done:;
        if (unlikely(__pyx_t_2)) {

          /* "pyarrow/io.pxi":675
 *                 else:
 *                     if 'w' not in handle.mode and '+' not in handle.mode:
 *                         raise TypeError("writable file expected")             # <<<<<<<<<<<<<<
 *             # (other duck-typed file-like objects are possible)
 * 
 */
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__208, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 675, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_Raise(__pyx_t_8, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __PYX_ERR(7, 675, __pyx_L1_error)

          /* "pyarrow/io.pxi":674
 *                         raise TypeError("readable file expected")
 *                 else:
 *                     if 'w' not in handle.mode and '+' not in handle.mode:             # <<<<<<<<<<<<<<
 *                         raise TypeError("writable file expected")
 *             # (other duck-typed file-like objects are possible)
 */
        }
      }
      __pyx_L30:;

      /* "pyarrow/io.pxi":668
 *                     if not handle.writable():
 *                         raise TypeError("writable file expected")
 *             elif file_type is not None and isinstance(handle, file_type):             # <<<<<<<<<<<<<<
 *                 # Python 2 file type
 *                 if kind == 'r':
 */
    }
    __pyx_L24:;

    /* "pyarrow/io.pxi":659
 * 
 *         # If mode was given, check it matches the given file
 *         if mode is not None:             # <<<<<<<<<<<<<<
 *             if isinstance(handle, IOBase):
 *                 # Python 3 IO object
 */
  }

  /* "pyarrow/io.pxi":679
 * 
 *         # If possible, check the file is a binary file
 *         if isinstance(handle, TextIOBase):             # <<<<<<<<<<<<<<
 *             raise TypeError("binary file expected, got text file")
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_TextIOBase); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_handle, __pyx_t_8); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(7, 679, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/io.pxi":680
 *         # If possible, check the file is a binary file
 *         if isinstance(handle, TextIOBase):
 *             raise TypeError("binary file expected, got text file")             # <<<<<<<<<<<<<<
 * 
 *         if kind == 'r':
 */
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__209, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 680, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_Raise(__pyx_t_8, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __PYX_ERR(7, 680, __pyx_L1_error)

    /* "pyarrow/io.pxi":679
 * 
 *         # If possible, check the file is a binary file
 *         if isinstance(handle, TextIOBase):             # <<<<<<<<<<<<<<
 *             raise TypeError("binary file expected, got text file")
 * 
 */
  }

  /* "pyarrow/io.pxi":682
 *             raise TypeError("binary file expected, got text file")
 * 
 *         if kind == 'r':             # <<<<<<<<<<<<<<
 *             self.set_random_access_file(
 *                 shared_ptr[CRandomAccessFile](new PyReadableFile(handle)))
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_kind, __pyx_n_u_r, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(7, 682, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/io.pxi":683
 * 
 *         if kind == 'r':
 *             self.set_random_access_file(             # <<<<<<<<<<<<<<
 *                 shared_ptr[CRandomAccessFile](new PyReadableFile(handle)))
 *             self.is_readable = True
 */
    __pyx_t_8 = ((struct __pyx_vtabstruct_7pyarrow_3lib_PythonFile *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_random_access_file(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), std::shared_ptr< arrow::io::RandomAccessFile> (new arrow::py::PyReadableFile(__pyx_v_handle))); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 683, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "pyarrow/io.pxi":685
 *             self.set_random_access_file(
 *                 shared_ptr[CRandomAccessFile](new PyReadableFile(handle)))
 *             self.is_readable = True             # <<<<<<<<<<<<<<
 *         else:
 *             self.set_output_stream(
 */
    __pyx_v_self->__pyx_base.is_readable = 1;

    /* "pyarrow/io.pxi":682
 *             raise TypeError("binary file expected, got text file")
 * 
 *         if kind == 'r':             # <<<<<<<<<<<<<<
 *             self.set_random_access_file(
 *                 shared_ptr[CRandomAccessFile](new PyReadableFile(handle)))
 */
    goto __pyx_L38;
  }

  /* "pyarrow/io.pxi":687
 *             self.is_readable = True
 *         else:
 *             self.set_output_stream(             # <<<<<<<<<<<<<<
 *                 shared_ptr[COutputStream](new PyOutputStream(handle)))
 *             self.is_writable = True
 */
  /*else*/ {

    /* "pyarrow/io.pxi":688
 *         else:
 *             self.set_output_stream(
 *                 shared_ptr[COutputStream](new PyOutputStream(handle)))             # <<<<<<<<<<<<<<
 *             self.is_writable = True
 * 
 */
    __pyx_t_8 = ((struct __pyx_vtabstruct_7pyarrow_3lib_PythonFile *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_output_stream(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), std::shared_ptr< arrow::io::OutputStream> (new arrow::py::PyOutputStream(__pyx_v_handle))); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 687, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "pyarrow/io.pxi":689
 *             self.set_output_stream(
 *                 shared_ptr[COutputStream](new PyOutputStream(handle)))
 *             self.is_writable = True             # <<<<<<<<<<<<<<
 * 
 *     def truncate(self, pos=None):
 */
    __pyx_v_self->__pyx_base.is_writable = 1;
  }
  __pyx_L38:;

  /* "pyarrow/io.pxi":633
 *         object handle
 * 
 *     def __cinit__(self, handle, mode=None):             # <<<<<<<<<<<<<<
 *         self.handle = handle
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_AddTraceback("pyarrow.lib.PythonFile.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_inferred_mode);
  __Pyx_XDECREF(__pyx_v_kind);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":691
 *             self.is_writable = True
 * 
 *     def truncate(self, pos=None):             # <<<<<<<<<<<<<<
 *         self.handle.truncate(pos)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10PythonFile_3truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10PythonFile_2truncate[] = "PythonFile.truncate(self, pos=None)";
static PyObject *__pyx_pw_7pyarrow_3lib_10PythonFile_3truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pos = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("truncate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pos,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pos);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "truncate") < 0)) __PYX_ERR(7, 691, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_pos = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("truncate", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 691, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.PythonFile.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_10PythonFile_2truncate(((struct __pyx_obj_7pyarrow_3lib_PythonFile *)__pyx_v_self), __pyx_v_pos);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10PythonFile_2truncate(struct __pyx_obj_7pyarrow_3lib_PythonFile *__pyx_v_self, PyObject *__pyx_v_pos) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("truncate", 0);

  /* "pyarrow/io.pxi":692
 * 
 *     def truncate(self, pos=None):
 *         self.handle.truncate(pos)             # <<<<<<<<<<<<<<
 * 
 *     def readline(self, size=None):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->handle, __pyx_n_s_truncate); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_pos) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_pos);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":691
 *             self.is_writable = True
 * 
 *     def truncate(self, pos=None):             # <<<<<<<<<<<<<<
 *         self.handle.truncate(pos)
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.PythonFile.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":694
 *         self.handle.truncate(pos)
 * 
 *     def readline(self, size=None):             # <<<<<<<<<<<<<<
 *         return self.handle.readline(size)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10PythonFile_5readline(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10PythonFile_4readline[] = "PythonFile.readline(self, size=None)";
static PyObject *__pyx_pw_7pyarrow_3lib_10PythonFile_5readline(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("readline (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "readline") < 0)) __PYX_ERR(7, 694, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_size = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("readline", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 694, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.PythonFile.readline", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_10PythonFile_4readline(((struct __pyx_obj_7pyarrow_3lib_PythonFile *)__pyx_v_self), __pyx_v_size);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10PythonFile_4readline(struct __pyx_obj_7pyarrow_3lib_PythonFile *__pyx_v_self, PyObject *__pyx_v_size) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("readline", 0);

  /* "pyarrow/io.pxi":695
 * 
 *     def readline(self, size=None):
 *         return self.handle.readline(size)             # <<<<<<<<<<<<<<
 * 
 *     def readlines(self, hint=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->handle, __pyx_n_s_readline); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_size) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_size);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":694
 *         self.handle.truncate(pos)
 * 
 *     def readline(self, size=None):             # <<<<<<<<<<<<<<
 *         return self.handle.readline(size)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.PythonFile.readline", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":697
 *         return self.handle.readline(size)
 * 
 *     def readlines(self, hint=None):             # <<<<<<<<<<<<<<
 *         return self.handle.readlines(hint)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10PythonFile_7readlines(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10PythonFile_6readlines[] = "PythonFile.readlines(self, hint=None)";
static PyObject *__pyx_pw_7pyarrow_3lib_10PythonFile_7readlines(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_hint = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("readlines (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hint,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hint);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "readlines") < 0)) __PYX_ERR(7, 697, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_hint = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("readlines", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 697, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.PythonFile.readlines", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_10PythonFile_6readlines(((struct __pyx_obj_7pyarrow_3lib_PythonFile *)__pyx_v_self), __pyx_v_hint);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10PythonFile_6readlines(struct __pyx_obj_7pyarrow_3lib_PythonFile *__pyx_v_self, PyObject *__pyx_v_hint) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("readlines", 0);

  /* "pyarrow/io.pxi":698
 * 
 *     def readlines(self, hint=None):
 *         return self.handle.readlines(hint)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->handle, __pyx_n_s_readlines); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_hint) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_hint);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":697
 *         return self.handle.readline(size)
 * 
 *     def readlines(self, hint=None):             # <<<<<<<<<<<<<<
 *         return self.handle.readlines(hint)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.PythonFile.readlines", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10PythonFile_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10PythonFile_8__reduce_cython__[] = "PythonFile.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10PythonFile_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10PythonFile_8__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_PythonFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10PythonFile_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_PythonFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__210, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.PythonFile.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10PythonFile_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10PythonFile_10__setstate_cython__[] = "PythonFile.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_10PythonFile_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10PythonFile_10__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_PythonFile *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_10PythonFile_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_PythonFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__211, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.PythonFile.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":712
 * 
 *     @staticmethod
 *     def create(path, size):             # <<<<<<<<<<<<<<
 *         cdef:
 *             shared_ptr[CMemoryMappedFile] handle
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_1create(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16MemoryMappedFile_create[] = "MemoryMappedFile.create(path, size)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_16MemoryMappedFile_1create = {"create", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_1create, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_16MemoryMappedFile_create};
static PyObject *__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_1create(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("create (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_size,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("create", 1, 2, 2, 1); __PYX_ERR(7, 712, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(7, 712, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_path = values[0];
    __pyx_v_size = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 712, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.MemoryMappedFile.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_16MemoryMappedFile_create(__pyx_v_path, __pyx_v_size);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16MemoryMappedFile_create(PyObject *__pyx_v_path, PyObject *__pyx_v_size) {
  std::shared_ptr< arrow::io::MemoryMappedFile>  __pyx_v_handle;
  std::string __pyx_v_c_path;
  int64_t __pyx_v_c_size;
  struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int64_t __pyx_t_5;
  std::shared_ptr< arrow::io::MemoryMappedFile>  __pyx_t_6;
  __Pyx_RefNannySetupContext("create", 0);

  /* "pyarrow/io.pxi":715
 *         cdef:
 *             shared_ptr[CMemoryMappedFile] handle
 *             c_string c_path = encode_file_path(path)             # <<<<<<<<<<<<<<
 *             int64_t c_size = size
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_file_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 715, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_path) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_path);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 715, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 715, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_path = __pyx_t_4;

  /* "pyarrow/io.pxi":716
 *             shared_ptr[CMemoryMappedFile] handle
 *             c_string c_path = encode_file_path(path)
 *             int64_t c_size = size             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_v_size); if (unlikely((__pyx_t_5 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 716, __pyx_L1_error)
  __pyx_v_c_size = __pyx_t_5;

  /* "pyarrow/io.pxi":718
 *             int64_t c_size = size
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             handle = GetResultValue(CMemoryMappedFile.Create(c_path, c_size))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":719
 * 
 *         with nogil:
 *             handle = GetResultValue(CMemoryMappedFile.Create(c_path, c_size))             # <<<<<<<<<<<<<<
 * 
 *         cdef MemoryMappedFile result = MemoryMappedFile()
 */
        __pyx_t_6 = arrow::py::GetResultValue<std::shared_ptr< arrow::io::MemoryMappedFile> >( arrow::io::MemoryMappedFile::Create(__pyx_v_c_path, __pyx_v_c_size)); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(7, 719, __pyx_L4_error)
        __pyx_v_handle = __pyx_t_6;
      }

      /* "pyarrow/io.pxi":718
 *             int64_t c_size = size
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             handle = GetResultValue(CMemoryMappedFile.Create(c_path, c_size))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io.pxi":721
 *             handle = GetResultValue(CMemoryMappedFile.Create(c_path, c_size))
 * 
 *         cdef MemoryMappedFile result = MemoryMappedFile()             # <<<<<<<<<<<<<<
 *         result.path = path
 *         result.is_readable = True
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_MemoryMappedFile)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":722
 * 
 *         cdef MemoryMappedFile result = MemoryMappedFile()
 *         result.path = path             # <<<<<<<<<<<<<<
 *         result.is_readable = True
 *         result.is_writable = True
 */
  __Pyx_INCREF(__pyx_v_path);
  __Pyx_GIVEREF(__pyx_v_path);
  __Pyx_GOTREF(__pyx_v_result->path);
  __Pyx_DECREF(__pyx_v_result->path);
  __pyx_v_result->path = __pyx_v_path;

  /* "pyarrow/io.pxi":723
 *         cdef MemoryMappedFile result = MemoryMappedFile()
 *         result.path = path
 *         result.is_readable = True             # <<<<<<<<<<<<<<
 *         result.is_writable = True
 *         result.set_output_stream(<shared_ptr[COutputStream]> handle)
 */
  __pyx_v_result->__pyx_base.is_readable = 1;

  /* "pyarrow/io.pxi":724
 *         result.path = path
 *         result.is_readable = True
 *         result.is_writable = True             # <<<<<<<<<<<<<<
 *         result.set_output_stream(<shared_ptr[COutputStream]> handle)
 *         result.set_random_access_file(<shared_ptr[CRandomAccessFile]> handle)
 */
  __pyx_v_result->__pyx_base.is_writable = 1;

  /* "pyarrow/io.pxi":725
 *         result.is_readable = True
 *         result.is_writable = True
 *         result.set_output_stream(<shared_ptr[COutputStream]> handle)             # <<<<<<<<<<<<<<
 *         result.set_random_access_file(<shared_ptr[CRandomAccessFile]> handle)
 *         result.handle = handle
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_MemoryMappedFile *)__pyx_v_result->__pyx_base.__pyx_vtab)->__pyx_base.set_output_stream(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_result), ((std::shared_ptr< arrow::io::OutputStream> )__pyx_v_handle)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":726
 *         result.is_writable = True
 *         result.set_output_stream(<shared_ptr[COutputStream]> handle)
 *         result.set_random_access_file(<shared_ptr[CRandomAccessFile]> handle)             # <<<<<<<<<<<<<<
 *         result.handle = handle
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_MemoryMappedFile *)__pyx_v_result->__pyx_base.__pyx_vtab)->__pyx_base.set_random_access_file(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_result), ((std::shared_ptr< arrow::io::RandomAccessFile> )__pyx_v_handle)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 726, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":727
 *         result.set_output_stream(<shared_ptr[COutputStream]> handle)
 *         result.set_random_access_file(<shared_ptr[CRandomAccessFile]> handle)
 *         result.handle = handle             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  __pyx_v_result->handle = __pyx_v_handle;

  /* "pyarrow/io.pxi":729
 *         result.handle = handle
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def _open(self, path, mode='r'):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/io.pxi":712
 * 
 *     @staticmethod
 *     def create(path, size):             # <<<<<<<<<<<<<<
 *         cdef:
 *             shared_ptr[CMemoryMappedFile] handle
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.MemoryMappedFile.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":731
 *         return result
 * 
 *     def _open(self, path, mode='r'):             # <<<<<<<<<<<<<<
 *         self.path = path
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_3_open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16MemoryMappedFile_2_open[] = "MemoryMappedFile._open(self, path, mode=u'r')";
static PyObject *__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_3_open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_mode = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_open (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_mode,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)__pyx_n_u_r);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_open") < 0)) __PYX_ERR(7, 731, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_path = values[0];
    __pyx_v_mode = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_open", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 731, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.MemoryMappedFile._open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_16MemoryMappedFile_2_open(((struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *)__pyx_v_self), __pyx_v_path, __pyx_v_mode);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16MemoryMappedFile_2_open(struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_mode) {
  enum  arrow::io::FileMode::type __pyx_v_c_mode;
  std::shared_ptr< arrow::io::MemoryMappedFile>  __pyx_v_handle;
  std::string __pyx_v_c_path;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  std::shared_ptr< arrow::io::MemoryMappedFile>  __pyx_t_7;
  __Pyx_RefNannySetupContext("_open", 0);

  /* "pyarrow/io.pxi":732
 * 
 *     def _open(self, path, mode='r'):
 *         self.path = path             # <<<<<<<<<<<<<<
 * 
 *         cdef:
 */
  __Pyx_INCREF(__pyx_v_path);
  __Pyx_GIVEREF(__pyx_v_path);
  __Pyx_GOTREF(__pyx_v_self->path);
  __Pyx_DECREF(__pyx_v_self->path);
  __pyx_v_self->path = __pyx_v_path;

  /* "pyarrow/io.pxi":737
 *             FileMode c_mode
 *             shared_ptr[CMemoryMappedFile] handle
 *             c_string c_path = encode_file_path(path)             # <<<<<<<<<<<<<<
 * 
 *         if mode in ('r', 'rb'):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_file_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 737, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_path) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_path);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 737, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 737, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_path = __pyx_t_4;

  /* "pyarrow/io.pxi":739
 *             c_string c_path = encode_file_path(path)
 * 
 *         if mode in ('r', 'rb'):             # <<<<<<<<<<<<<<
 *             c_mode = FileMode_READ
 *             self.is_readable = True
 */
  __Pyx_INCREF(__pyx_v_mode);
  __pyx_t_1 = __pyx_v_mode;
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_r, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(7, 739, __pyx_L1_error)
  if (!__pyx_t_6) {
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_rb_2, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(7, 739, __pyx_L1_error)
  __pyx_t_5 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {

    /* "pyarrow/io.pxi":740
 * 
 *         if mode in ('r', 'rb'):
 *             c_mode = FileMode_READ             # <<<<<<<<<<<<<<
 *             self.is_readable = True
 *         elif mode in ('w', 'wb'):
 */
    __pyx_v_c_mode =  arrow::io::FileMode::READ;

    /* "pyarrow/io.pxi":741
 *         if mode in ('r', 'rb'):
 *             c_mode = FileMode_READ
 *             self.is_readable = True             # <<<<<<<<<<<<<<
 *         elif mode in ('w', 'wb'):
 *             c_mode = FileMode_WRITE
 */
    __pyx_v_self->__pyx_base.is_readable = 1;

    /* "pyarrow/io.pxi":739
 *             c_string c_path = encode_file_path(path)
 * 
 *         if mode in ('r', 'rb'):             # <<<<<<<<<<<<<<
 *             c_mode = FileMode_READ
 *             self.is_readable = True
 */
    goto __pyx_L3;
  }

  /* "pyarrow/io.pxi":742
 *             c_mode = FileMode_READ
 *             self.is_readable = True
 *         elif mode in ('w', 'wb'):             # <<<<<<<<<<<<<<
 *             c_mode = FileMode_WRITE
 *             self.is_writable = True
 */
  __Pyx_INCREF(__pyx_v_mode);
  __pyx_t_1 = __pyx_v_mode;
  __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_w, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(7, 742, __pyx_L1_error)
  if (!__pyx_t_5) {
  } else {
    __pyx_t_6 = __pyx_t_5;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_wb, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(7, 742, __pyx_L1_error)
  __pyx_t_6 = __pyx_t_5;
  __pyx_L6_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_6 != 0);
  if (__pyx_t_5) {

    /* "pyarrow/io.pxi":743
 *             self.is_readable = True
 *         elif mode in ('w', 'wb'):
 *             c_mode = FileMode_WRITE             # <<<<<<<<<<<<<<
 *             self.is_writable = True
 *         elif mode in ('r+', 'r+b', 'rb+'):
 */
    __pyx_v_c_mode =  arrow::io::FileMode::WRITE;

    /* "pyarrow/io.pxi":744
 *         elif mode in ('w', 'wb'):
 *             c_mode = FileMode_WRITE
 *             self.is_writable = True             # <<<<<<<<<<<<<<
 *         elif mode in ('r+', 'r+b', 'rb+'):
 *             c_mode = FileMode_READWRITE
 */
    __pyx_v_self->__pyx_base.is_writable = 1;

    /* "pyarrow/io.pxi":742
 *             c_mode = FileMode_READ
 *             self.is_readable = True
 *         elif mode in ('w', 'wb'):             # <<<<<<<<<<<<<<
 *             c_mode = FileMode_WRITE
 *             self.is_writable = True
 */
    goto __pyx_L3;
  }

  /* "pyarrow/io.pxi":745
 *             c_mode = FileMode_WRITE
 *             self.is_writable = True
 *         elif mode in ('r+', 'r+b', 'rb+'):             # <<<<<<<<<<<<<<
 *             c_mode = FileMode_READWRITE
 *             self.is_readable = True
 */
  __Pyx_INCREF(__pyx_v_mode);
  __pyx_t_1 = __pyx_v_mode;
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_r_2, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(7, 745, __pyx_L1_error)
  if (!__pyx_t_6) {
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_r_b, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(7, 745, __pyx_L1_error)
  if (!__pyx_t_6) {
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_rb, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(7, 745, __pyx_L1_error)
  __pyx_t_5 = __pyx_t_6;
  __pyx_L8_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (likely(__pyx_t_6)) {

    /* "pyarrow/io.pxi":746
 *             self.is_writable = True
 *         elif mode in ('r+', 'r+b', 'rb+'):
 *             c_mode = FileMode_READWRITE             # <<<<<<<<<<<<<<
 *             self.is_readable = True
 *             self.is_writable = True
 */
    __pyx_v_c_mode =  arrow::io::FileMode::READWRITE;

    /* "pyarrow/io.pxi":747
 *         elif mode in ('r+', 'r+b', 'rb+'):
 *             c_mode = FileMode_READWRITE
 *             self.is_readable = True             # <<<<<<<<<<<<<<
 *             self.is_writable = True
 *         else:
 */
    __pyx_v_self->__pyx_base.is_readable = 1;

    /* "pyarrow/io.pxi":748
 *             c_mode = FileMode_READWRITE
 *             self.is_readable = True
 *             self.is_writable = True             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError('Invalid file mode: {0}'.format(mode))
 */
    __pyx_v_self->__pyx_base.is_writable = 1;

    /* "pyarrow/io.pxi":745
 *             c_mode = FileMode_WRITE
 *             self.is_writable = True
 *         elif mode in ('r+', 'r+b', 'rb+'):             # <<<<<<<<<<<<<<
 *             c_mode = FileMode_READWRITE
 *             self.is_readable = True
 */
    goto __pyx_L3;
  }

  /* "pyarrow/io.pxi":750
 *             self.is_writable = True
 *         else:
 *             raise ValueError('Invalid file mode: {0}'.format(mode))             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Invalid_file_mode_0, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 750, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_mode) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_mode);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 750, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 750, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(7, 750, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "pyarrow/io.pxi":752
 *             raise ValueError('Invalid file mode: {0}'.format(mode))
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             handle = GetResultValue(CMemoryMappedFile.Open(c_path, c_mode))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":753
 * 
 *         with nogil:
 *             handle = GetResultValue(CMemoryMappedFile.Open(c_path, c_mode))             # <<<<<<<<<<<<<<
 * 
 *         self.set_output_stream(<shared_ptr[COutputStream]> handle)
 */
        __pyx_t_7 = arrow::py::GetResultValue<std::shared_ptr< arrow::io::MemoryMappedFile> >( arrow::io::MemoryMappedFile::Open(__pyx_v_c_path, __pyx_v_c_mode)); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(7, 753, __pyx_L12_error)
        __pyx_v_handle = __pyx_t_7;
      }

      /* "pyarrow/io.pxi":752
 *             raise ValueError('Invalid file mode: {0}'.format(mode))
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             handle = GetResultValue(CMemoryMappedFile.Open(c_path, c_mode))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L13;
        }
        __pyx_L12_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L13:;
      }
  }

  /* "pyarrow/io.pxi":755
 *             handle = GetResultValue(CMemoryMappedFile.Open(c_path, c_mode))
 * 
 *         self.set_output_stream(<shared_ptr[COutputStream]> handle)             # <<<<<<<<<<<<<<
 *         self.set_random_access_file(<shared_ptr[CRandomAccessFile]> handle)
 *         self.handle = handle
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_3lib_MemoryMappedFile *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_output_stream(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), ((std::shared_ptr< arrow::io::OutputStream> )__pyx_v_handle)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io.pxi":756
 * 
 *         self.set_output_stream(<shared_ptr[COutputStream]> handle)
 *         self.set_random_access_file(<shared_ptr[CRandomAccessFile]> handle)             # <<<<<<<<<<<<<<
 *         self.handle = handle
 * 
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_3lib_MemoryMappedFile *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_random_access_file(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), ((std::shared_ptr< arrow::io::RandomAccessFile> )__pyx_v_handle)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 756, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io.pxi":757
 *         self.set_output_stream(<shared_ptr[COutputStream]> handle)
 *         self.set_random_access_file(<shared_ptr[CRandomAccessFile]> handle)
 *         self.handle = handle             # <<<<<<<<<<<<<<
 * 
 *     def resize(self, new_size):
 */
  __pyx_v_self->handle = __pyx_v_handle;

  /* "pyarrow/io.pxi":731
 *         return result
 * 
 *     def _open(self, path, mode='r'):             # <<<<<<<<<<<<<<
 *         self.path = path
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.MemoryMappedFile._open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":759
 *         self.handle = handle
 * 
 *     def resize(self, new_size):             # <<<<<<<<<<<<<<
 *         """
 *         Resize the map and underlying file.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_5resize(PyObject *__pyx_v_self, PyObject *__pyx_v_new_size); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16MemoryMappedFile_4resize[] = "MemoryMappedFile.resize(self, new_size)\n\n        Resize the map and underlying file.\n\n        Parameters\n        ----------\n        new_size : new size in bytes\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_5resize(PyObject *__pyx_v_self, PyObject *__pyx_v_new_size) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("resize (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16MemoryMappedFile_4resize(((struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *)__pyx_v_self), ((PyObject *)__pyx_v_new_size));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16MemoryMappedFile_4resize(struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *__pyx_v_self, PyObject *__pyx_v_new_size) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int64_t __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("resize", 0);

  /* "pyarrow/io.pxi":767
 *         new_size : new size in bytes
 *         """
 *         check_status(self.handle.get().Resize(new_size))             # <<<<<<<<<<<<<<
 * 
 *     def fileno(self):
 */
  __pyx_t_1 = __Pyx_PyInt_As_int64_t(__pyx_v_new_size); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 767, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->handle.get()->Resize(__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(7, 767, __pyx_L1_error)

  /* "pyarrow/io.pxi":759
 *         self.handle = handle
 * 
 *     def resize(self, new_size):             # <<<<<<<<<<<<<<
 *         """
 *         Resize the map and underlying file.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.MemoryMappedFile.resize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":769
 *         check_status(self.handle.get().Resize(new_size))
 * 
 *     def fileno(self):             # <<<<<<<<<<<<<<
 *         self._assert_open()
 *         return self.handle.get().file_descriptor()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_7fileno(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16MemoryMappedFile_6fileno[] = "MemoryMappedFile.fileno(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_7fileno(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fileno (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16MemoryMappedFile_6fileno(((struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16MemoryMappedFile_6fileno(struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("fileno", 0);

  /* "pyarrow/io.pxi":770
 * 
 *     def fileno(self):
 *         self._assert_open()             # <<<<<<<<<<<<<<
 *         return self.handle.get().file_descriptor()
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":771
 *     def fileno(self):
 *         self._assert_open()
 *         return self.handle.get().file_descriptor()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->handle.get()->file_descriptor()); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 771, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":769
 *         check_status(self.handle.get().Resize(new_size))
 * 
 *     def fileno(self):             # <<<<<<<<<<<<<<
 *         self._assert_open()
 *         return self.handle.get().file_descriptor()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.MemoryMappedFile.fileno", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16MemoryMappedFile_8__reduce_cython__[] = "MemoryMappedFile.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16MemoryMappedFile_8__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16MemoryMappedFile_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__212, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.MemoryMappedFile.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16MemoryMappedFile_10__setstate_cython__[] = "MemoryMappedFile.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16MemoryMappedFile_10__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16MemoryMappedFile_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__213, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.MemoryMappedFile.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":774
 * 
 * 
 * def memory_map(path, mode='r'):             # <<<<<<<<<<<<<<
 *     """
 *     Open memory map at file path. Size of the memory map cannot change
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_159memory_map(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_158memory_map[] = "memory_map(path, mode=u'r')\n\n    Open memory map at file path. Size of the memory map cannot change\n\n    Parameters\n    ----------\n    path : string\n    mode : {'r', 'r+', 'w'}, default 'r'\n        Whether the file is opened for reading ('r+'), writing ('w')\n        or both ('r+').\n\n    Returns\n    -------\n    mmap : MemoryMappedFile\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_159memory_map = {"memory_map", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_159memory_map, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_158memory_map};
static PyObject *__pyx_pw_7pyarrow_3lib_159memory_map(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_mode = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("memory_map (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_mode,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)__pyx_n_u_r);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "memory_map") < 0)) __PYX_ERR(7, 774, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_path = values[0];
    __pyx_v_mode = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("memory_map", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 774, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.memory_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_158memory_map(__pyx_self, __pyx_v_path, __pyx_v_mode);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_158memory_map(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_mode) {
  struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *__pyx_v_mmap = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("memory_map", 0);

  /* "pyarrow/io.pxi":789
 *     mmap : MemoryMappedFile
 *     """
 *     cdef MemoryMappedFile mmap = MemoryMappedFile()             # <<<<<<<<<<<<<<
 *     mmap._open(path, mode)
 *     return mmap
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_MemoryMappedFile)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 789, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_mmap = ((struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":790
 *     """
 *     cdef MemoryMappedFile mmap = MemoryMappedFile()
 *     mmap._open(path, mode)             # <<<<<<<<<<<<<<
 *     return mmap
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_mmap), __pyx_n_s_open_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 790, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_path, __pyx_v_mode};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 790, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_path, __pyx_v_mode};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 790, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 790, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_path);
    __Pyx_GIVEREF(__pyx_v_path);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_path);
    __Pyx_INCREF(__pyx_v_mode);
    __Pyx_GIVEREF(__pyx_v_mode);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_mode);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 790, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":791
 *     cdef MemoryMappedFile mmap = MemoryMappedFile()
 *     mmap._open(path, mode)
 *     return mmap             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_mmap));
  __pyx_r = ((PyObject *)__pyx_v_mmap);
  goto __pyx_L0;

  /* "pyarrow/io.pxi":774
 * 
 * 
 * def memory_map(path, mode='r'):             # <<<<<<<<<<<<<<
 *     """
 *     Open memory map at file path. Size of the memory map cannot change
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.memory_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_mmap);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":794
 * 
 * 
 * def create_memory_map(path, size):             # <<<<<<<<<<<<<<
 *     """
 *     Create a file of the given size and memory-map it.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_161create_memory_map(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_160create_memory_map[] = "create_memory_map(path, size)\n\n    Create a file of the given size and memory-map it.\n\n    Parameters\n    ----------\n    path : string\n        The file path to create, on the local filesystem.\n    size : int\n        The file size to create.\n\n    Returns\n    -------\n    mmap : MemoryMappedFile\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_161create_memory_map = {"create_memory_map", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_161create_memory_map, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_160create_memory_map};
static PyObject *__pyx_pw_7pyarrow_3lib_161create_memory_map(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("create_memory_map (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_size,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("create_memory_map", 1, 2, 2, 1); __PYX_ERR(7, 794, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create_memory_map") < 0)) __PYX_ERR(7, 794, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_path = values[0];
    __pyx_v_size = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create_memory_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 794, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.create_memory_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_160create_memory_map(__pyx_self, __pyx_v_path, __pyx_v_size);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_160create_memory_map(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_size) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("create_memory_map", 0);

  /* "pyarrow/io.pxi":809
 *     mmap : MemoryMappedFile
 *     """
 *     return MemoryMappedFile.create(path, size)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_MemoryMappedFile), __pyx_n_s_create); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 809, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_path, __pyx_v_size};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 809, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_path, __pyx_v_size};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 809, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 809, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_path);
    __Pyx_GIVEREF(__pyx_v_path);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_path);
    __Pyx_INCREF(__pyx_v_size);
    __Pyx_GIVEREF(__pyx_v_size);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_size);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 809, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":794
 * 
 * 
 * def create_memory_map(path, size):             # <<<<<<<<<<<<<<
 *     """
 *     Create a file of the given size and memory-map it.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.create_memory_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":819
 *         object path
 * 
 *     def __cinit__(self, path, mode='r', MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         self.path = path
 * 
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_6OSFile_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_6OSFile_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_mode = 0;
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_mode,&__pyx_n_s_memory_pool,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)__pyx_n_u_r);
    values[2] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(7, 819, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_path = values[0];
    __pyx_v_mode = values[1];
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 819, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.OSFile.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(7, 819, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_6OSFile___cinit__(((struct __pyx_obj_7pyarrow_3lib_OSFile *)__pyx_v_self), __pyx_v_path, __pyx_v_mode, __pyx_v_memory_pool);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_6OSFile___cinit__(struct __pyx_obj_7pyarrow_3lib_OSFile *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_mode, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool) {
  std::string __pyx_v_c_path;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/io.pxi":820
 * 
 *     def __cinit__(self, path, mode='r', MemoryPool memory_pool=None):
 *         self.path = path             # <<<<<<<<<<<<<<
 * 
 *         cdef:
 */
  __Pyx_INCREF(__pyx_v_path);
  __Pyx_GIVEREF(__pyx_v_path);
  __Pyx_GOTREF(__pyx_v_self->path);
  __Pyx_DECREF(__pyx_v_self->path);
  __pyx_v_self->path = __pyx_v_path;

  /* "pyarrow/io.pxi":825
 *             FileMode c_mode
 *             shared_ptr[Readable] handle
 *             c_string c_path = encode_file_path(path)             # <<<<<<<<<<<<<<
 * 
 *         if mode in ('r', 'rb'):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_file_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 825, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_path) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_path);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 825, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 825, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_path = __pyx_t_4;

  /* "pyarrow/io.pxi":827
 *             c_string c_path = encode_file_path(path)
 * 
 *         if mode in ('r', 'rb'):             # <<<<<<<<<<<<<<
 *             self._open_readable(c_path, maybe_unbox_memory_pool(memory_pool))
 *         elif mode in ('w', 'wb'):
 */
  __Pyx_INCREF(__pyx_v_mode);
  __pyx_t_1 = __pyx_v_mode;
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_r, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(7, 827, __pyx_L1_error)
  if (!__pyx_t_6) {
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_rb_2, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(7, 827, __pyx_L1_error)
  __pyx_t_5 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {

    /* "pyarrow/io.pxi":828
 * 
 *         if mode in ('r', 'rb'):
 *             self._open_readable(c_path, maybe_unbox_memory_pool(memory_pool))             # <<<<<<<<<<<<<<
 *         elif mode in ('w', 'wb'):
 *             self._open_writable(c_path)
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_OSFile *)__pyx_v_self->__pyx_base.__pyx_vtab)->_open_readable(__pyx_v_self, __pyx_v_c_path, __pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(__pyx_v_memory_pool)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 828, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/io.pxi":827
 *             c_string c_path = encode_file_path(path)
 * 
 *         if mode in ('r', 'rb'):             # <<<<<<<<<<<<<<
 *             self._open_readable(c_path, maybe_unbox_memory_pool(memory_pool))
 *         elif mode in ('w', 'wb'):
 */
    goto __pyx_L3;
  }

  /* "pyarrow/io.pxi":829
 *         if mode in ('r', 'rb'):
 *             self._open_readable(c_path, maybe_unbox_memory_pool(memory_pool))
 *         elif mode in ('w', 'wb'):             # <<<<<<<<<<<<<<
 *             self._open_writable(c_path)
 *         else:
 */
  __Pyx_INCREF(__pyx_v_mode);
  __pyx_t_1 = __pyx_v_mode;
  __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_w, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(7, 829, __pyx_L1_error)
  if (!__pyx_t_5) {
  } else {
    __pyx_t_6 = __pyx_t_5;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_wb, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(7, 829, __pyx_L1_error)
  __pyx_t_6 = __pyx_t_5;
  __pyx_L6_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_6 != 0);
  if (likely(__pyx_t_5)) {

    /* "pyarrow/io.pxi":830
 *             self._open_readable(c_path, maybe_unbox_memory_pool(memory_pool))
 *         elif mode in ('w', 'wb'):
 *             self._open_writable(c_path)             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError('Invalid file mode: {0}'.format(mode))
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_OSFile *)__pyx_v_self->__pyx_base.__pyx_vtab)->_open_writable(__pyx_v_self, __pyx_v_c_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 830, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/io.pxi":829
 *         if mode in ('r', 'rb'):
 *             self._open_readable(c_path, maybe_unbox_memory_pool(memory_pool))
 *         elif mode in ('w', 'wb'):             # <<<<<<<<<<<<<<
 *             self._open_writable(c_path)
 *         else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/io.pxi":832
 *             self._open_writable(c_path)
 *         else:
 *             raise ValueError('Invalid file mode: {0}'.format(mode))             # <<<<<<<<<<<<<<
 * 
 *     cdef _open_readable(self, c_string path, CMemoryPool* pool):
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Invalid_file_mode_0, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 832, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_mode) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_mode);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 832, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 832, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(7, 832, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "pyarrow/io.pxi":819
 *         object path
 * 
 *     def __cinit__(self, path, mode='r', MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         self.path = path
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.OSFile.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":834
 *             raise ValueError('Invalid file mode: {0}'.format(mode))
 * 
 *     cdef _open_readable(self, c_string path, CMemoryPool* pool):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[ReadableFile] handle
 * 
 */

static PyObject *__pyx_f_7pyarrow_3lib_6OSFile__open_readable(struct __pyx_obj_7pyarrow_3lib_OSFile *__pyx_v_self, std::string __pyx_v_path,  arrow::MemoryPool *__pyx_v_pool) {
  std::shared_ptr<arrow::io::ReadableFile>  __pyx_v_handle;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr<arrow::io::ReadableFile>  __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("_open_readable", 0);

  /* "pyarrow/io.pxi":837
 *         cdef shared_ptr[ReadableFile] handle
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             handle = GetResultValue(ReadableFile.Open(path, pool))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":838
 * 
 *         with nogil:
 *             handle = GetResultValue(ReadableFile.Open(path, pool))             # <<<<<<<<<<<<<<
 * 
 *         self.is_readable = True
 */
        __pyx_t_1 = arrow::py::GetResultValue<std::shared_ptr<arrow::io::ReadableFile> >(arrow::io::ReadableFile::Open(__pyx_v_path, __pyx_v_pool)); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(7, 838, __pyx_L4_error)
        __pyx_v_handle = __pyx_t_1;
      }

      /* "pyarrow/io.pxi":837
 *         cdef shared_ptr[ReadableFile] handle
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             handle = GetResultValue(ReadableFile.Open(path, pool))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io.pxi":840
 *             handle = GetResultValue(ReadableFile.Open(path, pool))
 * 
 *         self.is_readable = True             # <<<<<<<<<<<<<<
 *         self.set_random_access_file(<shared_ptr[CRandomAccessFile]> handle)
 * 
 */
  __pyx_v_self->__pyx_base.is_readable = 1;

  /* "pyarrow/io.pxi":841
 * 
 *         self.is_readable = True
 *         self.set_random_access_file(<shared_ptr[CRandomAccessFile]> handle)             # <<<<<<<<<<<<<<
 * 
 *     cdef _open_writable(self, c_string path):
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_3lib_OSFile *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_random_access_file(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), ((std::shared_ptr< arrow::io::RandomAccessFile> )__pyx_v_handle)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 841, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io.pxi":834
 *             raise ValueError('Invalid file mode: {0}'.format(mode))
 * 
 *     cdef _open_readable(self, c_string path, CMemoryPool* pool):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[ReadableFile] handle
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.OSFile._open_readable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":843
 *         self.set_random_access_file(<shared_ptr[CRandomAccessFile]> handle)
 * 
 *     cdef _open_writable(self, c_string path):             # <<<<<<<<<<<<<<
 *         with nogil:
 *             self.output_stream = GetResultValue(FileOutputStream.Open(path))
 */

static PyObject *__pyx_f_7pyarrow_3lib_6OSFile__open_writable(struct __pyx_obj_7pyarrow_3lib_OSFile *__pyx_v_self, std::string __pyx_v_path) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr< arrow::io::OutputStream>  __pyx_t_1;
  __Pyx_RefNannySetupContext("_open_writable", 0);

  /* "pyarrow/io.pxi":844
 * 
 *     cdef _open_writable(self, c_string path):
 *         with nogil:             # <<<<<<<<<<<<<<
 *             self.output_stream = GetResultValue(FileOutputStream.Open(path))
 *         self.is_writable = True
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":845
 *     cdef _open_writable(self, c_string path):
 *         with nogil:
 *             self.output_stream = GetResultValue(FileOutputStream.Open(path))             # <<<<<<<<<<<<<<
 *         self.is_writable = True
 * 
 */
        __pyx_t_1 = arrow::py::GetResultValue<std::shared_ptr< arrow::io::OutputStream> >(arrow::io::FileOutputStream::Open(__pyx_v_path)); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(7, 845, __pyx_L4_error)
        __pyx_v_self->__pyx_base.output_stream = __pyx_t_1;
      }

      /* "pyarrow/io.pxi":844
 * 
 *     cdef _open_writable(self, c_string path):
 *         with nogil:             # <<<<<<<<<<<<<<
 *             self.output_stream = GetResultValue(FileOutputStream.Open(path))
 *         self.is_writable = True
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io.pxi":846
 *         with nogil:
 *             self.output_stream = GetResultValue(FileOutputStream.Open(path))
 *         self.is_writable = True             # <<<<<<<<<<<<<<
 * 
 *     def fileno(self):
 */
  __pyx_v_self->__pyx_base.is_writable = 1;

  /* "pyarrow/io.pxi":843
 *         self.set_random_access_file(<shared_ptr[CRandomAccessFile]> handle)
 * 
 *     cdef _open_writable(self, c_string path):             # <<<<<<<<<<<<<<
 *         with nogil:
 *             self.output_stream = GetResultValue(FileOutputStream.Open(path))
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.OSFile._open_writable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":848
 *         self.is_writable = True
 * 
 *     def fileno(self):             # <<<<<<<<<<<<<<
 *         self._assert_open()
 *         return self.handle.file_descriptor()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6OSFile_3fileno(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6OSFile_2fileno[] = "OSFile.fileno(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_6OSFile_3fileno(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fileno (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6OSFile_2fileno(((struct __pyx_obj_7pyarrow_3lib_OSFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6OSFile_2fileno(struct __pyx_obj_7pyarrow_3lib_OSFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("fileno", 0);

  /* "pyarrow/io.pxi":849
 * 
 *     def fileno(self):
 *         self._assert_open()             # <<<<<<<<<<<<<<
 *         return self.handle.file_descriptor()
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":850
 *     def fileno(self):
 *         self._assert_open()
 *         return self.handle.file_descriptor()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_file_descriptor); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":848
 *         self.is_writable = True
 * 
 *     def fileno(self):             # <<<<<<<<<<<<<<
 *         self._assert_open()
 *         return self.handle.file_descriptor()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.OSFile.fileno", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6OSFile_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6OSFile_4__reduce_cython__[] = "OSFile.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_6OSFile_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6OSFile_4__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_OSFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6OSFile_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_OSFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__214, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.OSFile.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6OSFile_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6OSFile_6__setstate_cython__[] = "OSFile.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_6OSFile_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6OSFile_6__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_OSFile *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6OSFile_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_OSFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__215, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.OSFile.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":858
 *     """
 * 
 *     def __cinit__(self, Buffer buffer):             # <<<<<<<<<<<<<<
 *         self.output_stream.reset(new CFixedSizeBufferWriter(buffer.buffer))
 *         self.is_writable = True
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_buffer = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_buffer,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffer)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(7, 858, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_buffer = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 858, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.FixedSizeBufferWriter.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_buffer), __pyx_ptype_7pyarrow_3lib_Buffer, 1, "buffer", 0))) __PYX_ERR(7, 858, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_21FixedSizeBufferWriter___cinit__(((struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *)__pyx_v_self), __pyx_v_buffer);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_21FixedSizeBufferWriter___cinit__(struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_buffer) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/io.pxi":859
 * 
 *     def __cinit__(self, Buffer buffer):
 *         self.output_stream.reset(new CFixedSizeBufferWriter(buffer.buffer))             # <<<<<<<<<<<<<<
 *         self.is_writable = True
 * 
 */
  __pyx_v_self->__pyx_base.output_stream.reset(new  arrow::io::FixedSizeBufferWriter(__pyx_v_buffer->buffer));

  /* "pyarrow/io.pxi":860
 *     def __cinit__(self, Buffer buffer):
 *         self.output_stream.reset(new CFixedSizeBufferWriter(buffer.buffer))
 *         self.is_writable = True             # <<<<<<<<<<<<<<
 * 
 *     def set_memcopy_threads(self, int num_threads):
 */
  __pyx_v_self->__pyx_base.is_writable = 1;

  /* "pyarrow/io.pxi":858
 *     """
 * 
 *     def __cinit__(self, Buffer buffer):             # <<<<<<<<<<<<<<
 *         self.output_stream.reset(new CFixedSizeBufferWriter(buffer.buffer))
 *         self.is_writable = True
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":862
 *         self.is_writable = True
 * 
 *     def set_memcopy_threads(self, int num_threads):             # <<<<<<<<<<<<<<
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.output_stream.get()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_3set_memcopy_threads(PyObject *__pyx_v_self, PyObject *__pyx_arg_num_threads); /*proto*/
static char __pyx_doc_7pyarrow_3lib_21FixedSizeBufferWriter_2set_memcopy_threads[] = "FixedSizeBufferWriter.set_memcopy_threads(self, int num_threads)";
static PyObject *__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_3set_memcopy_threads(PyObject *__pyx_v_self, PyObject *__pyx_arg_num_threads) {
  int __pyx_v_num_threads;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_memcopy_threads (wrapper)", 0);
  assert(__pyx_arg_num_threads); {
    __pyx_v_num_threads = __Pyx_PyInt_As_int(__pyx_arg_num_threads); if (unlikely((__pyx_v_num_threads == (int)-1) && PyErr_Occurred())) __PYX_ERR(7, 862, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.FixedSizeBufferWriter.set_memcopy_threads", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_21FixedSizeBufferWriter_2set_memcopy_threads(((struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *)__pyx_v_self), ((int)__pyx_v_num_threads));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_21FixedSizeBufferWriter_2set_memcopy_threads(struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *__pyx_v_self, int __pyx_v_num_threads) {
   arrow::io::FixedSizeBufferWriter *__pyx_v_writer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_memcopy_threads", 0);

  /* "pyarrow/io.pxi":864
 *     def set_memcopy_threads(self, int num_threads):
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.output_stream.get()             # <<<<<<<<<<<<<<
 *         writer.set_memcopy_threads(num_threads)
 * 
 */
  __pyx_v_writer = (( arrow::io::FixedSizeBufferWriter *)__pyx_v_self->__pyx_base.output_stream.get());

  /* "pyarrow/io.pxi":865
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.output_stream.get()
 *         writer.set_memcopy_threads(num_threads)             # <<<<<<<<<<<<<<
 * 
 *     def set_memcopy_blocksize(self, int64_t blocksize):
 */
  __pyx_v_writer->set_memcopy_threads(__pyx_v_num_threads);

  /* "pyarrow/io.pxi":862
 *         self.is_writable = True
 * 
 *     def set_memcopy_threads(self, int num_threads):             # <<<<<<<<<<<<<<
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.output_stream.get()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":867
 *         writer.set_memcopy_threads(num_threads)
 * 
 *     def set_memcopy_blocksize(self, int64_t blocksize):             # <<<<<<<<<<<<<<
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.output_stream.get()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_5set_memcopy_blocksize(PyObject *__pyx_v_self, PyObject *__pyx_arg_blocksize); /*proto*/
static char __pyx_doc_7pyarrow_3lib_21FixedSizeBufferWriter_4set_memcopy_blocksize[] = "FixedSizeBufferWriter.set_memcopy_blocksize(self, int64_t blocksize)";
static PyObject *__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_5set_memcopy_blocksize(PyObject *__pyx_v_self, PyObject *__pyx_arg_blocksize) {
  int64_t __pyx_v_blocksize;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_memcopy_blocksize (wrapper)", 0);
  assert(__pyx_arg_blocksize); {
    __pyx_v_blocksize = __Pyx_PyInt_As_int64_t(__pyx_arg_blocksize); if (unlikely((__pyx_v_blocksize == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 867, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.FixedSizeBufferWriter.set_memcopy_blocksize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_21FixedSizeBufferWriter_4set_memcopy_blocksize(((struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *)__pyx_v_self), ((int64_t)__pyx_v_blocksize));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_21FixedSizeBufferWriter_4set_memcopy_blocksize(struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *__pyx_v_self, int64_t __pyx_v_blocksize) {
   arrow::io::FixedSizeBufferWriter *__pyx_v_writer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_memcopy_blocksize", 0);

  /* "pyarrow/io.pxi":869
 *     def set_memcopy_blocksize(self, int64_t blocksize):
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.output_stream.get()             # <<<<<<<<<<<<<<
 *         writer.set_memcopy_blocksize(blocksize)
 * 
 */
  __pyx_v_writer = (( arrow::io::FixedSizeBufferWriter *)__pyx_v_self->__pyx_base.output_stream.get());

  /* "pyarrow/io.pxi":870
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.output_stream.get()
 *         writer.set_memcopy_blocksize(blocksize)             # <<<<<<<<<<<<<<
 * 
 *     def set_memcopy_threshold(self, int64_t threshold):
 */
  __pyx_v_writer->set_memcopy_blocksize(__pyx_v_blocksize);

  /* "pyarrow/io.pxi":867
 *         writer.set_memcopy_threads(num_threads)
 * 
 *     def set_memcopy_blocksize(self, int64_t blocksize):             # <<<<<<<<<<<<<<
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.output_stream.get()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":872
 *         writer.set_memcopy_blocksize(blocksize)
 * 
 *     def set_memcopy_threshold(self, int64_t threshold):             # <<<<<<<<<<<<<<
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.output_stream.get()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_7set_memcopy_threshold(PyObject *__pyx_v_self, PyObject *__pyx_arg_threshold); /*proto*/
static char __pyx_doc_7pyarrow_3lib_21FixedSizeBufferWriter_6set_memcopy_threshold[] = "FixedSizeBufferWriter.set_memcopy_threshold(self, int64_t threshold)";
static PyObject *__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_7set_memcopy_threshold(PyObject *__pyx_v_self, PyObject *__pyx_arg_threshold) {
  int64_t __pyx_v_threshold;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_memcopy_threshold (wrapper)", 0);
  assert(__pyx_arg_threshold); {
    __pyx_v_threshold = __Pyx_PyInt_As_int64_t(__pyx_arg_threshold); if (unlikely((__pyx_v_threshold == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 872, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.FixedSizeBufferWriter.set_memcopy_threshold", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_21FixedSizeBufferWriter_6set_memcopy_threshold(((struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *)__pyx_v_self), ((int64_t)__pyx_v_threshold));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_21FixedSizeBufferWriter_6set_memcopy_threshold(struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *__pyx_v_self, int64_t __pyx_v_threshold) {
   arrow::io::FixedSizeBufferWriter *__pyx_v_writer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_memcopy_threshold", 0);

  /* "pyarrow/io.pxi":874
 *     def set_memcopy_threshold(self, int64_t threshold):
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.output_stream.get()             # <<<<<<<<<<<<<<
 *         writer.set_memcopy_threshold(threshold)
 * 
 */
  __pyx_v_writer = (( arrow::io::FixedSizeBufferWriter *)__pyx_v_self->__pyx_base.output_stream.get());

  /* "pyarrow/io.pxi":875
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.output_stream.get()
 *         writer.set_memcopy_threshold(threshold)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_writer->set_memcopy_threshold(__pyx_v_threshold);

  /* "pyarrow/io.pxi":872
 *         writer.set_memcopy_blocksize(blocksize)
 * 
 *     def set_memcopy_threshold(self, int64_t threshold):             # <<<<<<<<<<<<<<
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.output_stream.get()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_21FixedSizeBufferWriter_8__reduce_cython__[] = "FixedSizeBufferWriter.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_21FixedSizeBufferWriter_8__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_21FixedSizeBufferWriter_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__216, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FixedSizeBufferWriter.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_21FixedSizeBufferWriter_10__setstate_cython__[] = "FixedSizeBufferWriter.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_21FixedSizeBufferWriter_10__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_21FixedSizeBufferWriter_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__217, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FixedSizeBufferWriter.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":890
 *     """
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_6Buffer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_6Buffer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Buffer___cinit__(((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_6Buffer___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":893
 *         pass
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call Buffer's constructor directly, use "
 *                         "`pyarrow.py_buffer` function instead.")
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_6Buffer_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_6Buffer_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Buffer_2__init__(((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_6Buffer_2__init__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/io.pxi":894
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call Buffer's constructor directly, use "             # <<<<<<<<<<<<<<
 *                         "`pyarrow.py_buffer` function instead.")
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__218, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 894, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(7, 894, __pyx_L1_error)

  /* "pyarrow/io.pxi":893
 *         pass
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call Buffer's constructor directly, use "
 *                         "`pyarrow.py_buffer` function instead.")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Buffer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":897
 *                         "`pyarrow.py_buffer` function instead.")
 * 
 *     cdef void init(self, const shared_ptr[CBuffer]& buffer):             # <<<<<<<<<<<<<<
 *         self.buffer = buffer
 *         self.shape[0] = self.size
 */

static void __pyx_f_7pyarrow_3lib_6Buffer_init(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, std::shared_ptr< arrow::Buffer>  const &__pyx_v_buffer) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/io.pxi":898
 * 
 *     cdef void init(self, const shared_ptr[CBuffer]& buffer):
 *         self.buffer = buffer             # <<<<<<<<<<<<<<
 *         self.shape[0] = self.size
 *         self.strides[0] = <Py_ssize_t>(1)
 */
  __pyx_v_self->buffer = __pyx_v_buffer;

  /* "pyarrow/io.pxi":899
 *     cdef void init(self, const shared_ptr[CBuffer]& buffer):
 *         self.buffer = buffer
 *         self.shape[0] = self.size             # <<<<<<<<<<<<<<
 *         self.strides[0] = <Py_ssize_t>(1)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 899, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(7, 899, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  (__pyx_v_self->shape[0]) = __pyx_t_2;

  /* "pyarrow/io.pxi":900
 *         self.buffer = buffer
 *         self.shape[0] = self.size
 *         self.strides[0] = <Py_ssize_t>(1)             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  (__pyx_v_self->strides[0]) = ((Py_ssize_t)1);

  /* "pyarrow/io.pxi":897
 *                         "`pyarrow.py_buffer` function instead.")
 * 
 *     cdef void init(self, const shared_ptr[CBuffer]& buffer):             # <<<<<<<<<<<<<<
 *         self.buffer = buffer
 *         self.shape[0] = self.size
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("pyarrow.lib.Buffer.init", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/io.pxi":902
 *         self.strides[0] = <Py_ssize_t>(1)
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.size
 * 
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_7pyarrow_3lib_6Buffer_5__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pw_7pyarrow_3lib_6Buffer_5__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Buffer_4__len__(((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static Py_ssize_t __pyx_pf_7pyarrow_3lib_6Buffer_4__len__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "pyarrow/io.pxi":903
 * 
 *     def __len__(self):
 *         return self.size             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 903, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(7, 903, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":902
 *         self.strides[0] = <Py_ssize_t>(1)
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.size
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Buffer.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":906
 * 
 *     @property
 *     def size(self):             # <<<<<<<<<<<<<<
 *         """
 *         The buffer size in bytes.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_4size_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Buffer_4size___get__(((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_4size___get__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/io.pxi":910
 *         The buffer size in bytes.
 *         """
 *         return self.buffer.get().size()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->buffer.get()->size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":906
 * 
 *     @property
 *     def size(self):             # <<<<<<<<<<<<<<
 *         """
 *         The buffer size in bytes.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Buffer.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":913
 * 
 *     @property
 *     def address(self):             # <<<<<<<<<<<<<<
 *         """
 *         The buffer's address, as an integer.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_7address_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_7address_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Buffer_7address___get__(((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_7address___get__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/io.pxi":917
 *         The buffer's address, as an integer.
 *         """
 *         return <uintptr_t> self.buffer.get().data()             # <<<<<<<<<<<<<<
 * 
 *     def hex(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(((uintptr_t)__pyx_v_self->buffer.get()->data())); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 917, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":913
 * 
 *     @property
 *     def address(self):             # <<<<<<<<<<<<<<
 *         """
 *         The buffer's address, as an integer.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Buffer.address.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":919
 *         return <uintptr_t> self.buffer.get().data()
 * 
 *     def hex(self):             # <<<<<<<<<<<<<<
 *         """
 *         Compute hexadecimal representation of the buffer.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_7hex(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Buffer_6hex[] = "Buffer.hex(self)\n\n        Compute hexadecimal representation of the buffer.\n\n        Returns\n        -------\n        : bytes\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_7hex(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("hex (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Buffer_6hex(((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_6hex(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("hex", 0);

  /* "pyarrow/io.pxi":927
 *         : bytes
 *         """
 *         return self.buffer.get().ToHexString()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_self->buffer.get()->ToHexString()); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 927, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":919
 *         return <uintptr_t> self.buffer.get().data()
 * 
 *     def hex(self):             # <<<<<<<<<<<<<<
 *         """
 *         Compute hexadecimal representation of the buffer.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Buffer.hex", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":930
 * 
 *     @property
 *     def is_mutable(self):             # <<<<<<<<<<<<<<
 *         """
 *         Whether the buffer is mutable.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_10is_mutable_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_10is_mutable_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Buffer_10is_mutable___get__(((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_10is_mutable___get__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/io.pxi":934
 *         Whether the buffer is mutable.
 *         """
 *         return self.buffer.get().is_mutable()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->buffer.get()->is_mutable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 934, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":930
 * 
 *     @property
 *     def is_mutable(self):             # <<<<<<<<<<<<<<
 *         """
 *         Whether the buffer is mutable.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Buffer.is_mutable.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":937
 * 
 *     @property
 *     def parent(self):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[CBuffer] parent_buf = self.buffer.get().parent()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_6parent_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_6parent_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Buffer_6parent___get__(((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_6parent___get__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self) {
  std::shared_ptr< arrow::Buffer>  __pyx_v_parent_buf;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/io.pxi":938
 *     @property
 *     def parent(self):
 *         cdef shared_ptr[CBuffer] parent_buf = self.buffer.get().parent()             # <<<<<<<<<<<<<<
 * 
 *         if parent_buf.get() == NULL:
 */
  __pyx_v_parent_buf = __pyx_v_self->buffer.get()->parent();

  /* "pyarrow/io.pxi":940
 *         cdef shared_ptr[CBuffer] parent_buf = self.buffer.get().parent()
 * 
 *         if parent_buf.get() == NULL:             # <<<<<<<<<<<<<<
 *             return None
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_parent_buf.get() == NULL) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":941
 * 
 *         if parent_buf.get() == NULL:
 *             return None             # <<<<<<<<<<<<<<
 *         else:
 *             return pyarrow_wrap_buffer(parent_buf)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/io.pxi":940
 *         cdef shared_ptr[CBuffer] parent_buf = self.buffer.get().parent()
 * 
 *         if parent_buf.get() == NULL:             # <<<<<<<<<<<<<<
 *             return None
 *         else:
 */
  }

  /* "pyarrow/io.pxi":943
 *             return None
 *         else:
 *             return pyarrow_wrap_buffer(parent_buf)             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, key):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_parent_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 943, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/io.pxi":937
 * 
 *     @property
 *     def parent(self):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[CBuffer] parent_buf = self.buffer.get().parent()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Buffer.parent.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":945
 *             return pyarrow_wrap_buffer(parent_buf)
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         if PySlice_Check(key):
 *             return _normalize_slice(self, key)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_9__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_9__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Buffer_8__getitem__(((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_self), ((PyObject *)__pyx_v_key));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_8__getitem__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "pyarrow/io.pxi":946
 * 
 *     def __getitem__(self, key):
 *         if PySlice_Check(key):             # <<<<<<<<<<<<<<
 *             return _normalize_slice(self, key)
 * 
 */
  __pyx_t_1 = (PySlice_Check(__pyx_v_key) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":947
 *     def __getitem__(self, key):
 *         if PySlice_Check(key):
 *             return _normalize_slice(self, key)             # <<<<<<<<<<<<<<
 * 
 *         return self.getitem(_normalize_index(key, self.size))
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_normalize_slice); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 947, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_self), __pyx_v_key};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 947, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_self), __pyx_v_key};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 947, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    {
      __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 947, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_self));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_self));
      __Pyx_INCREF(__pyx_v_key);
      __Pyx_GIVEREF(__pyx_v_key);
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_key);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 947, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":946
 * 
 *     def __getitem__(self, key):
 *         if PySlice_Check(key):             # <<<<<<<<<<<<<<
 *             return _normalize_slice(self, key)
 * 
 */
  }

  /* "pyarrow/io.pxi":949
 *             return _normalize_slice(self, key)
 * 
 *         return self.getitem(_normalize_index(key, self.size))             # <<<<<<<<<<<<<<
 * 
 *     cdef getitem(self, int64_t i):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_key); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(7, 949, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(7, 949, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_9 = __pyx_f_7pyarrow_3lib__normalize_index(__pyx_t_7, __pyx_t_8); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1L))) __PYX_ERR(7, 949, __pyx_L1_error)
  __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_3lib_Buffer *)__pyx_v_self->__pyx_vtab)->getitem(__pyx_v_self, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":945
 *             return pyarrow_wrap_buffer(parent_buf)
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         if PySlice_Check(key):
 *             return _normalize_slice(self, key)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.Buffer.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":951
 *         return self.getitem(_normalize_index(key, self.size))
 * 
 *     cdef getitem(self, int64_t i):             # <<<<<<<<<<<<<<
 *         return self.buffer.get().data()[i]
 * 
 */

static PyObject *__pyx_f_7pyarrow_3lib_6Buffer_getitem(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, int64_t __pyx_v_i) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("getitem", 0);

  /* "pyarrow/io.pxi":952
 * 
 *     cdef getitem(self, int64_t i):
 *         return self.buffer.get().data()[i]             # <<<<<<<<<<<<<<
 * 
 *     def slice(self, offset=0, length=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_uint8_t((__pyx_v_self->buffer.get()->data()[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":951
 *         return self.getitem(_normalize_index(key, self.size))
 * 
 *     cdef getitem(self, int64_t i):             # <<<<<<<<<<<<<<
 *         return self.buffer.get().data()[i]
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Buffer.getitem", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":954
 *         return self.buffer.get().data()[i]
 * 
 *     def slice(self, offset=0, length=None):             # <<<<<<<<<<<<<<
 *         """
 *         Slice this buffer.  Memory is not copied.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_11slice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Buffer_10slice[] = "Buffer.slice(self, offset=0, length=None)\n\n        Slice this buffer.  Memory is not copied.\n\n        You can also use the Python slice notation ``buffer[start:stop]``.\n\n        Parameters\n        ----------\n        offset : int, default 0\n            Offset from start of buffer to slice\n        length : int, default None\n            Length of slice (default is until end of Buffer starting from\n            offset)\n\n        Returns\n        -------\n        sliced : Buffer\n            A logical view over this buffer.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_11slice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_offset = 0;
  PyObject *__pyx_v_length = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("slice (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_offset,&__pyx_n_s_length,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)__pyx_int_0);
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offset);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_length);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "slice") < 0)) __PYX_ERR(7, 954, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_offset = values[0];
    __pyx_v_length = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("slice", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 954, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Buffer.slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Buffer_10slice(((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_self), __pyx_v_offset, __pyx_v_length);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_10slice(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, PyObject *__pyx_v_offset, PyObject *__pyx_v_length) {
  std::shared_ptr< arrow::Buffer>  __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int64_t __pyx_t_4;
  long __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int64_t __pyx_t_9;
  __Pyx_RefNannySetupContext("slice", 0);

  /* "pyarrow/io.pxi":975
 *         cdef shared_ptr[CBuffer] result
 * 
 *         if offset < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError('Offset must be non-negative')
 * 
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_offset, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 975, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(7, 975, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/io.pxi":976
 * 
 *         if offset < 0:
 *             raise IndexError('Offset must be non-negative')             # <<<<<<<<<<<<<<
 * 
 *         if length is None:
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__147, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 976, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(7, 976, __pyx_L1_error)

    /* "pyarrow/io.pxi":975
 *         cdef shared_ptr[CBuffer] result
 * 
 *         if offset < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError('Offset must be non-negative')
 * 
 */
  }

  /* "pyarrow/io.pxi":978
 *             raise IndexError('Offset must be non-negative')
 * 
 *         if length is None:             # <<<<<<<<<<<<<<
 *             result = SliceBuffer(self.buffer, offset)
 *         else:
 */
  __pyx_t_2 = (__pyx_v_length == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/io.pxi":979
 * 
 *         if length is None:
 *             result = SliceBuffer(self.buffer, offset)             # <<<<<<<<<<<<<<
 *         else:
 *             result = SliceBuffer(self.buffer, offset, max(length, 0))
 */
    __pyx_t_4 = __Pyx_PyInt_As_int64_t(__pyx_v_offset); if (unlikely((__pyx_t_4 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 979, __pyx_L1_error)
    __pyx_v_result = arrow::SliceBuffer(__pyx_v_self->buffer, __pyx_t_4);

    /* "pyarrow/io.pxi":978
 *             raise IndexError('Offset must be non-negative')
 * 
 *         if length is None:             # <<<<<<<<<<<<<<
 *             result = SliceBuffer(self.buffer, offset)
 *         else:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/io.pxi":981
 *             result = SliceBuffer(self.buffer, offset)
 *         else:
 *             result = SliceBuffer(self.buffer, offset, max(length, 0))             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_buffer(result)
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyInt_As_int64_t(__pyx_v_offset); if (unlikely((__pyx_t_4 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 981, __pyx_L1_error)
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_v_length);
    __pyx_t_1 = __pyx_v_length;
    __pyx_t_7 = __Pyx_PyInt_From_long(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 981, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyObject_RichCompare(__pyx_t_7, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 981, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(7, 981, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (__pyx_t_3) {
      __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 981, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_6 = __pyx_t_8;
      __pyx_t_8 = 0;
    } else {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_6 = __pyx_t_1;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_9 = __Pyx_PyInt_As_int64_t(__pyx_t_6); if (unlikely((__pyx_t_9 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 981, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_result = arrow::SliceBuffer(__pyx_v_self->buffer, __pyx_t_4, __pyx_t_9);
  }
  __pyx_L4:;

  /* "pyarrow/io.pxi":983
 *             result = SliceBuffer(self.buffer, offset, max(length, 0))
 * 
 *         return pyarrow_wrap_buffer(result)             # <<<<<<<<<<<<<<
 * 
 *     def equals(self, Buffer other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_result); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 983, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":954
 *         return self.buffer.get().data()[i]
 * 
 *     def slice(self, offset=0, length=None):             # <<<<<<<<<<<<<<
 *         """
 *         Slice this buffer.  Memory is not copied.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow.lib.Buffer.slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":985
 *         return pyarrow_wrap_buffer(result)
 * 
 *     def equals(self, Buffer other):             # <<<<<<<<<<<<<<
 *         """
 *         Determine if two buffers contain exactly the same data.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_13equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Buffer_12equals[] = "Buffer.equals(self, Buffer other)\n\n        Determine if two buffers contain exactly the same data.\n\n        Parameters\n        ----------\n        other : Buffer\n\n        Returns\n        -------\n        are_equal : True if buffer contents and size are equal\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_13equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("equals (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_7pyarrow_3lib_Buffer, 1, "other", 0))) __PYX_ERR(7, 985, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Buffer_12equals(((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_12equals(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_other) {
  bool __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("equals", 0);

  /* "pyarrow/io.pxi":997
 *         are_equal : True if buffer contents and size are equal
 *         """
 *         cdef c_bool result = False             # <<<<<<<<<<<<<<
 *         with nogil:
 *             result = self.buffer.get().Equals(deref(other.buffer.get()))
 */
  __pyx_v_result = 0;

  /* "pyarrow/io.pxi":998
 *         """
 *         cdef c_bool result = False
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = self.buffer.get().Equals(deref(other.buffer.get()))
 *         return result
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":999
 *         cdef c_bool result = False
 *         with nogil:
 *             result = self.buffer.get().Equals(deref(other.buffer.get()))             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
        __pyx_v_result = __pyx_v_self->buffer.get()->Equals((*__pyx_v_other->buffer.get()));
      }

      /* "pyarrow/io.pxi":998
 *         """
 *         cdef c_bool result = False
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = self.buffer.get().Equals(deref(other.buffer.get()))
 *         return result
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io.pxi":1000
 *         with nogil:
 *             result = self.buffer.get().Equals(deref(other.buffer.get()))
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":985
 *         return pyarrow_wrap_buffer(result)
 * 
 *     def equals(self, Buffer other):             # <<<<<<<<<<<<<<
 *         """
 *         Determine if two buffers contain exactly the same data.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Buffer.equals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1002
 *         return result
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         if isinstance(other, Buffer):
 *             return self.equals(other)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_15__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_15__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Buffer_14__eq__(((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_self), ((PyObject *)__pyx_v_other));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_14__eq__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__eq__", 0);

  /* "pyarrow/io.pxi":1003
 * 
 *     def __eq__(self, other):
 *         if isinstance(other, Buffer):             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         else:
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_7pyarrow_3lib_Buffer); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/io.pxi":1004
 *     def __eq__(self, other):
 *         if isinstance(other, Buffer):
 *             return self.equals(other)             # <<<<<<<<<<<<<<
 *         else:
 *             return self.equals(py_buffer(other))
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_equals); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1004, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_other) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_other);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1004, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":1003
 * 
 *     def __eq__(self, other):
 *         if isinstance(other, Buffer):             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         else:
 */
  }

  /* "pyarrow/io.pxi":1006
 *             return self.equals(other)
 *         else:
 *             return self.equals(py_buffer(other))             # <<<<<<<<<<<<<<
 * 
 *     def __reduce_ex__(self, protocol):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_equals); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1006, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_py_buffer); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 1006, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_other) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_other);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1006, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1006, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/io.pxi":1002
 *         return result
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         if isinstance(other, Buffer):
 *             return self.equals(other)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.Buffer.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1008
 *             return self.equals(py_buffer(other))
 * 
 *     def __reduce_ex__(self, protocol):             # <<<<<<<<<<<<<<
 *         if protocol >= 5:
 *             return py_buffer, (builtin_pickle.PickleBuffer(self),)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_17__reduce_ex__(PyObject *__pyx_v_self, PyObject *__pyx_v_protocol); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Buffer_16__reduce_ex__[] = "Buffer.__reduce_ex__(self, protocol)";
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_17__reduce_ex__(PyObject *__pyx_v_self, PyObject *__pyx_v_protocol) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_ex__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Buffer_16__reduce_ex__(((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_self), ((PyObject *)__pyx_v_protocol));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_16__reduce_ex__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, PyObject *__pyx_v_protocol) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__reduce_ex__", 0);

  /* "pyarrow/io.pxi":1009
 * 
 *     def __reduce_ex__(self, protocol):
 *         if protocol >= 5:             # <<<<<<<<<<<<<<
 *             return py_buffer, (builtin_pickle.PickleBuffer(self),)
 *         else:
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_protocol, __pyx_int_5, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1009, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(7, 1009, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pyarrow/io.pxi":1010
 *     def __reduce_ex__(self, protocol):
 *         if protocol >= 5:
 *             return py_buffer, (builtin_pickle.PickleBuffer(self),)             # <<<<<<<<<<<<<<
 *         else:
 *             return py_buffer, (self.to_pybytes(),)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_py_buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1010, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_builtin_pickle); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1010, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_PickleBuffer); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1010, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_v_self));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1010, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1010, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1010, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
    __pyx_t_1 = 0;
    __pyx_t_5 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":1009
 * 
 *     def __reduce_ex__(self, protocol):
 *         if protocol >= 5:             # <<<<<<<<<<<<<<
 *             return py_buffer, (builtin_pickle.PickleBuffer(self),)
 *         else:
 */
  }

  /* "pyarrow/io.pxi":1012
 *             return py_buffer, (builtin_pickle.PickleBuffer(self),)
 *         else:
 *             return py_buffer, (self.to_pybytes(),)             # <<<<<<<<<<<<<<
 * 
 *     def to_pybytes(self):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_py_buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1012, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_to_pybytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1012, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1012, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1012, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1012, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
    __pyx_t_3 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/io.pxi":1008
 *             return self.equals(py_buffer(other))
 * 
 *     def __reduce_ex__(self, protocol):             # <<<<<<<<<<<<<<
 *         if protocol >= 5:
 *             return py_buffer, (builtin_pickle.PickleBuffer(self),)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.Buffer.__reduce_ex__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1014
 *             return py_buffer, (self.to_pybytes(),)
 * 
 *     def to_pybytes(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this buffer as a Python bytes object.  Memory is copied.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_19to_pybytes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Buffer_18to_pybytes[] = "Buffer.to_pybytes(self)\n\n        Return this buffer as a Python bytes object.  Memory is copied.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_19to_pybytes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_pybytes (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Buffer_18to_pybytes(((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_18to_pybytes(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("to_pybytes", 0);

  /* "pyarrow/io.pxi":1018
 *         Return this buffer as a Python bytes object.  Memory is copied.
 *         """
 *         return cp.PyBytes_FromStringAndSize(             # <<<<<<<<<<<<<<
 *             <const char*>self.buffer.get().data(),
 *             self.buffer.get().size())
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/io.pxi":1020
 *         return cp.PyBytes_FromStringAndSize(
 *             <const char*>self.buffer.get().data(),
 *             self.buffer.get().size())             # <<<<<<<<<<<<<<
 * 
 *     def __getbuffer__(self, cp.Py_buffer* buffer, int flags):
 */
  __pyx_t_1 = PyBytes_FromStringAndSize(((char const *)__pyx_v_self->buffer.get()->data()), __pyx_v_self->buffer.get()->size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1014
 *             return py_buffer, (self.to_pybytes(),)
 * 
 *     def to_pybytes(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return this buffer as a Python bytes object.  Memory is copied.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Buffer.to_pybytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1022
 *             self.buffer.get().size())
 * 
 *     def __getbuffer__(self, cp.Py_buffer* buffer, int flags):             # <<<<<<<<<<<<<<
 *         if self.buffer.get().is_mutable():
 *             buffer.readonly = 0
 */

/* Python wrapper */
static CYTHON_UNUSED int __pyx_pw_7pyarrow_3lib_6Buffer_21__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer, int __pyx_v_flags); /*proto*/
static CYTHON_UNUSED int __pyx_pw_7pyarrow_3lib_6Buffer_21__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer, int __pyx_v_flags) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Buffer_20__getbuffer__(((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_self), ((Py_buffer *)__pyx_v_buffer), ((int)__pyx_v_flags));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_6Buffer_20__getbuffer__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, Py_buffer *__pyx_v_buffer, int __pyx_v_flags) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t *__pyx_t_4;
  if (__pyx_v_buffer == NULL) {
    PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
    return -1;
  }
  __Pyx_RefNannySetupContext("__getbuffer__", 0);
  __pyx_v_buffer->obj = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(__pyx_v_buffer->obj);

  /* "pyarrow/io.pxi":1023
 * 
 *     def __getbuffer__(self, cp.Py_buffer* buffer, int flags):
 *         if self.buffer.get().is_mutable():             # <<<<<<<<<<<<<<
 *             buffer.readonly = 0
 *         else:
 */
  __pyx_t_1 = (__pyx_v_self->buffer.get()->is_mutable() != 0);
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":1024
 *     def __getbuffer__(self, cp.Py_buffer* buffer, int flags):
 *         if self.buffer.get().is_mutable():
 *             buffer.readonly = 0             # <<<<<<<<<<<<<<
 *         else:
 *             if flags & cp.PyBUF_WRITABLE:
 */
    __pyx_v_buffer->readonly = 0;

    /* "pyarrow/io.pxi":1023
 * 
 *     def __getbuffer__(self, cp.Py_buffer* buffer, int flags):
 *         if self.buffer.get().is_mutable():             # <<<<<<<<<<<<<<
 *             buffer.readonly = 0
 *         else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/io.pxi":1026
 *             buffer.readonly = 0
 *         else:
 *             if flags & cp.PyBUF_WRITABLE:             # <<<<<<<<<<<<<<
 *                 raise BufferError("Writable buffer requested but Arrow "
 *                                   "buffer was not mutable")
 */
  /*else*/ {
    __pyx_t_1 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
    if (unlikely(__pyx_t_1)) {

      /* "pyarrow/io.pxi":1027
 *         else:
 *             if flags & cp.PyBUF_WRITABLE:
 *                 raise BufferError("Writable buffer requested but Arrow "             # <<<<<<<<<<<<<<
 *                                   "buffer was not mutable")
 *             buffer.readonly = 1
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_BufferError, __pyx_tuple__219, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1027, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(7, 1027, __pyx_L1_error)

      /* "pyarrow/io.pxi":1026
 *             buffer.readonly = 0
 *         else:
 *             if flags & cp.PyBUF_WRITABLE:             # <<<<<<<<<<<<<<
 *                 raise BufferError("Writable buffer requested but Arrow "
 *                                   "buffer was not mutable")
 */
    }

    /* "pyarrow/io.pxi":1029
 *                 raise BufferError("Writable buffer requested but Arrow "
 *                                   "buffer was not mutable")
 *             buffer.readonly = 1             # <<<<<<<<<<<<<<
 *         buffer.buf = <char *>self.buffer.get().data()
 *         buffer.format = 'b'
 */
    __pyx_v_buffer->readonly = 1;
  }
  __pyx_L3:;

  /* "pyarrow/io.pxi":1030
 *                                   "buffer was not mutable")
 *             buffer.readonly = 1
 *         buffer.buf = <char *>self.buffer.get().data()             # <<<<<<<<<<<<<<
 *         buffer.format = 'b'
 *         buffer.internal = NULL
 */
  __pyx_v_buffer->buf = ((char *)__pyx_v_self->buffer.get()->data());

  /* "pyarrow/io.pxi":1031
 *             buffer.readonly = 1
 *         buffer.buf = <char *>self.buffer.get().data()
 *         buffer.format = 'b'             # <<<<<<<<<<<<<<
 *         buffer.internal = NULL
 *         buffer.itemsize = 1
 */
  __pyx_v_buffer->format = ((char *)"b");

  /* "pyarrow/io.pxi":1032
 *         buffer.buf = <char *>self.buffer.get().data()
 *         buffer.format = 'b'
 *         buffer.internal = NULL             # <<<<<<<<<<<<<<
 *         buffer.itemsize = 1
 *         buffer.len = self.size
 */
  __pyx_v_buffer->internal = NULL;

  /* "pyarrow/io.pxi":1033
 *         buffer.format = 'b'
 *         buffer.internal = NULL
 *         buffer.itemsize = 1             # <<<<<<<<<<<<<<
 *         buffer.len = self.size
 *         buffer.ndim = 1
 */
  __pyx_v_buffer->itemsize = 1;

  /* "pyarrow/io.pxi":1034
 *         buffer.internal = NULL
 *         buffer.itemsize = 1
 *         buffer.len = self.size             # <<<<<<<<<<<<<<
 *         buffer.ndim = 1
 *         buffer.obj = self
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(7, 1034, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_buffer->len = __pyx_t_3;

  /* "pyarrow/io.pxi":1035
 *         buffer.itemsize = 1
 *         buffer.len = self.size
 *         buffer.ndim = 1             # <<<<<<<<<<<<<<
 *         buffer.obj = self
 *         buffer.shape = self.shape
 */
  __pyx_v_buffer->ndim = 1;

  /* "pyarrow/io.pxi":1036
 *         buffer.len = self.size
 *         buffer.ndim = 1
 *         buffer.obj = self             # <<<<<<<<<<<<<<
 *         buffer.shape = self.shape
 *         buffer.strides = self.strides
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_GOTREF(__pyx_v_buffer->obj);
  __Pyx_DECREF(__pyx_v_buffer->obj);
  __pyx_v_buffer->obj = ((PyObject *)__pyx_v_self);

  /* "pyarrow/io.pxi":1037
 *         buffer.ndim = 1
 *         buffer.obj = self
 *         buffer.shape = self.shape             # <<<<<<<<<<<<<<
 *         buffer.strides = self.strides
 *         buffer.suboffsets = NULL
 */
  __pyx_t_4 = __pyx_v_self->shape;
  __pyx_v_buffer->shape = __pyx_t_4;

  /* "pyarrow/io.pxi":1038
 *         buffer.obj = self
 *         buffer.shape = self.shape
 *         buffer.strides = self.strides             # <<<<<<<<<<<<<<
 *         buffer.suboffsets = NULL
 * 
 */
  __pyx_t_4 = __pyx_v_self->strides;
  __pyx_v_buffer->strides = __pyx_t_4;

  /* "pyarrow/io.pxi":1039
 *         buffer.shape = self.shape
 *         buffer.strides = self.strides
 *         buffer.suboffsets = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __getsegcount__(self, Py_ssize_t *len_out):
 */
  __pyx_v_buffer->suboffsets = NULL;

  /* "pyarrow/io.pxi":1022
 *             self.buffer.get().size())
 * 
 *     def __getbuffer__(self, cp.Py_buffer* buffer, int flags):             # <<<<<<<<<<<<<<
 *         if self.buffer.get().is_mutable():
 *             buffer.readonly = 0
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Buffer.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  if (__pyx_v_buffer->obj != NULL) {
    __Pyx_GOTREF(__pyx_v_buffer->obj);
    __Pyx_DECREF(__pyx_v_buffer->obj); __pyx_v_buffer->obj = 0;
  }
  goto __pyx_L2;
  __pyx_L0:;
  if (__pyx_v_buffer->obj == Py_None) {
    __Pyx_GOTREF(__pyx_v_buffer->obj);
    __Pyx_DECREF(__pyx_v_buffer->obj); __pyx_v_buffer->obj = 0;
  }
  __pyx_L2:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1041
 *         buffer.suboffsets = NULL
 * 
 *     def __getsegcount__(self, Py_ssize_t *len_out):             # <<<<<<<<<<<<<<
 *         if len_out != NULL:
 *             len_out[0] = <Py_ssize_t>self.size
 */

/* Python wrapper */
#if PY_MAJOR_VERSION < 3
static Py_ssize_t __pyx_pw_7pyarrow_3lib_6Buffer_23__getsegcount__(PyObject *__pyx_v_self, Py_ssize_t *__pyx_v_len_out); /*proto*/
static Py_ssize_t __pyx_pw_7pyarrow_3lib_6Buffer_23__getsegcount__(PyObject *__pyx_v_self, Py_ssize_t *__pyx_v_len_out) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getsegcount__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Buffer_22__getsegcount__(((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_self), ((Py_ssize_t *)__pyx_v_len_out));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
#endif /*!(#if PY_MAJOR_VERSION < 3)*/

#if PY_MAJOR_VERSION < 3
static Py_ssize_t __pyx_pf_7pyarrow_3lib_6Buffer_22__getsegcount__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, Py_ssize_t *__pyx_v_len_out) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  __Pyx_RefNannySetupContext("__getsegcount__", 0);

  /* "pyarrow/io.pxi":1042
 * 
 *     def __getsegcount__(self, Py_ssize_t *len_out):
 *         if len_out != NULL:             # <<<<<<<<<<<<<<
 *             len_out[0] = <Py_ssize_t>self.size
 *         return 1
 */
  __pyx_t_1 = ((__pyx_v_len_out != NULL) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":1043
 *     def __getsegcount__(self, Py_ssize_t *len_out):
 *         if len_out != NULL:
 *             len_out[0] = <Py_ssize_t>self.size             # <<<<<<<<<<<<<<
 *         return 1
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1043, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(7, 1043, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    (__pyx_v_len_out[0]) = ((Py_ssize_t)__pyx_t_3);

    /* "pyarrow/io.pxi":1042
 * 
 *     def __getsegcount__(self, Py_ssize_t *len_out):
 *         if len_out != NULL:             # <<<<<<<<<<<<<<
 *             len_out[0] = <Py_ssize_t>self.size
 *         return 1
 */
  }

  /* "pyarrow/io.pxi":1044
 *         if len_out != NULL:
 *             len_out[0] = <Py_ssize_t>self.size
 *         return 1             # <<<<<<<<<<<<<<
 * 
 *     def __getreadbuffer__(self, Py_ssize_t idx, void **p):
 */
  __pyx_r = 1;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1041
 *         buffer.suboffsets = NULL
 * 
 *     def __getsegcount__(self, Py_ssize_t *len_out):             # <<<<<<<<<<<<<<
 *         if len_out != NULL:
 *             len_out[0] = <Py_ssize_t>self.size
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Buffer.__getsegcount__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
#endif /*!(#if PY_MAJOR_VERSION < 3)*/

/* "pyarrow/io.pxi":1046
 *         return 1
 * 
 *     def __getreadbuffer__(self, Py_ssize_t idx, void **p):             # <<<<<<<<<<<<<<
 *         if idx != 0:
 *             raise SystemError("accessing non-existent buffer segment")
 */

/* Python wrapper */
#if PY_MAJOR_VERSION < 3
static Py_ssize_t __pyx_pw_7pyarrow_3lib_6Buffer_25__getreadbuffer__(PyObject *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p); /*proto*/
static Py_ssize_t __pyx_pw_7pyarrow_3lib_6Buffer_25__getreadbuffer__(PyObject *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getreadbuffer__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Buffer_24__getreadbuffer__(((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_self), ((Py_ssize_t)__pyx_v_idx), ((void **)__pyx_v_p));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
#endif /*!(#if PY_MAJOR_VERSION < 3)*/

#if PY_MAJOR_VERSION < 3
static Py_ssize_t __pyx_pf_7pyarrow_3lib_6Buffer_24__getreadbuffer__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  __Pyx_RefNannySetupContext("__getreadbuffer__", 0);

  /* "pyarrow/io.pxi":1047
 * 
 *     def __getreadbuffer__(self, Py_ssize_t idx, void **p):
 *         if idx != 0:             # <<<<<<<<<<<<<<
 *             raise SystemError("accessing non-existent buffer segment")
 *         if p != NULL:
 */
  __pyx_t_1 = ((__pyx_v_idx != 0) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/io.pxi":1048
 *     def __getreadbuffer__(self, Py_ssize_t idx, void **p):
 *         if idx != 0:
 *             raise SystemError("accessing non-existent buffer segment")             # <<<<<<<<<<<<<<
 *         if p != NULL:
 *             p[0] = <void*> self.buffer.get().data()
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_SystemError, __pyx_tuple__220, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1048, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(7, 1048, __pyx_L1_error)

    /* "pyarrow/io.pxi":1047
 * 
 *     def __getreadbuffer__(self, Py_ssize_t idx, void **p):
 *         if idx != 0:             # <<<<<<<<<<<<<<
 *             raise SystemError("accessing non-existent buffer segment")
 *         if p != NULL:
 */
  }

  /* "pyarrow/io.pxi":1049
 *         if idx != 0:
 *             raise SystemError("accessing non-existent buffer segment")
 *         if p != NULL:             # <<<<<<<<<<<<<<
 *             p[0] = <void*> self.buffer.get().data()
 *         return self.size
 */
  __pyx_t_1 = ((__pyx_v_p != NULL) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":1050
 *             raise SystemError("accessing non-existent buffer segment")
 *         if p != NULL:
 *             p[0] = <void*> self.buffer.get().data()             # <<<<<<<<<<<<<<
 *         return self.size
 * 
 */
    (__pyx_v_p[0]) = ((void *)__pyx_v_self->buffer.get()->data());

    /* "pyarrow/io.pxi":1049
 *         if idx != 0:
 *             raise SystemError("accessing non-existent buffer segment")
 *         if p != NULL:             # <<<<<<<<<<<<<<
 *             p[0] = <void*> self.buffer.get().data()
 *         return self.size
 */
  }

  /* "pyarrow/io.pxi":1051
 *         if p != NULL:
 *             p[0] = <void*> self.buffer.get().data()
 *         return self.size             # <<<<<<<<<<<<<<
 * 
 *     def __getwritebuffer__(self, Py_ssize_t idx, void **p):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1051, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(7, 1051, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1046
 *         return 1
 * 
 *     def __getreadbuffer__(self, Py_ssize_t idx, void **p):             # <<<<<<<<<<<<<<
 *         if idx != 0:
 *             raise SystemError("accessing non-existent buffer segment")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Buffer.__getreadbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
#endif /*!(#if PY_MAJOR_VERSION < 3)*/

/* "pyarrow/io.pxi":1053
 *         return self.size
 * 
 *     def __getwritebuffer__(self, Py_ssize_t idx, void **p):             # <<<<<<<<<<<<<<
 *         if not self.buffer.get().is_mutable():
 *             raise SystemError("trying to write an immutable buffer")
 */

/* Python wrapper */
#if PY_MAJOR_VERSION < 3
static Py_ssize_t __pyx_pw_7pyarrow_3lib_6Buffer_27__getwritebuffer__(PyObject *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p); /*proto*/
static Py_ssize_t __pyx_pw_7pyarrow_3lib_6Buffer_27__getwritebuffer__(PyObject *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getwritebuffer__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Buffer_26__getwritebuffer__(((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_self), ((Py_ssize_t)__pyx_v_idx), ((void **)__pyx_v_p));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
#endif /*!(#if PY_MAJOR_VERSION < 3)*/

#if PY_MAJOR_VERSION < 3
static Py_ssize_t __pyx_pf_7pyarrow_3lib_6Buffer_26__getwritebuffer__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  __Pyx_RefNannySetupContext("__getwritebuffer__", 0);

  /* "pyarrow/io.pxi":1054
 * 
 *     def __getwritebuffer__(self, Py_ssize_t idx, void **p):
 *         if not self.buffer.get().is_mutable():             # <<<<<<<<<<<<<<
 *             raise SystemError("trying to write an immutable buffer")
 *         if idx != 0:
 */
  __pyx_t_1 = ((!(__pyx_v_self->buffer.get()->is_mutable() != 0)) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/io.pxi":1055
 *     def __getwritebuffer__(self, Py_ssize_t idx, void **p):
 *         if not self.buffer.get().is_mutable():
 *             raise SystemError("trying to write an immutable buffer")             # <<<<<<<<<<<<<<
 *         if idx != 0:
 *             raise SystemError("accessing non-existent buffer segment")
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_SystemError, __pyx_tuple__221, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1055, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(7, 1055, __pyx_L1_error)

    /* "pyarrow/io.pxi":1054
 * 
 *     def __getwritebuffer__(self, Py_ssize_t idx, void **p):
 *         if not self.buffer.get().is_mutable():             # <<<<<<<<<<<<<<
 *             raise SystemError("trying to write an immutable buffer")
 *         if idx != 0:
 */
  }

  /* "pyarrow/io.pxi":1056
 *         if not self.buffer.get().is_mutable():
 *             raise SystemError("trying to write an immutable buffer")
 *         if idx != 0:             # <<<<<<<<<<<<<<
 *             raise SystemError("accessing non-existent buffer segment")
 *         if p != NULL:
 */
  __pyx_t_1 = ((__pyx_v_idx != 0) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/io.pxi":1057
 *             raise SystemError("trying to write an immutable buffer")
 *         if idx != 0:
 *             raise SystemError("accessing non-existent buffer segment")             # <<<<<<<<<<<<<<
 *         if p != NULL:
 *             p[0] = <void*> self.buffer.get().data()
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_SystemError, __pyx_tuple__220, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1057, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(7, 1057, __pyx_L1_error)

    /* "pyarrow/io.pxi":1056
 *         if not self.buffer.get().is_mutable():
 *             raise SystemError("trying to write an immutable buffer")
 *         if idx != 0:             # <<<<<<<<<<<<<<
 *             raise SystemError("accessing non-existent buffer segment")
 *         if p != NULL:
 */
  }

  /* "pyarrow/io.pxi":1058
 *         if idx != 0:
 *             raise SystemError("accessing non-existent buffer segment")
 *         if p != NULL:             # <<<<<<<<<<<<<<
 *             p[0] = <void*> self.buffer.get().data()
 *         return self.size
 */
  __pyx_t_1 = ((__pyx_v_p != NULL) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":1059
 *             raise SystemError("accessing non-existent buffer segment")
 *         if p != NULL:
 *             p[0] = <void*> self.buffer.get().data()             # <<<<<<<<<<<<<<
 *         return self.size
 * 
 */
    (__pyx_v_p[0]) = ((void *)__pyx_v_self->buffer.get()->data());

    /* "pyarrow/io.pxi":1058
 *         if idx != 0:
 *             raise SystemError("accessing non-existent buffer segment")
 *         if p != NULL:             # <<<<<<<<<<<<<<
 *             p[0] = <void*> self.buffer.get().data()
 *         return self.size
 */
  }

  /* "pyarrow/io.pxi":1060
 *         if p != NULL:
 *             p[0] = <void*> self.buffer.get().data()
 *         return self.size             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1060, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(7, 1060, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1053
 *         return self.size
 * 
 *     def __getwritebuffer__(self, Py_ssize_t idx, void **p):             # <<<<<<<<<<<<<<
 *         if not self.buffer.get().is_mutable():
 *             raise SystemError("trying to write an immutable buffer")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Buffer.__getwritebuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
#endif /*!(#if PY_MAJOR_VERSION < 3)*/

/* "pyarrow/io.pxi":1068
 *     """
 * 
 *     cdef void init_rz(self, const shared_ptr[CResizableBuffer]& buffer):             # <<<<<<<<<<<<<<
 *         self.init(<shared_ptr[CBuffer]> buffer)
 * 
 */

static void __pyx_f_7pyarrow_3lib_15ResizableBuffer_init_rz(struct __pyx_obj_7pyarrow_3lib_ResizableBuffer *__pyx_v_self, std::shared_ptr< arrow::ResizableBuffer>  const &__pyx_v_buffer) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init_rz", 0);

  /* "pyarrow/io.pxi":1069
 * 
 *     cdef void init_rz(self, const shared_ptr[CResizableBuffer]& buffer):
 *         self.init(<shared_ptr[CBuffer]> buffer)             # <<<<<<<<<<<<<<
 * 
 *     def resize(self, int64_t new_size, shrink_to_fit=False):
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_ResizableBuffer *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.init(((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_self), ((std::shared_ptr< arrow::Buffer> )__pyx_v_buffer));

  /* "pyarrow/io.pxi":1068
 *     """
 * 
 *     cdef void init_rz(self, const shared_ptr[CResizableBuffer]& buffer):             # <<<<<<<<<<<<<<
 *         self.init(<shared_ptr[CBuffer]> buffer)
 * 
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/io.pxi":1071
 *         self.init(<shared_ptr[CBuffer]> buffer)
 * 
 *     def resize(self, int64_t new_size, shrink_to_fit=False):             # <<<<<<<<<<<<<<
 *         """
 *         Resize buffer to indicated size.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_15ResizableBuffer_1resize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_15ResizableBuffer_resize[] = "ResizableBuffer.resize(self, int64_t new_size, shrink_to_fit=False)\n\n        Resize buffer to indicated size.\n\n        Parameters\n        ----------\n        new_size : int\n            New size of buffer (padding may be added internally)\n        shrink_to_fit : boolean, default False\n            If this is true, the buffer is shrunk when new_size is less\n            than the current size.\n            If this is false, the buffer is never shrunk.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_15ResizableBuffer_1resize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int64_t __pyx_v_new_size;
  PyObject *__pyx_v_shrink_to_fit = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("resize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_new_size,&__pyx_n_s_shrink_to_fit,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_new_size)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shrink_to_fit);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "resize") < 0)) __PYX_ERR(7, 1071, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_new_size = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_new_size == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 1071, __pyx_L3_error)
    __pyx_v_shrink_to_fit = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("resize", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 1071, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.ResizableBuffer.resize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_15ResizableBuffer_resize(((struct __pyx_obj_7pyarrow_3lib_ResizableBuffer *)__pyx_v_self), __pyx_v_new_size, __pyx_v_shrink_to_fit);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_15ResizableBuffer_resize(struct __pyx_obj_7pyarrow_3lib_ResizableBuffer *__pyx_v_self, int64_t __pyx_v_new_size, PyObject *__pyx_v_shrink_to_fit) {
  bool __pyx_v_c_shrink_to_fit;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  bool __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("resize", 0);

  /* "pyarrow/io.pxi":1084
 *             If this is false, the buffer is never shrunk.
 *         """
 *         cdef c_bool c_shrink_to_fit = shrink_to_fit             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status((<CResizableBuffer*> self.buffer.get())
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_shrink_to_fit); if (unlikely((__pyx_t_1 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(7, 1084, __pyx_L1_error)
  __pyx_v_c_shrink_to_fit = __pyx_t_1;

  /* "pyarrow/io.pxi":1085
 *         """
 *         cdef c_bool c_shrink_to_fit = shrink_to_fit
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status((<CResizableBuffer*> self.buffer.get())
 *                          .Resize(new_size, c_shrink_to_fit))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":1086
 *         cdef c_bool c_shrink_to_fit = shrink_to_fit
 *         with nogil:
 *             check_status((<CResizableBuffer*> self.buffer.get())             # <<<<<<<<<<<<<<
 *                          .Resize(new_size, c_shrink_to_fit))
 * 
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status((( arrow::ResizableBuffer *)__pyx_v_self->__pyx_base.buffer.get())->Resize(__pyx_v_new_size, __pyx_v_c_shrink_to_fit)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(7, 1086, __pyx_L4_error)
      }

      /* "pyarrow/io.pxi":1085
 *         """
 *         cdef c_bool c_shrink_to_fit = shrink_to_fit
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status((<CResizableBuffer*> self.buffer.get())
 *                          .Resize(new_size, c_shrink_to_fit))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io.pxi":1071
 *         self.init(<shared_ptr[CBuffer]> buffer)
 * 
 *     def resize(self, int64_t new_size, shrink_to_fit=False):             # <<<<<<<<<<<<<<
 *         """
 *         Resize buffer to indicated size.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.ResizableBuffer.resize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1090
 * 
 * 
 * cdef shared_ptr[CResizableBuffer] _allocate_buffer(CMemoryPool* pool):             # <<<<<<<<<<<<<<
 *     cdef shared_ptr[CResizableBuffer] result
 *     with nogil:
 */

static std::shared_ptr< arrow::ResizableBuffer>  __pyx_f_7pyarrow_3lib__allocate_buffer( arrow::MemoryPool *__pyx_v_pool) {
  std::shared_ptr< arrow::ResizableBuffer>  __pyx_v_result;
  std::shared_ptr< arrow::ResizableBuffer>  __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("_allocate_buffer", 0);

  /* "pyarrow/io.pxi":1092
 * cdef shared_ptr[CResizableBuffer] _allocate_buffer(CMemoryPool* pool):
 *     cdef shared_ptr[CResizableBuffer] result
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(AllocateResizableBuffer(pool, 0, &result))
 *     return result
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":1093
 *     cdef shared_ptr[CResizableBuffer] result
 *     with nogil:
 *         check_status(AllocateResizableBuffer(pool, 0, &result))             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::AllocateResizableBuffer(__pyx_v_pool, 0, (&__pyx_v_result))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 1093, __pyx_L4_error)
      }

      /* "pyarrow/io.pxi":1092
 * cdef shared_ptr[CResizableBuffer] _allocate_buffer(CMemoryPool* pool):
 *     cdef shared_ptr[CResizableBuffer] result
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(AllocateResizableBuffer(pool, 0, &result))
 *     return result
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io.pxi":1094
 *     with nogil:
 *         check_status(AllocateResizableBuffer(pool, 0, &result))
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1090
 * 
 * 
 * cdef shared_ptr[CResizableBuffer] _allocate_buffer(CMemoryPool* pool):             # <<<<<<<<<<<<<<
 *     cdef shared_ptr[CResizableBuffer] result
 *     with nogil:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("pyarrow.lib._allocate_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1097
 * 
 * 
 * def allocate_buffer(int64_t size, MemoryPool memory_pool=None,             # <<<<<<<<<<<<<<
 *                     resizable=False):
 *     """
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_163allocate_buffer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_162allocate_buffer[] = "allocate_buffer(int64_t size, MemoryPool memory_pool=None, resizable=False)\n\n    Allocate a mutable buffer.\n\n    Parameters\n    ----------\n    size : int\n        Number of bytes to allocate (plus internal padding)\n    memory_pool : MemoryPool, optional\n        The pool to allocate memory from.\n        If not given, the default memory pool is used.\n    resizable : boolean, default False\n        If true, the returned buffer is resizable.\n\n    Returns\n    -------\n    buffer : Buffer or ResizableBuffer\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_163allocate_buffer = {"allocate_buffer", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_163allocate_buffer, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_162allocate_buffer};
static PyObject *__pyx_pw_7pyarrow_3lib_163allocate_buffer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int64_t __pyx_v_size;
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  PyObject *__pyx_v_resizable = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("allocate_buffer (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_memory_pool,&__pyx_n_s_resizable,0};
    PyObject* values[3] = {0,0,0};
    values[1] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);

    /* "pyarrow/io.pxi":1098
 * 
 * def allocate_buffer(int64_t size, MemoryPool memory_pool=None,
 *                     resizable=False):             # <<<<<<<<<<<<<<
 *     """
 *     Allocate a mutable buffer.
 */
    values[2] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_resizable);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "allocate_buffer") < 0)) __PYX_ERR(7, 1097, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_size = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_size == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 1097, __pyx_L3_error)
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[1]);
    __pyx_v_resizable = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("allocate_buffer", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 1097, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.allocate_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(7, 1097, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_162allocate_buffer(__pyx_self, __pyx_v_size, __pyx_v_memory_pool, __pyx_v_resizable);

  /* "pyarrow/io.pxi":1097
 * 
 * 
 * def allocate_buffer(int64_t size, MemoryPool memory_pool=None,             # <<<<<<<<<<<<<<
 *                     resizable=False):
 *     """
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_162allocate_buffer(CYTHON_UNUSED PyObject *__pyx_self, int64_t __pyx_v_size, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool, PyObject *__pyx_v_resizable) {
  std::shared_ptr< arrow::Buffer>  __pyx_v_buffer;
  std::shared_ptr< arrow::ResizableBuffer>  __pyx_v_rz_buffer;
   arrow::MemoryPool *__pyx_v_cpool;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("allocate_buffer", 0);

  /* "pyarrow/io.pxi":1119
 *         shared_ptr[CBuffer] buffer
 *         shared_ptr[CResizableBuffer] rz_buffer
 *         CMemoryPool* cpool = maybe_unbox_memory_pool(memory_pool)             # <<<<<<<<<<<<<<
 * 
 *     if resizable:
 */
  __pyx_v_cpool = __pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(__pyx_v_memory_pool);

  /* "pyarrow/io.pxi":1121
 *         CMemoryPool* cpool = maybe_unbox_memory_pool(memory_pool)
 * 
 *     if resizable:             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(AllocateResizableBuffer(cpool, size, &rz_buffer))
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_resizable); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(7, 1121, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":1122
 * 
 *     if resizable:
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(AllocateResizableBuffer(cpool, size, &rz_buffer))
 *         return pyarrow_wrap_resizable_buffer(rz_buffer)
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "pyarrow/io.pxi":1123
 *     if resizable:
 *         with nogil:
 *             check_status(AllocateResizableBuffer(cpool, size, &rz_buffer))             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_resizable_buffer(rz_buffer)
 *     else:
 */
          __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(arrow::AllocateResizableBuffer(__pyx_v_cpool, __pyx_v_size, (&__pyx_v_rz_buffer))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(7, 1123, __pyx_L5_error)
        }

        /* "pyarrow/io.pxi":1122
 * 
 *     if resizable:
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(AllocateResizableBuffer(cpool, size, &rz_buffer))
 *         return pyarrow_wrap_resizable_buffer(rz_buffer)
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L6;
          }
          __pyx_L5_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L6:;
        }
    }

    /* "pyarrow/io.pxi":1124
 *         with nogil:
 *             check_status(AllocateResizableBuffer(cpool, size, &rz_buffer))
 *         return pyarrow_wrap_resizable_buffer(rz_buffer)             # <<<<<<<<<<<<<<
 *     else:
 *         with nogil:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_resizable_buffer(__pyx_v_rz_buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1124, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":1121
 *         CMemoryPool* cpool = maybe_unbox_memory_pool(memory_pool)
 * 
 *     if resizable:             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(AllocateResizableBuffer(cpool, size, &rz_buffer))
 */
  }

  /* "pyarrow/io.pxi":1126
 *         return pyarrow_wrap_resizable_buffer(rz_buffer)
 *     else:
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(AllocateBuffer(cpool, size, &buffer))
 *         return pyarrow_wrap_buffer(buffer)
 */
  /*else*/ {
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "pyarrow/io.pxi":1127
 *     else:
 *         with nogil:
 *             check_status(AllocateBuffer(cpool, size, &buffer))             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_buffer(buffer)
 * 
 */
          __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(arrow::AllocateBuffer(__pyx_v_cpool, __pyx_v_size, (&__pyx_v_buffer))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(7, 1127, __pyx_L8_error)
        }

        /* "pyarrow/io.pxi":1126
 *         return pyarrow_wrap_resizable_buffer(rz_buffer)
 *     else:
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(AllocateBuffer(cpool, size, &buffer))
 *         return pyarrow_wrap_buffer(buffer)
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L9;
          }
          __pyx_L8_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L9:;
        }
    }

    /* "pyarrow/io.pxi":1128
 *         with nogil:
 *             check_status(AllocateBuffer(cpool, size, &buffer))
 *         return pyarrow_wrap_buffer(buffer)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1128, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/io.pxi":1097
 * 
 * 
 * def allocate_buffer(int64_t size, MemoryPool memory_pool=None,             # <<<<<<<<<<<<<<
 *                     resizable=False):
 *     """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.allocate_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1136
 *         shared_ptr[CResizableBuffer] buffer
 * 
 *     def __cinit__(self, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         self.buffer = _allocate_buffer(maybe_unbox_memory_pool(memory_pool))
 *         self.output_stream.reset(new CBufferOutputStream(
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_18BufferOutputStream_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_18BufferOutputStream_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_memory_pool,0};
    PyObject* values[1] = {0};
    values[0] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(7, 1136, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 1136, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.BufferOutputStream.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(7, 1136, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_18BufferOutputStream___cinit__(((struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *)__pyx_v_self), __pyx_v_memory_pool);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_18BufferOutputStream___cinit__(struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/io.pxi":1137
 * 
 *     def __cinit__(self, MemoryPool memory_pool=None):
 *         self.buffer = _allocate_buffer(maybe_unbox_memory_pool(memory_pool))             # <<<<<<<<<<<<<<
 *         self.output_stream.reset(new CBufferOutputStream(
 *             <shared_ptr[CResizableBuffer]> self.buffer))
 */
  __pyx_v_self->buffer = __pyx_f_7pyarrow_3lib__allocate_buffer(__pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(__pyx_v_memory_pool));

  /* "pyarrow/io.pxi":1138
 *     def __cinit__(self, MemoryPool memory_pool=None):
 *         self.buffer = _allocate_buffer(maybe_unbox_memory_pool(memory_pool))
 *         self.output_stream.reset(new CBufferOutputStream(             # <<<<<<<<<<<<<<
 *             <shared_ptr[CResizableBuffer]> self.buffer))
 *         self.is_writable = True
 */
  __pyx_v_self->__pyx_base.output_stream.reset(new  arrow::io::BufferOutputStream(((std::shared_ptr< arrow::ResizableBuffer> )__pyx_v_self->buffer)));

  /* "pyarrow/io.pxi":1140
 *         self.output_stream.reset(new CBufferOutputStream(
 *             <shared_ptr[CResizableBuffer]> self.buffer))
 *         self.is_writable = True             # <<<<<<<<<<<<<<
 * 
 *     def getvalue(self):
 */
  __pyx_v_self->__pyx_base.is_writable = 1;

  /* "pyarrow/io.pxi":1136
 *         shared_ptr[CResizableBuffer] buffer
 * 
 *     def __cinit__(self, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         self.buffer = _allocate_buffer(maybe_unbox_memory_pool(memory_pool))
 *         self.output_stream.reset(new CBufferOutputStream(
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1142
 *         self.is_writable = True
 * 
 *     def getvalue(self):             # <<<<<<<<<<<<<<
 *         """
 *         Finalize output stream and return result as pyarrow.Buffer.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18BufferOutputStream_3getvalue(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18BufferOutputStream_2getvalue[] = "BufferOutputStream.getvalue(self)\n\n        Finalize output stream and return result as pyarrow.Buffer.\n\n        Returns\n        -------\n        value : Buffer\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_18BufferOutputStream_3getvalue(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getvalue (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_18BufferOutputStream_2getvalue(((struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18BufferOutputStream_2getvalue(struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("getvalue", 0);

  /* "pyarrow/io.pxi":1150
 *         value : Buffer
 *         """
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.output_stream.get().Close())
 *         return pyarrow_wrap_buffer(<shared_ptr[CBuffer]> self.buffer)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":1151
 *         """
 *         with nogil:
 *             check_status(self.output_stream.get().Close())             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_buffer(<shared_ptr[CBuffer]> self.buffer)
 * 
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->__pyx_base.output_stream.get()->Close()); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 1151, __pyx_L4_error)
      }

      /* "pyarrow/io.pxi":1150
 *         value : Buffer
 *         """
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.output_stream.get().Close())
 *         return pyarrow_wrap_buffer(<shared_ptr[CBuffer]> self.buffer)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io.pxi":1152
 *         with nogil:
 *             check_status(self.output_stream.get().Close())
 *         return pyarrow_wrap_buffer(<shared_ptr[CBuffer]> self.buffer)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(((std::shared_ptr< arrow::Buffer> )__pyx_v_self->buffer)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1142
 *         self.is_writable = True
 * 
 *     def getvalue(self):             # <<<<<<<<<<<<<<
 *         """
 *         Finalize output stream and return result as pyarrow.Buffer.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.BufferOutputStream.getvalue", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18BufferOutputStream_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18BufferOutputStream_4__reduce_cython__[] = "BufferOutputStream.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_18BufferOutputStream_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_18BufferOutputStream_4__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18BufferOutputStream_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__222, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.BufferOutputStream.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18BufferOutputStream_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18BufferOutputStream_6__setstate_cython__[] = "BufferOutputStream.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_18BufferOutputStream_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_18BufferOutputStream_6__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18BufferOutputStream_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__223, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.BufferOutputStream.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1157
 * cdef class MockOutputStream(NativeFile):
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.output_stream.reset(new CMockOutputStream())
 *         self.is_writable = True
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_16MockOutputStream_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_16MockOutputStream_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_16MockOutputStream___cinit__(((struct __pyx_obj_7pyarrow_3lib_MockOutputStream *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_16MockOutputStream___cinit__(struct __pyx_obj_7pyarrow_3lib_MockOutputStream *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/io.pxi":1158
 * 
 *     def __cinit__(self):
 *         self.output_stream.reset(new CMockOutputStream())             # <<<<<<<<<<<<<<
 *         self.is_writable = True
 * 
 */
  __pyx_v_self->__pyx_base.output_stream.reset(new  arrow::io::MockOutputStream());

  /* "pyarrow/io.pxi":1159
 *     def __cinit__(self):
 *         self.output_stream.reset(new CMockOutputStream())
 *         self.is_writable = True             # <<<<<<<<<<<<<<
 * 
 *     def size(self):
 */
  __pyx_v_self->__pyx_base.is_writable = 1;

  /* "pyarrow/io.pxi":1157
 * cdef class MockOutputStream(NativeFile):
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.output_stream.reset(new CMockOutputStream())
 *         self.is_writable = True
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1161
 *         self.is_writable = True
 * 
 *     def size(self):             # <<<<<<<<<<<<<<
 *         handle = <CMockOutputStream*> self.output_stream.get()
 *         return handle.GetExtentBytesWritten()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16MockOutputStream_3size(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16MockOutputStream_2size[] = "MockOutputStream.size(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_16MockOutputStream_3size(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("size (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16MockOutputStream_2size(((struct __pyx_obj_7pyarrow_3lib_MockOutputStream *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16MockOutputStream_2size(struct __pyx_obj_7pyarrow_3lib_MockOutputStream *__pyx_v_self) {
   arrow::io::MockOutputStream *__pyx_v_handle;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("size", 0);

  /* "pyarrow/io.pxi":1162
 * 
 *     def size(self):
 *         handle = <CMockOutputStream*> self.output_stream.get()             # <<<<<<<<<<<<<<
 *         return handle.GetExtentBytesWritten()
 * 
 */
  __pyx_v_handle = (( arrow::io::MockOutputStream *)__pyx_v_self->__pyx_base.output_stream.get());

  /* "pyarrow/io.pxi":1163
 *     def size(self):
 *         handle = <CMockOutputStream*> self.output_stream.get()
 *         return handle.GetExtentBytesWritten()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_handle->GetExtentBytesWritten()); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1161
 *         self.is_writable = True
 * 
 *     def size(self):             # <<<<<<<<<<<<<<
 *         handle = <CMockOutputStream*> self.output_stream.get()
 *         return handle.GetExtentBytesWritten()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.MockOutputStream.size", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16MockOutputStream_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16MockOutputStream_4__reduce_cython__[] = "MockOutputStream.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_16MockOutputStream_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16MockOutputStream_4__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_MockOutputStream *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16MockOutputStream_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MockOutputStream *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__224, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.MockOutputStream.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16MockOutputStream_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16MockOutputStream_6__setstate_cython__[] = "MockOutputStream.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_16MockOutputStream_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16MockOutputStream_6__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_MockOutputStream *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16MockOutputStream_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MockOutputStream *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__225, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.MockOutputStream.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1177
 *         Buffer buffer
 * 
 *     def __cinit__(self, object obj):             # <<<<<<<<<<<<<<
 *         self.buffer = as_buffer(obj)
 *         self.set_random_access_file(shared_ptr[CRandomAccessFile](
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_12BufferReader_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_12BufferReader_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_obj = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(7, 1177, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_obj = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 1177, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.BufferReader.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_12BufferReader___cinit__(((struct __pyx_obj_7pyarrow_3lib_BufferReader *)__pyx_v_self), __pyx_v_obj);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_12BufferReader___cinit__(struct __pyx_obj_7pyarrow_3lib_BufferReader *__pyx_v_self, PyObject *__pyx_v_obj) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/io.pxi":1178
 * 
 *     def __cinit__(self, object obj):
 *         self.buffer = as_buffer(obj)             # <<<<<<<<<<<<<<
 *         self.set_random_access_file(shared_ptr[CRandomAccessFile](
 *             new CBufferReader(self.buffer.buffer)))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_as_buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_obj);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_Buffer))))) __PYX_ERR(7, 1178, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->buffer);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->buffer));
  __pyx_v_self->buffer = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":1179
 *     def __cinit__(self, object obj):
 *         self.buffer = as_buffer(obj)
 *         self.set_random_access_file(shared_ptr[CRandomAccessFile](             # <<<<<<<<<<<<<<
 *             new CBufferReader(self.buffer.buffer)))
 *         self.is_readable = True
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_BufferReader *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_random_access_file(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), std::shared_ptr< arrow::io::RandomAccessFile> (new  arrow::io::BufferReader(__pyx_v_self->buffer->buffer))); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":1181
 *         self.set_random_access_file(shared_ptr[CRandomAccessFile](
 *             new CBufferReader(self.buffer.buffer)))
 *         self.is_readable = True             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->__pyx_base.is_readable = 1;

  /* "pyarrow/io.pxi":1177
 *         Buffer buffer
 * 
 *     def __cinit__(self, object obj):             # <<<<<<<<<<<<<<
 *         self.buffer = as_buffer(obj)
 *         self.set_random_access_file(shared_ptr[CRandomAccessFile](
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.BufferReader.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12BufferReader_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12BufferReader_2__reduce_cython__[] = "BufferReader.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_12BufferReader_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12BufferReader_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_BufferReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12BufferReader_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__226, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.BufferReader.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12BufferReader_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12BufferReader_4__setstate_cython__[] = "BufferReader.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_12BufferReader_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12BufferReader_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_BufferReader *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_12BufferReader_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__227, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.BufferReader.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1194
 *         The compression type ("bz2", "brotli", "gzip", "lz4" or "zstd")
 *     """
 *     def __init__(self, NativeFile stream, compression):             # <<<<<<<<<<<<<<
 *         cdef:
 *             CompressionType compression_type
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_21CompressedInputStream_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_21CompressedInputStream_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_stream = 0;
  PyObject *__pyx_v_compression = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stream,&__pyx_n_s_compression,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stream)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_compression)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(7, 1194, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(7, 1194, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_stream = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)values[0]);
    __pyx_v_compression = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 1194, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.CompressedInputStream.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_stream), __pyx_ptype_7pyarrow_3lib_NativeFile, 1, "stream", 0))) __PYX_ERR(7, 1194, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_21CompressedInputStream___init__(((struct __pyx_obj_7pyarrow_3lib_CompressedInputStream *)__pyx_v_self), __pyx_v_stream, __pyx_v_compression);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_21CompressedInputStream___init__(struct __pyx_obj_7pyarrow_3lib_CompressedInputStream *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_stream, PyObject *__pyx_v_compression) {
  enum  arrow::Compression::type __pyx_v_compression_type;
  std::unique_ptr< arrow::util::Codec>  __pyx_v_codec;
  std::shared_ptr< arrow::io::CompressedInputStream>  __pyx_v_compressed_stream;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  enum  arrow::Compression::type __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::unique_ptr< arrow::util::Codec>  __pyx_t_6;
  std::shared_ptr< arrow::io::InputStream>  __pyx_t_7;
  std::shared_ptr< arrow::io::CompressedInputStream>  __pyx_t_8;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/io.pxi":1200
 *             shared_ptr[CCompressedInputStream] compressed_stream
 * 
 *         compression_type = _get_compression_type(compression)             # <<<<<<<<<<<<<<
 *         if compression_type == CompressionType_UNCOMPRESSED:
 *             raise ValueError('Invalid value for compression: {!r}'
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__get_compression_type(__pyx_v_compression); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 1200, __pyx_L1_error)
  __pyx_v_compression_type = __pyx_t_1;

  /* "pyarrow/io.pxi":1201
 * 
 *         compression_type = _get_compression_type(compression)
 *         if compression_type == CompressionType_UNCOMPRESSED:             # <<<<<<<<<<<<<<
 *             raise ValueError('Invalid value for compression: {!r}'
 *                              .format(compression))
 */
  __pyx_t_2 = ((__pyx_v_compression_type ==  arrow::Compression::UNCOMPRESSED) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/io.pxi":1203
 *         if compression_type == CompressionType_UNCOMPRESSED:
 *             raise ValueError('Invalid value for compression: {!r}'
 *                              .format(compression))             # <<<<<<<<<<<<<<
 * 
 *         codec = move(GetResultValue(CCodec.Create(compression_type)))
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Invalid_value_for_compression_r, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1203, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_compression) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_compression);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1203, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/io.pxi":1202
 *         compression_type = _get_compression_type(compression)
 *         if compression_type == CompressionType_UNCOMPRESSED:
 *             raise ValueError('Invalid value for compression: {!r}'             # <<<<<<<<<<<<<<
 *                              .format(compression))
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1202, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(7, 1202, __pyx_L1_error)

    /* "pyarrow/io.pxi":1201
 * 
 *         compression_type = _get_compression_type(compression)
 *         if compression_type == CompressionType_UNCOMPRESSED:             # <<<<<<<<<<<<<<
 *             raise ValueError('Invalid value for compression: {!r}'
 *                              .format(compression))
 */
  }

  /* "pyarrow/io.pxi":1205
 *                              .format(compression))
 * 
 *         codec = move(GetResultValue(CCodec.Create(compression_type)))             # <<<<<<<<<<<<<<
 *         compressed_stream = GetResultValue(CCompressedInputStream.Make(
 *             codec.get(), stream.get_input_stream()))
 */
  __pyx_t_6 = arrow::py::GetResultValue<std::unique_ptr< arrow::util::Codec> >( arrow::util::Codec::Create(__pyx_v_compression_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 1205, __pyx_L1_error)
  __pyx_v_codec =  cymove::cymove<std::unique_ptr< arrow::util::Codec> >(__pyx_t_6);

  /* "pyarrow/io.pxi":1207
 *         codec = move(GetResultValue(CCodec.Create(compression_type)))
 *         compressed_stream = GetResultValue(CCompressedInputStream.Make(
 *             codec.get(), stream.get_input_stream()))             # <<<<<<<<<<<<<<
 * 
 *         self.set_input_stream(<shared_ptr[CInputStream]> compressed_stream)
 */
  __pyx_t_7 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_stream->__pyx_vtab)->get_input_stream(__pyx_v_stream); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 1207, __pyx_L1_error)

  /* "pyarrow/io.pxi":1206
 * 
 *         codec = move(GetResultValue(CCodec.Create(compression_type)))
 *         compressed_stream = GetResultValue(CCompressedInputStream.Make(             # <<<<<<<<<<<<<<
 *             codec.get(), stream.get_input_stream()))
 * 
 */
  __pyx_t_8 = arrow::py::GetResultValue<std::shared_ptr< arrow::io::CompressedInputStream> >( arrow::io::CompressedInputStream::Make(__pyx_v_codec.get(), __pyx_t_7)); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 1206, __pyx_L1_error)
  __pyx_v_compressed_stream = __pyx_t_8;

  /* "pyarrow/io.pxi":1209
 *             codec.get(), stream.get_input_stream()))
 * 
 *         self.set_input_stream(<shared_ptr[CInputStream]> compressed_stream)             # <<<<<<<<<<<<<<
 *         self.is_readable = True
 * 
 */
  __pyx_t_4 = ((struct __pyx_vtabstruct_7pyarrow_3lib_CompressedInputStream *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_input_stream(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), ((std::shared_ptr< arrow::io::InputStream> )__pyx_v_compressed_stream)); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/io.pxi":1210
 * 
 *         self.set_input_stream(<shared_ptr[CInputStream]> compressed_stream)
 *         self.is_readable = True             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->__pyx_base.is_readable = 1;

  /* "pyarrow/io.pxi":1194
 *         The compression type ("bz2", "brotli", "gzip", "lz4" or "zstd")
 *     """
 *     def __init__(self, NativeFile stream, compression):             # <<<<<<<<<<<<<<
 *         cdef:
 *             CompressionType compression_type
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.CompressedInputStream.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_21CompressedInputStream_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_21CompressedInputStream_2__reduce_cython__[] = "CompressedInputStream.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_21CompressedInputStream_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_21CompressedInputStream_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_CompressedInputStream *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_21CompressedInputStream_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_CompressedInputStream *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__228, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.CompressedInputStream.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_21CompressedInputStream_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_21CompressedInputStream_4__setstate_cython__[] = "CompressedInputStream.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_21CompressedInputStream_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_21CompressedInputStream_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_CompressedInputStream *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_21CompressedInputStream_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_CompressedInputStream *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__229, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.CompressedInputStream.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1224
 *     """
 * 
 *     def __init__(self, NativeFile stream, compression):             # <<<<<<<<<<<<<<
 *         cdef:
 *             CompressionType compression_type
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_22CompressedOutputStream_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_22CompressedOutputStream_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_stream = 0;
  PyObject *__pyx_v_compression = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stream,&__pyx_n_s_compression,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stream)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_compression)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(7, 1224, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(7, 1224, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_stream = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)values[0]);
    __pyx_v_compression = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 1224, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.CompressedOutputStream.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_stream), __pyx_ptype_7pyarrow_3lib_NativeFile, 1, "stream", 0))) __PYX_ERR(7, 1224, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_22CompressedOutputStream___init__(((struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream *)__pyx_v_self), __pyx_v_stream, __pyx_v_compression);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_22CompressedOutputStream___init__(struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_stream, PyObject *__pyx_v_compression) {
  enum  arrow::Compression::type __pyx_v_compression_type;
  std::unique_ptr< arrow::util::Codec>  __pyx_v_codec;
  std::shared_ptr< arrow::io::CompressedOutputStream>  __pyx_v_compressed_stream;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  enum  arrow::Compression::type __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::unique_ptr< arrow::util::Codec>  __pyx_t_6;
  std::shared_ptr< arrow::io::OutputStream>  __pyx_t_7;
  std::shared_ptr< arrow::io::CompressedOutputStream>  __pyx_t_8;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/io.pxi":1230
 *             shared_ptr[CCompressedOutputStream] compressed_stream
 * 
 *         compression_type = _get_compression_type(compression)             # <<<<<<<<<<<<<<
 *         if compression_type == CompressionType_UNCOMPRESSED:
 *             raise ValueError('Invalid value for compression: {!r}'
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__get_compression_type(__pyx_v_compression); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 1230, __pyx_L1_error)
  __pyx_v_compression_type = __pyx_t_1;

  /* "pyarrow/io.pxi":1231
 * 
 *         compression_type = _get_compression_type(compression)
 *         if compression_type == CompressionType_UNCOMPRESSED:             # <<<<<<<<<<<<<<
 *             raise ValueError('Invalid value for compression: {!r}'
 *                              .format(compression))
 */
  __pyx_t_2 = ((__pyx_v_compression_type ==  arrow::Compression::UNCOMPRESSED) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/io.pxi":1233
 *         if compression_type == CompressionType_UNCOMPRESSED:
 *             raise ValueError('Invalid value for compression: {!r}'
 *                              .format(compression))             # <<<<<<<<<<<<<<
 * 
 *         codec = move(GetResultValue(CCodec.Create(compression_type)))
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Invalid_value_for_compression_r, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_compression) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_compression);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/io.pxi":1232
 *         compression_type = _get_compression_type(compression)
 *         if compression_type == CompressionType_UNCOMPRESSED:
 *             raise ValueError('Invalid value for compression: {!r}'             # <<<<<<<<<<<<<<
 *                              .format(compression))
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1232, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(7, 1232, __pyx_L1_error)

    /* "pyarrow/io.pxi":1231
 * 
 *         compression_type = _get_compression_type(compression)
 *         if compression_type == CompressionType_UNCOMPRESSED:             # <<<<<<<<<<<<<<
 *             raise ValueError('Invalid value for compression: {!r}'
 *                              .format(compression))
 */
  }

  /* "pyarrow/io.pxi":1235
 *                              .format(compression))
 * 
 *         codec = move(GetResultValue(CCodec.Create(compression_type)))             # <<<<<<<<<<<<<<
 *         compressed_stream = GetResultValue(CCompressedOutputStream.Make(
 *             codec.get(), stream.get_output_stream()))
 */
  __pyx_t_6 = arrow::py::GetResultValue<std::unique_ptr< arrow::util::Codec> >( arrow::util::Codec::Create(__pyx_v_compression_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 1235, __pyx_L1_error)
  __pyx_v_codec =  cymove::cymove<std::unique_ptr< arrow::util::Codec> >(__pyx_t_6);

  /* "pyarrow/io.pxi":1237
 *         codec = move(GetResultValue(CCodec.Create(compression_type)))
 *         compressed_stream = GetResultValue(CCompressedOutputStream.Make(
 *             codec.get(), stream.get_output_stream()))             # <<<<<<<<<<<<<<
 * 
 *         self.set_output_stream(<shared_ptr[COutputStream]> compressed_stream)
 */
  __pyx_t_7 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_stream->__pyx_vtab)->get_output_stream(__pyx_v_stream); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 1237, __pyx_L1_error)

  /* "pyarrow/io.pxi":1236
 * 
 *         codec = move(GetResultValue(CCodec.Create(compression_type)))
 *         compressed_stream = GetResultValue(CCompressedOutputStream.Make(             # <<<<<<<<<<<<<<
 *             codec.get(), stream.get_output_stream()))
 * 
 */
  __pyx_t_8 = arrow::py::GetResultValue<std::shared_ptr< arrow::io::CompressedOutputStream> >( arrow::io::CompressedOutputStream::Make(__pyx_v_codec.get(), __pyx_t_7)); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 1236, __pyx_L1_error)
  __pyx_v_compressed_stream = __pyx_t_8;

  /* "pyarrow/io.pxi":1239
 *             codec.get(), stream.get_output_stream()))
 * 
 *         self.set_output_stream(<shared_ptr[COutputStream]> compressed_stream)             # <<<<<<<<<<<<<<
 *         self.is_writable = True
 * 
 */
  __pyx_t_4 = ((struct __pyx_vtabstruct_7pyarrow_3lib_CompressedOutputStream *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_output_stream(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), ((std::shared_ptr< arrow::io::OutputStream> )__pyx_v_compressed_stream)); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/io.pxi":1240
 * 
 *         self.set_output_stream(<shared_ptr[COutputStream]> compressed_stream)
 *         self.is_writable = True             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->__pyx_base.is_writable = 1;

  /* "pyarrow/io.pxi":1224
 *     """
 * 
 *     def __init__(self, NativeFile stream, compression):             # <<<<<<<<<<<<<<
 *         cdef:
 *             CompressionType compression_type
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.CompressedOutputStream.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_22CompressedOutputStream_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_22CompressedOutputStream_2__reduce_cython__[] = "CompressedOutputStream.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_22CompressedOutputStream_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_22CompressedOutputStream_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_22CompressedOutputStream_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__230, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.CompressedOutputStream.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_22CompressedOutputStream_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_22CompressedOutputStream_4__setstate_cython__[] = "CompressedOutputStream.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_22CompressedOutputStream_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_22CompressedOutputStream_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_22CompressedOutputStream_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__231, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.CompressedOutputStream.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1250
 * cdef class BufferedInputStream(NativeFile):
 * 
 *     def __init__(self, NativeFile stream, int buffer_size,             # <<<<<<<<<<<<<<
 *                  MemoryPool memory_pool=None):
 *         cdef shared_ptr[CBufferedInputStream] buffered_stream
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_19BufferedInputStream_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_19BufferedInputStream_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_stream = 0;
  int __pyx_v_buffer_size;
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stream,&__pyx_n_s_buffer_size,&__pyx_n_s_memory_pool,0};
    PyObject* values[3] = {0,0,0};

    /* "pyarrow/io.pxi":1251
 * 
 *     def __init__(self, NativeFile stream, int buffer_size,
 *                  MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[CBufferedInputStream] buffered_stream
 * 
 */
    values[2] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stream)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffer_size)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); __PYX_ERR(7, 1250, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(7, 1250, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_stream = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)values[0]);
    __pyx_v_buffer_size = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_buffer_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(7, 1250, __pyx_L3_error)
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 1250, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.BufferedInputStream.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_stream), __pyx_ptype_7pyarrow_3lib_NativeFile, 1, "stream", 0))) __PYX_ERR(7, 1250, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(7, 1251, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_19BufferedInputStream___init__(((struct __pyx_obj_7pyarrow_3lib_BufferedInputStream *)__pyx_v_self), __pyx_v_stream, __pyx_v_buffer_size, __pyx_v_memory_pool);

  /* "pyarrow/io.pxi":1250
 * cdef class BufferedInputStream(NativeFile):
 * 
 *     def __init__(self, NativeFile stream, int buffer_size,             # <<<<<<<<<<<<<<
 *                  MemoryPool memory_pool=None):
 *         cdef shared_ptr[CBufferedInputStream] buffered_stream
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_19BufferedInputStream___init__(struct __pyx_obj_7pyarrow_3lib_BufferedInputStream *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_stream, int __pyx_v_buffer_size, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool) {
  std::shared_ptr< arrow::io::BufferedInputStream>  __pyx_v_buffered_stream;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  std::shared_ptr< arrow::io::InputStream>  __pyx_t_3;
  std::shared_ptr< arrow::io::BufferedInputStream>  __pyx_t_4;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/io.pxi":1254
 *         cdef shared_ptr[CBufferedInputStream] buffered_stream
 * 
 *         if buffer_size <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Buffer size must be larger than zero')
 *         buffered_stream = GetResultValue(CBufferedInputStream.Create(
 */
  __pyx_t_1 = ((__pyx_v_buffer_size <= 0) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/io.pxi":1255
 * 
 *         if buffer_size <= 0:
 *             raise ValueError('Buffer size must be larger than zero')             # <<<<<<<<<<<<<<
 *         buffered_stream = GetResultValue(CBufferedInputStream.Create(
 *             buffer_size, maybe_unbox_memory_pool(memory_pool),
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__232, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1255, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(7, 1255, __pyx_L1_error)

    /* "pyarrow/io.pxi":1254
 *         cdef shared_ptr[CBufferedInputStream] buffered_stream
 * 
 *         if buffer_size <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Buffer size must be larger than zero')
 *         buffered_stream = GetResultValue(CBufferedInputStream.Create(
 */
  }

  /* "pyarrow/io.pxi":1258
 *         buffered_stream = GetResultValue(CBufferedInputStream.Create(
 *             buffer_size, maybe_unbox_memory_pool(memory_pool),
 *             stream.get_input_stream()))             # <<<<<<<<<<<<<<
 * 
 *         self.set_input_stream(<shared_ptr[CInputStream]> buffered_stream)
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_stream->__pyx_vtab)->get_input_stream(__pyx_v_stream); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 1258, __pyx_L1_error)

  /* "pyarrow/io.pxi":1256
 *         if buffer_size <= 0:
 *             raise ValueError('Buffer size must be larger than zero')
 *         buffered_stream = GetResultValue(CBufferedInputStream.Create(             # <<<<<<<<<<<<<<
 *             buffer_size, maybe_unbox_memory_pool(memory_pool),
 *             stream.get_input_stream()))
 */
  __pyx_t_4 = arrow::py::GetResultValue<std::shared_ptr< arrow::io::BufferedInputStream> >( arrow::io::BufferedInputStream::Create(__pyx_v_buffer_size, __pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(__pyx_v_memory_pool), __pyx_t_3)); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 1256, __pyx_L1_error)
  __pyx_v_buffered_stream = __pyx_t_4;

  /* "pyarrow/io.pxi":1260
 *             stream.get_input_stream()))
 * 
 *         self.set_input_stream(<shared_ptr[CInputStream]> buffered_stream)             # <<<<<<<<<<<<<<
 *         self.is_readable = True
 * 
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_3lib_BufferedInputStream *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_input_stream(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), ((std::shared_ptr< arrow::io::InputStream> )__pyx_v_buffered_stream)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io.pxi":1261
 * 
 *         self.set_input_stream(<shared_ptr[CInputStream]> buffered_stream)
 *         self.is_readable = True             # <<<<<<<<<<<<<<
 * 
 *     def detach(self):
 */
  __pyx_v_self->__pyx_base.is_readable = 1;

  /* "pyarrow/io.pxi":1250
 * cdef class BufferedInputStream(NativeFile):
 * 
 *     def __init__(self, NativeFile stream, int buffer_size,             # <<<<<<<<<<<<<<
 *                  MemoryPool memory_pool=None):
 *         cdef shared_ptr[CBufferedInputStream] buffered_stream
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.BufferedInputStream.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1263
 *         self.is_readable = True
 * 
 *     def detach(self):             # <<<<<<<<<<<<<<
 *         """
 *         Release the raw InputStream.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19BufferedInputStream_3detach(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19BufferedInputStream_2detach[] = "BufferedInputStream.detach(self)\n\n        Release the raw InputStream.\n        Further operations on this stream are invalid.\n\n        Returns\n        -------\n        raw : NativeFile\n            The underlying raw input stream\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_19BufferedInputStream_3detach(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("detach (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_19BufferedInputStream_2detach(((struct __pyx_obj_7pyarrow_3lib_BufferedInputStream *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19BufferedInputStream_2detach(struct __pyx_obj_7pyarrow_3lib_BufferedInputStream *__pyx_v_self) {
  std::shared_ptr< arrow::io::InputStream>  __pyx_v_c_raw;
  __pyx_t_7pyarrow_3lib__CBufferedInputStreamPtr __pyx_v_buffered;
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_raw = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __pyx_t_7pyarrow_3lib__CBufferedInputStreamPtr __pyx_t_1;
  std::shared_ptr< arrow::io::InputStream>  __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __pyx_t_7pyarrow_3lib__RandomAccessFilePtr __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("detach", 0);

  /* "pyarrow/io.pxi":1278
 *             NativeFile raw
 * 
 *         buffered = dynamic_cast[_CBufferedInputStreamPtr](             # <<<<<<<<<<<<<<
 *             self.input_stream.get())
 *         assert buffered != nullptr
 */
  try {
    __pyx_t_1 = dynamic_cast<__pyx_t_7pyarrow_3lib__CBufferedInputStreamPtr>(__pyx_v_self->__pyx_base.input_stream.get());
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(7, 1278, __pyx_L1_error)
  }
  __pyx_v_buffered = __pyx_t_1;

  /* "pyarrow/io.pxi":1280
 *         buffered = dynamic_cast[_CBufferedInputStreamPtr](
 *             self.input_stream.get())
 *         assert buffered != nullptr             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    if (unlikely(!((__pyx_v_buffered != nullptr) != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(7, 1280, __pyx_L1_error)
    }
  }
  #endif

  /* "pyarrow/io.pxi":1282
 *         assert buffered != nullptr
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             c_raw = GetResultValue(buffered.Detach())
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":1283
 * 
 *         with nogil:
 *             c_raw = GetResultValue(buffered.Detach())             # <<<<<<<<<<<<<<
 * 
 *         raw = NativeFile()
 */
        __pyx_t_2 = arrow::py::GetResultValue<std::shared_ptr< arrow::io::InputStream> >(__pyx_v_buffered->Detach()); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(7, 1283, __pyx_L4_error)
        __pyx_v_c_raw = __pyx_t_2;
      }

      /* "pyarrow/io.pxi":1282
 *         assert buffered != nullptr
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             c_raw = GetResultValue(buffered.Detach())
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io.pxi":1285
 *             c_raw = GetResultValue(buffered.Detach())
 * 
 *         raw = NativeFile()             # <<<<<<<<<<<<<<
 *         raw.is_readable = True
 *         # Find out whether the raw stream is a RandomAccessFile
 */
  __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_NativeFile)); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1285, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_raw = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyarrow/io.pxi":1286
 * 
 *         raw = NativeFile()
 *         raw.is_readable = True             # <<<<<<<<<<<<<<
 *         # Find out whether the raw stream is a RandomAccessFile
 *         # or a mere InputStream.  This helps us support seek() etc.
 */
  __pyx_v_raw->is_readable = 1;

  /* "pyarrow/io.pxi":1290
 *         # or a mere InputStream.  This helps us support seek() etc.
 *         # selectively.
 *         if dynamic_cast[_RandomAccessFilePtr](c_raw.get()) != nullptr:             # <<<<<<<<<<<<<<
 *             raw.set_random_access_file(
 *                 static_pointer_cast[CRandomAccessFile, CInputStream](c_raw))
 */
  try {
    __pyx_t_4 = dynamic_cast<__pyx_t_7pyarrow_3lib__RandomAccessFilePtr>(__pyx_v_c_raw.get());
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(7, 1290, __pyx_L1_error)
  }
  __pyx_t_5 = ((__pyx_t_4 != nullptr) != 0);
  if (__pyx_t_5) {

    /* "pyarrow/io.pxi":1291
 *         # selectively.
 *         if dynamic_cast[_RandomAccessFilePtr](c_raw.get()) != nullptr:
 *             raw.set_random_access_file(             # <<<<<<<<<<<<<<
 *                 static_pointer_cast[CRandomAccessFile, CInputStream](c_raw))
 *         else:
 */
    __pyx_t_3 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_raw->__pyx_vtab)->set_random_access_file(__pyx_v_raw, std::static_pointer_cast< arrow::io::RandomAccessFile, arrow::io::InputStream>(__pyx_v_c_raw)); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1291, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "pyarrow/io.pxi":1290
 *         # or a mere InputStream.  This helps us support seek() etc.
 *         # selectively.
 *         if dynamic_cast[_RandomAccessFilePtr](c_raw.get()) != nullptr:             # <<<<<<<<<<<<<<
 *             raw.set_random_access_file(
 *                 static_pointer_cast[CRandomAccessFile, CInputStream](c_raw))
 */
    goto __pyx_L6;
  }

  /* "pyarrow/io.pxi":1294
 *                 static_pointer_cast[CRandomAccessFile, CInputStream](c_raw))
 *         else:
 *             raw.set_input_stream(c_raw)             # <<<<<<<<<<<<<<
 *         return raw
 * 
 */
  /*else*/ {
    __pyx_t_3 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_raw->__pyx_vtab)->set_input_stream(__pyx_v_raw, __pyx_v_c_raw); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1294, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_L6:;

  /* "pyarrow/io.pxi":1295
 *         else:
 *             raw.set_input_stream(c_raw)
 *         return raw             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_raw));
  __pyx_r = ((PyObject *)__pyx_v_raw);
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1263
 *         self.is_readable = True
 * 
 *     def detach(self):             # <<<<<<<<<<<<<<
 *         """
 *         Release the raw InputStream.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.BufferedInputStream.detach", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_raw);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19BufferedInputStream_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19BufferedInputStream_4__reduce_cython__[] = "BufferedInputStream.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_19BufferedInputStream_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_19BufferedInputStream_4__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_BufferedInputStream *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19BufferedInputStream_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferedInputStream *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__233, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.BufferedInputStream.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19BufferedInputStream_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19BufferedInputStream_6__setstate_cython__[] = "BufferedInputStream.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_19BufferedInputStream_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_19BufferedInputStream_6__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_BufferedInputStream *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19BufferedInputStream_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferedInputStream *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__234, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.BufferedInputStream.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1300
 * cdef class BufferedOutputStream(NativeFile):
 * 
 *     def __init__(self, NativeFile stream, int buffer_size,             # <<<<<<<<<<<<<<
 *                  MemoryPool memory_pool=None):
 *         cdef shared_ptr[CBufferedOutputStream] buffered_stream
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_20BufferedOutputStream_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_20BufferedOutputStream_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_stream = 0;
  int __pyx_v_buffer_size;
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stream,&__pyx_n_s_buffer_size,&__pyx_n_s_memory_pool,0};
    PyObject* values[3] = {0,0,0};

    /* "pyarrow/io.pxi":1301
 * 
 *     def __init__(self, NativeFile stream, int buffer_size,
 *                  MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[CBufferedOutputStream] buffered_stream
 * 
 */
    values[2] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stream)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffer_size)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); __PYX_ERR(7, 1300, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(7, 1300, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_stream = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)values[0]);
    __pyx_v_buffer_size = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_buffer_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(7, 1300, __pyx_L3_error)
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 1300, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.BufferedOutputStream.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_stream), __pyx_ptype_7pyarrow_3lib_NativeFile, 1, "stream", 0))) __PYX_ERR(7, 1300, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(7, 1301, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_20BufferedOutputStream___init__(((struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream *)__pyx_v_self), __pyx_v_stream, __pyx_v_buffer_size, __pyx_v_memory_pool);

  /* "pyarrow/io.pxi":1300
 * cdef class BufferedOutputStream(NativeFile):
 * 
 *     def __init__(self, NativeFile stream, int buffer_size,             # <<<<<<<<<<<<<<
 *                  MemoryPool memory_pool=None):
 *         cdef shared_ptr[CBufferedOutputStream] buffered_stream
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_20BufferedOutputStream___init__(struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_stream, int __pyx_v_buffer_size, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool) {
  std::shared_ptr< arrow::io::BufferedOutputStream>  __pyx_v_buffered_stream;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  std::shared_ptr< arrow::io::OutputStream>  __pyx_t_3;
  std::shared_ptr< arrow::io::BufferedOutputStream>  __pyx_t_4;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/io.pxi":1304
 *         cdef shared_ptr[CBufferedOutputStream] buffered_stream
 * 
 *         if buffer_size <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Buffer size must be larger than zero')
 *         buffered_stream = GetResultValue(CBufferedOutputStream.Create(
 */
  __pyx_t_1 = ((__pyx_v_buffer_size <= 0) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/io.pxi":1305
 * 
 *         if buffer_size <= 0:
 *             raise ValueError('Buffer size must be larger than zero')             # <<<<<<<<<<<<<<
 *         buffered_stream = GetResultValue(CBufferedOutputStream.Create(
 *             buffer_size, maybe_unbox_memory_pool(memory_pool),
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__232, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1305, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(7, 1305, __pyx_L1_error)

    /* "pyarrow/io.pxi":1304
 *         cdef shared_ptr[CBufferedOutputStream] buffered_stream
 * 
 *         if buffer_size <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('Buffer size must be larger than zero')
 *         buffered_stream = GetResultValue(CBufferedOutputStream.Create(
 */
  }

  /* "pyarrow/io.pxi":1308
 *         buffered_stream = GetResultValue(CBufferedOutputStream.Create(
 *             buffer_size, maybe_unbox_memory_pool(memory_pool),
 *             stream.get_output_stream()))             # <<<<<<<<<<<<<<
 * 
 *         self.set_output_stream(<shared_ptr[COutputStream]> buffered_stream)
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_stream->__pyx_vtab)->get_output_stream(__pyx_v_stream); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 1308, __pyx_L1_error)

  /* "pyarrow/io.pxi":1306
 *         if buffer_size <= 0:
 *             raise ValueError('Buffer size must be larger than zero')
 *         buffered_stream = GetResultValue(CBufferedOutputStream.Create(             # <<<<<<<<<<<<<<
 *             buffer_size, maybe_unbox_memory_pool(memory_pool),
 *             stream.get_output_stream()))
 */
  __pyx_t_4 = arrow::py::GetResultValue<std::shared_ptr< arrow::io::BufferedOutputStream> >( arrow::io::BufferedOutputStream::Create(__pyx_v_buffer_size, __pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(__pyx_v_memory_pool), __pyx_t_3)); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 1306, __pyx_L1_error)
  __pyx_v_buffered_stream = __pyx_t_4;

  /* "pyarrow/io.pxi":1310
 *             stream.get_output_stream()))
 * 
 *         self.set_output_stream(<shared_ptr[COutputStream]> buffered_stream)             # <<<<<<<<<<<<<<
 *         self.is_writable = True
 * 
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_3lib_BufferedOutputStream *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_output_stream(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self), ((std::shared_ptr< arrow::io::OutputStream> )__pyx_v_buffered_stream)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io.pxi":1311
 * 
 *         self.set_output_stream(<shared_ptr[COutputStream]> buffered_stream)
 *         self.is_writable = True             # <<<<<<<<<<<<<<
 * 
 *     def detach(self):
 */
  __pyx_v_self->__pyx_base.is_writable = 1;

  /* "pyarrow/io.pxi":1300
 * cdef class BufferedOutputStream(NativeFile):
 * 
 *     def __init__(self, NativeFile stream, int buffer_size,             # <<<<<<<<<<<<<<
 *                  MemoryPool memory_pool=None):
 *         cdef shared_ptr[CBufferedOutputStream] buffered_stream
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.BufferedOutputStream.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1313
 *         self.is_writable = True
 * 
 *     def detach(self):             # <<<<<<<<<<<<<<
 *         """
 *         Flush any buffered writes and release the raw OutputStream.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20BufferedOutputStream_3detach(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20BufferedOutputStream_2detach[] = "BufferedOutputStream.detach(self)\n\n        Flush any buffered writes and release the raw OutputStream.\n        Further operations on this stream are invalid.\n\n        Returns\n        -------\n        raw : NativeFile\n            The underlying raw output stream\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_20BufferedOutputStream_3detach(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("detach (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_20BufferedOutputStream_2detach(((struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20BufferedOutputStream_2detach(struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream *__pyx_v_self) {
  std::shared_ptr< arrow::io::OutputStream>  __pyx_v_c_raw;
  __pyx_t_7pyarrow_3lib__CBufferedOutputStreamPtr __pyx_v_buffered;
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_raw = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __pyx_t_7pyarrow_3lib__CBufferedOutputStreamPtr __pyx_t_1;
  std::shared_ptr< arrow::io::OutputStream>  __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("detach", 0);

  /* "pyarrow/io.pxi":1328
 *             NativeFile raw
 * 
 *         buffered = dynamic_cast[_CBufferedOutputStreamPtr](             # <<<<<<<<<<<<<<
 *             self.output_stream.get())
 *         assert buffered != nullptr
 */
  try {
    __pyx_t_1 = dynamic_cast<__pyx_t_7pyarrow_3lib__CBufferedOutputStreamPtr>(__pyx_v_self->__pyx_base.output_stream.get());
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(7, 1328, __pyx_L1_error)
  }
  __pyx_v_buffered = __pyx_t_1;

  /* "pyarrow/io.pxi":1330
 *         buffered = dynamic_cast[_CBufferedOutputStreamPtr](
 *             self.output_stream.get())
 *         assert buffered != nullptr             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    if (unlikely(!((__pyx_v_buffered != nullptr) != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(7, 1330, __pyx_L1_error)
    }
  }
  #endif

  /* "pyarrow/io.pxi":1332
 *         assert buffered != nullptr
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             c_raw = GetResultValue(buffered.Detach())
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":1333
 * 
 *         with nogil:
 *             c_raw = GetResultValue(buffered.Detach())             # <<<<<<<<<<<<<<
 * 
 *         raw = NativeFile()
 */
        __pyx_t_2 = arrow::py::GetResultValue<std::shared_ptr< arrow::io::OutputStream> >(__pyx_v_buffered->Detach()); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(7, 1333, __pyx_L4_error)
        __pyx_v_c_raw = __pyx_t_2;
      }

      /* "pyarrow/io.pxi":1332
 *         assert buffered != nullptr
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             c_raw = GetResultValue(buffered.Detach())
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io.pxi":1335
 *             c_raw = GetResultValue(buffered.Detach())
 * 
 *         raw = NativeFile()             # <<<<<<<<<<<<<<
 *         raw.is_writable = True
 *         raw.set_output_stream(c_raw)
 */
  __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_NativeFile)); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1335, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_raw = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyarrow/io.pxi":1336
 * 
 *         raw = NativeFile()
 *         raw.is_writable = True             # <<<<<<<<<<<<<<
 *         raw.set_output_stream(c_raw)
 *         return raw
 */
  __pyx_v_raw->is_writable = 1;

  /* "pyarrow/io.pxi":1337
 *         raw = NativeFile()
 *         raw.is_writable = True
 *         raw.set_output_stream(c_raw)             # <<<<<<<<<<<<<<
 *         return raw
 * 
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_raw->__pyx_vtab)->set_output_stream(__pyx_v_raw, __pyx_v_c_raw); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/io.pxi":1338
 *         raw.is_writable = True
 *         raw.set_output_stream(c_raw)
 *         return raw             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_raw));
  __pyx_r = ((PyObject *)__pyx_v_raw);
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1313
 *         self.is_writable = True
 * 
 *     def detach(self):             # <<<<<<<<<<<<<<
 *         """
 *         Flush any buffered writes and release the raw OutputStream.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.BufferedOutputStream.detach", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_raw);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20BufferedOutputStream_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20BufferedOutputStream_4__reduce_cython__[] = "BufferedOutputStream.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_20BufferedOutputStream_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_20BufferedOutputStream_4__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20BufferedOutputStream_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__235, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.BufferedOutputStream.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20BufferedOutputStream_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20BufferedOutputStream_6__setstate_cython__[] = "BufferedOutputStream.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_20BufferedOutputStream_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_20BufferedOutputStream_6__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20BufferedOutputStream_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__236, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.BufferedOutputStream.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1341
 * 
 * 
 * def py_buffer(object obj):             # <<<<<<<<<<<<<<
 *     """
 *     Construct an Arrow buffer from a Python bytes-like or buffer-like object
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_165py_buffer(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_164py_buffer[] = "py_buffer(obj)\n\n    Construct an Arrow buffer from a Python bytes-like or buffer-like object\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_165py_buffer = {"py_buffer", (PyCFunction)__pyx_pw_7pyarrow_3lib_165py_buffer, METH_O, __pyx_doc_7pyarrow_3lib_164py_buffer};
static PyObject *__pyx_pw_7pyarrow_3lib_165py_buffer(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("py_buffer (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_164py_buffer(__pyx_self, ((PyObject *)__pyx_v_obj));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_164py_buffer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  std::shared_ptr< arrow::Buffer>  __pyx_v_buf;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr< arrow::Buffer>  __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("py_buffer", 0);

  /* "pyarrow/io.pxi":1346
 *     """
 *     cdef shared_ptr[CBuffer] buf
 *     buf = GetResultValue(PyBuffer.FromPyObject(obj))             # <<<<<<<<<<<<<<
 *     return pyarrow_wrap_buffer(buf)
 * 
 */
  __pyx_t_1 = arrow::py::GetResultValue<std::shared_ptr< arrow::Buffer> >(arrow::py::PyBuffer::FromPyObject(__pyx_v_obj)); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 1346, __pyx_L1_error)
  __pyx_v_buf = __pyx_t_1;

  /* "pyarrow/io.pxi":1347
 *     cdef shared_ptr[CBuffer] buf
 *     buf = GetResultValue(PyBuffer.FromPyObject(obj))
 *     return pyarrow_wrap_buffer(buf)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1341
 * 
 * 
 * def py_buffer(object obj):             # <<<<<<<<<<<<<<
 *     """
 *     Construct an Arrow buffer from a Python bytes-like or buffer-like object
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.py_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1350
 * 
 * 
 * def foreign_buffer(address, size, base=None):             # <<<<<<<<<<<<<<
 *     """
 *     Construct an Arrow buffer with the given *address* and *size*,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_167foreign_buffer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_166foreign_buffer[] = "foreign_buffer(address, size, base=None)\n\n    Construct an Arrow buffer with the given *address* and *size*,\n    optionally backed by the Python *base* object.\n\n    The *base* object, if given, will be kept alive as long as this buffer\n    is alive, including across language boundaries (for example if the\n    buffer is referenced by C++ code).\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_167foreign_buffer = {"foreign_buffer", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_167foreign_buffer, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_166foreign_buffer};
static PyObject *__pyx_pw_7pyarrow_3lib_167foreign_buffer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_address = 0;
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_v_base = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("foreign_buffer (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_address,&__pyx_n_s_size,&__pyx_n_s_base,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_address)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("foreign_buffer", 0, 2, 3, 1); __PYX_ERR(7, 1350, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_base);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "foreign_buffer") < 0)) __PYX_ERR(7, 1350, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_address = values[0];
    __pyx_v_size = values[1];
    __pyx_v_base = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("foreign_buffer", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 1350, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.foreign_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_166foreign_buffer(__pyx_self, __pyx_v_address, __pyx_v_size, __pyx_v_base);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_166foreign_buffer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_address, PyObject *__pyx_v_size, PyObject *__pyx_v_base) {
  intptr_t __pyx_v_c_addr;
  int64_t __pyx_v_c_size;
  std::shared_ptr< arrow::Buffer>  __pyx_v_buf;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  intptr_t __pyx_t_1;
  int64_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("foreign_buffer", 0);

  /* "pyarrow/io.pxi":1360
 *     """
 *     cdef:
 *         intptr_t c_addr = address             # <<<<<<<<<<<<<<
 *         int64_t c_size = size
 *         shared_ptr[CBuffer] buf
 */
  __pyx_t_1 = PyInt_AsSsize_t(__pyx_v_address); if (unlikely((__pyx_t_1 == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 1360, __pyx_L1_error)
  __pyx_v_c_addr = __pyx_t_1;

  /* "pyarrow/io.pxi":1361
 *     cdef:
 *         intptr_t c_addr = address
 *         int64_t c_size = size             # <<<<<<<<<<<<<<
 *         shared_ptr[CBuffer] buf
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_As_int64_t(__pyx_v_size); if (unlikely((__pyx_t_2 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 1361, __pyx_L1_error)
  __pyx_v_c_size = __pyx_t_2;

  /* "pyarrow/io.pxi":1364
 *         shared_ptr[CBuffer] buf
 * 
 *     check_status(PyForeignBuffer.Make(<uint8_t*> c_addr, c_size,             # <<<<<<<<<<<<<<
 *                                       base, &buf))
 *     return pyarrow_wrap_buffer(buf)
 */
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::PyForeignBuffer::Make(((uint8_t *)__pyx_v_c_addr), __pyx_v_c_size, __pyx_v_base, (&__pyx_v_buf))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 1364, __pyx_L1_error)

  /* "pyarrow/io.pxi":1366
 *     check_status(PyForeignBuffer.Make(<uint8_t*> c_addr, c_size,
 *                                       base, &buf))
 *     return pyarrow_wrap_buffer(buf)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_buf); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1350
 * 
 * 
 * def foreign_buffer(address, size, base=None):             # <<<<<<<<<<<<<<
 *     """
 *     Construct an Arrow buffer with the given *address* and *size*,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.foreign_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1369
 * 
 * 
 * def as_buffer(object o):             # <<<<<<<<<<<<<<
 *     if isinstance(o, Buffer):
 *         return o
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_169as_buffer(PyObject *__pyx_self, PyObject *__pyx_v_o); /*proto*/
static char __pyx_doc_7pyarrow_3lib_168as_buffer[] = "as_buffer(o)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_169as_buffer = {"as_buffer", (PyCFunction)__pyx_pw_7pyarrow_3lib_169as_buffer, METH_O, __pyx_doc_7pyarrow_3lib_168as_buffer};
static PyObject *__pyx_pw_7pyarrow_3lib_169as_buffer(PyObject *__pyx_self, PyObject *__pyx_v_o) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_buffer (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_168as_buffer(__pyx_self, ((PyObject *)__pyx_v_o));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_168as_buffer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_o) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("as_buffer", 0);

  /* "pyarrow/io.pxi":1370
 * 
 * def as_buffer(object o):
 *     if isinstance(o, Buffer):             # <<<<<<<<<<<<<<
 *         return o
 *     return py_buffer(o)
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_ptype_7pyarrow_3lib_Buffer); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/io.pxi":1371
 * def as_buffer(object o):
 *     if isinstance(o, Buffer):
 *         return o             # <<<<<<<<<<<<<<
 *     return py_buffer(o)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_o);
    __pyx_r = __pyx_v_o;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":1370
 * 
 * def as_buffer(object o):
 *     if isinstance(o, Buffer):             # <<<<<<<<<<<<<<
 *         return o
 *     return py_buffer(o)
 */
  }

  /* "pyarrow/io.pxi":1372
 *     if isinstance(o, Buffer):
 *         return o
 *     return py_buffer(o)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_py_buffer); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_o) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_o);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1369
 * 
 * 
 * def as_buffer(object o):             # <<<<<<<<<<<<<<
 *     if isinstance(o, Buffer):
 *         return o
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.as_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1375
 * 
 * 
 * cdef shared_ptr[CBuffer] as_c_buffer(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef shared_ptr[CBuffer] buf
 *     if isinstance(o, Buffer):
 */

static std::shared_ptr< arrow::Buffer>  __pyx_f_7pyarrow_3lib_as_c_buffer(PyObject *__pyx_v_o) {
  std::shared_ptr< arrow::Buffer>  __pyx_v_buf;
  std::shared_ptr< arrow::Buffer>  __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  std::shared_ptr< arrow::Buffer>  __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("as_c_buffer", 0);

  /* "pyarrow/io.pxi":1377
 * cdef shared_ptr[CBuffer] as_c_buffer(object o) except *:
 *     cdef shared_ptr[CBuffer] buf
 *     if isinstance(o, Buffer):             # <<<<<<<<<<<<<<
 *         buf = (<Buffer> o).buffer
 *         if buf == nullptr:
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_ptype_7pyarrow_3lib_Buffer); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/io.pxi":1378
 *     cdef shared_ptr[CBuffer] buf
 *     if isinstance(o, Buffer):
 *         buf = (<Buffer> o).buffer             # <<<<<<<<<<<<<<
 *         if buf == nullptr:
 *             raise ValueError("got null buffer")
 */
    __pyx_t_3 = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_o)->buffer;
    __pyx_v_buf = __pyx_t_3;

    /* "pyarrow/io.pxi":1379
 *     if isinstance(o, Buffer):
 *         buf = (<Buffer> o).buffer
 *         if buf == nullptr:             # <<<<<<<<<<<<<<
 *             raise ValueError("got null buffer")
 *     else:
 */
    __pyx_t_2 = ((__pyx_v_buf == nullptr) != 0);
    if (unlikely(__pyx_t_2)) {

      /* "pyarrow/io.pxi":1380
 *         buf = (<Buffer> o).buffer
 *         if buf == nullptr:
 *             raise ValueError("got null buffer")             # <<<<<<<<<<<<<<
 *     else:
 *         buf = GetResultValue(PyBuffer.FromPyObject(o))
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__237, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1380, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(7, 1380, __pyx_L1_error)

      /* "pyarrow/io.pxi":1379
 *     if isinstance(o, Buffer):
 *         buf = (<Buffer> o).buffer
 *         if buf == nullptr:             # <<<<<<<<<<<<<<
 *             raise ValueError("got null buffer")
 *     else:
 */
    }

    /* "pyarrow/io.pxi":1377
 * cdef shared_ptr[CBuffer] as_c_buffer(object o) except *:
 *     cdef shared_ptr[CBuffer] buf
 *     if isinstance(o, Buffer):             # <<<<<<<<<<<<<<
 *         buf = (<Buffer> o).buffer
 *         if buf == nullptr:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/io.pxi":1382
 *             raise ValueError("got null buffer")
 *     else:
 *         buf = GetResultValue(PyBuffer.FromPyObject(o))             # <<<<<<<<<<<<<<
 *     return buf
 * 
 */
  /*else*/ {
    __pyx_t_3 = arrow::py::GetResultValue<std::shared_ptr< arrow::Buffer> >(arrow::py::PyBuffer::FromPyObject(__pyx_v_o)); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 1382, __pyx_L1_error)
    __pyx_v_buf = __pyx_t_3;
  }
  __pyx_L3:;

  /* "pyarrow/io.pxi":1383
 *     else:
 *         buf = GetResultValue(PyBuffer.FromPyObject(o))
 *     return buf             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_buf;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1375
 * 
 * 
 * cdef shared_ptr[CBuffer] as_c_buffer(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef shared_ptr[CBuffer] buf
 *     if isinstance(o, Buffer):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.as_c_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1386
 * 
 * 
 * cdef NativeFile _get_native_file(object source, c_bool use_memory_map):             # <<<<<<<<<<<<<<
 *     try:
 *         source_path = _stringify_path(source)
 */

static struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_f_7pyarrow_3lib__get_native_file(PyObject *__pyx_v_source, bool __pyx_v_use_memory_map) {
  PyObject *__pyx_v_source_path = NULL;
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  __Pyx_RefNannySetupContext("_get_native_file", 0);
  __Pyx_INCREF(__pyx_v_source);

  /* "pyarrow/io.pxi":1387
 * 
 * cdef NativeFile _get_native_file(object source, c_bool use_memory_map):
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "pyarrow/io.pxi":1388
 * cdef NativeFile _get_native_file(object source, c_bool use_memory_map):
 *     try:
 *         source_path = _stringify_path(source)             # <<<<<<<<<<<<<<
 *     except TypeError:
 *         if isinstance(source, Buffer):
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_stringify_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1388, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_source);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1388, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_source_path = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "pyarrow/io.pxi":1387
 * 
 * cdef NativeFile _get_native_file(object source, c_bool use_memory_map):
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
    }

    /* "pyarrow/io.pxi":1396
 *             source = PythonFile(source, mode='r')
 *     else:
 *         if use_memory_map:             # <<<<<<<<<<<<<<
 *             source = memory_map(source_path, mode='r')
 *         else:
 */
    /*else:*/ {
      __pyx_t_7 = (__pyx_v_use_memory_map != 0);
      if (__pyx_t_7) {

        /* "pyarrow/io.pxi":1397
 *     else:
 *         if use_memory_map:
 *             source = memory_map(source_path, mode='r')             # <<<<<<<<<<<<<<
 *         else:
 *             source = OSFile(source_path, mode='r')
 */
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_memory_map); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1397, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1397, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_v_source_path);
        __Pyx_GIVEREF(__pyx_v_source_path);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_source_path);
        __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 1397, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_mode, __pyx_n_u_r) < 0) __PYX_ERR(7, 1397, __pyx_L5_except_error)
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1397, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_8);
        __pyx_t_8 = 0;

        /* "pyarrow/io.pxi":1396
 *             source = PythonFile(source, mode='r')
 *     else:
 *         if use_memory_map:             # <<<<<<<<<<<<<<
 *             source = memory_map(source_path, mode='r')
 *         else:
 */
        goto __pyx_L9;
      }

      /* "pyarrow/io.pxi":1399
 *             source = memory_map(source_path, mode='r')
 *         else:
 *             source = OSFile(source_path, mode='r')             # <<<<<<<<<<<<<<
 * 
 *     return source
 */
      /*else*/ {
        __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1399, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_v_source_path);
        __Pyx_GIVEREF(__pyx_v_source_path);
        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_source_path);
        __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 1399, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_mode, __pyx_n_u_r) < 0) __PYX_ERR(7, 1399, __pyx_L5_except_error)
        __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pyarrow_3lib_OSFile), __pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1399, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_5);
        __pyx_t_5 = 0;
      }
      __pyx_L9:;
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/io.pxi":1389
 *     try:
 *         source_path = _stringify_path(source)
 *     except TypeError:             # <<<<<<<<<<<<<<
 *         if isinstance(source, Buffer):
 *             source = BufferReader(source)
 */
    __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_9) {
      __Pyx_AddTraceback("pyarrow.lib._get_native_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_8) < 0) __PYX_ERR(7, 1389, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_8);

      /* "pyarrow/io.pxi":1390
 *         source_path = _stringify_path(source)
 *     except TypeError:
 *         if isinstance(source, Buffer):             # <<<<<<<<<<<<<<
 *             source = BufferReader(source)
 *         elif not isinstance(source, NativeFile) and hasattr(source, 'read'):
 */
      __pyx_t_7 = __Pyx_TypeCheck(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_Buffer); 
      __pyx_t_10 = (__pyx_t_7 != 0);
      if (__pyx_t_10) {

        /* "pyarrow/io.pxi":1391
 *     except TypeError:
 *         if isinstance(source, Buffer):
 *             source = BufferReader(source)             # <<<<<<<<<<<<<<
 *         elif not isinstance(source, NativeFile) and hasattr(source, 'read'):
 *             # Optimistically hope this is file-like
 */
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_BufferReader), __pyx_v_source); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1391, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "pyarrow/io.pxi":1390
 *         source_path = _stringify_path(source)
 *     except TypeError:
 *         if isinstance(source, Buffer):             # <<<<<<<<<<<<<<
 *             source = BufferReader(source)
 *         elif not isinstance(source, NativeFile) and hasattr(source, 'read'):
 */
        goto __pyx_L12;
      }

      /* "pyarrow/io.pxi":1392
 *         if isinstance(source, Buffer):
 *             source = BufferReader(source)
 *         elif not isinstance(source, NativeFile) and hasattr(source, 'read'):             # <<<<<<<<<<<<<<
 *             # Optimistically hope this is file-like
 *             source = PythonFile(source, mode='r')
 */
      __pyx_t_7 = __Pyx_TypeCheck(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_NativeFile); 
      __pyx_t_11 = ((!(__pyx_t_7 != 0)) != 0);
      if (__pyx_t_11) {
      } else {
        __pyx_t_10 = __pyx_t_11;
        goto __pyx_L13_bool_binop_done;
      }
      __pyx_t_11 = __Pyx_HasAttr(__pyx_v_source, __pyx_n_u_read); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(7, 1392, __pyx_L5_except_error)
      __pyx_t_7 = (__pyx_t_11 != 0);
      __pyx_t_10 = __pyx_t_7;
      __pyx_L13_bool_binop_done:;
      if (__pyx_t_10) {

        /* "pyarrow/io.pxi":1394
 *         elif not isinstance(source, NativeFile) and hasattr(source, 'read'):
 *             # Optimistically hope this is file-like
 *             source = PythonFile(source, mode='r')             # <<<<<<<<<<<<<<
 *     else:
 *         if use_memory_map:
 */
        __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1394, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_v_source);
        __Pyx_GIVEREF(__pyx_v_source);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_source);
        __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(7, 1394, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_12);
        if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_mode, __pyx_n_u_r) < 0) __PYX_ERR(7, 1394, __pyx_L5_except_error)
        __pyx_t_13 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pyarrow_3lib_PythonFile), __pyx_t_4, __pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(7, 1394, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_13);
        __pyx_t_13 = 0;

        /* "pyarrow/io.pxi":1392
 *         if isinstance(source, Buffer):
 *             source = BufferReader(source)
 *         elif not isinstance(source, NativeFile) and hasattr(source, 'read'):             # <<<<<<<<<<<<<<
 *             # Optimistically hope this is file-like
 *             source = PythonFile(source, mode='r')
 */
      }
      __pyx_L12:;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/io.pxi":1387
 * 
 * cdef NativeFile _get_native_file(object source, c_bool use_memory_map):
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "pyarrow/io.pxi":1401
 *             source = OSFile(source_path, mode='r')
 * 
 *     return source             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  if (!(likely(((__pyx_v_source) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_NativeFile))))) __PYX_ERR(7, 1401, __pyx_L1_error)
  __Pyx_INCREF(__pyx_v_source);
  __pyx_r = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_source);
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1386
 * 
 * 
 * cdef NativeFile _get_native_file(object source, c_bool use_memory_map):             # <<<<<<<<<<<<<<
 *     try:
 *         source_path = _stringify_path(source)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("pyarrow.lib._get_native_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_source_path);
  __Pyx_XDECREF(__pyx_v_source);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1404
 * 
 * 
 * cdef get_reader(object source, c_bool use_memory_map,             # <<<<<<<<<<<<<<
 *                 shared_ptr[CRandomAccessFile]* reader):
 *     cdef NativeFile nf
 */

static PyObject *__pyx_f_7pyarrow_3lib_get_reader(PyObject *__pyx_v_source, bool __pyx_v_use_memory_map, std::shared_ptr< arrow::io::RandomAccessFile>  *__pyx_v_reader) {
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_nf = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  std::shared_ptr< arrow::io::RandomAccessFile>  __pyx_t_2;
  __Pyx_RefNannySetupContext("get_reader", 0);

  /* "pyarrow/io.pxi":1408
 *     cdef NativeFile nf
 * 
 *     nf = _get_native_file(source, use_memory_map)             # <<<<<<<<<<<<<<
 *     reader[0] = nf.get_random_access_file()
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib__get_native_file(__pyx_v_source, __pyx_v_use_memory_map)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_nf = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":1409
 * 
 *     nf = _get_native_file(source, use_memory_map)
 *     reader[0] = nf.get_random_access_file()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_nf->__pyx_vtab)->get_random_access_file(__pyx_v_nf); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 1409, __pyx_L1_error)
  (__pyx_v_reader[0]) = __pyx_t_2;

  /* "pyarrow/io.pxi":1404
 * 
 * 
 * cdef get_reader(object source, c_bool use_memory_map,             # <<<<<<<<<<<<<<
 *                 shared_ptr[CRandomAccessFile]* reader):
 *     cdef NativeFile nf
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.get_reader", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_nf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1412
 * 
 * 
 * cdef get_input_stream(object source, c_bool use_memory_map,             # <<<<<<<<<<<<<<
 *                       shared_ptr[CInputStream]* out):
 *     """
 */

static PyObject *__pyx_f_7pyarrow_3lib_get_input_stream(PyObject *__pyx_v_source, bool __pyx_v_use_memory_map, std::shared_ptr< arrow::io::InputStream>  *__pyx_v_out) {
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_nf = 0;
  std::unique_ptr< arrow::util::Codec>  __pyx_v_codec;
  std::shared_ptr< arrow::io::InputStream>  __pyx_v_input_stream;
  enum  arrow::Compression::type __pyx_v_compression_type;
  PyObject *__pyx_v_source_path = NULL;
  PyObject *__pyx_v_compression = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  enum  arrow::Compression::type __pyx_t_8;
  std::shared_ptr< arrow::io::InputStream>  __pyx_t_9;
  int __pyx_t_10;
  std::unique_ptr< arrow::util::Codec>  __pyx_t_11;
  std::shared_ptr< arrow::io::CompressedInputStream>  __pyx_t_12;
  __Pyx_RefNannySetupContext("get_input_stream", 0);

  /* "pyarrow/io.pxi":1424
 *         CompressionType compression_type
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "pyarrow/io.pxi":1425
 * 
 *     try:
 *         source_path = _stringify_path(source)             # <<<<<<<<<<<<<<
 *     except TypeError:
 *         compression = None
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_stringify_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1425, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_source);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1425, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_source_path = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "pyarrow/io.pxi":1424
 *         CompressionType compression_type
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
    }

    /* "pyarrow/io.pxi":1429
 *         compression = None
 *     else:
 *         compression = _detect_compression(source_path)             # <<<<<<<<<<<<<<
 * 
 *     compression_type = _get_compression_type(compression)
 */
    /*else:*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_detect_compression); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1429, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_source_path) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_source_path);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1429, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_compression = __pyx_t_4;
      __pyx_t_4 = 0;
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/io.pxi":1426
 *     try:
 *         source_path = _stringify_path(source)
 *     except TypeError:             # <<<<<<<<<<<<<<
 *         compression = None
 *     else:
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("pyarrow.lib.get_input_stream", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(7, 1426, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);

      /* "pyarrow/io.pxi":1427
 *         source_path = _stringify_path(source)
 *     except TypeError:
 *         compression = None             # <<<<<<<<<<<<<<
 *     else:
 *         compression = _detect_compression(source_path)
 */
      __Pyx_INCREF(Py_None);
      __pyx_v_compression = Py_None;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/io.pxi":1424
 *         CompressionType compression_type
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "pyarrow/io.pxi":1431
 *         compression = _detect_compression(source_path)
 * 
 *     compression_type = _get_compression_type(compression)             # <<<<<<<<<<<<<<
 *     nf = _get_native_file(source, use_memory_map)
 *     input_stream = nf.get_input_stream()
 */
  __pyx_t_8 = __pyx_f_7pyarrow_3lib__get_compression_type(__pyx_v_compression); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 1431, __pyx_L1_error)
  __pyx_v_compression_type = __pyx_t_8;

  /* "pyarrow/io.pxi":1432
 * 
 *     compression_type = _get_compression_type(compression)
 *     nf = _get_native_file(source, use_memory_map)             # <<<<<<<<<<<<<<
 *     input_stream = nf.get_input_stream()
 * 
 */
  __pyx_t_6 = ((PyObject *)__pyx_f_7pyarrow_3lib__get_native_file(__pyx_v_source, __pyx_v_use_memory_map)); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 1432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_v_nf = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pyarrow/io.pxi":1433
 *     compression_type = _get_compression_type(compression)
 *     nf = _get_native_file(source, use_memory_map)
 *     input_stream = nf.get_input_stream()             # <<<<<<<<<<<<<<
 * 
 *     if compression_type != CompressionType_UNCOMPRESSED:
 */
  __pyx_t_9 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_nf->__pyx_vtab)->get_input_stream(__pyx_v_nf); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 1433, __pyx_L1_error)
  __pyx_v_input_stream = __pyx_t_9;

  /* "pyarrow/io.pxi":1435
 *     input_stream = nf.get_input_stream()
 * 
 *     if compression_type != CompressionType_UNCOMPRESSED:             # <<<<<<<<<<<<<<
 *         codec = move(GetResultValue(CCodec.Create(compression_type)))
 *         input_stream = <shared_ptr[CInputStream]> GetResultValue(
 */
  __pyx_t_10 = ((__pyx_v_compression_type !=  arrow::Compression::UNCOMPRESSED) != 0);
  if (__pyx_t_10) {

    /* "pyarrow/io.pxi":1436
 * 
 *     if compression_type != CompressionType_UNCOMPRESSED:
 *         codec = move(GetResultValue(CCodec.Create(compression_type)))             # <<<<<<<<<<<<<<
 *         input_stream = <shared_ptr[CInputStream]> GetResultValue(
 *             CCompressedInputStream.Make(codec.get(), input_stream))
 */
    __pyx_t_11 = arrow::py::GetResultValue<std::unique_ptr< arrow::util::Codec> >( arrow::util::Codec::Create(__pyx_v_compression_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 1436, __pyx_L1_error)
    __pyx_v_codec =  cymove::cymove<std::unique_ptr< arrow::util::Codec> >(__pyx_t_11);

    /* "pyarrow/io.pxi":1437
 *     if compression_type != CompressionType_UNCOMPRESSED:
 *         codec = move(GetResultValue(CCodec.Create(compression_type)))
 *         input_stream = <shared_ptr[CInputStream]> GetResultValue(             # <<<<<<<<<<<<<<
 *             CCompressedInputStream.Make(codec.get(), input_stream))
 * 
 */
    __pyx_t_12 = arrow::py::GetResultValue<std::shared_ptr< arrow::io::CompressedInputStream> >( arrow::io::CompressedInputStream::Make(__pyx_v_codec.get(), __pyx_v_input_stream)); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 1437, __pyx_L1_error)
    __pyx_v_input_stream = ((std::shared_ptr< arrow::io::InputStream> )__pyx_t_12);

    /* "pyarrow/io.pxi":1435
 *     input_stream = nf.get_input_stream()
 * 
 *     if compression_type != CompressionType_UNCOMPRESSED:             # <<<<<<<<<<<<<<
 *         codec = move(GetResultValue(CCodec.Create(compression_type)))
 *         input_stream = <shared_ptr[CInputStream]> GetResultValue(
 */
  }

  /* "pyarrow/io.pxi":1440
 *             CCompressedInputStream.Make(codec.get(), input_stream))
 * 
 *     out[0] = input_stream             # <<<<<<<<<<<<<<
 * 
 * 
 */
  (__pyx_v_out[0]) = __pyx_v_input_stream;

  /* "pyarrow/io.pxi":1412
 * 
 * 
 * cdef get_input_stream(object source, c_bool use_memory_map,             # <<<<<<<<<<<<<<
 *                       shared_ptr[CInputStream]* out):
 *     """
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.get_input_stream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_nf);
  __Pyx_XDECREF(__pyx_v_source_path);
  __Pyx_XDECREF(__pyx_v_compression);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1443
 * 
 * 
 * cdef get_writer(object source, shared_ptr[COutputStream]* writer):             # <<<<<<<<<<<<<<
 *     cdef NativeFile nf
 * 
 */

static PyObject *__pyx_f_7pyarrow_3lib_get_writer(PyObject *__pyx_v_source, std::shared_ptr< arrow::io::OutputStream>  *__pyx_v_writer) {
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_nf = 0;
  PyObject *__pyx_v_source_path = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  std::shared_ptr< arrow::io::OutputStream>  __pyx_t_14;
  __Pyx_RefNannySetupContext("get_writer", 0);
  __Pyx_INCREF(__pyx_v_source);

  /* "pyarrow/io.pxi":1446
 *     cdef NativeFile nf
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "pyarrow/io.pxi":1447
 * 
 *     try:
 *         source_path = _stringify_path(source)             # <<<<<<<<<<<<<<
 *     except TypeError:
 *         if not isinstance(source, NativeFile) and hasattr(source, 'write'):
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_stringify_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1447, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_source);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1447, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_source_path = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "pyarrow/io.pxi":1446
 *     cdef NativeFile nf
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
    }

    /* "pyarrow/io.pxi":1453
 *             source = PythonFile(source, mode='w')
 *     else:
 *         source = OSFile(source_path, mode='w')             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(source, NativeFile):
 */
    /*else:*/ {
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1453, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_source_path);
      __Pyx_GIVEREF(__pyx_v_source_path);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_source_path);
      __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1453, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_mode, __pyx_n_u_w) < 0) __PYX_ERR(7, 1453, __pyx_L5_except_error)
      __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pyarrow_3lib_OSFile), __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 1453, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_6);
      __pyx_t_6 = 0;
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/io.pxi":1448
 *     try:
 *         source_path = _stringify_path(source)
 *     except TypeError:             # <<<<<<<<<<<<<<
 *         if not isinstance(source, NativeFile) and hasattr(source, 'write'):
 *             # Optimistically hope this is file-like
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("pyarrow.lib.get_writer", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) __PYX_ERR(7, 1448, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_4);

      /* "pyarrow/io.pxi":1449
 *         source_path = _stringify_path(source)
 *     except TypeError:
 *         if not isinstance(source, NativeFile) and hasattr(source, 'write'):             # <<<<<<<<<<<<<<
 *             # Optimistically hope this is file-like
 *             source = PythonFile(source, mode='w')
 */
      __pyx_t_9 = __Pyx_TypeCheck(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_NativeFile); 
      __pyx_t_10 = ((!(__pyx_t_9 != 0)) != 0);
      if (__pyx_t_10) {
      } else {
        __pyx_t_8 = __pyx_t_10;
        goto __pyx_L12_bool_binop_done;
      }
      __pyx_t_10 = __Pyx_HasAttr(__pyx_v_source, __pyx_n_u_write); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(7, 1449, __pyx_L5_except_error)
      __pyx_t_9 = (__pyx_t_10 != 0);
      __pyx_t_8 = __pyx_t_9;
      __pyx_L12_bool_binop_done:;
      if (__pyx_t_8) {

        /* "pyarrow/io.pxi":1451
 *         if not isinstance(source, NativeFile) and hasattr(source, 'write'):
 *             # Optimistically hope this is file-like
 *             source = PythonFile(source, mode='w')             # <<<<<<<<<<<<<<
 *     else:
 *         source = OSFile(source_path, mode='w')
 */
        __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(7, 1451, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_INCREF(__pyx_v_source);
        __Pyx_GIVEREF(__pyx_v_source);
        PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_source);
        __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(7, 1451, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_12);
        if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_mode, __pyx_n_u_w) < 0) __PYX_ERR(7, 1451, __pyx_L5_except_error)
        __pyx_t_13 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pyarrow_3lib_PythonFile), __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(7, 1451, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_13);
        __pyx_t_13 = 0;

        /* "pyarrow/io.pxi":1449
 *         source_path = _stringify_path(source)
 *     except TypeError:
 *         if not isinstance(source, NativeFile) and hasattr(source, 'write'):             # <<<<<<<<<<<<<<
 *             # Optimistically hope this is file-like
 *             source = PythonFile(source, mode='w')
 */
      }
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/io.pxi":1446
 *     cdef NativeFile nf
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "pyarrow/io.pxi":1455
 *         source = OSFile(source_path, mode='w')
 * 
 *     if isinstance(source, NativeFile):             # <<<<<<<<<<<<<<
 *         nf = source
 *         writer[0] = nf.get_output_stream()
 */
  __pyx_t_8 = __Pyx_TypeCheck(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_NativeFile); 
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (likely(__pyx_t_9)) {

    /* "pyarrow/io.pxi":1456
 * 
 *     if isinstance(source, NativeFile):
 *         nf = source             # <<<<<<<<<<<<<<
 *         writer[0] = nf.get_output_stream()
 *     else:
 */
    if (!(likely(((__pyx_v_source) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_NativeFile))))) __PYX_ERR(7, 1456, __pyx_L1_error)
    __pyx_t_4 = __pyx_v_source;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_nf = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/io.pxi":1457
 *     if isinstance(source, NativeFile):
 *         nf = source
 *         writer[0] = nf.get_output_stream()             # <<<<<<<<<<<<<<
 *     else:
 *         raise TypeError('Unable to read from object of type: {0}'
 */
    __pyx_t_14 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_nf->__pyx_vtab)->get_output_stream(__pyx_v_nf); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 1457, __pyx_L1_error)
    (__pyx_v_writer[0]) = __pyx_t_14;

    /* "pyarrow/io.pxi":1455
 *         source = OSFile(source_path, mode='w')
 * 
 *     if isinstance(source, NativeFile):             # <<<<<<<<<<<<<<
 *         nf = source
 *         writer[0] = nf.get_output_stream()
 */
    goto __pyx_L14;
  }

  /* "pyarrow/io.pxi":1459
 *         writer[0] = nf.get_output_stream()
 *     else:
 *         raise TypeError('Unable to read from object of type: {0}'             # <<<<<<<<<<<<<<
 *                         .format(type(source)))
 * 
 */
  /*else*/ {

    /* "pyarrow/io.pxi":1460
 *     else:
 *         raise TypeError('Unable to read from object of type: {0}'
 *                         .format(type(source)))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Unable_to_read_from_object_of_ty, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1460, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, ((PyObject *)Py_TYPE(__pyx_v_source))) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)Py_TYPE(__pyx_v_source)));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1460, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "pyarrow/io.pxi":1459
 *         writer[0] = nf.get_output_stream()
 *     else:
 *         raise TypeError('Unable to read from object of type: {0}'             # <<<<<<<<<<<<<<
 *                         .format(type(source)))
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1459, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(7, 1459, __pyx_L1_error)
  }
  __pyx_L14:;

  /* "pyarrow/io.pxi":1443
 * 
 * 
 * cdef get_writer(object source, shared_ptr[COutputStream]* writer):             # <<<<<<<<<<<<<<
 *     cdef NativeFile nf
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("pyarrow.lib.get_writer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_nf);
  __Pyx_XDECREF(__pyx_v_source_path);
  __Pyx_XDECREF(__pyx_v_source);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1465
 * # ---------------------------------------------------------------------
 * 
 * cdef CompressionType _get_compression_type(object name) except *:             # <<<<<<<<<<<<<<
 *     if name is None or name == 'uncompressed':
 *         return CompressionType_UNCOMPRESSED
 */

static enum  arrow::Compression::type __pyx_f_7pyarrow_3lib__get_compression_type(PyObject *__pyx_v_name) {
  enum  arrow::Compression::type __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("_get_compression_type", 0);

  /* "pyarrow/io.pxi":1466
 * 
 * cdef CompressionType _get_compression_type(object name) except *:
 *     if name is None or name == 'uncompressed':             # <<<<<<<<<<<<<<
 *         return CompressionType_UNCOMPRESSED
 *     elif name == 'bz2':
 */
  __pyx_t_2 = (__pyx_v_name == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_name, __pyx_n_u_uncompressed, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(7, 1466, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":1467
 * cdef CompressionType _get_compression_type(object name) except *:
 *     if name is None or name == 'uncompressed':
 *         return CompressionType_UNCOMPRESSED             # <<<<<<<<<<<<<<
 *     elif name == 'bz2':
 *         return CompressionType_BZ2
 */
    __pyx_r =  arrow::Compression::UNCOMPRESSED;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":1466
 * 
 * cdef CompressionType _get_compression_type(object name) except *:
 *     if name is None or name == 'uncompressed':             # <<<<<<<<<<<<<<
 *         return CompressionType_UNCOMPRESSED
 *     elif name == 'bz2':
 */
  }

  /* "pyarrow/io.pxi":1468
 *     if name is None or name == 'uncompressed':
 *         return CompressionType_UNCOMPRESSED
 *     elif name == 'bz2':             # <<<<<<<<<<<<<<
 *         return CompressionType_BZ2
 *     elif name == 'brotli':
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_name, __pyx_n_u_bz2, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(7, 1468, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":1469
 *         return CompressionType_UNCOMPRESSED
 *     elif name == 'bz2':
 *         return CompressionType_BZ2             # <<<<<<<<<<<<<<
 *     elif name == 'brotli':
 *         return CompressionType_BROTLI
 */
    __pyx_r =  arrow::Compression::BZ2;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":1468
 *     if name is None or name == 'uncompressed':
 *         return CompressionType_UNCOMPRESSED
 *     elif name == 'bz2':             # <<<<<<<<<<<<<<
 *         return CompressionType_BZ2
 *     elif name == 'brotli':
 */
  }

  /* "pyarrow/io.pxi":1470
 *     elif name == 'bz2':
 *         return CompressionType_BZ2
 *     elif name == 'brotli':             # <<<<<<<<<<<<<<
 *         return CompressionType_BROTLI
 *     elif name == 'gzip':
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_name, __pyx_n_u_brotli, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(7, 1470, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":1471
 *         return CompressionType_BZ2
 *     elif name == 'brotli':
 *         return CompressionType_BROTLI             # <<<<<<<<<<<<<<
 *     elif name == 'gzip':
 *         return CompressionType_GZIP
 */
    __pyx_r =  arrow::Compression::BROTLI;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":1470
 *     elif name == 'bz2':
 *         return CompressionType_BZ2
 *     elif name == 'brotli':             # <<<<<<<<<<<<<<
 *         return CompressionType_BROTLI
 *     elif name == 'gzip':
 */
  }

  /* "pyarrow/io.pxi":1472
 *     elif name == 'brotli':
 *         return CompressionType_BROTLI
 *     elif name == 'gzip':             # <<<<<<<<<<<<<<
 *         return CompressionType_GZIP
 *     elif name == 'lz4':
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_name, __pyx_n_u_gzip, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(7, 1472, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":1473
 *         return CompressionType_BROTLI
 *     elif name == 'gzip':
 *         return CompressionType_GZIP             # <<<<<<<<<<<<<<
 *     elif name == 'lz4':
 *         return CompressionType_LZ4
 */
    __pyx_r =  arrow::Compression::GZIP;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":1472
 *     elif name == 'brotli':
 *         return CompressionType_BROTLI
 *     elif name == 'gzip':             # <<<<<<<<<<<<<<
 *         return CompressionType_GZIP
 *     elif name == 'lz4':
 */
  }

  /* "pyarrow/io.pxi":1474
 *     elif name == 'gzip':
 *         return CompressionType_GZIP
 *     elif name == 'lz4':             # <<<<<<<<<<<<<<
 *         return CompressionType_LZ4
 *     elif name == 'snappy':
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_name, __pyx_n_u_lz4, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(7, 1474, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":1475
 *         return CompressionType_GZIP
 *     elif name == 'lz4':
 *         return CompressionType_LZ4             # <<<<<<<<<<<<<<
 *     elif name == 'snappy':
 *         return CompressionType_SNAPPY
 */
    __pyx_r =  arrow::Compression::LZ4;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":1474
 *     elif name == 'gzip':
 *         return CompressionType_GZIP
 *     elif name == 'lz4':             # <<<<<<<<<<<<<<
 *         return CompressionType_LZ4
 *     elif name == 'snappy':
 */
  }

  /* "pyarrow/io.pxi":1476
 *     elif name == 'lz4':
 *         return CompressionType_LZ4
 *     elif name == 'snappy':             # <<<<<<<<<<<<<<
 *         return CompressionType_SNAPPY
 *     elif name == 'zstd':
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_name, __pyx_n_u_snappy, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(7, 1476, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":1477
 *         return CompressionType_LZ4
 *     elif name == 'snappy':
 *         return CompressionType_SNAPPY             # <<<<<<<<<<<<<<
 *     elif name == 'zstd':
 *         return CompressionType_ZSTD
 */
    __pyx_r =  arrow::Compression::SNAPPY;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":1476
 *     elif name == 'lz4':
 *         return CompressionType_LZ4
 *     elif name == 'snappy':             # <<<<<<<<<<<<<<
 *         return CompressionType_SNAPPY
 *     elif name == 'zstd':
 */
  }

  /* "pyarrow/io.pxi":1478
 *     elif name == 'snappy':
 *         return CompressionType_SNAPPY
 *     elif name == 'zstd':             # <<<<<<<<<<<<<<
 *         return CompressionType_ZSTD
 *     else:
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_name, __pyx_n_u_zstd, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(7, 1478, __pyx_L1_error)
  if (likely(__pyx_t_1)) {

    /* "pyarrow/io.pxi":1479
 *         return CompressionType_SNAPPY
 *     elif name == 'zstd':
 *         return CompressionType_ZSTD             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError('Unrecognized compression type: {}'.format(name))
 */
    __pyx_r =  arrow::Compression::ZSTD;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":1478
 *     elif name == 'snappy':
 *         return CompressionType_SNAPPY
 *     elif name == 'zstd':             # <<<<<<<<<<<<<<
 *         return CompressionType_ZSTD
 *     else:
 */
  }

  /* "pyarrow/io.pxi":1481
 *         return CompressionType_ZSTD
 *     else:
 *         raise ValueError('Unrecognized compression type: {}'.format(name))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Unrecognized_compression_type, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1481, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_name);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1481, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1481, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(7, 1481, __pyx_L1_error)
  }

  /* "pyarrow/io.pxi":1465
 * # ---------------------------------------------------------------------
 * 
 * cdef CompressionType _get_compression_type(object name) except *:             # <<<<<<<<<<<<<<
 *     if name is None or name == 'uncompressed':
 *         return CompressionType_UNCOMPRESSED
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib._get_compression_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = (enum  arrow::Compression::type) 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1484
 * 
 * 
 * def _detect_compression(path):             # <<<<<<<<<<<<<<
 *     if isinstance(path, six.string_types):
 *         if path.endswith('.bz2'):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_171_detect_compression(PyObject *__pyx_self, PyObject *__pyx_v_path); /*proto*/
static char __pyx_doc_7pyarrow_3lib_170_detect_compression[] = "_detect_compression(path)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_171_detect_compression = {"_detect_compression", (PyCFunction)__pyx_pw_7pyarrow_3lib_171_detect_compression, METH_O, __pyx_doc_7pyarrow_3lib_170_detect_compression};
static PyObject *__pyx_pw_7pyarrow_3lib_171_detect_compression(PyObject *__pyx_self, PyObject *__pyx_v_path) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_detect_compression (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_170_detect_compression(__pyx_self, ((PyObject *)__pyx_v_path));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_170_detect_compression(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("_detect_compression", 0);

  /* "pyarrow/io.pxi":1485
 * 
 * def _detect_compression(path):
 *     if isinstance(path, six.string_types):             # <<<<<<<<<<<<<<
 *         if path.endswith('.bz2'):
 *             return 'bz2'
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_six); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1485, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_string_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1485, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_path, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 1485, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "pyarrow/io.pxi":1486
 * def _detect_compression(path):
 *     if isinstance(path, six.string_types):
 *         if path.endswith('.bz2'):             # <<<<<<<<<<<<<<
 *             return 'bz2'
 *         elif path.endswith('.gz'):
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_path, __pyx_n_s_endswith); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1486, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_kp_u_bz2_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_kp_u_bz2_2);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1486, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(7, 1486, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_4) {

      /* "pyarrow/io.pxi":1487
 *     if isinstance(path, six.string_types):
 *         if path.endswith('.bz2'):
 *             return 'bz2'             # <<<<<<<<<<<<<<
 *         elif path.endswith('.gz'):
 *             return 'gzip'
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_n_u_bz2);
      __pyx_r = __pyx_n_u_bz2;
      goto __pyx_L0;

      /* "pyarrow/io.pxi":1486
 * def _detect_compression(path):
 *     if isinstance(path, six.string_types):
 *         if path.endswith('.bz2'):             # <<<<<<<<<<<<<<
 *             return 'bz2'
 *         elif path.endswith('.gz'):
 */
    }

    /* "pyarrow/io.pxi":1488
 *         if path.endswith('.bz2'):
 *             return 'bz2'
 *         elif path.endswith('.gz'):             # <<<<<<<<<<<<<<
 *             return 'gzip'
 *         elif path.endswith('.lz4'):
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_path, __pyx_n_s_endswith); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1488, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_kp_u_gz) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_kp_u_gz);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1488, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(7, 1488, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_4) {

      /* "pyarrow/io.pxi":1489
 *             return 'bz2'
 *         elif path.endswith('.gz'):
 *             return 'gzip'             # <<<<<<<<<<<<<<
 *         elif path.endswith('.lz4'):
 *             return 'lz4'
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_n_u_gzip);
      __pyx_r = __pyx_n_u_gzip;
      goto __pyx_L0;

      /* "pyarrow/io.pxi":1488
 *         if path.endswith('.bz2'):
 *             return 'bz2'
 *         elif path.endswith('.gz'):             # <<<<<<<<<<<<<<
 *             return 'gzip'
 *         elif path.endswith('.lz4'):
 */
    }

    /* "pyarrow/io.pxi":1490
 *         elif path.endswith('.gz'):
 *             return 'gzip'
 *         elif path.endswith('.lz4'):             # <<<<<<<<<<<<<<
 *             return 'lz4'
 *         elif path.endswith('.zst'):
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_path, __pyx_n_s_endswith); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1490, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_kp_u_lz4_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_kp_u_lz4_2);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1490, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(7, 1490, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_4) {

      /* "pyarrow/io.pxi":1491
 *             return 'gzip'
 *         elif path.endswith('.lz4'):
 *             return 'lz4'             # <<<<<<<<<<<<<<
 *         elif path.endswith('.zst'):
 *             return 'zstd'
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_n_u_lz4);
      __pyx_r = __pyx_n_u_lz4;
      goto __pyx_L0;

      /* "pyarrow/io.pxi":1490
 *         elif path.endswith('.gz'):
 *             return 'gzip'
 *         elif path.endswith('.lz4'):             # <<<<<<<<<<<<<<
 *             return 'lz4'
 *         elif path.endswith('.zst'):
 */
    }

    /* "pyarrow/io.pxi":1492
 *         elif path.endswith('.lz4'):
 *             return 'lz4'
 *         elif path.endswith('.zst'):             # <<<<<<<<<<<<<<
 *             return 'zstd'
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_path, __pyx_n_s_endswith); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1492, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_kp_u_zst) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_kp_u_zst);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1492, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(7, 1492, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_4) {

      /* "pyarrow/io.pxi":1493
 *             return 'lz4'
 *         elif path.endswith('.zst'):
 *             return 'zstd'             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_n_u_zstd);
      __pyx_r = __pyx_n_u_zstd;
      goto __pyx_L0;

      /* "pyarrow/io.pxi":1492
 *         elif path.endswith('.lz4'):
 *             return 'lz4'
 *         elif path.endswith('.zst'):             # <<<<<<<<<<<<<<
 *             return 'zstd'
 * 
 */
    }

    /* "pyarrow/io.pxi":1485
 * 
 * def _detect_compression(path):
 *     if isinstance(path, six.string_types):             # <<<<<<<<<<<<<<
 *         if path.endswith('.bz2'):
 *             return 'bz2'
 */
  }

  /* "pyarrow/io.pxi":1484
 * 
 * 
 * def _detect_compression(path):             # <<<<<<<<<<<<<<
 *     if isinstance(path, six.string_types):
 *         if path.endswith('.bz2'):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib._detect_compression", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1496
 * 
 * 
 * def compress(object buf, codec='lz4', asbytes=False, memory_pool=None):             # <<<<<<<<<<<<<<
 *     """
 *     Compress data from buffer-like object.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_173compress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_172compress[] = "compress(buf, codec=u'lz4', asbytes=False, memory_pool=None)\n\n    Compress data from buffer-like object.\n\n    Parameters\n    ----------\n    buf : pyarrow.Buffer, bytes, or other object supporting buffer protocol\n    codec : string, default 'lz4'\n        Compression codec.\n        Supported types: {'brotli, 'gzip', 'lz4', 'snappy', 'zstd'}\n    asbytes : boolean, default False\n        Return result as Python bytes object, otherwise Buffer\n    memory_pool : MemoryPool, default None\n        Memory pool to use for buffer allocations, if any\n\n    Returns\n    -------\n    compressed : pyarrow.Buffer or bytes (if asbytes=True)\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_173compress = {"compress", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_173compress, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_172compress};
static PyObject *__pyx_pw_7pyarrow_3lib_173compress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_buf = 0;
  PyObject *__pyx_v_codec = 0;
  PyObject *__pyx_v_asbytes = 0;
  PyObject *__pyx_v_memory_pool = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("compress (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_buf,&__pyx_n_s_codec,&__pyx_n_s_asbytes,&__pyx_n_s_memory_pool,0};
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)__pyx_n_u_lz4);
    values[2] = ((PyObject *)Py_False);
    values[3] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buf)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_codec);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_asbytes);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compress") < 0)) __PYX_ERR(7, 1496, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_buf = values[0];
    __pyx_v_codec = values[1];
    __pyx_v_asbytes = values[2];
    __pyx_v_memory_pool = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("compress", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 1496, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_172compress(__pyx_self, __pyx_v_buf, __pyx_v_codec, __pyx_v_asbytes, __pyx_v_memory_pool);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_172compress(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_buf, PyObject *__pyx_v_codec, PyObject *__pyx_v_asbytes, PyObject *__pyx_v_memory_pool) {
  enum  arrow::Compression::type __pyx_v_compression_type;
  std::unique_ptr< arrow::util::Codec>  __pyx_v_c_codec;
  std::shared_ptr< arrow::Buffer>  __pyx_v_owned_buf;
   arrow::Buffer *__pyx_v_c_buf;
  PyObject *__pyx_v_pyobj;
  struct __pyx_obj_7pyarrow_3lib_ResizableBuffer *__pyx_v_out_buf = 0;
  int64_t __pyx_v_max_output_size;
  uint8_t *__pyx_v_output_buffer;
  int64_t __pyx_v_output_length;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  enum  arrow::Compression::type __pyx_t_1;
  std::unique_ptr< arrow::util::Codec>  __pyx_t_2;
  std::shared_ptr< arrow::Buffer>  __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int64_t __pyx_t_10;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("compress", 0);

  /* "pyarrow/io.pxi":1516
 *     """
 *     cdef:
 *         CompressionType compression_type = _get_compression_type(codec)             # <<<<<<<<<<<<<<
 *         unique_ptr[CCodec] c_codec
 *         cdef shared_ptr[CBuffer] owned_buf
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__get_compression_type(__pyx_v_codec); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 1516, __pyx_L1_error)
  __pyx_v_compression_type = __pyx_t_1;

  /* "pyarrow/io.pxi":1523
 *         cdef ResizableBuffer out_buf
 * 
 *     c_codec = move(GetResultValue(CCodec.Create(compression_type)))             # <<<<<<<<<<<<<<
 * 
 *     owned_buf = as_c_buffer(buf)
 */
  __pyx_t_2 = arrow::py::GetResultValue<std::unique_ptr< arrow::util::Codec> >( arrow::util::Codec::Create(__pyx_v_compression_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 1523, __pyx_L1_error)
  __pyx_v_c_codec =  cymove::cymove<std::unique_ptr< arrow::util::Codec> >(__pyx_t_2);

  /* "pyarrow/io.pxi":1525
 *     c_codec = move(GetResultValue(CCodec.Create(compression_type)))
 * 
 *     owned_buf = as_c_buffer(buf)             # <<<<<<<<<<<<<<
 *     c_buf = owned_buf.get()
 * 
 */
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_as_c_buffer(__pyx_v_buf); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 1525, __pyx_L1_error)
  __pyx_v_owned_buf = __pyx_t_3;

  /* "pyarrow/io.pxi":1526
 * 
 *     owned_buf = as_c_buffer(buf)
 *     c_buf = owned_buf.get()             # <<<<<<<<<<<<<<
 * 
 *     cdef int64_t max_output_size = (c_codec.get()
 */
  __pyx_v_c_buf = __pyx_v_owned_buf.get();

  /* "pyarrow/io.pxi":1529
 * 
 *     cdef int64_t max_output_size = (c_codec.get()
 *                                     .MaxCompressedLen(c_buf.size(),             # <<<<<<<<<<<<<<
 *                                                       c_buf.data()))
 *     cdef uint8_t* output_buffer = NULL
 */
  __pyx_v_max_output_size = __pyx_v_c_codec.get()->MaxCompressedLen(__pyx_v_c_buf->size(), __pyx_v_c_buf->data());

  /* "pyarrow/io.pxi":1531
 *                                     .MaxCompressedLen(c_buf.size(),
 *                                                       c_buf.data()))
 *     cdef uint8_t* output_buffer = NULL             # <<<<<<<<<<<<<<
 * 
 *     if asbytes:
 */
  __pyx_v_output_buffer = NULL;

  /* "pyarrow/io.pxi":1533
 *     cdef uint8_t* output_buffer = NULL
 * 
 *     if asbytes:             # <<<<<<<<<<<<<<
 *         pyobj = PyBytes_FromStringAndSizeNative(NULL, max_output_size)
 *         output_buffer = <uint8_t*> cp.PyBytes_AS_STRING(<object> pyobj)
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_asbytes); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(7, 1533, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "pyarrow/io.pxi":1534
 * 
 *     if asbytes:
 *         pyobj = PyBytes_FromStringAndSizeNative(NULL, max_output_size)             # <<<<<<<<<<<<<<
 *         output_buffer = <uint8_t*> cp.PyBytes_AS_STRING(<object> pyobj)
 *     else:
 */
    __pyx_t_5 =  PyBytes_FromStringAndSize(NULL, __pyx_v_max_output_size); if (unlikely(__pyx_t_5 == ((PyObject *)NULL))) __PYX_ERR(7, 1534, __pyx_L1_error)
    __pyx_v_pyobj = __pyx_t_5;

    /* "pyarrow/io.pxi":1535
 *     if asbytes:
 *         pyobj = PyBytes_FromStringAndSizeNative(NULL, max_output_size)
 *         output_buffer = <uint8_t*> cp.PyBytes_AS_STRING(<object> pyobj)             # <<<<<<<<<<<<<<
 *     else:
 *         out_buf = allocate_buffer(max_output_size, memory_pool=memory_pool,
 */
    __pyx_v_output_buffer = ((uint8_t *)PyBytes_AS_STRING(((PyObject *)__pyx_v_pyobj)));

    /* "pyarrow/io.pxi":1533
 *     cdef uint8_t* output_buffer = NULL
 * 
 *     if asbytes:             # <<<<<<<<<<<<<<
 *         pyobj = PyBytes_FromStringAndSizeNative(NULL, max_output_size)
 *         output_buffer = <uint8_t*> cp.PyBytes_AS_STRING(<object> pyobj)
 */
    goto __pyx_L3;
  }

  /* "pyarrow/io.pxi":1537
 *         output_buffer = <uint8_t*> cp.PyBytes_AS_STRING(<object> pyobj)
 *     else:
 *         out_buf = allocate_buffer(max_output_size, memory_pool=memory_pool,             # <<<<<<<<<<<<<<
 *                                   resizable=True)
 *         output_buffer = out_buf.buffer.get().mutable_data()
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_allocate_buffer); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 1537, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyInt_From_int64_t(__pyx_v_max_output_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 1537, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1537, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 1537, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_memory_pool, __pyx_v_memory_pool) < 0) __PYX_ERR(7, 1537, __pyx_L1_error)

    /* "pyarrow/io.pxi":1538
 *     else:
 *         out_buf = allocate_buffer(max_output_size, memory_pool=memory_pool,
 *                                   resizable=True)             # <<<<<<<<<<<<<<
 *         output_buffer = out_buf.buffer.get().mutable_data()
 * 
 */
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_resizable, Py_True) < 0) __PYX_ERR(7, 1537, __pyx_L1_error)

    /* "pyarrow/io.pxi":1537
 *         output_buffer = <uint8_t*> cp.PyBytes_AS_STRING(<object> pyobj)
 *     else:
 *         out_buf = allocate_buffer(max_output_size, memory_pool=memory_pool,             # <<<<<<<<<<<<<<
 *                                   resizable=True)
 *         output_buffer = out_buf.buffer.get().mutable_data()
 */
    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 1537, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_7pyarrow_3lib_ResizableBuffer))))) __PYX_ERR(7, 1537, __pyx_L1_error)
    __pyx_v_out_buf = ((struct __pyx_obj_7pyarrow_3lib_ResizableBuffer *)__pyx_t_9);
    __pyx_t_9 = 0;

    /* "pyarrow/io.pxi":1539
 *         out_buf = allocate_buffer(max_output_size, memory_pool=memory_pool,
 *                                   resizable=True)
 *         output_buffer = out_buf.buffer.get().mutable_data()             # <<<<<<<<<<<<<<
 * 
 *     cdef int64_t output_length
 */
    __pyx_v_output_buffer = __pyx_v_out_buf->__pyx_base.buffer.get()->mutable_data();
  }
  __pyx_L3:;

  /* "pyarrow/io.pxi":1542
 * 
 *     cdef int64_t output_length
 *     with nogil:             # <<<<<<<<<<<<<<
 *         output_length = GetResultValue(
 *             c_codec.get()
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":1543
 *     cdef int64_t output_length
 *     with nogil:
 *         output_length = GetResultValue(             # <<<<<<<<<<<<<<
 *             c_codec.get()
 *             .Compress(c_buf.size(), c_buf.data(),
 */
        __pyx_t_10 = arrow::py::GetResultValue<int64_t>(__pyx_v_c_codec.get()->Compress(__pyx_v_c_buf->size(), __pyx_v_c_buf->data(), __pyx_v_max_output_size, __pyx_v_output_buffer)); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(7, 1543, __pyx_L5_error)
        __pyx_v_output_length = __pyx_t_10;
      }

      /* "pyarrow/io.pxi":1542
 * 
 *     cdef int64_t output_length
 *     with nogil:             # <<<<<<<<<<<<<<
 *         output_length = GetResultValue(
 *             c_codec.get()
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L6;
        }
        __pyx_L5_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L6:;
      }
  }

  /* "pyarrow/io.pxi":1548
 *                       max_output_size, output_buffer))
 * 
 *     if asbytes:             # <<<<<<<<<<<<<<
 *         cp._PyBytes_Resize(&pyobj, <Py_ssize_t> output_length)
 *         return PyObject_to_object(pyobj)
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_asbytes); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(7, 1548, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "pyarrow/io.pxi":1549
 * 
 *     if asbytes:
 *         cp._PyBytes_Resize(&pyobj, <Py_ssize_t> output_length)             # <<<<<<<<<<<<<<
 *         return PyObject_to_object(pyobj)
 *     else:
 */
    __pyx_t_11 = _PyBytes_Resize((&__pyx_v_pyobj), ((Py_ssize_t)__pyx_v_output_length)); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(7, 1549, __pyx_L1_error)

    /* "pyarrow/io.pxi":1550
 *     if asbytes:
 *         cp._PyBytes_Resize(&pyobj, <Py_ssize_t> output_length)
 *         return PyObject_to_object(pyobj)             # <<<<<<<<<<<<<<
 *     else:
 *         out_buf.resize(output_length)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_9 = __pyx_f_7pyarrow_8includes_6common_PyObject_to_object(__pyx_v_pyobj); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 1550, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_r = __pyx_t_9;
    __pyx_t_9 = 0;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":1548
 *                       max_output_size, output_buffer))
 * 
 *     if asbytes:             # <<<<<<<<<<<<<<
 *         cp._PyBytes_Resize(&pyobj, <Py_ssize_t> output_length)
 *         return PyObject_to_object(pyobj)
 */
  }

  /* "pyarrow/io.pxi":1552
 *         return PyObject_to_object(pyobj)
 *     else:
 *         out_buf.resize(output_length)             # <<<<<<<<<<<<<<
 *         return out_buf
 * 
 */
  /*else*/ {
    if (unlikely(!__pyx_v_out_buf)) { __Pyx_RaiseUnboundLocalError("out_buf"); __PYX_ERR(7, 1552, __pyx_L1_error) }
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out_buf), __pyx_n_s_resize); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 1552, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyInt_From_int64_t(__pyx_v_output_length); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1552, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_9 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_6, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 1552, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "pyarrow/io.pxi":1553
 *     else:
 *         out_buf.resize(output_length)
 *         return out_buf             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(!__pyx_v_out_buf)) { __Pyx_RaiseUnboundLocalError("out_buf"); __PYX_ERR(7, 1553, __pyx_L1_error) }
    __Pyx_INCREF(((PyObject *)__pyx_v_out_buf));
    __pyx_r = ((PyObject *)__pyx_v_out_buf);
    goto __pyx_L0;
  }

  /* "pyarrow/io.pxi":1496
 * 
 * 
 * def compress(object buf, codec='lz4', asbytes=False, memory_pool=None):             # <<<<<<<<<<<<<<
 *     """
 *     Compress data from buffer-like object.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pyarrow.lib.compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out_buf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1556
 * 
 * 
 * def decompress(object buf, decompressed_size=None, codec='lz4',             # <<<<<<<<<<<<<<
 *                asbytes=False, memory_pool=None):
 *     """
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_175decompress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_174decompress[] = "decompress(buf, decompressed_size=None, codec=u'lz4', asbytes=False, memory_pool=None)\n\n    Decompress data from buffer-like object.\n\n    Parameters\n    ----------\n    buf : pyarrow.Buffer, bytes, or memoryview-compatible object\n    decompressed_size : int64_t, default None\n        If not specified, will be computed if the codec is able to determine\n        the uncompressed buffer size\n    codec : string, default 'lz4'\n        Compression codec.\n        Supported types: {'brotli, 'gzip', 'lz4', 'snappy', 'zstd'}\n    asbytes : boolean, default False\n        Return result as Python bytes object, otherwise Buffer\n    memory_pool : MemoryPool, default None\n        Memory pool to use for buffer allocations, if any\n\n    Returns\n    -------\n    uncompressed : pyarrow.Buffer or bytes (if asbytes=True)\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_175decompress = {"decompress", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_175decompress, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_174decompress};
static PyObject *__pyx_pw_7pyarrow_3lib_175decompress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_buf = 0;
  PyObject *__pyx_v_decompressed_size = 0;
  PyObject *__pyx_v_codec = 0;
  PyObject *__pyx_v_asbytes = 0;
  PyObject *__pyx_v_memory_pool = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("decompress (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_buf,&__pyx_n_s_decompressed_size,&__pyx_n_s_codec,&__pyx_n_s_asbytes,&__pyx_n_s_memory_pool,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)__pyx_n_u_lz4);

    /* "pyarrow/io.pxi":1557
 * 
 * def decompress(object buf, decompressed_size=None, codec='lz4',
 *                asbytes=False, memory_pool=None):             # <<<<<<<<<<<<<<
 *     """
 *     Decompress data from buffer-like object.
 */
    values[3] = ((PyObject *)Py_False);
    values[4] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buf)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_decompressed_size);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_codec);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_asbytes);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "decompress") < 0)) __PYX_ERR(7, 1556, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_buf = values[0];
    __pyx_v_decompressed_size = values[1];
    __pyx_v_codec = values[2];
    __pyx_v_asbytes = values[3];
    __pyx_v_memory_pool = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("decompress", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 1556, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.decompress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_174decompress(__pyx_self, __pyx_v_buf, __pyx_v_decompressed_size, __pyx_v_codec, __pyx_v_asbytes, __pyx_v_memory_pool);

  /* "pyarrow/io.pxi":1556
 * 
 * 
 * def decompress(object buf, decompressed_size=None, codec='lz4',             # <<<<<<<<<<<<<<
 *                asbytes=False, memory_pool=None):
 *     """
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_174decompress(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_buf, PyObject *__pyx_v_decompressed_size, PyObject *__pyx_v_codec, PyObject *__pyx_v_asbytes, PyObject *__pyx_v_memory_pool) {
  enum  arrow::Compression::type __pyx_v_compression_type;
  std::unique_ptr< arrow::util::Codec>  __pyx_v_c_codec;
  std::shared_ptr< arrow::Buffer>  __pyx_v_owned_buf;
   arrow::Buffer *__pyx_v_c_buf;
  struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_out_buf = 0;
  int64_t __pyx_v_output_size;
  uint8_t *__pyx_v_output_buffer;
  PyObject *__pyx_v_pybuf = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  enum  arrow::Compression::type __pyx_t_1;
  std::unique_ptr< arrow::util::Codec>  __pyx_t_2;
  std::shared_ptr< arrow::Buffer>  __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int64_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("decompress", 0);

  /* "pyarrow/io.pxi":1580
 *     """
 *     cdef:
 *         CompressionType compression_type = _get_compression_type(codec)             # <<<<<<<<<<<<<<
 *         unique_ptr[CCodec] c_codec
 *         cdef shared_ptr[CBuffer] owned_buf
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__get_compression_type(__pyx_v_codec); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 1580, __pyx_L1_error)
  __pyx_v_compression_type = __pyx_t_1;

  /* "pyarrow/io.pxi":1586
 *         cdef Buffer out_buf
 * 
 *     c_codec = move(GetResultValue(CCodec.Create(compression_type)))             # <<<<<<<<<<<<<<
 * 
 *     owned_buf = as_c_buffer(buf)
 */
  __pyx_t_2 = arrow::py::GetResultValue<std::unique_ptr< arrow::util::Codec> >( arrow::util::Codec::Create(__pyx_v_compression_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 1586, __pyx_L1_error)
  __pyx_v_c_codec =  cymove::cymove<std::unique_ptr< arrow::util::Codec> >(__pyx_t_2);

  /* "pyarrow/io.pxi":1588
 *     c_codec = move(GetResultValue(CCodec.Create(compression_type)))
 * 
 *     owned_buf = as_c_buffer(buf)             # <<<<<<<<<<<<<<
 *     c_buf = owned_buf.get()
 * 
 */
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_as_c_buffer(__pyx_v_buf); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 1588, __pyx_L1_error)
  __pyx_v_owned_buf = __pyx_t_3;

  /* "pyarrow/io.pxi":1589
 * 
 *     owned_buf = as_c_buffer(buf)
 *     c_buf = owned_buf.get()             # <<<<<<<<<<<<<<
 * 
 *     if decompressed_size is None:
 */
  __pyx_v_c_buf = __pyx_v_owned_buf.get();

  /* "pyarrow/io.pxi":1591
 *     c_buf = owned_buf.get()
 * 
 *     if decompressed_size is None:             # <<<<<<<<<<<<<<
 *         raise ValueError("Must pass decompressed_size for {0} codec"
 *                          .format(codec))
 */
  __pyx_t_4 = (__pyx_v_decompressed_size == Py_None);
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (unlikely(__pyx_t_5)) {

    /* "pyarrow/io.pxi":1593
 *     if decompressed_size is None:
 *         raise ValueError("Must pass decompressed_size for {0} codec"
 *                          .format(codec))             # <<<<<<<<<<<<<<
 * 
 *     cdef int64_t output_size = decompressed_size
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Must_pass_decompressed_size_for, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 1593, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_v_codec) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_codec);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 1593, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "pyarrow/io.pxi":1592
 * 
 *     if decompressed_size is None:
 *         raise ValueError("Must pass decompressed_size for {0} codec"             # <<<<<<<<<<<<<<
 *                          .format(codec))
 * 
 */
    __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 1592, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __PYX_ERR(7, 1592, __pyx_L1_error)

    /* "pyarrow/io.pxi":1591
 *     c_buf = owned_buf.get()
 * 
 *     if decompressed_size is None:             # <<<<<<<<<<<<<<
 *         raise ValueError("Must pass decompressed_size for {0} codec"
 *                          .format(codec))
 */
  }

  /* "pyarrow/io.pxi":1595
 *                          .format(codec))
 * 
 *     cdef int64_t output_size = decompressed_size             # <<<<<<<<<<<<<<
 *     cdef uint8_t* output_buffer = NULL
 * 
 */
  __pyx_t_9 = __Pyx_PyInt_As_int64_t(__pyx_v_decompressed_size); if (unlikely((__pyx_t_9 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 1595, __pyx_L1_error)
  __pyx_v_output_size = __pyx_t_9;

  /* "pyarrow/io.pxi":1596
 * 
 *     cdef int64_t output_size = decompressed_size
 *     cdef uint8_t* output_buffer = NULL             # <<<<<<<<<<<<<<
 * 
 *     if asbytes:
 */
  __pyx_v_output_buffer = NULL;

  /* "pyarrow/io.pxi":1598
 *     cdef uint8_t* output_buffer = NULL
 * 
 *     if asbytes:             # <<<<<<<<<<<<<<
 *         pybuf = cp.PyBytes_FromStringAndSize(NULL, output_size)
 *         output_buffer = <uint8_t*> cp.PyBytes_AS_STRING(pybuf)
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_asbytes); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(7, 1598, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "pyarrow/io.pxi":1599
 * 
 *     if asbytes:
 *         pybuf = cp.PyBytes_FromStringAndSize(NULL, output_size)             # <<<<<<<<<<<<<<
 *         output_buffer = <uint8_t*> cp.PyBytes_AS_STRING(pybuf)
 *     else:
 */
    __pyx_t_7 = PyBytes_FromStringAndSize(NULL, __pyx_v_output_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 1599, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_v_pybuf = ((PyObject*)__pyx_t_7);
    __pyx_t_7 = 0;

    /* "pyarrow/io.pxi":1600
 *     if asbytes:
 *         pybuf = cp.PyBytes_FromStringAndSize(NULL, output_size)
 *         output_buffer = <uint8_t*> cp.PyBytes_AS_STRING(pybuf)             # <<<<<<<<<<<<<<
 *     else:
 *         out_buf = allocate_buffer(output_size, memory_pool=memory_pool)
 */
    __pyx_v_output_buffer = ((uint8_t *)PyBytes_AS_STRING(__pyx_v_pybuf));

    /* "pyarrow/io.pxi":1598
 *     cdef uint8_t* output_buffer = NULL
 * 
 *     if asbytes:             # <<<<<<<<<<<<<<
 *         pybuf = cp.PyBytes_FromStringAndSize(NULL, output_size)
 *         output_buffer = <uint8_t*> cp.PyBytes_AS_STRING(pybuf)
 */
    goto __pyx_L4;
  }

  /* "pyarrow/io.pxi":1602
 *         output_buffer = <uint8_t*> cp.PyBytes_AS_STRING(pybuf)
 *     else:
 *         out_buf = allocate_buffer(output_size, memory_pool=memory_pool)             # <<<<<<<<<<<<<<
 *         output_buffer = out_buf.buffer.get().mutable_data()
 * 
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_allocate_buffer); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 1602, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = __Pyx_PyInt_From_int64_t(__pyx_v_output_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 1602, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1602, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 1602, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_memory_pool, __pyx_v_memory_pool) < 0) __PYX_ERR(7, 1602, __pyx_L1_error)
    __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(7, 1602, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_7pyarrow_3lib_Buffer))))) __PYX_ERR(7, 1602, __pyx_L1_error)
    __pyx_v_out_buf = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_t_10);
    __pyx_t_10 = 0;

    /* "pyarrow/io.pxi":1603
 *     else:
 *         out_buf = allocate_buffer(output_size, memory_pool=memory_pool)
 *         output_buffer = out_buf.buffer.get().mutable_data()             # <<<<<<<<<<<<<<
 * 
 *     with nogil:
 */
    __pyx_v_output_buffer = __pyx_v_out_buf->buffer.get()->mutable_data();
  }
  __pyx_L4:;

  /* "pyarrow/io.pxi":1605
 *         output_buffer = out_buf.buffer.get().mutable_data()
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(c_codec.get()
 *                      .Decompress(c_buf.size(), c_buf.data(),
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":1606
 * 
 *     with nogil:
 *         check_status(c_codec.get()             # <<<<<<<<<<<<<<
 *                      .Decompress(c_buf.size(), c_buf.data(),
 *                                  output_size, output_buffer)
 */
        __pyx_t_11 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_c_codec.get()->Decompress(__pyx_v_c_buf->size(), __pyx_v_c_buf->data(), __pyx_v_output_size, __pyx_v_output_buffer).status()); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(7, 1606, __pyx_L6_error)
      }

      /* "pyarrow/io.pxi":1605
 *         output_buffer = out_buf.buffer.get().mutable_data()
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(c_codec.get()
 *                      .Decompress(c_buf.size(), c_buf.data(),
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L7;
        }
        __pyx_L6_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L7:;
      }
  }

  /* "pyarrow/io.pxi":1611
 *                      .status())
 * 
 *     return pybuf if asbytes else out_buf             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_asbytes); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(7, 1611, __pyx_L1_error)
  if (__pyx_t_5) {
    if (unlikely(!__pyx_v_pybuf)) { __Pyx_RaiseUnboundLocalError("pybuf"); __PYX_ERR(7, 1611, __pyx_L1_error) }
    __Pyx_INCREF(__pyx_v_pybuf);
    __pyx_t_10 = __pyx_v_pybuf;
  } else {
    if (unlikely(!__pyx_v_out_buf)) { __Pyx_RaiseUnboundLocalError("out_buf"); __PYX_ERR(7, 1611, __pyx_L1_error) }
    __Pyx_INCREF(((PyObject *)__pyx_v_out_buf));
    __pyx_t_10 = ((PyObject *)__pyx_v_out_buf);
  }
  __pyx_r = __pyx_t_10;
  __pyx_t_10 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1556
 * 
 * 
 * def decompress(object buf, decompressed_size=None, codec='lz4',             # <<<<<<<<<<<<<<
 *                asbytes=False, memory_pool=None):
 *     """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("pyarrow.lib.decompress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out_buf);
  __Pyx_XDECREF(__pyx_v_pybuf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1614
 * 
 * 
 * def input_stream(source, compression='detect', buffer_size=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create an Arrow input stream.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_177input_stream(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_176input_stream[] = "input_stream(source, compression=u'detect', buffer_size=None)\n\n    Create an Arrow input stream.\n\n    Parameters\n    ----------\n    source: str, Path, buffer, file-like object, ...\n        The source to open for reading\n    compression: str optional, default 'detect'\n        The compression algorithm to use for on-the-fly decompression.\n        If \"detect\" and source is a file path, then compression will be\n        chosen based on the file extension.\n        If None, no compression will be applied.\n        Otherwise, a well-known algorithm name must be supplied (e.g. \"gzip\")\n    buffer_size: int, default None\n        If None or 0, no buffering will happen.  Otherwise the size of the\n        temporary read buffer.\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_177input_stream = {"input_stream", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_177input_stream, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_176input_stream};
static PyObject *__pyx_pw_7pyarrow_3lib_177input_stream(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_source = 0;
  PyObject *__pyx_v_compression = 0;
  PyObject *__pyx_v_buffer_size = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("input_stream (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,&__pyx_n_s_compression,&__pyx_n_s_buffer_size,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)__pyx_n_u_detect);
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_compression);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffer_size);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "input_stream") < 0)) __PYX_ERR(7, 1614, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_source = values[0];
    __pyx_v_compression = values[1];
    __pyx_v_buffer_size = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("input_stream", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 1614, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.input_stream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_176input_stream(__pyx_self, __pyx_v_source, __pyx_v_compression, __pyx_v_buffer_size);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_176input_stream(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source, PyObject *__pyx_v_compression, PyObject *__pyx_v_buffer_size) {
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_stream = 0;
  PyObject *__pyx_v_source_path = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("input_stream", 0);
  __Pyx_INCREF(__pyx_v_compression);

  /* "pyarrow/io.pxi":1634
 *     cdef NativeFile stream
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "pyarrow/io.pxi":1635
 * 
 *     try:
 *         source_path = _stringify_path(source)             # <<<<<<<<<<<<<<
 *     except TypeError:
 *         source_path = None
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_stringify_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1635, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_source);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1635, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_source_path = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "pyarrow/io.pxi":1634
 *     cdef NativeFile stream
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/io.pxi":1636
 *     try:
 *         source_path = _stringify_path(source)
 *     except TypeError:             # <<<<<<<<<<<<<<
 *         source_path = None
 * 
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("pyarrow.lib.input_stream", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(7, 1636, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);

      /* "pyarrow/io.pxi":1637
 *         source_path = _stringify_path(source)
 *     except TypeError:
 *         source_path = None             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(source, NativeFile):
 */
      __Pyx_INCREF(Py_None);
      __Pyx_XDECREF_SET(__pyx_v_source_path, Py_None);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/io.pxi":1634
 *     cdef NativeFile stream
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "pyarrow/io.pxi":1639
 *         source_path = None
 * 
 *     if isinstance(source, NativeFile):             # <<<<<<<<<<<<<<
 *         stream = source
 *     elif source_path is not None:
 */
  __pyx_t_8 = __Pyx_TypeCheck(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_NativeFile); 
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (__pyx_t_9) {

    /* "pyarrow/io.pxi":1640
 * 
 *     if isinstance(source, NativeFile):
 *         stream = source             # <<<<<<<<<<<<<<
 *     elif source_path is not None:
 *         stream = OSFile(source_path, 'r')
 */
    if (!(likely(((__pyx_v_source) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_NativeFile))))) __PYX_ERR(7, 1640, __pyx_L1_error)
    __pyx_t_6 = __pyx_v_source;
    __Pyx_INCREF(__pyx_t_6);
    __pyx_v_stream = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "pyarrow/io.pxi":1639
 *         source_path = None
 * 
 *     if isinstance(source, NativeFile):             # <<<<<<<<<<<<<<
 *         stream = source
 *     elif source_path is not None:
 */
    goto __pyx_L11;
  }

  /* "pyarrow/io.pxi":1641
 *     if isinstance(source, NativeFile):
 *         stream = source
 *     elif source_path is not None:             # <<<<<<<<<<<<<<
 *         stream = OSFile(source_path, 'r')
 *     elif isinstance(source, (Buffer, memoryview)):
 */
  __pyx_t_9 = (__pyx_v_source_path != Py_None);
  __pyx_t_8 = (__pyx_t_9 != 0);
  if (__pyx_t_8) {

    /* "pyarrow/io.pxi":1642
 *         stream = source
 *     elif source_path is not None:
 *         stream = OSFile(source_path, 'r')             # <<<<<<<<<<<<<<
 *     elif isinstance(source, (Buffer, memoryview)):
 *         stream = BufferReader(as_buffer(source))
 */
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 1642, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_source_path);
    __Pyx_GIVEREF(__pyx_v_source_path);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_source_path);
    __Pyx_INCREF(__pyx_n_u_r);
    __Pyx_GIVEREF(__pyx_n_u_r);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_u_r);
    __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pyarrow_3lib_OSFile), __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1642, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_stream = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "pyarrow/io.pxi":1641
 *     if isinstance(source, NativeFile):
 *         stream = source
 *     elif source_path is not None:             # <<<<<<<<<<<<<<
 *         stream = OSFile(source_path, 'r')
 *     elif isinstance(source, (Buffer, memoryview)):
 */
    goto __pyx_L11;
  }

  /* "pyarrow/io.pxi":1643
 *     elif source_path is not None:
 *         stream = OSFile(source_path, 'r')
 *     elif isinstance(source, (Buffer, memoryview)):             # <<<<<<<<<<<<<<
 *         stream = BufferReader(as_buffer(source))
 *     elif (hasattr(source, 'read') and
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_memoryview); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_9 = __Pyx_TypeCheck(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_Buffer); 
  __pyx_t_10 = (__pyx_t_9 != 0);
  if (!__pyx_t_10) {
  } else {
    __pyx_t_8 = __pyx_t_10;
    goto __pyx_L12_bool_binop_done;
  }
  __pyx_t_10 = PyObject_IsInstance(__pyx_v_source, __pyx_t_5); 
  __pyx_t_9 = (__pyx_t_10 != 0);
  __pyx_t_8 = __pyx_t_9;
  __pyx_L12_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (__pyx_t_9) {

    /* "pyarrow/io.pxi":1644
 *         stream = OSFile(source_path, 'r')
 *     elif isinstance(source, (Buffer, memoryview)):
 *         stream = BufferReader(as_buffer(source))             # <<<<<<<<<<<<<<
 *     elif (hasattr(source, 'read') and
 *           hasattr(source, 'close') and
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_as_buffer); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 1644, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_source);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1644, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_BufferReader), __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 1644, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_stream = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "pyarrow/io.pxi":1643
 *     elif source_path is not None:
 *         stream = OSFile(source_path, 'r')
 *     elif isinstance(source, (Buffer, memoryview)):             # <<<<<<<<<<<<<<
 *         stream = BufferReader(as_buffer(source))
 *     elif (hasattr(source, 'read') and
 */
    goto __pyx_L11;
  }

  /* "pyarrow/io.pxi":1645
 *     elif isinstance(source, (Buffer, memoryview)):
 *         stream = BufferReader(as_buffer(source))
 *     elif (hasattr(source, 'read') and             # <<<<<<<<<<<<<<
 *           hasattr(source, 'close') and
 *           hasattr(source, 'closed')):
 */
  __pyx_t_8 = __Pyx_HasAttr(__pyx_v_source, __pyx_n_u_read); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(7, 1645, __pyx_L1_error)
  __pyx_t_10 = (__pyx_t_8 != 0);
  if (__pyx_t_10) {
  } else {
    __pyx_t_9 = __pyx_t_10;
    goto __pyx_L14_bool_binop_done;
  }

  /* "pyarrow/io.pxi":1646
 *         stream = BufferReader(as_buffer(source))
 *     elif (hasattr(source, 'read') and
 *           hasattr(source, 'close') and             # <<<<<<<<<<<<<<
 *           hasattr(source, 'closed')):
 *         stream = PythonFile(source, 'r')
 */
  __pyx_t_10 = __Pyx_HasAttr(__pyx_v_source, __pyx_n_u_close); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(7, 1646, __pyx_L1_error)
  __pyx_t_8 = (__pyx_t_10 != 0);
  if (__pyx_t_8) {
  } else {
    __pyx_t_9 = __pyx_t_8;
    goto __pyx_L14_bool_binop_done;
  }

  /* "pyarrow/io.pxi":1647
 *     elif (hasattr(source, 'read') and
 *           hasattr(source, 'close') and
 *           hasattr(source, 'closed')):             # <<<<<<<<<<<<<<
 *         stream = PythonFile(source, 'r')
 *     else:
 */
  __pyx_t_8 = __Pyx_HasAttr(__pyx_v_source, __pyx_n_u_closed); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(7, 1647, __pyx_L1_error)
  __pyx_t_10 = (__pyx_t_8 != 0);
  __pyx_t_9 = __pyx_t_10;
  __pyx_L14_bool_binop_done:;

  /* "pyarrow/io.pxi":1645
 *     elif isinstance(source, (Buffer, memoryview)):
 *         stream = BufferReader(as_buffer(source))
 *     elif (hasattr(source, 'read') and             # <<<<<<<<<<<<<<
 *           hasattr(source, 'close') and
 *           hasattr(source, 'closed')):
 */
  if (likely(__pyx_t_9)) {

    /* "pyarrow/io.pxi":1648
 *           hasattr(source, 'close') and
 *           hasattr(source, 'closed')):
 *         stream = PythonFile(source, 'r')             # <<<<<<<<<<<<<<
 *     else:
 *         raise TypeError("pa.input_stream() called with instance of '{}'"
 */
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 1648, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_source);
    __Pyx_GIVEREF(__pyx_v_source);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_source);
    __Pyx_INCREF(__pyx_n_u_r);
    __Pyx_GIVEREF(__pyx_n_u_r);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_u_r);
    __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pyarrow_3lib_PythonFile), __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1648, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_stream = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "pyarrow/io.pxi":1645
 *     elif isinstance(source, (Buffer, memoryview)):
 *         stream = BufferReader(as_buffer(source))
 *     elif (hasattr(source, 'read') and             # <<<<<<<<<<<<<<
 *           hasattr(source, 'close') and
 *           hasattr(source, 'closed')):
 */
    goto __pyx_L11;
  }

  /* "pyarrow/io.pxi":1650
 *         stream = PythonFile(source, 'r')
 *     else:
 *         raise TypeError("pa.input_stream() called with instance of '{}'"             # <<<<<<<<<<<<<<
 *                         .format(source.__class__))
 * 
 */
  /*else*/ {

    /* "pyarrow/io.pxi":1651
 *     else:
 *         raise TypeError("pa.input_stream() called with instance of '{}'"
 *                         .format(source.__class__))             # <<<<<<<<<<<<<<
 * 
 *     if compression == 'detect':
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_pa_input_stream_called_with_inst, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 1651, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1651, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_11 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_11)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_11, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1651, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/io.pxi":1650
 *         stream = PythonFile(source, 'r')
 *     else:
 *         raise TypeError("pa.input_stream() called with instance of '{}'"             # <<<<<<<<<<<<<<
 *                         .format(source.__class__))
 * 
 */
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 1650, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __PYX_ERR(7, 1650, __pyx_L1_error)
  }
  __pyx_L11:;

  /* "pyarrow/io.pxi":1653
 *                         .format(source.__class__))
 * 
 *     if compression == 'detect':             # <<<<<<<<<<<<<<
 *         # detect for OSFile too
 *         compression = _detect_compression(source_path)
 */
  __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_v_compression, __pyx_n_u_detect, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(7, 1653, __pyx_L1_error)
  if (__pyx_t_9) {

    /* "pyarrow/io.pxi":1655
 *     if compression == 'detect':
 *         # detect for OSFile too
 *         compression = _detect_compression(source_path)             # <<<<<<<<<<<<<<
 * 
 *     if buffer_size is not None and buffer_size != 0:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_detect_compression); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1655, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_source_path) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_source_path);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 1655, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_compression, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "pyarrow/io.pxi":1653
 *                         .format(source.__class__))
 * 
 *     if compression == 'detect':             # <<<<<<<<<<<<<<
 *         # detect for OSFile too
 *         compression = _detect_compression(source_path)
 */
  }

  /* "pyarrow/io.pxi":1657
 *         compression = _detect_compression(source_path)
 * 
 *     if buffer_size is not None and buffer_size != 0:             # <<<<<<<<<<<<<<
 *         stream = BufferedInputStream(stream, buffer_size)
 * 
 */
  __pyx_t_10 = (__pyx_v_buffer_size != Py_None);
  __pyx_t_8 = (__pyx_t_10 != 0);
  if (__pyx_t_8) {
  } else {
    __pyx_t_9 = __pyx_t_8;
    goto __pyx_L19_bool_binop_done;
  }
  __pyx_t_6 = __Pyx_PyInt_NeObjC(__pyx_v_buffer_size, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 1657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(7, 1657, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_9 = __pyx_t_8;
  __pyx_L19_bool_binop_done:;
  if (__pyx_t_9) {

    /* "pyarrow/io.pxi":1658
 * 
 *     if buffer_size is not None and buffer_size != 0:
 *         stream = BufferedInputStream(stream, buffer_size)             # <<<<<<<<<<<<<<
 * 
 *     if compression is not None:
 */
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 1658, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(((PyObject *)__pyx_v_stream));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_stream));
    PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_stream));
    __Pyx_INCREF(__pyx_v_buffer_size);
    __Pyx_GIVEREF(__pyx_v_buffer_size);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_buffer_size);
    __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pyarrow_3lib_BufferedInputStream), __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1658, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF_SET(__pyx_v_stream, ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "pyarrow/io.pxi":1657
 *         compression = _detect_compression(source_path)
 * 
 *     if buffer_size is not None and buffer_size != 0:             # <<<<<<<<<<<<<<
 *         stream = BufferedInputStream(stream, buffer_size)
 * 
 */
  }

  /* "pyarrow/io.pxi":1660
 *         stream = BufferedInputStream(stream, buffer_size)
 * 
 *     if compression is not None:             # <<<<<<<<<<<<<<
 *         stream = CompressedInputStream(stream, compression)
 * 
 */
  __pyx_t_9 = (__pyx_v_compression != Py_None);
  __pyx_t_8 = (__pyx_t_9 != 0);
  if (__pyx_t_8) {

    /* "pyarrow/io.pxi":1661
 * 
 *     if compression is not None:
 *         stream = CompressedInputStream(stream, compression)             # <<<<<<<<<<<<<<
 * 
 *     return stream
 */
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1661, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(((PyObject *)__pyx_v_stream));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_stream));
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_stream));
    __Pyx_INCREF(__pyx_v_compression);
    __Pyx_GIVEREF(__pyx_v_compression);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_compression);
    __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pyarrow_3lib_CompressedInputStream), __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 1661, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_stream, ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_6));
    __pyx_t_6 = 0;

    /* "pyarrow/io.pxi":1660
 *         stream = BufferedInputStream(stream, buffer_size)
 * 
 *     if compression is not None:             # <<<<<<<<<<<<<<
 *         stream = CompressedInputStream(stream, compression)
 * 
 */
  }

  /* "pyarrow/io.pxi":1663
 *         stream = CompressedInputStream(stream, compression)
 * 
 *     return stream             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_stream));
  __pyx_r = ((PyObject *)__pyx_v_stream);
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1614
 * 
 * 
 * def input_stream(source, compression='detect', buffer_size=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create an Arrow input stream.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("pyarrow.lib.input_stream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_stream);
  __Pyx_XDECREF(__pyx_v_source_path);
  __Pyx_XDECREF(__pyx_v_compression);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1666
 * 
 * 
 * def output_stream(source, compression='detect', buffer_size=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create an Arrow output stream.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_179output_stream(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_178output_stream[] = "output_stream(source, compression=u'detect', buffer_size=None)\n\n    Create an Arrow output stream.\n\n    Parameters\n    ----------\n    source: str, Path, buffer, file-like object, ...\n        The source to open for writing\n    compression: str optional, default 'detect'\n        The compression algorithm to use for on-the-fly compression.\n        If \"detect\" and source is a file path, then compression will be\n        chosen based on the file extension.\n        If None, no compression will be applied.\n        Otherwise, a well-known algorithm name must be supplied (e.g. \"gzip\")\n    buffer_size: int, default None\n        If None or 0, no buffering will happen.  Otherwise the size of the\n        temporary write buffer.\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_179output_stream = {"output_stream", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_179output_stream, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_178output_stream};
static PyObject *__pyx_pw_7pyarrow_3lib_179output_stream(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_source = 0;
  PyObject *__pyx_v_compression = 0;
  PyObject *__pyx_v_buffer_size = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("output_stream (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,&__pyx_n_s_compression,&__pyx_n_s_buffer_size,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)__pyx_n_u_detect);
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_compression);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffer_size);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "output_stream") < 0)) __PYX_ERR(7, 1666, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_source = values[0];
    __pyx_v_compression = values[1];
    __pyx_v_buffer_size = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("output_stream", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 1666, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.output_stream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_178output_stream(__pyx_self, __pyx_v_source, __pyx_v_compression, __pyx_v_buffer_size);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_178output_stream(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source, PyObject *__pyx_v_compression, PyObject *__pyx_v_buffer_size) {
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_stream = 0;
  PyObject *__pyx_v_source_path = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("output_stream", 0);
  __Pyx_INCREF(__pyx_v_compression);

  /* "pyarrow/io.pxi":1686
 *     cdef NativeFile stream
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "pyarrow/io.pxi":1687
 * 
 *     try:
 *         source_path = _stringify_path(source)             # <<<<<<<<<<<<<<
 *     except TypeError:
 *         source_path = None
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_stringify_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1687, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_source);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1687, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_source_path = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "pyarrow/io.pxi":1686
 *     cdef NativeFile stream
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/io.pxi":1688
 *     try:
 *         source_path = _stringify_path(source)
 *     except TypeError:             # <<<<<<<<<<<<<<
 *         source_path = None
 * 
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("pyarrow.lib.output_stream", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(7, 1688, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);

      /* "pyarrow/io.pxi":1689
 *         source_path = _stringify_path(source)
 *     except TypeError:
 *         source_path = None             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(source, NativeFile):
 */
      __Pyx_INCREF(Py_None);
      __Pyx_XDECREF_SET(__pyx_v_source_path, Py_None);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/io.pxi":1686
 *     cdef NativeFile stream
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "pyarrow/io.pxi":1691
 *         source_path = None
 * 
 *     if isinstance(source, NativeFile):             # <<<<<<<<<<<<<<
 *         stream = source
 *     elif source_path is not None:
 */
  __pyx_t_8 = __Pyx_TypeCheck(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_NativeFile); 
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (__pyx_t_9) {

    /* "pyarrow/io.pxi":1692
 * 
 *     if isinstance(source, NativeFile):
 *         stream = source             # <<<<<<<<<<<<<<
 *     elif source_path is not None:
 *         stream = OSFile(source_path, 'w')
 */
    if (!(likely(((__pyx_v_source) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_NativeFile))))) __PYX_ERR(7, 1692, __pyx_L1_error)
    __pyx_t_6 = __pyx_v_source;
    __Pyx_INCREF(__pyx_t_6);
    __pyx_v_stream = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "pyarrow/io.pxi":1691
 *         source_path = None
 * 
 *     if isinstance(source, NativeFile):             # <<<<<<<<<<<<<<
 *         stream = source
 *     elif source_path is not None:
 */
    goto __pyx_L11;
  }

  /* "pyarrow/io.pxi":1693
 *     if isinstance(source, NativeFile):
 *         stream = source
 *     elif source_path is not None:             # <<<<<<<<<<<<<<
 *         stream = OSFile(source_path, 'w')
 *     elif isinstance(source, (Buffer, memoryview)):
 */
  __pyx_t_9 = (__pyx_v_source_path != Py_None);
  __pyx_t_8 = (__pyx_t_9 != 0);
  if (__pyx_t_8) {

    /* "pyarrow/io.pxi":1694
 *         stream = source
 *     elif source_path is not None:
 *         stream = OSFile(source_path, 'w')             # <<<<<<<<<<<<<<
 *     elif isinstance(source, (Buffer, memoryview)):
 *         stream = FixedSizeBufferWriter(as_buffer(source))
 */
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 1694, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_source_path);
    __Pyx_GIVEREF(__pyx_v_source_path);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_source_path);
    __Pyx_INCREF(__pyx_n_u_w);
    __Pyx_GIVEREF(__pyx_n_u_w);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_u_w);
    __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pyarrow_3lib_OSFile), __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1694, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_stream = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "pyarrow/io.pxi":1693
 *     if isinstance(source, NativeFile):
 *         stream = source
 *     elif source_path is not None:             # <<<<<<<<<<<<<<
 *         stream = OSFile(source_path, 'w')
 *     elif isinstance(source, (Buffer, memoryview)):
 */
    goto __pyx_L11;
  }

  /* "pyarrow/io.pxi":1695
 *     elif source_path is not None:
 *         stream = OSFile(source_path, 'w')
 *     elif isinstance(source, (Buffer, memoryview)):             # <<<<<<<<<<<<<<
 *         stream = FixedSizeBufferWriter(as_buffer(source))
 *     elif (hasattr(source, 'write') and
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_memoryview); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_9 = __Pyx_TypeCheck(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_Buffer); 
  __pyx_t_10 = (__pyx_t_9 != 0);
  if (!__pyx_t_10) {
  } else {
    __pyx_t_8 = __pyx_t_10;
    goto __pyx_L12_bool_binop_done;
  }
  __pyx_t_10 = PyObject_IsInstance(__pyx_v_source, __pyx_t_5); 
  __pyx_t_9 = (__pyx_t_10 != 0);
  __pyx_t_8 = __pyx_t_9;
  __pyx_L12_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (__pyx_t_9) {

    /* "pyarrow/io.pxi":1696
 *         stream = OSFile(source_path, 'w')
 *     elif isinstance(source, (Buffer, memoryview)):
 *         stream = FixedSizeBufferWriter(as_buffer(source))             # <<<<<<<<<<<<<<
 *     elif (hasattr(source, 'write') and
 *           hasattr(source, 'close') and
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_as_buffer); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 1696, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_source);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1696, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_FixedSizeBufferWriter), __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 1696, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_stream = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "pyarrow/io.pxi":1695
 *     elif source_path is not None:
 *         stream = OSFile(source_path, 'w')
 *     elif isinstance(source, (Buffer, memoryview)):             # <<<<<<<<<<<<<<
 *         stream = FixedSizeBufferWriter(as_buffer(source))
 *     elif (hasattr(source, 'write') and
 */
    goto __pyx_L11;
  }

  /* "pyarrow/io.pxi":1697
 *     elif isinstance(source, (Buffer, memoryview)):
 *         stream = FixedSizeBufferWriter(as_buffer(source))
 *     elif (hasattr(source, 'write') and             # <<<<<<<<<<<<<<
 *           hasattr(source, 'close') and
 *           hasattr(source, 'closed')):
 */
  __pyx_t_8 = __Pyx_HasAttr(__pyx_v_source, __pyx_n_u_write); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(7, 1697, __pyx_L1_error)
  __pyx_t_10 = (__pyx_t_8 != 0);
  if (__pyx_t_10) {
  } else {
    __pyx_t_9 = __pyx_t_10;
    goto __pyx_L14_bool_binop_done;
  }

  /* "pyarrow/io.pxi":1698
 *         stream = FixedSizeBufferWriter(as_buffer(source))
 *     elif (hasattr(source, 'write') and
 *           hasattr(source, 'close') and             # <<<<<<<<<<<<<<
 *           hasattr(source, 'closed')):
 *         stream = PythonFile(source, 'w')
 */
  __pyx_t_10 = __Pyx_HasAttr(__pyx_v_source, __pyx_n_u_close); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(7, 1698, __pyx_L1_error)
  __pyx_t_8 = (__pyx_t_10 != 0);
  if (__pyx_t_8) {
  } else {
    __pyx_t_9 = __pyx_t_8;
    goto __pyx_L14_bool_binop_done;
  }

  /* "pyarrow/io.pxi":1699
 *     elif (hasattr(source, 'write') and
 *           hasattr(source, 'close') and
 *           hasattr(source, 'closed')):             # <<<<<<<<<<<<<<
 *         stream = PythonFile(source, 'w')
 *     else:
 */
  __pyx_t_8 = __Pyx_HasAttr(__pyx_v_source, __pyx_n_u_closed); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(7, 1699, __pyx_L1_error)
  __pyx_t_10 = (__pyx_t_8 != 0);
  __pyx_t_9 = __pyx_t_10;
  __pyx_L14_bool_binop_done:;

  /* "pyarrow/io.pxi":1697
 *     elif isinstance(source, (Buffer, memoryview)):
 *         stream = FixedSizeBufferWriter(as_buffer(source))
 *     elif (hasattr(source, 'write') and             # <<<<<<<<<<<<<<
 *           hasattr(source, 'close') and
 *           hasattr(source, 'closed')):
 */
  if (likely(__pyx_t_9)) {

    /* "pyarrow/io.pxi":1700
 *           hasattr(source, 'close') and
 *           hasattr(source, 'closed')):
 *         stream = PythonFile(source, 'w')             # <<<<<<<<<<<<<<
 *     else:
 *         raise TypeError("pa.output_stream() called with instance of '{}'"
 */
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 1700, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_source);
    __Pyx_GIVEREF(__pyx_v_source);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_source);
    __Pyx_INCREF(__pyx_n_u_w);
    __Pyx_GIVEREF(__pyx_n_u_w);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_u_w);
    __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pyarrow_3lib_PythonFile), __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1700, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_stream = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "pyarrow/io.pxi":1697
 *     elif isinstance(source, (Buffer, memoryview)):
 *         stream = FixedSizeBufferWriter(as_buffer(source))
 *     elif (hasattr(source, 'write') and             # <<<<<<<<<<<<<<
 *           hasattr(source, 'close') and
 *           hasattr(source, 'closed')):
 */
    goto __pyx_L11;
  }

  /* "pyarrow/io.pxi":1702
 *         stream = PythonFile(source, 'w')
 *     else:
 *         raise TypeError("pa.output_stream() called with instance of '{}'"             # <<<<<<<<<<<<<<
 *                         .format(source.__class__))
 * 
 */
  /*else*/ {

    /* "pyarrow/io.pxi":1703
 *     else:
 *         raise TypeError("pa.output_stream() called with instance of '{}'"
 *                         .format(source.__class__))             # <<<<<<<<<<<<<<
 * 
 *     if compression == 'detect':
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_pa_output_stream_called_with_ins, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 1703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_11 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_11)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_11, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/io.pxi":1702
 *         stream = PythonFile(source, 'w')
 *     else:
 *         raise TypeError("pa.output_stream() called with instance of '{}'"             # <<<<<<<<<<<<<<
 *                         .format(source.__class__))
 * 
 */
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 1702, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __PYX_ERR(7, 1702, __pyx_L1_error)
  }
  __pyx_L11:;

  /* "pyarrow/io.pxi":1705
 *                         .format(source.__class__))
 * 
 *     if compression == 'detect':             # <<<<<<<<<<<<<<
 *         compression = _detect_compression(source_path)
 * 
 */
  __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_v_compression, __pyx_n_u_detect, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(7, 1705, __pyx_L1_error)
  if (__pyx_t_9) {

    /* "pyarrow/io.pxi":1706
 * 
 *     if compression == 'detect':
 *         compression = _detect_compression(source_path)             # <<<<<<<<<<<<<<
 * 
 *     if buffer_size is not None and buffer_size != 0:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_detect_compression); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1706, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_source_path) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_source_path);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 1706, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_compression, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "pyarrow/io.pxi":1705
 *                         .format(source.__class__))
 * 
 *     if compression == 'detect':             # <<<<<<<<<<<<<<
 *         compression = _detect_compression(source_path)
 * 
 */
  }

  /* "pyarrow/io.pxi":1708
 *         compression = _detect_compression(source_path)
 * 
 *     if buffer_size is not None and buffer_size != 0:             # <<<<<<<<<<<<<<
 *         stream = BufferedOutputStream(stream, buffer_size)
 * 
 */
  __pyx_t_10 = (__pyx_v_buffer_size != Py_None);
  __pyx_t_8 = (__pyx_t_10 != 0);
  if (__pyx_t_8) {
  } else {
    __pyx_t_9 = __pyx_t_8;
    goto __pyx_L19_bool_binop_done;
  }
  __pyx_t_6 = __Pyx_PyInt_NeObjC(__pyx_v_buffer_size, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 1708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(7, 1708, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_9 = __pyx_t_8;
  __pyx_L19_bool_binop_done:;
  if (__pyx_t_9) {

    /* "pyarrow/io.pxi":1709
 * 
 *     if buffer_size is not None and buffer_size != 0:
 *         stream = BufferedOutputStream(stream, buffer_size)             # <<<<<<<<<<<<<<
 * 
 *     if compression is not None:
 */
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 1709, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(((PyObject *)__pyx_v_stream));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_stream));
    PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_stream));
    __Pyx_INCREF(__pyx_v_buffer_size);
    __Pyx_GIVEREF(__pyx_v_buffer_size);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_buffer_size);
    __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pyarrow_3lib_BufferedOutputStream), __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1709, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF_SET(__pyx_v_stream, ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "pyarrow/io.pxi":1708
 *         compression = _detect_compression(source_path)
 * 
 *     if buffer_size is not None and buffer_size != 0:             # <<<<<<<<<<<<<<
 *         stream = BufferedOutputStream(stream, buffer_size)
 * 
 */
  }

  /* "pyarrow/io.pxi":1711
 *         stream = BufferedOutputStream(stream, buffer_size)
 * 
 *     if compression is not None:             # <<<<<<<<<<<<<<
 *         stream = CompressedOutputStream(stream, compression)
 * 
 */
  __pyx_t_9 = (__pyx_v_compression != Py_None);
  __pyx_t_8 = (__pyx_t_9 != 0);
  if (__pyx_t_8) {

    /* "pyarrow/io.pxi":1712
 * 
 *     if compression is not None:
 *         stream = CompressedOutputStream(stream, compression)             # <<<<<<<<<<<<<<
 * 
 *     return stream
 */
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1712, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(((PyObject *)__pyx_v_stream));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_stream));
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_stream));
    __Pyx_INCREF(__pyx_v_compression);
    __Pyx_GIVEREF(__pyx_v_compression);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_compression);
    __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pyarrow_3lib_CompressedOutputStream), __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 1712, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_stream, ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_6));
    __pyx_t_6 = 0;

    /* "pyarrow/io.pxi":1711
 *         stream = BufferedOutputStream(stream, buffer_size)
 * 
 *     if compression is not None:             # <<<<<<<<<<<<<<
 *         stream = CompressedOutputStream(stream, compression)
 * 
 */
  }

  /* "pyarrow/io.pxi":1714
 *         stream = CompressedOutputStream(stream, compression)
 * 
 *     return stream             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_stream));
  __pyx_r = ((PyObject *)__pyx_v_stream);
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1666
 * 
 * 
 * def output_stream(source, compression='detect', buffer_size=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create an Arrow output stream.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("pyarrow.lib.output_stream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_stream);
  __Pyx_XDECREF(__pyx_v_source_path);
  __Pyx_XDECREF(__pyx_v_compression);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":30
 * 
 * 
 * def have_libhdfs():             # <<<<<<<<<<<<<<
 *     try:
 *         with nogil:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_181have_libhdfs(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_180have_libhdfs[] = "have_libhdfs()";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_181have_libhdfs = {"have_libhdfs", (PyCFunction)__pyx_pw_7pyarrow_3lib_181have_libhdfs, METH_NOARGS, __pyx_doc_7pyarrow_3lib_180have_libhdfs};
static PyObject *__pyx_pw_7pyarrow_3lib_181have_libhdfs(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("have_libhdfs (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_180have_libhdfs(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_180have_libhdfs(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("have_libhdfs", 0);

  /* "pyarrow/io-hdfs.pxi":31
 * 
 * def have_libhdfs():
 *     try:             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(HaveLibHdfs())
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "pyarrow/io-hdfs.pxi":32
 * def have_libhdfs():
 *     try:
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(HaveLibHdfs())
 *         return True
 */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          __Pyx_FastGIL_Remember();
          #endif
          /*try:*/ {

            /* "pyarrow/io-hdfs.pxi":33
 *     try:
 *         with nogil:
 *             check_status(HaveLibHdfs())             # <<<<<<<<<<<<<<
 *         return True
 *     except Exception:
 */
            __pyx_t_4 = __pyx_f_7pyarrow_3lib_check_status(arrow::io::HaveLibHdfs()); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 33, __pyx_L10_error)
          }

          /* "pyarrow/io-hdfs.pxi":32
 * def have_libhdfs():
 *     try:
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(HaveLibHdfs())
 *         return True
 */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              __Pyx_FastGIL_Forget();
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L11;
            }
            __pyx_L10_error: {
              #ifdef WITH_THREAD
              __Pyx_FastGIL_Forget();
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L3_error;
            }
            __pyx_L11:;
          }
      }

      /* "pyarrow/io-hdfs.pxi":34
 *         with nogil:
 *             check_status(HaveLibHdfs())
 *         return True             # <<<<<<<<<<<<<<
 *     except Exception:
 *         return False
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_True);
      __pyx_r = Py_True;
      goto __pyx_L7_try_return;

      /* "pyarrow/io-hdfs.pxi":31
 * 
 * def have_libhdfs():
 *     try:             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(HaveLibHdfs())
 */
    }
    __pyx_L3_error:;

    /* "pyarrow/io-hdfs.pxi":35
 *             check_status(HaveLibHdfs())
 *         return True
 *     except Exception:             # <<<<<<<<<<<<<<
 *         return False
 * 
 */
    __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_4) {
      __Pyx_AddTraceback("pyarrow.lib.have_libhdfs", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 35, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);

      /* "pyarrow/io-hdfs.pxi":36
 *         return True
 *     except Exception:
 *         return False             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/io-hdfs.pxi":31
 * 
 * def have_libhdfs():
 *     try:             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(HaveLibHdfs())
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "pyarrow/io-hdfs.pxi":30
 * 
 * 
 * def have_libhdfs():             # <<<<<<<<<<<<<<
 *     try:
 *         with nogil:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.have_libhdfs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":39
 * 
 * 
 * def have_libhdfs3():             # <<<<<<<<<<<<<<
 *     try:
 *         with nogil:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_183have_libhdfs3(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_182have_libhdfs3[] = "have_libhdfs3()";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_183have_libhdfs3 = {"have_libhdfs3", (PyCFunction)__pyx_pw_7pyarrow_3lib_183have_libhdfs3, METH_NOARGS, __pyx_doc_7pyarrow_3lib_182have_libhdfs3};
static PyObject *__pyx_pw_7pyarrow_3lib_183have_libhdfs3(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("have_libhdfs3 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_182have_libhdfs3(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_182have_libhdfs3(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("have_libhdfs3", 0);

  /* "pyarrow/io-hdfs.pxi":40
 * 
 * def have_libhdfs3():
 *     try:             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(HaveLibHdfs3())
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "pyarrow/io-hdfs.pxi":41
 * def have_libhdfs3():
 *     try:
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(HaveLibHdfs3())
 *         return True
 */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          __Pyx_FastGIL_Remember();
          #endif
          /*try:*/ {

            /* "pyarrow/io-hdfs.pxi":42
 *     try:
 *         with nogil:
 *             check_status(HaveLibHdfs3())             # <<<<<<<<<<<<<<
 *         return True
 *     except Exception:
 */
            __pyx_t_4 = __pyx_f_7pyarrow_3lib_check_status(arrow::io::HaveLibHdfs3()); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 42, __pyx_L10_error)
          }

          /* "pyarrow/io-hdfs.pxi":41
 * def have_libhdfs3():
 *     try:
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(HaveLibHdfs3())
 *         return True
 */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              __Pyx_FastGIL_Forget();
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L11;
            }
            __pyx_L10_error: {
              #ifdef WITH_THREAD
              __Pyx_FastGIL_Forget();
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L3_error;
            }
            __pyx_L11:;
          }
      }

      /* "pyarrow/io-hdfs.pxi":43
 *         with nogil:
 *             check_status(HaveLibHdfs3())
 *         return True             # <<<<<<<<<<<<<<
 *     except Exception:
 *         return False
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_True);
      __pyx_r = Py_True;
      goto __pyx_L7_try_return;

      /* "pyarrow/io-hdfs.pxi":40
 * 
 * def have_libhdfs3():
 *     try:             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(HaveLibHdfs3())
 */
    }
    __pyx_L3_error:;

    /* "pyarrow/io-hdfs.pxi":44
 *             check_status(HaveLibHdfs3())
 *         return True
 *     except Exception:             # <<<<<<<<<<<<<<
 *         return False
 * 
 */
    __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_4) {
      __Pyx_AddTraceback("pyarrow.lib.have_libhdfs3", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 44, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);

      /* "pyarrow/io-hdfs.pxi":45
 *         return True
 *     except Exception:
 *         return False             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/io-hdfs.pxi":40
 * 
 * def have_libhdfs3():
 *     try:             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(HaveLibHdfs3())
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "pyarrow/io-hdfs.pxi":39
 * 
 * 
 * def have_libhdfs3():             # <<<<<<<<<<<<<<
 *     try:
 *         with nogil:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.have_libhdfs3", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":48
 * 
 * 
 * def strip_hdfs_abspath(path):             # <<<<<<<<<<<<<<
 *     m = _HDFS_PATH_RE.match(path)
 *     if m:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_185strip_hdfs_abspath(PyObject *__pyx_self, PyObject *__pyx_v_path); /*proto*/
static char __pyx_doc_7pyarrow_3lib_184strip_hdfs_abspath[] = "strip_hdfs_abspath(path)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_185strip_hdfs_abspath = {"strip_hdfs_abspath", (PyCFunction)__pyx_pw_7pyarrow_3lib_185strip_hdfs_abspath, METH_O, __pyx_doc_7pyarrow_3lib_184strip_hdfs_abspath};
static PyObject *__pyx_pw_7pyarrow_3lib_185strip_hdfs_abspath(PyObject *__pyx_self, PyObject *__pyx_v_path) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("strip_hdfs_abspath (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_184strip_hdfs_abspath(__pyx_self, ((PyObject *)__pyx_v_path));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_184strip_hdfs_abspath(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path) {
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("strip_hdfs_abspath", 0);

  /* "pyarrow/io-hdfs.pxi":49
 * 
 * def strip_hdfs_abspath(path):
 *     m = _HDFS_PATH_RE.match(path)             # <<<<<<<<<<<<<<
 *     if m:
 *         return m.group(3)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_HDFS_PATH_RE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_match); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_path) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_path);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_m = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":50
 * def strip_hdfs_abspath(path):
 *     m = _HDFS_PATH_RE.match(path)
 *     if m:             # <<<<<<<<<<<<<<
 *         return m.group(3)
 *     else:
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_m); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 50, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "pyarrow/io-hdfs.pxi":51
 *     m = _HDFS_PATH_RE.match(path)
 *     if m:
 *         return m.group(3)             # <<<<<<<<<<<<<<
 *     else:
 *         return path
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_n_s_group); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 51, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_int_3);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 51, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "pyarrow/io-hdfs.pxi":50
 * def strip_hdfs_abspath(path):
 *     m = _HDFS_PATH_RE.match(path)
 *     if m:             # <<<<<<<<<<<<<<
 *         return m.group(3)
 *     else:
 */
  }

  /* "pyarrow/io-hdfs.pxi":53
 *         return m.group(3)
 *     else:
 *         return path             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_path);
    __pyx_r = __pyx_v_path;
    goto __pyx_L0;
  }

  /* "pyarrow/io-hdfs.pxi":48
 * 
 * 
 * def strip_hdfs_abspath(path):             # <<<<<<<<<<<<<<
 *     m = _HDFS_PATH_RE.match(path)
 *     if m:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.strip_hdfs_abspath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":69
 *         dict extra_conf
 * 
 *     def _connect(self, host, port, user, kerb_ticket, driver, extra_conf):             # <<<<<<<<<<<<<<
 *         cdef HdfsConnectionConfig conf
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_1_connect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem__connect[] = "HadoopFileSystem._connect(self, host, port, user, kerb_ticket, driver, extra_conf)";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_1_connect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_host = 0;
  PyObject *__pyx_v_port = 0;
  PyObject *__pyx_v_user = 0;
  PyObject *__pyx_v_kerb_ticket = 0;
  PyObject *__pyx_v_driver = 0;
  PyObject *__pyx_v_extra_conf = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_connect (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_host,&__pyx_n_s_port,&__pyx_n_s_user,&__pyx_n_s_kerb_ticket,&__pyx_n_s_driver,&__pyx_n_s_extra_conf,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_host)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_port)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_connect", 1, 6, 6, 1); __PYX_ERR(2, 69, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_user)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_connect", 1, 6, 6, 2); __PYX_ERR(2, 69, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kerb_ticket)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_connect", 1, 6, 6, 3); __PYX_ERR(2, 69, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_driver)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_connect", 1, 6, 6, 4); __PYX_ERR(2, 69, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extra_conf)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_connect", 1, 6, 6, 5); __PYX_ERR(2, 69, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_connect") < 0)) __PYX_ERR(2, 69, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
    }
    __pyx_v_host = values[0];
    __pyx_v_port = values[1];
    __pyx_v_user = values[2];
    __pyx_v_kerb_ticket = values[3];
    __pyx_v_driver = values[4];
    __pyx_v_extra_conf = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_connect", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 69, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem._connect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem__connect(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), __pyx_v_host, __pyx_v_port, __pyx_v_user, __pyx_v_kerb_ticket, __pyx_v_driver, __pyx_v_extra_conf);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem__connect(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_host, PyObject *__pyx_v_port, PyObject *__pyx_v_user, PyObject *__pyx_v_kerb_ticket, PyObject *__pyx_v_driver, PyObject *__pyx_v_extra_conf) {
  arrow::io::HdfsConnectionConfig __pyx_v_conf;
  PyObject *__pyx_9genexpr20__pyx_v_k = NULL;
  PyObject *__pyx_9genexpr20__pyx_v_v = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  std::unordered_map<std::string,std::string>  __pyx_t_15;
  __Pyx_RefNannySetupContext("_connect", 0);

  /* "pyarrow/io-hdfs.pxi":72
 *         cdef HdfsConnectionConfig conf
 * 
 *         if host is not None:             # <<<<<<<<<<<<<<
 *             conf.host = tobytes(host)
 *         self.host = host
 */
  __pyx_t_1 = (__pyx_v_host != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/io-hdfs.pxi":73
 * 
 *         if host is not None:
 *             conf.host = tobytes(host)             # <<<<<<<<<<<<<<
 *         self.host = host
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 73, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_host) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_host);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 73, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 73, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_conf.host = __pyx_t_6;

    /* "pyarrow/io-hdfs.pxi":72
 *         cdef HdfsConnectionConfig conf
 * 
 *         if host is not None:             # <<<<<<<<<<<<<<
 *             conf.host = tobytes(host)
 *         self.host = host
 */
  }

  /* "pyarrow/io-hdfs.pxi":74
 *         if host is not None:
 *             conf.host = tobytes(host)
 *         self.host = host             # <<<<<<<<<<<<<<
 * 
 *         conf.port = port
 */
  __Pyx_INCREF(__pyx_v_host);
  __Pyx_GIVEREF(__pyx_v_host);
  __Pyx_GOTREF(__pyx_v_self->host);
  __Pyx_DECREF(__pyx_v_self->host);
  __pyx_v_self->host = __pyx_v_host;

  /* "pyarrow/io-hdfs.pxi":76
 *         self.host = host
 * 
 *         conf.port = port             # <<<<<<<<<<<<<<
 *         self.port = port
 * 
 */
  __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_port); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 76, __pyx_L1_error)
  __pyx_v_conf.port = __pyx_t_7;

  /* "pyarrow/io-hdfs.pxi":77
 * 
 *         conf.port = port
 *         self.port = port             # <<<<<<<<<<<<<<
 * 
 *         if user is not None:
 */
  __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_port); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 77, __pyx_L1_error)
  __pyx_v_self->port = __pyx_t_7;

  /* "pyarrow/io-hdfs.pxi":79
 *         self.port = port
 * 
 *         if user is not None:             # <<<<<<<<<<<<<<
 *             conf.user = tobytes(user)
 *         self.user = user
 */
  __pyx_t_2 = (__pyx_v_user != Py_None);
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pyarrow/io-hdfs.pxi":80
 * 
 *         if user is not None:
 *             conf.user = tobytes(user)             # <<<<<<<<<<<<<<
 *         self.user = user
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 80, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_user) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_user);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 80, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 80, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_conf.user = __pyx_t_6;

    /* "pyarrow/io-hdfs.pxi":79
 *         self.port = port
 * 
 *         if user is not None:             # <<<<<<<<<<<<<<
 *             conf.user = tobytes(user)
 *         self.user = user
 */
  }

  /* "pyarrow/io-hdfs.pxi":81
 *         if user is not None:
 *             conf.user = tobytes(user)
 *         self.user = user             # <<<<<<<<<<<<<<
 * 
 *         if kerb_ticket is not None:
 */
  __Pyx_INCREF(__pyx_v_user);
  __Pyx_GIVEREF(__pyx_v_user);
  __Pyx_GOTREF(__pyx_v_self->user);
  __Pyx_DECREF(__pyx_v_self->user);
  __pyx_v_self->user = __pyx_v_user;

  /* "pyarrow/io-hdfs.pxi":83
 *         self.user = user
 * 
 *         if kerb_ticket is not None:             # <<<<<<<<<<<<<<
 *             conf.kerb_ticket = tobytes(kerb_ticket)
 *         self.kerb_ticket = kerb_ticket
 */
  __pyx_t_1 = (__pyx_v_kerb_ticket != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/io-hdfs.pxi":84
 * 
 *         if kerb_ticket is not None:
 *             conf.kerb_ticket = tobytes(kerb_ticket)             # <<<<<<<<<<<<<<
 *         self.kerb_ticket = kerb_ticket
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 84, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_kerb_ticket) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_kerb_ticket);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 84, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 84, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_conf.kerb_ticket = __pyx_t_6;

    /* "pyarrow/io-hdfs.pxi":83
 *         self.user = user
 * 
 *         if kerb_ticket is not None:             # <<<<<<<<<<<<<<
 *             conf.kerb_ticket = tobytes(kerb_ticket)
 *         self.kerb_ticket = kerb_ticket
 */
  }

  /* "pyarrow/io-hdfs.pxi":85
 *         if kerb_ticket is not None:
 *             conf.kerb_ticket = tobytes(kerb_ticket)
 *         self.kerb_ticket = kerb_ticket             # <<<<<<<<<<<<<<
 * 
 *         if driver == 'libhdfs':
 */
  __Pyx_INCREF(__pyx_v_kerb_ticket);
  __Pyx_GIVEREF(__pyx_v_kerb_ticket);
  __Pyx_GOTREF(__pyx_v_self->kerb_ticket);
  __Pyx_DECREF(__pyx_v_self->kerb_ticket);
  __pyx_v_self->kerb_ticket = __pyx_v_kerb_ticket;

  /* "pyarrow/io-hdfs.pxi":87
 *         self.kerb_ticket = kerb_ticket
 * 
 *         if driver == 'libhdfs':             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 check_status(HaveLibHdfs())
 */
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_driver, __pyx_n_u_libhdfs, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 87, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "pyarrow/io-hdfs.pxi":88
 * 
 *         if driver == 'libhdfs':
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(HaveLibHdfs())
 *             conf.driver = HdfsDriver_LIBHDFS
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "pyarrow/io-hdfs.pxi":89
 *         if driver == 'libhdfs':
 *             with nogil:
 *                 check_status(HaveLibHdfs())             # <<<<<<<<<<<<<<
 *             conf.driver = HdfsDriver_LIBHDFS
 *         elif driver == 'libhdfs3':
 */
          __pyx_t_7 = __pyx_f_7pyarrow_3lib_check_status(arrow::io::HaveLibHdfs()); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 89, __pyx_L8_error)
        }

        /* "pyarrow/io-hdfs.pxi":88
 * 
 *         if driver == 'libhdfs':
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(HaveLibHdfs())
 *             conf.driver = HdfsDriver_LIBHDFS
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L9;
          }
          __pyx_L8_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L9:;
        }
    }

    /* "pyarrow/io-hdfs.pxi":90
 *             with nogil:
 *                 check_status(HaveLibHdfs())
 *             conf.driver = HdfsDriver_LIBHDFS             # <<<<<<<<<<<<<<
 *         elif driver == 'libhdfs3':
 *             with nogil:
 */
    __pyx_v_conf.driver =  arrow::io::HdfsDriver::LIBHDFS;

    /* "pyarrow/io-hdfs.pxi":87
 *         self.kerb_ticket = kerb_ticket
 * 
 *         if driver == 'libhdfs':             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 check_status(HaveLibHdfs())
 */
    goto __pyx_L6;
  }

  /* "pyarrow/io-hdfs.pxi":91
 *                 check_status(HaveLibHdfs())
 *             conf.driver = HdfsDriver_LIBHDFS
 *         elif driver == 'libhdfs3':             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 check_status(HaveLibHdfs3())
 */
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_driver, __pyx_n_u_libhdfs3, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 91, __pyx_L1_error)
  if (likely(__pyx_t_2)) {

    /* "pyarrow/io-hdfs.pxi":92
 *             conf.driver = HdfsDriver_LIBHDFS
 *         elif driver == 'libhdfs3':
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(HaveLibHdfs3())
 *             conf.driver = HdfsDriver_LIBHDFS3
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "pyarrow/io-hdfs.pxi":93
 *         elif driver == 'libhdfs3':
 *             with nogil:
 *                 check_status(HaveLibHdfs3())             # <<<<<<<<<<<<<<
 *             conf.driver = HdfsDriver_LIBHDFS3
 *         else:
 */
          __pyx_t_7 = __pyx_f_7pyarrow_3lib_check_status(arrow::io::HaveLibHdfs3()); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 93, __pyx_L11_error)
        }

        /* "pyarrow/io-hdfs.pxi":92
 *             conf.driver = HdfsDriver_LIBHDFS
 *         elif driver == 'libhdfs3':
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(HaveLibHdfs3())
 *             conf.driver = HdfsDriver_LIBHDFS3
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L12;
          }
          __pyx_L11_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L12:;
        }
    }

    /* "pyarrow/io-hdfs.pxi":94
 *             with nogil:
 *                 check_status(HaveLibHdfs3())
 *             conf.driver = HdfsDriver_LIBHDFS3             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError("unknown driver: %r" % driver)
 */
    __pyx_v_conf.driver =  arrow::io::HdfsDriver::LIBHDFS3;

    /* "pyarrow/io-hdfs.pxi":91
 *                 check_status(HaveLibHdfs())
 *             conf.driver = HdfsDriver_LIBHDFS
 *         elif driver == 'libhdfs3':             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 check_status(HaveLibHdfs3())
 */
    goto __pyx_L6;
  }

  /* "pyarrow/io-hdfs.pxi":96
 *             conf.driver = HdfsDriver_LIBHDFS3
 *         else:
 *             raise ValueError("unknown driver: %r" % driver)             # <<<<<<<<<<<<<<
 *         self.driver = driver
 * 
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unknown_driver_r, __pyx_v_driver); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 96, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 96, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(2, 96, __pyx_L1_error)
  }
  __pyx_L6:;

  /* "pyarrow/io-hdfs.pxi":97
 *         else:
 *             raise ValueError("unknown driver: %r" % driver)
 *         self.driver = driver             # <<<<<<<<<<<<<<
 * 
 *         if extra_conf is not None and isinstance(extra_conf, dict):
 */
  __Pyx_INCREF(__pyx_v_driver);
  __Pyx_GIVEREF(__pyx_v_driver);
  __Pyx_GOTREF(__pyx_v_self->driver);
  __Pyx_DECREF(__pyx_v_self->driver);
  __pyx_v_self->driver = __pyx_v_driver;

  /* "pyarrow/io-hdfs.pxi":99
 *         self.driver = driver
 * 
 *         if extra_conf is not None and isinstance(extra_conf, dict):             # <<<<<<<<<<<<<<
 *             conf.extra_conf = {tobytes(k): tobytes(v)
 *                                for k, v in extra_conf.items()}
 */
  __pyx_t_1 = (__pyx_v_extra_conf != Py_None);
  __pyx_t_8 = (__pyx_t_1 != 0);
  if (__pyx_t_8) {
  } else {
    __pyx_t_2 = __pyx_t_8;
    goto __pyx_L14_bool_binop_done;
  }
  __pyx_t_8 = PyDict_Check(__pyx_v_extra_conf); 
  __pyx_t_1 = (__pyx_t_8 != 0);
  __pyx_t_2 = __pyx_t_1;
  __pyx_L14_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pyarrow/io-hdfs.pxi":100
 * 
 *         if extra_conf is not None and isinstance(extra_conf, dict):
 *             conf.extra_conf = {tobytes(k): tobytes(v)             # <<<<<<<<<<<<<<
 *                                for k, v in extra_conf.items()}
 *         self.extra_conf = extra_conf
 */
    { /* enter inner scope */
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 100, __pyx_L18_error)
      __Pyx_GOTREF(__pyx_t_4);

      /* "pyarrow/io-hdfs.pxi":101
 *         if extra_conf is not None and isinstance(extra_conf, dict):
 *             conf.extra_conf = {tobytes(k): tobytes(v)
 *                                for k, v in extra_conf.items()}             # <<<<<<<<<<<<<<
 *         self.extra_conf = extra_conf
 * 
 */
      __pyx_t_9 = 0;
      if (unlikely(__pyx_v_extra_conf == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
        __PYX_ERR(2, 101, __pyx_L18_error)
      }
      __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_extra_conf, 0, __pyx_n_s_items, (&__pyx_t_10), (&__pyx_t_7)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 101, __pyx_L18_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_3);
      __pyx_t_3 = __pyx_t_5;
      __pyx_t_5 = 0;
      while (1) {
        __pyx_t_12 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_10, &__pyx_t_9, &__pyx_t_5, &__pyx_t_11, NULL, __pyx_t_7);
        if (unlikely(__pyx_t_12 == 0)) break;
        if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(2, 101, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_XDECREF_SET(__pyx_9genexpr20__pyx_v_k, __pyx_t_5);
        __pyx_t_5 = 0;
        __Pyx_XDECREF_SET(__pyx_9genexpr20__pyx_v_v, __pyx_t_11);
        __pyx_t_11 = 0;

        /* "pyarrow/io-hdfs.pxi":100
 * 
 *         if extra_conf is not None and isinstance(extra_conf, dict):
 *             conf.extra_conf = {tobytes(k): tobytes(v)             # <<<<<<<<<<<<<<
 *                                for k, v in extra_conf.items()}
 *         self.extra_conf = extra_conf
 */
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 100, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_13 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
          }
        }
        __pyx_t_11 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_13, __pyx_9genexpr20__pyx_v_k) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_9genexpr20__pyx_v_k);
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 100, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 100, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_14 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
          __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
          if (likely(__pyx_t_14)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
            __Pyx_INCREF(__pyx_t_14);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_13, function);
          }
        }
        __pyx_t_5 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_14, __pyx_9genexpr20__pyx_v_v) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_9genexpr20__pyx_v_v);
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 100, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(PyDict_SetItem(__pyx_t_4, (PyObject*)__pyx_t_11, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 100, __pyx_L18_error)
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_k); __pyx_9genexpr20__pyx_v_k = 0;
      __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_v); __pyx_9genexpr20__pyx_v_v = 0;
      goto __pyx_L21_exit_scope;
      __pyx_L18_error:;
      __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_k); __pyx_9genexpr20__pyx_v_k = 0;
      __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_v); __pyx_9genexpr20__pyx_v_v = 0;
      goto __pyx_L1_error;
      __pyx_L21_exit_scope:;
    } /* exit inner scope */
    __pyx_t_15 = __pyx_convert_unordered_map_from_py_std_3a__3a_string__and_std_3a__3a_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 100, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_conf.extra_conf = __pyx_t_15;

    /* "pyarrow/io-hdfs.pxi":99
 *         self.driver = driver
 * 
 *         if extra_conf is not None and isinstance(extra_conf, dict):             # <<<<<<<<<<<<<<
 *             conf.extra_conf = {tobytes(k): tobytes(v)
 *                                for k, v in extra_conf.items()}
 */
  }

  /* "pyarrow/io-hdfs.pxi":102
 *             conf.extra_conf = {tobytes(k): tobytes(v)
 *                                for k, v in extra_conf.items()}
 *         self.extra_conf = extra_conf             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  if (!(likely(PyDict_CheckExact(__pyx_v_extra_conf))||((__pyx_v_extra_conf) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_extra_conf)->tp_name), 0))) __PYX_ERR(2, 102, __pyx_L1_error)
  __pyx_t_4 = __pyx_v_extra_conf;
  __Pyx_INCREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_self->extra_conf);
  __Pyx_DECREF(__pyx_v_self->extra_conf);
  __pyx_v_self->extra_conf = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyarrow/io-hdfs.pxi":104
 *         self.extra_conf = extra_conf
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CIOHadoopFileSystem.Connect(&conf, &self.client))
 *         self.is_open = True
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io-hdfs.pxi":105
 * 
 *         with nogil:
 *             check_status(CIOHadoopFileSystem.Connect(&conf, &self.client))             # <<<<<<<<<<<<<<
 *         self.is_open = True
 * 
 */
        __pyx_t_7 = __pyx_f_7pyarrow_3lib_check_status(arrow::io::HadoopFileSystem::Connect((&__pyx_v_conf), (&__pyx_v_self->client))); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 105, __pyx_L23_error)
      }

      /* "pyarrow/io-hdfs.pxi":104
 *         self.extra_conf = extra_conf
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CIOHadoopFileSystem.Connect(&conf, &self.client))
 *         self.is_open = True
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L24;
        }
        __pyx_L23_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L24:;
      }
  }

  /* "pyarrow/io-hdfs.pxi":106
 *         with nogil:
 *             check_status(CIOHadoopFileSystem.Connect(&conf, &self.client))
 *         self.is_open = True             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __pyx_v_self->is_open = 1;

  /* "pyarrow/io-hdfs.pxi":69
 *         dict extra_conf
 * 
 *     def _connect(self, host, port, user, kerb_ticket, driver, extra_conf):             # <<<<<<<<<<<<<<
 *         cdef HdfsConnectionConfig conf
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem._connect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_k);
  __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_v);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":109
 * 
 *     @classmethod
 *     def connect(cls, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         return cls(*args, **kwargs)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_3connect(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_2connect[] = "HadoopFileSystem.connect(type cls, *args, **kwargs)";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_3connect(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("connect (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "connect", 1))) return NULL;
  if (unlikely(__pyx_kwds)) {
    __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return NULL;
    __Pyx_GOTREF(__pyx_v_kwargs);
  } else {
    __pyx_v_kwargs = NULL;
  }
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_2connect(((PyTypeObject*)__pyx_v_cls), __pyx_v_args, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_2connect(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("connect", 0);

  /* "pyarrow/io-hdfs.pxi":110
 *     @classmethod
 *     def connect(cls, *args, **kwargs):
 *         return cls(*args, **kwargs)             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_cls), __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io-hdfs.pxi":109
 * 
 *     @classmethod
 *     def connect(cls, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         return cls(*args, **kwargs)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.connect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":112
 *         return cls(*args, **kwargs)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self.is_open:
 *             self.close()
 */

/* Python wrapper */
static void __pyx_pw_7pyarrow_3lib_16HadoopFileSystem_5__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7pyarrow_3lib_16HadoopFileSystem_5__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_4__dealloc__(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_4__dealloc__(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pyarrow/io-hdfs.pxi":113
 * 
 *     def __dealloc__(self):
 *         if self.is_open:             # <<<<<<<<<<<<<<
 *             self.close()
 * 
 */
  __pyx_t_1 = (__pyx_v_self->is_open != 0);
  if (__pyx_t_1) {

    /* "pyarrow/io-hdfs.pxi":114
 *     def __dealloc__(self):
 *         if self.is_open:
 *             self.close()             # <<<<<<<<<<<<<<
 * 
 *     def close(self):
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 114, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 114, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pyarrow/io-hdfs.pxi":113
 * 
 *     def __dealloc__(self):
 *         if self.is_open:             # <<<<<<<<<<<<<<
 *             self.close()
 * 
 */
  }

  /* "pyarrow/io-hdfs.pxi":112
 *         return cls(*args, **kwargs)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self.is_open:
 *             self.close()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("pyarrow.lib.HadoopFileSystem.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/io-hdfs.pxi":116
 *             self.close()
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         """
 *         Disconnect from the HDFS cluster
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_7close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_6close[] = "HadoopFileSystem.close(self)\n\n        Disconnect from the HDFS cluster\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_7close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("close (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_6close(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_6close(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("close", 0);

  /* "pyarrow/io-hdfs.pxi":120
 *         Disconnect from the HDFS cluster
 *         """
 *         self._ensure_client()             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(self.client.get().Disconnect())
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self->__pyx_vtab)->_ensure_client(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":121
 *         """
 *         self._ensure_client()
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get().Disconnect())
 *         self.is_open = False
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io-hdfs.pxi":122
 *         self._ensure_client()
 *         with nogil:
 *             check_status(self.client.get().Disconnect())             # <<<<<<<<<<<<<<
 *         self.is_open = False
 * 
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->client.get()->Disconnect()); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(2, 122, __pyx_L4_error)
      }

      /* "pyarrow/io-hdfs.pxi":121
 *         """
 *         self._ensure_client()
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get().Disconnect())
 *         self.is_open = False
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io-hdfs.pxi":123
 *         with nogil:
 *             check_status(self.client.get().Disconnect())
 *         self.is_open = False             # <<<<<<<<<<<<<<
 * 
 *     cdef _ensure_client(self):
 */
  __pyx_v_self->is_open = 0;

  /* "pyarrow/io-hdfs.pxi":116
 *             self.close()
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         """
 *         Disconnect from the HDFS cluster
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.close", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":125
 *         self.is_open = False
 * 
 *     cdef _ensure_client(self):             # <<<<<<<<<<<<<<
 *         if self.client.get() == NULL:
 *             raise IOError('HDFS client improperly initialized')
 */

static PyObject *__pyx_f_7pyarrow_3lib_16HadoopFileSystem__ensure_client(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("_ensure_client", 0);

  /* "pyarrow/io-hdfs.pxi":126
 * 
 *     cdef _ensure_client(self):
 *         if self.client.get() == NULL:             # <<<<<<<<<<<<<<
 *             raise IOError('HDFS client improperly initialized')
 *         elif not self.is_open:
 */
  __pyx_t_1 = ((__pyx_v_self->client.get() == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/io-hdfs.pxi":127
 *     cdef _ensure_client(self):
 *         if self.client.get() == NULL:
 *             raise IOError('HDFS client improperly initialized')             # <<<<<<<<<<<<<<
 *         elif not self.is_open:
 *             raise IOError('HDFS client is closed')
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__238, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 127, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(2, 127, __pyx_L1_error)

    /* "pyarrow/io-hdfs.pxi":126
 * 
 *     cdef _ensure_client(self):
 *         if self.client.get() == NULL:             # <<<<<<<<<<<<<<
 *             raise IOError('HDFS client improperly initialized')
 *         elif not self.is_open:
 */
  }

  /* "pyarrow/io-hdfs.pxi":128
 *         if self.client.get() == NULL:
 *             raise IOError('HDFS client improperly initialized')
 *         elif not self.is_open:             # <<<<<<<<<<<<<<
 *             raise IOError('HDFS client is closed')
 * 
 */
  __pyx_t_1 = ((!(__pyx_v_self->is_open != 0)) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/io-hdfs.pxi":129
 *             raise IOError('HDFS client improperly initialized')
 *         elif not self.is_open:
 *             raise IOError('HDFS client is closed')             # <<<<<<<<<<<<<<
 * 
 *     def exists(self, path):
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__239, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 129, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(2, 129, __pyx_L1_error)

    /* "pyarrow/io-hdfs.pxi":128
 *         if self.client.get() == NULL:
 *             raise IOError('HDFS client improperly initialized')
 *         elif not self.is_open:             # <<<<<<<<<<<<<<
 *             raise IOError('HDFS client is closed')
 * 
 */
  }

  /* "pyarrow/io-hdfs.pxi":125
 *         self.is_open = False
 * 
 *     cdef _ensure_client(self):             # <<<<<<<<<<<<<<
 *         if self.client.get() == NULL:
 *             raise IOError('HDFS client improperly initialized')
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem._ensure_client", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":131
 *             raise IOError('HDFS client is closed')
 * 
 *     def exists(self, path):             # <<<<<<<<<<<<<<
 *         """
 *         Returns True if the path is known to the cluster, False if it does not
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_9exists(PyObject *__pyx_v_self, PyObject *__pyx_v_path); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_8exists[] = "HadoopFileSystem.exists(self, path)\n\n        Returns True if the path is known to the cluster, False if it does not\n        (or there is an RPC error)\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_9exists(PyObject *__pyx_v_self, PyObject *__pyx_v_path) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("exists (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_8exists(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), ((PyObject *)__pyx_v_path));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_8exists(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path) {
  std::string __pyx_v_c_path;
  bool __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  __Pyx_RefNannySetupContext("exists", 0);

  /* "pyarrow/io-hdfs.pxi":136
 *         (or there is an RPC error)
 *         """
 *         self._ensure_client()             # <<<<<<<<<<<<<<
 * 
 *         cdef c_string c_path = tobytes(path)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self->__pyx_vtab)->_ensure_client(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":138
 *         self._ensure_client()
 * 
 *         cdef c_string c_path = tobytes(path)             # <<<<<<<<<<<<<<
 *         cdef c_bool result
 *         with nogil:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_path) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_path);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 138, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_path = __pyx_t_4;

  /* "pyarrow/io-hdfs.pxi":140
 *         cdef c_string c_path = tobytes(path)
 *         cdef c_bool result
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = self.client.get().Exists(c_path)
 *         return result
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io-hdfs.pxi":141
 *         cdef c_bool result
 *         with nogil:
 *             result = self.client.get().Exists(c_path)             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
        __pyx_v_result = __pyx_v_self->client.get()->Exists(__pyx_v_c_path);
      }

      /* "pyarrow/io-hdfs.pxi":140
 *         cdef c_string c_path = tobytes(path)
 *         cdef c_bool result
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = self.client.get().Exists(c_path)
 *         return result
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io-hdfs.pxi":142
 *         with nogil:
 *             result = self.client.get().Exists(c_path)
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def isdir(self, path):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io-hdfs.pxi":131
 *             raise IOError('HDFS client is closed')
 * 
 *     def exists(self, path):             # <<<<<<<<<<<<<<
 *         """
 *         Returns True if the path is known to the cluster, False if it does not
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.exists", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":144
 *         return result
 * 
 *     def isdir(self, path):             # <<<<<<<<<<<<<<
 *         cdef HdfsPathInfo info
 *         try:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_11isdir(PyObject *__pyx_v_self, PyObject *__pyx_v_path); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_10isdir[] = "HadoopFileSystem.isdir(self, path)";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_11isdir(PyObject *__pyx_v_self, PyObject *__pyx_v_path) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("isdir (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_10isdir(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), ((PyObject *)__pyx_v_path));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_10isdir(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path) {
  arrow::io::HdfsPathInfo __pyx_v_info;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("isdir", 0);

  /* "pyarrow/io-hdfs.pxi":146
 *     def isdir(self, path):
 *         cdef HdfsPathInfo info
 *         try:             # <<<<<<<<<<<<<<
 *             self._path_info(path, &info)
 *         except ArrowIOError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "pyarrow/io-hdfs.pxi":147
 *         cdef HdfsPathInfo info
 *         try:
 *             self._path_info(path, &info)             # <<<<<<<<<<<<<<
 *         except ArrowIOError:
 *             return False
 */
      __pyx_t_4 = ((struct __pyx_vtabstruct_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self->__pyx_vtab)->_path_info(__pyx_v_self, __pyx_v_path, (&__pyx_v_info)); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 147, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "pyarrow/io-hdfs.pxi":146
 *     def isdir(self, path):
 *         cdef HdfsPathInfo info
 *         try:             # <<<<<<<<<<<<<<
 *             self._path_info(path, &info)
 *         except ArrowIOError:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/io-hdfs.pxi":148
 *         try:
 *             self._path_info(path, &info)
 *         except ArrowIOError:             # <<<<<<<<<<<<<<
 *             return False
 *         return info.kind == ObjectType_DIRECTORY
 */
    __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ArrowIOError); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 148, __pyx_L5_except_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_4, __pyx_t_7);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_ErrRestore(__pyx_t_4, __pyx_t_5, __pyx_t_6);
    __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0;
    if (__pyx_t_8) {
      __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.isdir", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) __PYX_ERR(2, 148, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_4);

      /* "pyarrow/io-hdfs.pxi":149
 *             self._path_info(path, &info)
 *         except ArrowIOError:
 *             return False             # <<<<<<<<<<<<<<
 *         return info.kind == ObjectType_DIRECTORY
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/io-hdfs.pxi":146
 *     def isdir(self, path):
 *         cdef HdfsPathInfo info
 *         try:             # <<<<<<<<<<<<<<
 *             self._path_info(path, &info)
 *         except ArrowIOError:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L8_try_end:;
  }

  /* "pyarrow/io-hdfs.pxi":150
 *         except ArrowIOError:
 *             return False
 *         return info.kind == ObjectType_DIRECTORY             # <<<<<<<<<<<<<<
 * 
 *     def isfile(self, path):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyBool_FromLong((__pyx_v_info.kind ==  arrow::io::ObjectType::DIRECTORY)); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/io-hdfs.pxi":144
 *         return result
 * 
 *     def isdir(self, path):             # <<<<<<<<<<<<<<
 *         cdef HdfsPathInfo info
 *         try:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.isdir", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":152
 *         return info.kind == ObjectType_DIRECTORY
 * 
 *     def isfile(self, path):             # <<<<<<<<<<<<<<
 *         cdef HdfsPathInfo info
 *         try:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_13isfile(PyObject *__pyx_v_self, PyObject *__pyx_v_path); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_12isfile[] = "HadoopFileSystem.isfile(self, path)";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_13isfile(PyObject *__pyx_v_self, PyObject *__pyx_v_path) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("isfile (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_12isfile(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), ((PyObject *)__pyx_v_path));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_12isfile(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path) {
  arrow::io::HdfsPathInfo __pyx_v_info;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("isfile", 0);

  /* "pyarrow/io-hdfs.pxi":154
 *     def isfile(self, path):
 *         cdef HdfsPathInfo info
 *         try:             # <<<<<<<<<<<<<<
 *             self._path_info(path, &info)
 *         except ArrowIOError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "pyarrow/io-hdfs.pxi":155
 *         cdef HdfsPathInfo info
 *         try:
 *             self._path_info(path, &info)             # <<<<<<<<<<<<<<
 *         except ArrowIOError:
 *             return False
 */
      __pyx_t_4 = ((struct __pyx_vtabstruct_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self->__pyx_vtab)->_path_info(__pyx_v_self, __pyx_v_path, (&__pyx_v_info)); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 155, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "pyarrow/io-hdfs.pxi":154
 *     def isfile(self, path):
 *         cdef HdfsPathInfo info
 *         try:             # <<<<<<<<<<<<<<
 *             self._path_info(path, &info)
 *         except ArrowIOError:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/io-hdfs.pxi":156
 *         try:
 *             self._path_info(path, &info)
 *         except ArrowIOError:             # <<<<<<<<<<<<<<
 *             return False
 *         return info.kind == ObjectType_FILE
 */
    __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ArrowIOError); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 156, __pyx_L5_except_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_4, __pyx_t_7);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_ErrRestore(__pyx_t_4, __pyx_t_5, __pyx_t_6);
    __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0;
    if (__pyx_t_8) {
      __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.isfile", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) __PYX_ERR(2, 156, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_4);

      /* "pyarrow/io-hdfs.pxi":157
 *             self._path_info(path, &info)
 *         except ArrowIOError:
 *             return False             # <<<<<<<<<<<<<<
 *         return info.kind == ObjectType_FILE
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/io-hdfs.pxi":154
 *     def isfile(self, path):
 *         cdef HdfsPathInfo info
 *         try:             # <<<<<<<<<<<<<<
 *             self._path_info(path, &info)
 *         except ArrowIOError:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L8_try_end:;
  }

  /* "pyarrow/io-hdfs.pxi":158
 *         except ArrowIOError:
 *             return False
 *         return info.kind == ObjectType_FILE             # <<<<<<<<<<<<<<
 * 
 *     def get_capacity(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyBool_FromLong((__pyx_v_info.kind ==  arrow::io::ObjectType::FILE)); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/io-hdfs.pxi":152
 *         return info.kind == ObjectType_DIRECTORY
 * 
 *     def isfile(self, path):             # <<<<<<<<<<<<<<
 *         cdef HdfsPathInfo info
 *         try:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.isfile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":160
 *         return info.kind == ObjectType_FILE
 * 
 *     def get_capacity(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get reported total capacity of file system
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_15get_capacity(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_14get_capacity[] = "HadoopFileSystem.get_capacity(self)\n\n        Get reported total capacity of file system\n\n        Returns\n        -------\n        capacity : int\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_15get_capacity(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_capacity (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_14get_capacity(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_14get_capacity(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self) {
  int64_t __pyx_v_capacity;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("get_capacity", 0);

  /* "pyarrow/io-hdfs.pxi":168
 *         capacity : int
 *         """
 *         cdef int64_t capacity = 0             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(self.client.get().GetCapacity(&capacity))
 */
  __pyx_v_capacity = 0;

  /* "pyarrow/io-hdfs.pxi":169
 *         """
 *         cdef int64_t capacity = 0
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get().GetCapacity(&capacity))
 *         return capacity
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io-hdfs.pxi":170
 *         cdef int64_t capacity = 0
 *         with nogil:
 *             check_status(self.client.get().GetCapacity(&capacity))             # <<<<<<<<<<<<<<
 *         return capacity
 * 
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->client.get()->GetCapacity((&__pyx_v_capacity))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 170, __pyx_L4_error)
      }

      /* "pyarrow/io-hdfs.pxi":169
 *         """
 *         cdef int64_t capacity = 0
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get().GetCapacity(&capacity))
 *         return capacity
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io-hdfs.pxi":171
 *         with nogil:
 *             check_status(self.client.get().GetCapacity(&capacity))
 *         return capacity             # <<<<<<<<<<<<<<
 * 
 *     def get_space_used(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_capacity); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/io-hdfs.pxi":160
 *         return info.kind == ObjectType_FILE
 * 
 *     def get_capacity(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get reported total capacity of file system
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.get_capacity", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":173
 *         return capacity
 * 
 *     def get_space_used(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get space used on file system
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_17get_space_used(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_16get_space_used[] = "HadoopFileSystem.get_space_used(self)\n\n        Get space used on file system\n\n        Returns\n        -------\n        space_used : int\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_17get_space_used(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_space_used (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_16get_space_used(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_16get_space_used(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self) {
  int64_t __pyx_v_space_used;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("get_space_used", 0);

  /* "pyarrow/io-hdfs.pxi":181
 *         space_used : int
 *         """
 *         cdef int64_t space_used = 0             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(self.client.get().GetUsed(&space_used))
 */
  __pyx_v_space_used = 0;

  /* "pyarrow/io-hdfs.pxi":182
 *         """
 *         cdef int64_t space_used = 0
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get().GetUsed(&space_used))
 *         return space_used
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io-hdfs.pxi":183
 *         cdef int64_t space_used = 0
 *         with nogil:
 *             check_status(self.client.get().GetUsed(&space_used))             # <<<<<<<<<<<<<<
 *         return space_used
 * 
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->client.get()->GetUsed((&__pyx_v_space_used))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 183, __pyx_L4_error)
      }

      /* "pyarrow/io-hdfs.pxi":182
 *         """
 *         cdef int64_t space_used = 0
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get().GetUsed(&space_used))
 *         return space_used
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io-hdfs.pxi":184
 *         with nogil:
 *             check_status(self.client.get().GetUsed(&space_used))
 *         return space_used             # <<<<<<<<<<<<<<
 * 
 *     def df(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_space_used); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/io-hdfs.pxi":173
 *         return capacity
 * 
 *     def get_space_used(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get space used on file system
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.get_space_used", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":186
 *         return space_used
 * 
 *     def df(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return free space on disk, like the UNIX df command
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_19df(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_18df[] = "HadoopFileSystem.df(self)\n\n        Return free space on disk, like the UNIX df command\n\n        Returns\n        -------\n        space : int\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_19df(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("df (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_18df(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_18df(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("df", 0);

  /* "pyarrow/io-hdfs.pxi":194
 *         space : int
 *         """
 *         return self.get_capacity() - self.get_space_used()             # <<<<<<<<<<<<<<
 * 
 *     def rename(self, path, new_path):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_capacity); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_space_used); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/io-hdfs.pxi":186
 *         return space_used
 * 
 *     def df(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return free space on disk, like the UNIX df command
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.df", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":196
 *         return self.get_capacity() - self.get_space_used()
 * 
 *     def rename(self, path, new_path):             # <<<<<<<<<<<<<<
 *         cdef c_string c_path = tobytes(path)
 *         cdef c_string c_new_path = tobytes(new_path)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_21rename(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_20rename[] = "HadoopFileSystem.rename(self, path, new_path)";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_21rename(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_new_path = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rename (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_new_path,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_new_path)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("rename", 1, 2, 2, 1); __PYX_ERR(2, 196, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rename") < 0)) __PYX_ERR(2, 196, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_path = values[0];
    __pyx_v_new_path = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("rename", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 196, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.rename", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_20rename(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), __pyx_v_path, __pyx_v_new_path);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_20rename(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_new_path) {
  std::string __pyx_v_c_path;
  std::string __pyx_v_c_new_path;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("rename", 0);

  /* "pyarrow/io-hdfs.pxi":197
 * 
 *     def rename(self, path, new_path):
 *         cdef c_string c_path = tobytes(path)             # <<<<<<<<<<<<<<
 *         cdef c_string c_new_path = tobytes(new_path)
 *         with nogil:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_path) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_path);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 197, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_path = __pyx_t_4;

  /* "pyarrow/io-hdfs.pxi":198
 *     def rename(self, path, new_path):
 *         cdef c_string c_path = tobytes(path)
 *         cdef c_string c_new_path = tobytes(new_path)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(self.client.get().Rename(c_path, c_new_path))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_new_path) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_new_path);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 198, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_new_path = __pyx_t_4;

  /* "pyarrow/io-hdfs.pxi":199
 *         cdef c_string c_path = tobytes(path)
 *         cdef c_string c_new_path = tobytes(new_path)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get().Rename(c_path, c_new_path))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io-hdfs.pxi":200
 *         cdef c_string c_new_path = tobytes(new_path)
 *         with nogil:
 *             check_status(self.client.get().Rename(c_path, c_new_path))             # <<<<<<<<<<<<<<
 * 
 *     def info(self, path):
 */
        __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->client.get()->Rename(__pyx_v_c_path, __pyx_v_c_new_path)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(2, 200, __pyx_L4_error)
      }

      /* "pyarrow/io-hdfs.pxi":199
 *         cdef c_string c_path = tobytes(path)
 *         cdef c_string c_new_path = tobytes(new_path)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get().Rename(c_path, c_new_path))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io-hdfs.pxi":196
 *         return self.get_capacity() - self.get_space_used()
 * 
 *     def rename(self, path, new_path):             # <<<<<<<<<<<<<<
 *         cdef c_string c_path = tobytes(path)
 *         cdef c_string c_new_path = tobytes(new_path)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.rename", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":202
 *             check_status(self.client.get().Rename(c_path, c_new_path))
 * 
 *     def info(self, path):             # <<<<<<<<<<<<<<
 *         """
 *         Return detailed HDFS information for path
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_23info(PyObject *__pyx_v_self, PyObject *__pyx_v_path); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_22info[] = "HadoopFileSystem.info(self, path)\n\n        Return detailed HDFS information for path\n\n        Parameters\n        ----------\n        path : string\n            Path to file or directory\n\n        Returns\n        -------\n        path_info : dict\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_23info(PyObject *__pyx_v_self, PyObject *__pyx_v_path) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("info (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_22info(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), ((PyObject *)__pyx_v_path));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_22info(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path) {
  arrow::io::HdfsPathInfo __pyx_v_info;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("info", 0);

  /* "pyarrow/io-hdfs.pxi":216
 *         """
 *         cdef HdfsPathInfo info
 *         self._path_info(path, &info)             # <<<<<<<<<<<<<<
 *         return {
 *             'path': frombytes(info.name),
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self->__pyx_vtab)->_path_info(__pyx_v_self, __pyx_v_path, (&__pyx_v_info)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":217
 *         cdef HdfsPathInfo info
 *         self._path_info(path, &info)
 *         return {             # <<<<<<<<<<<<<<
 *             'path': frombytes(info.name),
 *             'owner': frombytes(info.owner),
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/io-hdfs.pxi":218
 *         self._path_info(path, &info)
 *         return {
 *             'path': frombytes(info.name),             # <<<<<<<<<<<<<<
 *             'owner': frombytes(info.owner),
 *             'group': frombytes(info.group),
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(10); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_info.name); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_path, __pyx_t_2) < 0) __PYX_ERR(2, 218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io-hdfs.pxi":219
 *         return {
 *             'path': frombytes(info.name),
 *             'owner': frombytes(info.owner),             # <<<<<<<<<<<<<<
 *             'group': frombytes(info.group),
 *             'size': info.size,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_info.owner); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_owner, __pyx_t_2) < 0) __PYX_ERR(2, 218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io-hdfs.pxi":220
 *             'path': frombytes(info.name),
 *             'owner': frombytes(info.owner),
 *             'group': frombytes(info.group),             # <<<<<<<<<<<<<<
 *             'size': info.size,
 *             'block_size': info.block_size,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_info.group); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_group, __pyx_t_2) < 0) __PYX_ERR(2, 218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io-hdfs.pxi":221
 *             'owner': frombytes(info.owner),
 *             'group': frombytes(info.group),
 *             'size': info.size,             # <<<<<<<<<<<<<<
 *             'block_size': info.block_size,
 *             'last_modified': info.last_modified_time,
 */
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_info.size); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_size, __pyx_t_2) < 0) __PYX_ERR(2, 218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io-hdfs.pxi":222
 *             'group': frombytes(info.group),
 *             'size': info.size,
 *             'block_size': info.block_size,             # <<<<<<<<<<<<<<
 *             'last_modified': info.last_modified_time,
 *             'last_accessed': info.last_access_time,
 */
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_info.block_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_block_size, __pyx_t_2) < 0) __PYX_ERR(2, 218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io-hdfs.pxi":223
 *             'size': info.size,
 *             'block_size': info.block_size,
 *             'last_modified': info.last_modified_time,             # <<<<<<<<<<<<<<
 *             'last_accessed': info.last_access_time,
 *             'replication': info.replication,
 */
  __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_info.last_modified_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_last_modified, __pyx_t_2) < 0) __PYX_ERR(2, 218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io-hdfs.pxi":224
 *             'block_size': info.block_size,
 *             'last_modified': info.last_modified_time,
 *             'last_accessed': info.last_access_time,             # <<<<<<<<<<<<<<
 *             'replication': info.replication,
 *             'permissions': info.permissions,
 */
  __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_info.last_access_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_last_accessed, __pyx_t_2) < 0) __PYX_ERR(2, 218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io-hdfs.pxi":225
 *             'last_modified': info.last_modified_time,
 *             'last_accessed': info.last_access_time,
 *             'replication': info.replication,             # <<<<<<<<<<<<<<
 *             'permissions': info.permissions,
 *             'kind': ('directory' if info.kind == ObjectType_DIRECTORY
 */
  __pyx_t_2 = __Pyx_PyInt_From_int16_t(__pyx_v_info.replication); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_replication, __pyx_t_2) < 0) __PYX_ERR(2, 218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io-hdfs.pxi":226
 *             'last_accessed': info.last_access_time,
 *             'replication': info.replication,
 *             'permissions': info.permissions,             # <<<<<<<<<<<<<<
 *             'kind': ('directory' if info.kind == ObjectType_DIRECTORY
 *                      else 'file')
 */
  __pyx_t_2 = __Pyx_PyInt_From_int16_t(__pyx_v_info.permissions); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_permissions, __pyx_t_2) < 0) __PYX_ERR(2, 218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io-hdfs.pxi":227
 *             'replication': info.replication,
 *             'permissions': info.permissions,
 *             'kind': ('directory' if info.kind == ObjectType_DIRECTORY             # <<<<<<<<<<<<<<
 *                      else 'file')
 *         }
 */
  if (((__pyx_v_info.kind ==  arrow::io::ObjectType::DIRECTORY) != 0)) {
    __Pyx_INCREF(__pyx_n_u_directory);
    __pyx_t_2 = __pyx_n_u_directory;
  } else {
    __Pyx_INCREF(__pyx_n_u_file);
    __pyx_t_2 = __pyx_n_u_file;
  }
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_kind, __pyx_t_2) < 0) __PYX_ERR(2, 218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io-hdfs.pxi":202
 *             check_status(self.client.get().Rename(c_path, c_new_path))
 * 
 *     def info(self, path):             # <<<<<<<<<<<<<<
 *         """
 *         Return detailed HDFS information for path
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":231
 *         }
 * 
 *     def stat(self, path):             # <<<<<<<<<<<<<<
 *         """
 *         Return basic file system statistics about path
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_25stat(PyObject *__pyx_v_self, PyObject *__pyx_v_path); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_24stat[] = "HadoopFileSystem.stat(self, path)\n\n        Return basic file system statistics about path\n\n        Parameters\n        ----------\n        path : string\n            Path to file or directory\n\n        Returns\n        -------\n        stat : dict\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_25stat(PyObject *__pyx_v_self, PyObject *__pyx_v_path) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("stat (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_24stat(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), ((PyObject *)__pyx_v_path));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_24stat(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path) {
  arrow::io::FileStatistics __pyx_v_info;
  std::string __pyx_v_c_path;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("stat", 0);

  /* "pyarrow/io-hdfs.pxi":245
 *         """
 *         cdef FileStatistics info
 *         cdef c_string c_path = tobytes(path)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(self.client.get()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_path) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_path);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 245, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_path = __pyx_t_4;

  /* "pyarrow/io-hdfs.pxi":246
 *         cdef FileStatistics info
 *         cdef c_string c_path = tobytes(path)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get()
 *                          .Stat(c_path, &info))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io-hdfs.pxi":247
 *         cdef c_string c_path = tobytes(path)
 *         with nogil:
 *             check_status(self.client.get()             # <<<<<<<<<<<<<<
 *                          .Stat(c_path, &info))
 *         return {
 */
        __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->client.get()->Stat(__pyx_v_c_path, (&__pyx_v_info))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(2, 247, __pyx_L4_error)
      }

      /* "pyarrow/io-hdfs.pxi":246
 *         cdef FileStatistics info
 *         cdef c_string c_path = tobytes(path)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get()
 *                          .Stat(c_path, &info))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io-hdfs.pxi":249
 *             check_status(self.client.get()
 *                          .Stat(c_path, &info))
 *         return {             # <<<<<<<<<<<<<<
 *             'size': info.size,
 *             'kind': ('directory' if info.kind == ObjectType_DIRECTORY
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/io-hdfs.pxi":250
 *                          .Stat(c_path, &info))
 *         return {
 *             'size': info.size,             # <<<<<<<<<<<<<<
 *             'kind': ('directory' if info.kind == ObjectType_DIRECTORY
 *                      else 'file')
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_info.size); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_size, __pyx_t_2) < 0) __PYX_ERR(2, 250, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/io-hdfs.pxi":251
 *         return {
 *             'size': info.size,
 *             'kind': ('directory' if info.kind == ObjectType_DIRECTORY             # <<<<<<<<<<<<<<
 *                      else 'file')
 *         }
 */
  if (((__pyx_v_info.kind ==  arrow::io::ObjectType::DIRECTORY) != 0)) {
    __Pyx_INCREF(__pyx_n_u_directory);
    __pyx_t_2 = __pyx_n_u_directory;
  } else {
    __Pyx_INCREF(__pyx_n_u_file);
    __pyx_t_2 = __pyx_n_u_file;
  }
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_kind, __pyx_t_2) < 0) __PYX_ERR(2, 250, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io-hdfs.pxi":231
 *         }
 * 
 *     def stat(self, path):             # <<<<<<<<<<<<<<
 *         """
 *         Return basic file system statistics about path
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.stat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":255
 *         }
 * 
 *     cdef _path_info(self, path, HdfsPathInfo* info):             # <<<<<<<<<<<<<<
 *         cdef c_string c_path = tobytes(path)
 * 
 */

static PyObject *__pyx_f_7pyarrow_3lib_16HadoopFileSystem__path_info(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, arrow::io::HdfsPathInfo *__pyx_v_info) {
  std::string __pyx_v_c_path;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("_path_info", 0);

  /* "pyarrow/io-hdfs.pxi":256
 * 
 *     cdef _path_info(self, path, HdfsPathInfo* info):
 *         cdef c_string c_path = tobytes(path)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_path) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_path);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 256, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_path = __pyx_t_4;

  /* "pyarrow/io-hdfs.pxi":258
 *         cdef c_string c_path = tobytes(path)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get()
 *                          .GetPathInfo(c_path, info))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io-hdfs.pxi":259
 * 
 *         with nogil:
 *             check_status(self.client.get()             # <<<<<<<<<<<<<<
 *                          .GetPathInfo(c_path, info))
 * 
 */
        __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->client.get()->GetPathInfo(__pyx_v_c_path, __pyx_v_info)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(2, 259, __pyx_L4_error)
      }

      /* "pyarrow/io-hdfs.pxi":258
 *         cdef c_string c_path = tobytes(path)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get()
 *                          .GetPathInfo(c_path, info))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io-hdfs.pxi":255
 *         }
 * 
 *     cdef _path_info(self, path, HdfsPathInfo* info):             # <<<<<<<<<<<<<<
 *         cdef c_string c_path = tobytes(path)
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem._path_info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":262
 *                          .GetPathInfo(c_path, info))
 * 
 *     def ls(self, path, bint full_info):             # <<<<<<<<<<<<<<
 *         cdef:
 *             c_string c_path = tobytes(path)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_27ls(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_26ls[] = "HadoopFileSystem.ls(self, path, bool full_info)";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_27ls(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  int __pyx_v_full_info;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ls (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_full_info,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_full_info)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ls", 1, 2, 2, 1); __PYX_ERR(2, 262, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ls") < 0)) __PYX_ERR(2, 262, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_path = values[0];
    __pyx_v_full_info = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_full_info == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 262, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ls", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 262, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.ls", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_26ls(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), __pyx_v_path, __pyx_v_full_info);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_26ls(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, int __pyx_v_full_info) {
  std::string __pyx_v_c_path;
  std::vector<arrow::io::HdfsPathInfo>  __pyx_v_listing;
  PyObject *__pyx_v_results = 0;
  int __pyx_v_i;
  arrow::io::HdfsPathInfo const *__pyx_v_info;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_kind = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  __Pyx_RefNannySetupContext("ls", 0);

  /* "pyarrow/io-hdfs.pxi":264
 *     def ls(self, path, bint full_info):
 *         cdef:
 *             c_string c_path = tobytes(path)             # <<<<<<<<<<<<<<
 *             vector[HdfsPathInfo] listing
 *             list results = []
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_path) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_path);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 264, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_path = __pyx_t_4;

  /* "pyarrow/io-hdfs.pxi":266
 *             c_string c_path = tobytes(path)
 *             vector[HdfsPathInfo] listing
 *             list results = []             # <<<<<<<<<<<<<<
 *             int i
 * 
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_results = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":269
 *             int i
 * 
 *         self._ensure_client()             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self->__pyx_vtab)->_ensure_client(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":271
 *         self._ensure_client()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get()
 *                          .ListDirectory(c_path, &listing))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io-hdfs.pxi":272
 * 
 *         with nogil:
 *             check_status(self.client.get()             # <<<<<<<<<<<<<<
 *                          .ListDirectory(c_path, &listing))
 * 
 */
        __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->client.get()->ListDirectory(__pyx_v_c_path, (&__pyx_v_listing))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(2, 272, __pyx_L4_error)
      }

      /* "pyarrow/io-hdfs.pxi":271
 *         self._ensure_client()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get()
 *                          .ListDirectory(c_path, &listing))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io-hdfs.pxi":276
 * 
 *         cdef const HdfsPathInfo* info
 *         for i in range(<int> listing.size()):             # <<<<<<<<<<<<<<
 *             info = &listing[i]
 * 
 */
  __pyx_t_5 = ((int)__pyx_v_listing.size());
  __pyx_t_6 = __pyx_t_5;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "pyarrow/io-hdfs.pxi":277
 *         cdef const HdfsPathInfo* info
 *         for i in range(<int> listing.size()):
 *             info = &listing[i]             # <<<<<<<<<<<<<<
 * 
 *             # Try to trim off the hdfs://HOST:PORT piece
 */
    __pyx_v_info = (&(__pyx_v_listing[__pyx_v_i]));

    /* "pyarrow/io-hdfs.pxi":280
 * 
 *             # Try to trim off the hdfs://HOST:PORT piece
 *             name = strip_hdfs_abspath(frombytes(info.name))             # <<<<<<<<<<<<<<
 * 
 *             if full_info:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_strip_hdfs_abspath); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 280, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 280, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_info->name); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 280, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    __pyx_t_3 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_10, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 280, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_8, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 280, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/io-hdfs.pxi":282
 *             name = strip_hdfs_abspath(frombytes(info.name))
 * 
 *             if full_info:             # <<<<<<<<<<<<<<
 *                 kind = ('file' if info.kind == ObjectType_FILE
 *                         else 'directory')
 */
    __pyx_t_11 = (__pyx_v_full_info != 0);
    if (__pyx_t_11) {

      /* "pyarrow/io-hdfs.pxi":283
 * 
 *             if full_info:
 *                 kind = ('file' if info.kind == ObjectType_FILE             # <<<<<<<<<<<<<<
 *                         else 'directory')
 * 
 */
      if (((__pyx_v_info->kind ==  arrow::io::ObjectType::FILE) != 0)) {
        __Pyx_INCREF(__pyx_n_u_file);
        __pyx_t_1 = __pyx_n_u_file;
      } else {
        __Pyx_INCREF(__pyx_n_u_directory);
        __pyx_t_1 = __pyx_n_u_directory;
      }
      __Pyx_XDECREF_SET(__pyx_v_kind, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "pyarrow/io-hdfs.pxi":287
 * 
 *                 results.append({
 *                     'kind': kind,             # <<<<<<<<<<<<<<
 *                     'name': name,
 *                     'owner': frombytes(info.owner),
 */
      __pyx_t_1 = __Pyx_PyDict_NewPresized(10); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_kind, __pyx_v_kind) < 0) __PYX_ERR(2, 287, __pyx_L1_error)

      /* "pyarrow/io-hdfs.pxi":288
 *                 results.append({
 *                     'kind': kind,
 *                     'name': name,             # <<<<<<<<<<<<<<
 *                     'owner': frombytes(info.owner),
 *                     'group': frombytes(info.group),
 */
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_name, __pyx_v_name) < 0) __PYX_ERR(2, 287, __pyx_L1_error)

      /* "pyarrow/io-hdfs.pxi":289
 *                     'kind': kind,
 *                     'name': name,
 *                     'owner': frombytes(info.owner),             # <<<<<<<<<<<<<<
 *                     'group': frombytes(info.group),
 *                     'last_modified_time': info.last_modified_time,
 */
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 289, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_info->owner); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 289, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_9, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_8);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 289, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_owner, __pyx_t_2) < 0) __PYX_ERR(2, 287, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "pyarrow/io-hdfs.pxi":290
 *                     'name': name,
 *                     'owner': frombytes(info.owner),
 *                     'group': frombytes(info.group),             # <<<<<<<<<<<<<<
 *                     'last_modified_time': info.last_modified_time,
 *                     'last_access_time': info.last_access_time,
 */
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 290, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_info->group); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 290, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_9, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_8);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 290, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_group, __pyx_t_2) < 0) __PYX_ERR(2, 287, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "pyarrow/io-hdfs.pxi":291
 *                     'owner': frombytes(info.owner),
 *                     'group': frombytes(info.group),
 *                     'last_modified_time': info.last_modified_time,             # <<<<<<<<<<<<<<
 *                     'last_access_time': info.last_access_time,
 *                     'size': info.size,
 */
      __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_info->last_modified_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 291, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_last_modified_time, __pyx_t_2) < 0) __PYX_ERR(2, 287, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "pyarrow/io-hdfs.pxi":292
 *                     'group': frombytes(info.group),
 *                     'last_modified_time': info.last_modified_time,
 *                     'last_access_time': info.last_access_time,             # <<<<<<<<<<<<<<
 *                     'size': info.size,
 *                     'replication': info.replication,
 */
      __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_info->last_access_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 292, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_last_access_time, __pyx_t_2) < 0) __PYX_ERR(2, 287, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "pyarrow/io-hdfs.pxi":293
 *                     'last_modified_time': info.last_modified_time,
 *                     'last_access_time': info.last_access_time,
 *                     'size': info.size,             # <<<<<<<<<<<<<<
 *                     'replication': info.replication,
 *                     'block_size': info.block_size,
 */
      __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_info->size); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 293, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_size, __pyx_t_2) < 0) __PYX_ERR(2, 287, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "pyarrow/io-hdfs.pxi":294
 *                     'last_access_time': info.last_access_time,
 *                     'size': info.size,
 *                     'replication': info.replication,             # <<<<<<<<<<<<<<
 *                     'block_size': info.block_size,
 *                     'permissions': info.permissions
 */
      __pyx_t_2 = __Pyx_PyInt_From_int16_t(__pyx_v_info->replication); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 294, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_replication, __pyx_t_2) < 0) __PYX_ERR(2, 287, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "pyarrow/io-hdfs.pxi":295
 *                     'size': info.size,
 *                     'replication': info.replication,
 *                     'block_size': info.block_size,             # <<<<<<<<<<<<<<
 *                     'permissions': info.permissions
 *                 })
 */
      __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_info->block_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 295, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_block_size, __pyx_t_2) < 0) __PYX_ERR(2, 287, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "pyarrow/io-hdfs.pxi":296
 *                     'replication': info.replication,
 *                     'block_size': info.block_size,
 *                     'permissions': info.permissions             # <<<<<<<<<<<<<<
 *                 })
 *             else:
 */
      __pyx_t_2 = __Pyx_PyInt_From_int16_t(__pyx_v_info->permissions); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 296, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_permissions, __pyx_t_2) < 0) __PYX_ERR(2, 287, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "pyarrow/io-hdfs.pxi":286
 *                         else 'directory')
 * 
 *                 results.append({             # <<<<<<<<<<<<<<
 *                     'kind': kind,
 *                     'name': name,
 */
      __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_results, __pyx_t_1); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(2, 286, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "pyarrow/io-hdfs.pxi":282
 *             name = strip_hdfs_abspath(frombytes(info.name))
 * 
 *             if full_info:             # <<<<<<<<<<<<<<
 *                 kind = ('file' if info.kind == ObjectType_FILE
 *                         else 'directory')
 */
      goto __pyx_L8;
    }

    /* "pyarrow/io-hdfs.pxi":299
 *                 })
 *             else:
 *                 results.append(name)             # <<<<<<<<<<<<<<
 * 
 *         return results
 */
    /*else*/ {
      __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_results, __pyx_v_name); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(2, 299, __pyx_L1_error)
    }
    __pyx_L8:;
  }

  /* "pyarrow/io-hdfs.pxi":301
 *                 results.append(name)
 * 
 *         return results             # <<<<<<<<<<<<<<
 * 
 *     def chmod(self, path, mode):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_results);
  __pyx_r = __pyx_v_results;
  goto __pyx_L0;

  /* "pyarrow/io-hdfs.pxi":262
 *                          .GetPathInfo(c_path, info))
 * 
 *     def ls(self, path, bint full_info):             # <<<<<<<<<<<<<<
 *         cdef:
 *             c_string c_path = tobytes(path)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.ls", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_results);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_kind);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":303
 *         return results
 * 
 *     def chmod(self, path, mode):             # <<<<<<<<<<<<<<
 *         """
 *         Change file permissions
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_29chmod(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_28chmod[] = "HadoopFileSystem.chmod(self, path, mode)\n\n        Change file permissions\n\n        Parameters\n        ----------\n        path : string\n            absolute path to file or directory\n        mode : int\n            POSIX-like bitmask\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_29chmod(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_mode = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("chmod (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_mode,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("chmod", 1, 2, 2, 1); __PYX_ERR(2, 303, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "chmod") < 0)) __PYX_ERR(2, 303, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_path = values[0];
    __pyx_v_mode = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("chmod", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 303, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.chmod", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_28chmod(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), __pyx_v_path, __pyx_v_mode);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_28chmod(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_mode) {
  std::string __pyx_v_c_path;
  int __pyx_v_c_mode;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("chmod", 0);

  /* "pyarrow/io-hdfs.pxi":314
 *             POSIX-like bitmask
 *         """
 *         self._ensure_client()             # <<<<<<<<<<<<<<
 *         cdef c_string c_path = tobytes(path)
 *         cdef int c_mode = mode
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self->__pyx_vtab)->_ensure_client(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":315
 *         """
 *         self._ensure_client()
 *         cdef c_string c_path = tobytes(path)             # <<<<<<<<<<<<<<
 *         cdef int c_mode = mode
 *         with nogil:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_path) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_path);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 315, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_path = __pyx_t_4;

  /* "pyarrow/io-hdfs.pxi":316
 *         self._ensure_client()
 *         cdef c_string c_path = tobytes(path)
 *         cdef int c_mode = mode             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(self.client.get()
 */
  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_mode); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 316, __pyx_L1_error)
  __pyx_v_c_mode = __pyx_t_5;

  /* "pyarrow/io-hdfs.pxi":317
 *         cdef c_string c_path = tobytes(path)
 *         cdef int c_mode = mode
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get()
 *                          .Chmod(c_path, c_mode))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io-hdfs.pxi":318
 *         cdef int c_mode = mode
 *         with nogil:
 *             check_status(self.client.get()             # <<<<<<<<<<<<<<
 *                          .Chmod(c_path, c_mode))
 * 
 */
        __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->client.get()->Chmod(__pyx_v_c_path, __pyx_v_c_mode)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(2, 318, __pyx_L4_error)
      }

      /* "pyarrow/io-hdfs.pxi":317
 *         cdef c_string c_path = tobytes(path)
 *         cdef int c_mode = mode
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get()
 *                          .Chmod(c_path, c_mode))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io-hdfs.pxi":303
 *         return results
 * 
 *     def chmod(self, path, mode):             # <<<<<<<<<<<<<<
 *         """
 *         Change file permissions
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.chmod", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":321
 *                          .Chmod(c_path, c_mode))
 * 
 *     def chown(self, path, owner=None, group=None):             # <<<<<<<<<<<<<<
 *         """
 *         Change file permissions
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_31chown(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_30chown[] = "HadoopFileSystem.chown(self, path, owner=None, group=None)\n\n        Change file permissions\n\n        Parameters\n        ----------\n        path : string\n            absolute path to file or directory\n        owner : string, default None\n            New owner, None for no change\n        group : string, default None\n            New group, None for no change\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_31chown(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_owner = 0;
  PyObject *__pyx_v_group = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("chown (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_owner,&__pyx_n_s_group,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_owner);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_group);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "chown") < 0)) __PYX_ERR(2, 321, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_path = values[0];
    __pyx_v_owner = values[1];
    __pyx_v_group = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("chown", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 321, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.chown", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_30chown(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), __pyx_v_path, __pyx_v_owner, __pyx_v_group);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_30chown(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_owner, PyObject *__pyx_v_group) {
  std::string __pyx_v_c_path;
  std::string __pyx_v_c_owner;
  std::string __pyx_v_c_group;
  char const *__pyx_v_c_owner_ptr;
  char const *__pyx_v_c_group_ptr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("chown", 0);

  /* "pyarrow/io-hdfs.pxi":338
 *             c_string c_owner
 *             c_string c_group
 *             const char* c_owner_ptr = NULL             # <<<<<<<<<<<<<<
 *             const char* c_group_ptr = NULL
 * 
 */
  __pyx_v_c_owner_ptr = NULL;

  /* "pyarrow/io-hdfs.pxi":339
 *             c_string c_group
 *             const char* c_owner_ptr = NULL
 *             const char* c_group_ptr = NULL             # <<<<<<<<<<<<<<
 * 
 *         self._ensure_client()
 */
  __pyx_v_c_group_ptr = NULL;

  /* "pyarrow/io-hdfs.pxi":341
 *             const char* c_group_ptr = NULL
 * 
 *         self._ensure_client()             # <<<<<<<<<<<<<<
 * 
 *         c_path = tobytes(path)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self->__pyx_vtab)->_ensure_client(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":343
 *         self._ensure_client()
 * 
 *         c_path = tobytes(path)             # <<<<<<<<<<<<<<
 *         if owner is not None:
 *             c_owner = tobytes(owner)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_path) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_path);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 343, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_path = __pyx_t_4;

  /* "pyarrow/io-hdfs.pxi":344
 * 
 *         c_path = tobytes(path)
 *         if owner is not None:             # <<<<<<<<<<<<<<
 *             c_owner = tobytes(owner)
 *             c_owner_ptr = c_owner.c_str()
 */
  __pyx_t_5 = (__pyx_v_owner != Py_None);
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {

    /* "pyarrow/io-hdfs.pxi":345
 *         c_path = tobytes(path)
 *         if owner is not None:
 *             c_owner = tobytes(owner)             # <<<<<<<<<<<<<<
 *             c_owner_ptr = c_owner.c_str()
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 345, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_owner) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_owner);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 345, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 345, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_owner = __pyx_t_4;

    /* "pyarrow/io-hdfs.pxi":346
 *         if owner is not None:
 *             c_owner = tobytes(owner)
 *             c_owner_ptr = c_owner.c_str()             # <<<<<<<<<<<<<<
 * 
 *         if group is not None:
 */
    __pyx_v_c_owner_ptr = __pyx_v_c_owner.c_str();

    /* "pyarrow/io-hdfs.pxi":344
 * 
 *         c_path = tobytes(path)
 *         if owner is not None:             # <<<<<<<<<<<<<<
 *             c_owner = tobytes(owner)
 *             c_owner_ptr = c_owner.c_str()
 */
  }

  /* "pyarrow/io-hdfs.pxi":348
 *             c_owner_ptr = c_owner.c_str()
 * 
 *         if group is not None:             # <<<<<<<<<<<<<<
 *             c_group = tobytes(group)
 *             c_group_ptr = c_group.c_str()
 */
  __pyx_t_6 = (__pyx_v_group != Py_None);
  __pyx_t_5 = (__pyx_t_6 != 0);
  if (__pyx_t_5) {

    /* "pyarrow/io-hdfs.pxi":349
 * 
 *         if group is not None:
 *             c_group = tobytes(group)             # <<<<<<<<<<<<<<
 *             c_group_ptr = c_group.c_str()
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 349, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_group) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_group);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 349, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 349, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_group = __pyx_t_4;

    /* "pyarrow/io-hdfs.pxi":350
 *         if group is not None:
 *             c_group = tobytes(group)
 *             c_group_ptr = c_group.c_str()             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
    __pyx_v_c_group_ptr = __pyx_v_c_group.c_str();

    /* "pyarrow/io-hdfs.pxi":348
 *             c_owner_ptr = c_owner.c_str()
 * 
 *         if group is not None:             # <<<<<<<<<<<<<<
 *             c_group = tobytes(group)
 *             c_group_ptr = c_group.c_str()
 */
  }

  /* "pyarrow/io-hdfs.pxi":352
 *             c_group_ptr = c_group.c_str()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get()
 *                          .Chown(c_path, c_owner_ptr, c_group_ptr))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io-hdfs.pxi":353
 * 
 *         with nogil:
 *             check_status(self.client.get()             # <<<<<<<<<<<<<<
 *                          .Chown(c_path, c_owner_ptr, c_group_ptr))
 * 
 */
        __pyx_t_7 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->client.get()->Chown(__pyx_v_c_path, __pyx_v_c_owner_ptr, __pyx_v_c_group_ptr)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 353, __pyx_L6_error)
      }

      /* "pyarrow/io-hdfs.pxi":352
 *             c_group_ptr = c_group.c_str()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get()
 *                          .Chown(c_path, c_owner_ptr, c_group_ptr))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L7;
        }
        __pyx_L6_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L7:;
      }
  }

  /* "pyarrow/io-hdfs.pxi":321
 *                          .Chmod(c_path, c_mode))
 * 
 *     def chown(self, path, owner=None, group=None):             # <<<<<<<<<<<<<<
 *         """
 *         Change file permissions
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.chown", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":356
 *                          .Chown(c_path, c_owner_ptr, c_group_ptr))
 * 
 *     def mkdir(self, path):             # <<<<<<<<<<<<<<
 *         """
 *         Create indicated directory and any necessary parent directories
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_33mkdir(PyObject *__pyx_v_self, PyObject *__pyx_v_path); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_32mkdir[] = "HadoopFileSystem.mkdir(self, path)\n\n        Create indicated directory and any necessary parent directories\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_33mkdir(PyObject *__pyx_v_self, PyObject *__pyx_v_path) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mkdir (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_32mkdir(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), ((PyObject *)__pyx_v_path));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_32mkdir(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path) {
  std::string __pyx_v_c_path;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("mkdir", 0);

  /* "pyarrow/io-hdfs.pxi":360
 *         Create indicated directory and any necessary parent directories
 *         """
 *         self._ensure_client()             # <<<<<<<<<<<<<<
 *         cdef c_string c_path = tobytes(path)
 *         with nogil:
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self->__pyx_vtab)->_ensure_client(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":361
 *         """
 *         self._ensure_client()
 *         cdef c_string c_path = tobytes(path)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(self.client.get()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_path) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_path);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 361, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_path = __pyx_t_4;

  /* "pyarrow/io-hdfs.pxi":362
 *         self._ensure_client()
 *         cdef c_string c_path = tobytes(path)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get()
 *                          .MakeDirectory(c_path))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io-hdfs.pxi":363
 *         cdef c_string c_path = tobytes(path)
 *         with nogil:
 *             check_status(self.client.get()             # <<<<<<<<<<<<<<
 *                          .MakeDirectory(c_path))
 * 
 */
        __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->client.get()->MakeDirectory(__pyx_v_c_path)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(2, 363, __pyx_L4_error)
      }

      /* "pyarrow/io-hdfs.pxi":362
 *         self._ensure_client()
 *         cdef c_string c_path = tobytes(path)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get()
 *                          .MakeDirectory(c_path))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io-hdfs.pxi":356
 *                          .Chown(c_path, c_owner_ptr, c_group_ptr))
 * 
 *     def mkdir(self, path):             # <<<<<<<<<<<<<<
 *         """
 *         Create indicated directory and any necessary parent directories
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.mkdir", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":366
 *                          .MakeDirectory(c_path))
 * 
 *     def delete(self, path, bint recursive=False):             # <<<<<<<<<<<<<<
 *         """
 *         Delete the indicated file or directory
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_35delete(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_34delete[] = "HadoopFileSystem.delete(self, path, bool recursive=False)\n\n        Delete the indicated file or directory\n\n        Parameters\n        ----------\n        path : string\n        recursive : boolean, default False\n            If True, also delete child paths for directories\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_35delete(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  int __pyx_v_recursive;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("delete (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_recursive,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_recursive);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "delete") < 0)) __PYX_ERR(2, 366, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_path = values[0];
    if (values[1]) {
      __pyx_v_recursive = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_recursive == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 366, __pyx_L3_error)
    } else {
      __pyx_v_recursive = ((int)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("delete", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 366, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.delete", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_34delete(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), __pyx_v_path, __pyx_v_recursive);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_34delete(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, int __pyx_v_recursive) {
  std::string __pyx_v_c_path;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("delete", 0);

  /* "pyarrow/io-hdfs.pxi":376
 *             If True, also delete child paths for directories
 *         """
 *         self._ensure_client()             # <<<<<<<<<<<<<<
 * 
 *         cdef c_string c_path = tobytes(path)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self->__pyx_vtab)->_ensure_client(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":378
 *         self._ensure_client()
 * 
 *         cdef c_string c_path = tobytes(path)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(self.client.get()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_path) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_path);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 378, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_path = __pyx_t_4;

  /* "pyarrow/io-hdfs.pxi":379
 * 
 *         cdef c_string c_path = tobytes(path)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get()
 *                          .Delete(c_path, recursive == 1))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io-hdfs.pxi":380
 *         cdef c_string c_path = tobytes(path)
 *         with nogil:
 *             check_status(self.client.get()             # <<<<<<<<<<<<<<
 *                          .Delete(c_path, recursive == 1))
 * 
 */
        __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->client.get()->Delete(__pyx_v_c_path, (__pyx_v_recursive == 1))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(2, 380, __pyx_L4_error)
      }

      /* "pyarrow/io-hdfs.pxi":379
 * 
 *         cdef c_string c_path = tobytes(path)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.client.get()
 *                          .Delete(c_path, recursive == 1))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/io-hdfs.pxi":366
 *                          .MakeDirectory(c_path))
 * 
 *     def delete(self, path, bint recursive=False):             # <<<<<<<<<<<<<<
 *         """
 *         Delete the indicated file or directory
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.delete", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":383
 *                          .Delete(c_path, recursive == 1))
 * 
 *     def open(self, path, mode='rb', buffer_size=None, replication=None,             # <<<<<<<<<<<<<<
 *              default_block_size=None):
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_37open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_36open[] = "HadoopFileSystem.open(self, path, mode=u'rb', buffer_size=None, replication=None, default_block_size=None)\n\n        Open HDFS file for reading or writing\n\n        Parameters\n        ----------\n        mode : string\n            Must be one of 'rb', 'wb', 'ab'\n\n        Returns\n        -------\n        handle : HdfsFile\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_37open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_mode = 0;
  PyObject *__pyx_v_buffer_size = 0;
  PyObject *__pyx_v_replication = 0;
  PyObject *__pyx_v_default_block_size = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("open (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_mode,&__pyx_n_s_buffer_size,&__pyx_n_s_replication,&__pyx_n_s_default_block_size,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[1] = ((PyObject *)__pyx_n_u_rb_2);
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)Py_None);

    /* "pyarrow/io-hdfs.pxi":384
 * 
 *     def open(self, path, mode='rb', buffer_size=None, replication=None,
 *              default_block_size=None):             # <<<<<<<<<<<<<<
 *         """
 *         Open HDFS file for reading or writing
 */
    values[4] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffer_size);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_replication);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default_block_size);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "open") < 0)) __PYX_ERR(2, 383, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_path = values[0];
    __pyx_v_mode = values[1];
    __pyx_v_buffer_size = values[2];
    __pyx_v_replication = values[3];
    __pyx_v_default_block_size = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("open", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 383, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_36open(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), __pyx_v_path, __pyx_v_mode, __pyx_v_buffer_size, __pyx_v_replication, __pyx_v_default_block_size);

  /* "pyarrow/io-hdfs.pxi":383
 *                          .Delete(c_path, recursive == 1))
 * 
 *     def open(self, path, mode='rb', buffer_size=None, replication=None,             # <<<<<<<<<<<<<<
 *              default_block_size=None):
 *         """
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_36open(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_mode, PyObject *__pyx_v_buffer_size, PyObject *__pyx_v_replication, PyObject *__pyx_v_default_block_size) {
  struct __pyx_obj_7pyarrow_3lib_HdfsFile *__pyx_v_out = 0;
  std::string __pyx_v_c_path;
  bool __pyx_v_append;
  int32_t __pyx_v_c_buffer_size;
  int16_t __pyx_v_c_replication;
  int64_t __pyx_v_c_default_block_size;
  std::shared_ptr<arrow::io::HdfsOutputStream>  __pyx_v_wr_handle;
  std::shared_ptr<arrow::io::HdfsReadableFile>  __pyx_v_rd_handle;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  int32_t __pyx_t_7;
  int32_t __pyx_t_8;
  int16_t __pyx_t_9;
  int16_t __pyx_t_10;
  int64_t __pyx_t_11;
  int64_t __pyx_t_12;
  int __pyx_t_13;
  __Pyx_RefNannySetupContext("open", 0);

  /* "pyarrow/io-hdfs.pxi":397
 *         handle : HdfsFile
 *         """
 *         self._ensure_client()             # <<<<<<<<<<<<<<
 * 
 *         cdef HdfsFile out = HdfsFile()
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self->__pyx_vtab)->_ensure_client(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":399
 *         self._ensure_client()
 * 
 *         cdef HdfsFile out = HdfsFile()             # <<<<<<<<<<<<<<
 * 
 *         if mode not in ('rb', 'wb', 'ab'):
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_HdfsFile)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_HdfsFile *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":401
 *         cdef HdfsFile out = HdfsFile()
 * 
 *         if mode not in ('rb', 'wb', 'ab'):             # <<<<<<<<<<<<<<
 *             raise Exception("Mode must be 'rb' (read), "
 *                             "'wb' (write, new file), or 'ab' (append)")
 */
  __Pyx_INCREF(__pyx_v_mode);
  __pyx_t_1 = __pyx_v_mode;
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_rb_2, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(2, 401, __pyx_L1_error)
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_wb, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(2, 401, __pyx_L1_error)
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_ab, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(2, 401, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (unlikely(__pyx_t_3)) {

    /* "pyarrow/io-hdfs.pxi":402
 * 
 *         if mode not in ('rb', 'wb', 'ab'):
 *             raise Exception("Mode must be 'rb' (read), "             # <<<<<<<<<<<<<<
 *                             "'wb' (write, new file), or 'ab' (append)")
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__240, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 402, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(2, 402, __pyx_L1_error)

    /* "pyarrow/io-hdfs.pxi":401
 *         cdef HdfsFile out = HdfsFile()
 * 
 *         if mode not in ('rb', 'wb', 'ab'):             # <<<<<<<<<<<<<<
 *             raise Exception("Mode must be 'rb' (read), "
 *                             "'wb' (write, new file), or 'ab' (append)")
 */
  }

  /* "pyarrow/io-hdfs.pxi":405
 *                             "'wb' (write, new file), or 'ab' (append)")
 * 
 *         cdef c_string c_path = tobytes(path)             # <<<<<<<<<<<<<<
 *         cdef c_bool append = False
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_path) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_path);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 405, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_path = __pyx_t_6;

  /* "pyarrow/io-hdfs.pxi":406
 * 
 *         cdef c_string c_path = tobytes(path)
 *         cdef c_bool append = False             # <<<<<<<<<<<<<<
 * 
 *         # 0 in libhdfs means "use the default"
 */
  __pyx_v_append = 0;

  /* "pyarrow/io-hdfs.pxi":409
 * 
 *         # 0 in libhdfs means "use the default"
 *         cdef int32_t c_buffer_size = buffer_size or 0             # <<<<<<<<<<<<<<
 *         cdef int16_t c_replication = replication or 0
 *         cdef int64_t c_default_block_size = default_block_size or 0
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_buffer_size); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(2, 409, __pyx_L1_error)
  if (!__pyx_t_3) {
  } else {
    __pyx_t_8 = __Pyx_PyInt_As_int32_t(__pyx_v_buffer_size); if (unlikely((__pyx_t_8 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 409, __pyx_L1_error)
    __pyx_t_7 = __pyx_t_8;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_7 = 0;
  __pyx_L7_bool_binop_done:;
  __pyx_v_c_buffer_size = __pyx_t_7;

  /* "pyarrow/io-hdfs.pxi":410
 *         # 0 in libhdfs means "use the default"
 *         cdef int32_t c_buffer_size = buffer_size or 0
 *         cdef int16_t c_replication = replication or 0             # <<<<<<<<<<<<<<
 *         cdef int64_t c_default_block_size = default_block_size or 0
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_replication); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(2, 410, __pyx_L1_error)
  if (!__pyx_t_3) {
  } else {
    __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_v_replication); if (unlikely((__pyx_t_10 == ((int16_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 410, __pyx_L1_error)
    __pyx_t_9 = __pyx_t_10;
    goto __pyx_L9_bool_binop_done;
  }
  __pyx_t_9 = 0;
  __pyx_L9_bool_binop_done:;
  __pyx_v_c_replication = __pyx_t_9;

  /* "pyarrow/io-hdfs.pxi":411
 *         cdef int32_t c_buffer_size = buffer_size or 0
 *         cdef int16_t c_replication = replication or 0
 *         cdef int64_t c_default_block_size = default_block_size or 0             # <<<<<<<<<<<<<<
 * 
 *         cdef shared_ptr[HdfsOutputStream] wr_handle
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_default_block_size); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(2, 411, __pyx_L1_error)
  if (!__pyx_t_3) {
  } else {
    __pyx_t_12 = __Pyx_PyInt_As_int64_t(__pyx_v_default_block_size); if (unlikely((__pyx_t_12 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 411, __pyx_L1_error)
    __pyx_t_11 = __pyx_t_12;
    goto __pyx_L11_bool_binop_done;
  }
  __pyx_t_11 = 0;
  __pyx_L11_bool_binop_done:;
  __pyx_v_c_default_block_size = __pyx_t_11;

  /* "pyarrow/io-hdfs.pxi":416
 *         cdef shared_ptr[HdfsReadableFile] rd_handle
 * 
 *         if mode in ('wb', 'ab'):             # <<<<<<<<<<<<<<
 *             if mode == 'ab':
 *                 append = True
 */
  __Pyx_INCREF(__pyx_v_mode);
  __pyx_t_1 = __pyx_v_mode;
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_wb, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 416, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L14_bool_binop_done;
  }
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_ab, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 416, __pyx_L1_error)
  __pyx_t_3 = __pyx_t_2;
  __pyx_L14_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/io-hdfs.pxi":417
 * 
 *         if mode in ('wb', 'ab'):
 *             if mode == 'ab':             # <<<<<<<<<<<<<<
 *                 append = True
 * 
 */
    __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_mode, __pyx_n_u_ab, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 417, __pyx_L1_error)
    if (__pyx_t_2) {

      /* "pyarrow/io-hdfs.pxi":418
 *         if mode in ('wb', 'ab'):
 *             if mode == 'ab':
 *                 append = True             # <<<<<<<<<<<<<<
 * 
 *             with nogil:
 */
      __pyx_v_append = 1;

      /* "pyarrow/io-hdfs.pxi":417
 * 
 *         if mode in ('wb', 'ab'):
 *             if mode == 'ab':             # <<<<<<<<<<<<<<
 *                 append = True
 * 
 */
    }

    /* "pyarrow/io-hdfs.pxi":420
 *                 append = True
 * 
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(
 *                     self.client.get()
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "pyarrow/io-hdfs.pxi":421
 * 
 *             with nogil:
 *                 check_status(             # <<<<<<<<<<<<<<
 *                     self.client.get()
 *                     .OpenWritable(c_path, append, c_buffer_size,
 */
          __pyx_t_13 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->client.get()->OpenWritable(__pyx_v_c_path, __pyx_v_append, __pyx_v_c_buffer_size, __pyx_v_c_replication, __pyx_v_c_default_block_size, (&__pyx_v_wr_handle))); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(2, 421, __pyx_L18_error)
        }

        /* "pyarrow/io-hdfs.pxi":420
 *                 append = True
 * 
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(
 *                     self.client.get()
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L19;
          }
          __pyx_L18_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L19:;
        }
    }

    /* "pyarrow/io-hdfs.pxi":427
 *                                   &wr_handle))
 * 
 *             out.set_output_stream(<shared_ptr[COutputStream]> wr_handle)             # <<<<<<<<<<<<<<
 *             out.is_writable = True
 *         else:
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_HdfsFile *)__pyx_v_out->__pyx_base.__pyx_vtab)->__pyx_base.set_output_stream(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_out), ((std::shared_ptr< arrow::io::OutputStream> )__pyx_v_wr_handle)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 427, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/io-hdfs.pxi":428
 * 
 *             out.set_output_stream(<shared_ptr[COutputStream]> wr_handle)
 *             out.is_writable = True             # <<<<<<<<<<<<<<
 *         else:
 *             with nogil:
 */
    __pyx_v_out->__pyx_base.is_writable = 1;

    /* "pyarrow/io-hdfs.pxi":416
 *         cdef shared_ptr[HdfsReadableFile] rd_handle
 * 
 *         if mode in ('wb', 'ab'):             # <<<<<<<<<<<<<<
 *             if mode == 'ab':
 *                 append = True
 */
    goto __pyx_L13;
  }

  /* "pyarrow/io-hdfs.pxi":430
 *             out.is_writable = True
 *         else:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(self.client.get()
 *                              .OpenReadable(c_path, &rd_handle))
 */
  /*else*/ {
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "pyarrow/io-hdfs.pxi":431
 *         else:
 *             with nogil:
 *                 check_status(self.client.get()             # <<<<<<<<<<<<<<
 *                              .OpenReadable(c_path, &rd_handle))
 * 
 */
          __pyx_t_13 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->client.get()->OpenReadable(__pyx_v_c_path, (&__pyx_v_rd_handle))); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(2, 431, __pyx_L21_error)
        }

        /* "pyarrow/io-hdfs.pxi":430
 *             out.is_writable = True
 *         else:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_status(self.client.get()
 *                              .OpenReadable(c_path, &rd_handle))
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L22;
          }
          __pyx_L21_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L22:;
        }
    }

    /* "pyarrow/io-hdfs.pxi":434
 *                              .OpenReadable(c_path, &rd_handle))
 * 
 *             out.set_random_access_file(             # <<<<<<<<<<<<<<
 *                 <shared_ptr[CRandomAccessFile]> rd_handle)
 *             out.is_readable = True
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_HdfsFile *)__pyx_v_out->__pyx_base.__pyx_vtab)->__pyx_base.set_random_access_file(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_out), ((std::shared_ptr< arrow::io::RandomAccessFile> )__pyx_v_rd_handle)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 434, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/io-hdfs.pxi":436
 *             out.set_random_access_file(
 *                 <shared_ptr[CRandomAccessFile]> rd_handle)
 *             out.is_readable = True             # <<<<<<<<<<<<<<
 * 
 *         assert not out.closed
 */
    __pyx_v_out->__pyx_base.is_readable = 1;
  }
  __pyx_L13:;

  /* "pyarrow/io-hdfs.pxi":438
 *             out.is_readable = True
 * 
 *         assert not out.closed             # <<<<<<<<<<<<<<
 * 
 *         if c_buffer_size == 0:
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out), __pyx_n_s_closed); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 438, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 438, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!((!__pyx_t_2) != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(2, 438, __pyx_L1_error)
    }
  }
  #endif

  /* "pyarrow/io-hdfs.pxi":440
 *         assert not out.closed
 * 
 *         if c_buffer_size == 0:             # <<<<<<<<<<<<<<
 *             c_buffer_size = 2 ** 16
 * 
 */
  __pyx_t_2 = ((__pyx_v_c_buffer_size == 0) != 0);
  if (__pyx_t_2) {

    /* "pyarrow/io-hdfs.pxi":441
 * 
 *         if c_buffer_size == 0:
 *             c_buffer_size = 2 ** 16             # <<<<<<<<<<<<<<
 * 
 *         out.mode = mode
 */
    __pyx_v_c_buffer_size = 0x10000;

    /* "pyarrow/io-hdfs.pxi":440
 *         assert not out.closed
 * 
 *         if c_buffer_size == 0:             # <<<<<<<<<<<<<<
 *             c_buffer_size = 2 ** 16
 * 
 */
  }

  /* "pyarrow/io-hdfs.pxi":443
 *             c_buffer_size = 2 ** 16
 * 
 *         out.mode = mode             # <<<<<<<<<<<<<<
 *         out.buffer_size = c_buffer_size
 *         out.parent = _HdfsFileNanny(self, out)
 */
  __Pyx_INCREF(__pyx_v_mode);
  __Pyx_GIVEREF(__pyx_v_mode);
  __Pyx_GOTREF(__pyx_v_out->mode);
  __Pyx_DECREF(__pyx_v_out->mode);
  __pyx_v_out->mode = __pyx_v_mode;

  /* "pyarrow/io-hdfs.pxi":444
 * 
 *         out.mode = mode
 *         out.buffer_size = c_buffer_size             # <<<<<<<<<<<<<<
 *         out.parent = _HdfsFileNanny(self, out)
 *         out.own_file = True
 */
  __pyx_v_out->buffer_size = __pyx_v_c_buffer_size;

  /* "pyarrow/io-hdfs.pxi":445
 *         out.mode = mode
 *         out.buffer_size = c_buffer_size
 *         out.parent = _HdfsFileNanny(self, out)             # <<<<<<<<<<<<<<
 *         out.own_file = True
 * 
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_out));
  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pyarrow_3lib__HdfsFileNanny), __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_out->parent);
  __Pyx_DECREF(__pyx_v_out->parent);
  __pyx_v_out->parent = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pyarrow/io-hdfs.pxi":446
 *         out.buffer_size = c_buffer_size
 *         out.parent = _HdfsFileNanny(self, out)
 *         out.own_file = True             # <<<<<<<<<<<<<<
 * 
 *         return out
 */
  __pyx_v_out->__pyx_base.own_file = 1;

  /* "pyarrow/io-hdfs.pxi":448
 *         out.own_file = True
 * 
 *         return out             # <<<<<<<<<<<<<<
 * 
 *     def download(self, path, stream, buffer_size=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = ((PyObject *)__pyx_v_out);
  goto __pyx_L0;

  /* "pyarrow/io-hdfs.pxi":383
 *                          .Delete(c_path, recursive == 1))
 * 
 *     def open(self, path, mode='rb', buffer_size=None, replication=None,             # <<<<<<<<<<<<<<
 *              default_block_size=None):
 *         """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":450
 *         return out
 * 
 *     def download(self, path, stream, buffer_size=None):             # <<<<<<<<<<<<<<
 *         with self.open(path, 'rb') as f:
 *             f.download(stream, buffer_size=buffer_size)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_39download(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_38download[] = "HadoopFileSystem.download(self, path, stream, buffer_size=None)";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_39download(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_stream = 0;
  PyObject *__pyx_v_buffer_size = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("download (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_stream,&__pyx_n_s_buffer_size,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stream)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("download", 0, 2, 3, 1); __PYX_ERR(2, 450, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffer_size);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "download") < 0)) __PYX_ERR(2, 450, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_path = values[0];
    __pyx_v_stream = values[1];
    __pyx_v_buffer_size = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("download", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 450, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.download", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_38download(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), __pyx_v_path, __pyx_v_stream, __pyx_v_buffer_size);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_38download(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_stream, PyObject *__pyx_v_buffer_size) {
  PyObject *__pyx_v_f = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  __Pyx_RefNannySetupContext("download", 0);

  /* "pyarrow/io-hdfs.pxi":451
 * 
 *     def download(self, path, stream, buffer_size=None):
 *         with self.open(path, 'rb') as f:             # <<<<<<<<<<<<<<
 *             f.download(stream, buffer_size=buffer_size)
 * 
 */
  /*with:*/ {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_4 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_path, __pyx_n_u_rb_2};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 451, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_path, __pyx_n_u_rb_2};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 451, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 451, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__pyx_t_3) {
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
      }
      __Pyx_INCREF(__pyx_v_path);
      __Pyx_GIVEREF(__pyx_v_path);
      PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_path);
      __Pyx_INCREF(__pyx_n_u_rb_2);
      __Pyx_GIVEREF(__pyx_n_u_rb_2);
      PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_u_rb_2);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 451, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 451, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 451, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __pyx_t_2;
    __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        /*try:*/ {
          __pyx_v_f = __pyx_t_5;
          __pyx_t_5 = 0;

          /* "pyarrow/io-hdfs.pxi":452
 *     def download(self, path, stream, buffer_size=None):
 *         with self.open(path, 'rb') as f:
 *             f.download(stream, buffer_size=buffer_size)             # <<<<<<<<<<<<<<
 * 
 *     def upload(self, path, stream, buffer_size=None):
 */
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_download); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 452, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 452, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_INCREF(__pyx_v_stream);
          __Pyx_GIVEREF(__pyx_v_stream);
          PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_stream);
          __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 452, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_buffer_size, __pyx_v_buffer_size) < 0) __PYX_ERR(2, 452, __pyx_L7_error)
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 452, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "pyarrow/io-hdfs.pxi":451
 * 
 *     def download(self, path, stream, buffer_size=None):
 *         with self.open(path, 'rb') as f:             # <<<<<<<<<<<<<<
 *             f.download(stream, buffer_size=buffer_size)
 * 
 */
        }
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L12_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.download", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1) < 0) __PYX_ERR(2, 451, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_5 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 451, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 451, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (__pyx_t_11 < 0) __PYX_ERR(2, 451, __pyx_L9_except_error)
          __pyx_t_12 = ((!(__pyx_t_11 != 0)) != 0);
          if (__pyx_t_12) {
            __Pyx_GIVEREF(__pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_XGIVEREF(__pyx_t_1);
            __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_2, __pyx_t_1);
            __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; 
            __PYX_ERR(2, 451, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        __pyx_L12_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_6) {
          __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__241, NULL);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 451, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L16;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L1_error;
    __pyx_L16:;
  }

  /* "pyarrow/io-hdfs.pxi":450
 *         return out
 * 
 *     def download(self, path, stream, buffer_size=None):             # <<<<<<<<<<<<<<
 *         with self.open(path, 'rb') as f:
 *             f.download(stream, buffer_size=buffer_size)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.download", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":454
 *             f.download(stream, buffer_size=buffer_size)
 * 
 *     def upload(self, path, stream, buffer_size=None):             # <<<<<<<<<<<<<<
 *         """
 *         Upload file-like object to HDFS path
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_41upload(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_40upload[] = "HadoopFileSystem.upload(self, path, stream, buffer_size=None)\n\n        Upload file-like object to HDFS path\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_41upload(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_stream = 0;
  PyObject *__pyx_v_buffer_size = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("upload (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_stream,&__pyx_n_s_buffer_size,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stream)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("upload", 0, 2, 3, 1); __PYX_ERR(2, 454, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffer_size);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "upload") < 0)) __PYX_ERR(2, 454, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_path = values[0];
    __pyx_v_stream = values[1];
    __pyx_v_buffer_size = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("upload", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 454, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.upload", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_40upload(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), __pyx_v_path, __pyx_v_stream, __pyx_v_buffer_size);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_40upload(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_stream, PyObject *__pyx_v_buffer_size) {
  PyObject *__pyx_v_f = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  __Pyx_RefNannySetupContext("upload", 0);

  /* "pyarrow/io-hdfs.pxi":458
 *         Upload file-like object to HDFS path
 *         """
 *         with self.open(path, 'wb') as f:             # <<<<<<<<<<<<<<
 *             f.upload(stream, buffer_size=buffer_size)
 * 
 */
  /*with:*/ {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 458, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_4 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_path, __pyx_n_u_wb};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 458, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_path, __pyx_n_u_wb};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 458, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 458, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__pyx_t_3) {
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
      }
      __Pyx_INCREF(__pyx_v_path);
      __Pyx_GIVEREF(__pyx_v_path);
      PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_path);
      __Pyx_INCREF(__pyx_n_u_wb);
      __Pyx_GIVEREF(__pyx_n_u_wb);
      PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_u_wb);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 458, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 458, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 458, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 458, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __pyx_t_2;
    __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        /*try:*/ {
          __pyx_v_f = __pyx_t_5;
          __pyx_t_5 = 0;

          /* "pyarrow/io-hdfs.pxi":459
 *         """
 *         with self.open(path, 'wb') as f:
 *             f.upload(stream, buffer_size=buffer_size)             # <<<<<<<<<<<<<<
 * 
 * 
 */
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_upload); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 459, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 459, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_INCREF(__pyx_v_stream);
          __Pyx_GIVEREF(__pyx_v_stream);
          PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_stream);
          __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 459, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_buffer_size, __pyx_v_buffer_size) < 0) __PYX_ERR(2, 459, __pyx_L7_error)
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 459, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "pyarrow/io-hdfs.pxi":458
 *         Upload file-like object to HDFS path
 *         """
 *         with self.open(path, 'wb') as f:             # <<<<<<<<<<<<<<
 *             f.upload(stream, buffer_size=buffer_size)
 * 
 */
        }
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L12_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.upload", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1) < 0) __PYX_ERR(2, 458, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_5 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 458, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 458, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (__pyx_t_11 < 0) __PYX_ERR(2, 458, __pyx_L9_except_error)
          __pyx_t_12 = ((!(__pyx_t_11 != 0)) != 0);
          if (__pyx_t_12) {
            __Pyx_GIVEREF(__pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_XGIVEREF(__pyx_t_1);
            __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_2, __pyx_t_1);
            __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; 
            __PYX_ERR(2, 458, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        __pyx_L12_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_6) {
          __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__241, NULL);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 458, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L16;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L1_error;
    __pyx_L16:;
  }

  /* "pyarrow/io-hdfs.pxi":454
 *             f.download(stream, buffer_size=buffer_size)
 * 
 *     def upload(self, path, stream, buffer_size=None):             # <<<<<<<<<<<<<<
 *         """
 *         Upload file-like object to HDFS path
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.upload", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":61
 * 
 *     cdef readonly:
 *         bint is_open             # <<<<<<<<<<<<<<
 *         object host
 *         object user
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_7is_open_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_7is_open_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_7is_open___get__(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_7is_open___get__(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->is_open); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.is_open.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":62
 *     cdef readonly:
 *         bint is_open
 *         object host             # <<<<<<<<<<<<<<
 *         object user
 *         object kerb_ticket
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_4host_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_4host_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_4host___get__(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_4host___get__(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->host);
  __pyx_r = __pyx_v_self->host;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":63
 *         bint is_open
 *         object host
 *         object user             # <<<<<<<<<<<<<<
 *         object kerb_ticket
 *         object driver
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_4user_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_4user_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_4user___get__(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_4user___get__(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->user);
  __pyx_r = __pyx_v_self->user;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":64
 *         object host
 *         object user
 *         object kerb_ticket             # <<<<<<<<<<<<<<
 *         object driver
 *         int port
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_11kerb_ticket_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_11kerb_ticket_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_11kerb_ticket___get__(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_11kerb_ticket___get__(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->kerb_ticket);
  __pyx_r = __pyx_v_self->kerb_ticket;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":65
 *         object user
 *         object kerb_ticket
 *         object driver             # <<<<<<<<<<<<<<
 *         int port
 *         dict extra_conf
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_6driver_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_6driver_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_6driver___get__(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_6driver___get__(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->driver);
  __pyx_r = __pyx_v_self->driver;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":66
 *         object kerb_ticket
 *         object driver
 *         int port             # <<<<<<<<<<<<<<
 *         dict extra_conf
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_4port_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_4port_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_4port___get__(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_4port___get__(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->port); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.port.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":67
 *         object driver
 *         int port
 *         dict extra_conf             # <<<<<<<<<<<<<<
 * 
 *     def _connect(self, host, port, user, kerb_ticket, driver, extra_conf):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_10extra_conf_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_10extra_conf_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_10extra_conf___get__(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_10extra_conf___get__(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->extra_conf);
  __pyx_r = __pyx_v_self->extra_conf;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.client cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_43__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_42__reduce_cython__[] = "HadoopFileSystem.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_43__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_42__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_42__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.client cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.client cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__242, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.client cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.client cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.client cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_45__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_44__setstate_cython__[] = "HadoopFileSystem.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_45__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_16HadoopFileSystem_44__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_16HadoopFileSystem_44__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.client cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.client cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__243, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.client cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.client cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":471
 *         object file_handle_ref
 * 
 *     def __cinit__(self, client, file_handle):             # <<<<<<<<<<<<<<
 *         import weakref
 *         self.client = client
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_14_HdfsFileNanny_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_14_HdfsFileNanny_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_client = 0;
  PyObject *__pyx_v_file_handle = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_client,&__pyx_n_s_file_handle,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_client)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_file_handle)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); __PYX_ERR(2, 471, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 471, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_client = values[0];
    __pyx_v_file_handle = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 471, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._HdfsFileNanny.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_HdfsFileNanny___cinit__(((struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *)__pyx_v_self), __pyx_v_client, __pyx_v_file_handle);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_14_HdfsFileNanny___cinit__(struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *__pyx_v_self, PyObject *__pyx_v_client, PyObject *__pyx_v_file_handle) {
  PyObject *__pyx_v_weakref = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/io-hdfs.pxi":472
 * 
 *     def __cinit__(self, client, file_handle):
 *         import weakref             # <<<<<<<<<<<<<<
 *         self.client = client
 *         self.file_handle_ref = weakref.ref(file_handle)
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_weakref, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_weakref = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":473
 *     def __cinit__(self, client, file_handle):
 *         import weakref
 *         self.client = client             # <<<<<<<<<<<<<<
 *         self.file_handle_ref = weakref.ref(file_handle)
 * 
 */
  __Pyx_INCREF(__pyx_v_client);
  __Pyx_GIVEREF(__pyx_v_client);
  __Pyx_GOTREF(__pyx_v_self->client);
  __Pyx_DECREF(__pyx_v_self->client);
  __pyx_v_self->client = __pyx_v_client;

  /* "pyarrow/io-hdfs.pxi":474
 *         import weakref
 *         self.client = client
 *         self.file_handle_ref = weakref.ref(file_handle)             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_weakref, __pyx_n_s_ref); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_file_handle) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_file_handle);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->file_handle_ref);
  __Pyx_DECREF(__pyx_v_self->file_handle_ref);
  __pyx_v_self->file_handle_ref = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":471
 *         object file_handle_ref
 * 
 *     def __cinit__(self, client, file_handle):             # <<<<<<<<<<<<<<
 *         import weakref
 *         self.client = client
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib._HdfsFileNanny.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_weakref);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":476
 *         self.file_handle_ref = weakref.ref(file_handle)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         fh = self.file_handle_ref()
 *         if fh:
 */

/* Python wrapper */
static void __pyx_pw_7pyarrow_3lib_14_HdfsFileNanny_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7pyarrow_3lib_14_HdfsFileNanny_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_7pyarrow_3lib_14_HdfsFileNanny_2__dealloc__(((struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_7pyarrow_3lib_14_HdfsFileNanny_2__dealloc__(struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *__pyx_v_self) {
  PyObject *__pyx_v_fh = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pyarrow/io-hdfs.pxi":477
 * 
 *     def __dealloc__(self):
 *         fh = self.file_handle_ref()             # <<<<<<<<<<<<<<
 *         if fh:
 *             fh.close()
 */
  __Pyx_INCREF(__pyx_v_self->file_handle_ref);
  __pyx_t_2 = __pyx_v_self->file_handle_ref; __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_fh = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":478
 *     def __dealloc__(self):
 *         fh = self.file_handle_ref()
 *         if fh:             # <<<<<<<<<<<<<<
 *             fh.close()
 *         # avoid cyclic GC
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_fh); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 478, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "pyarrow/io-hdfs.pxi":479
 *         fh = self.file_handle_ref()
 *         if fh:
 *             fh.close()             # <<<<<<<<<<<<<<
 *         # avoid cyclic GC
 *         self.file_handle_ref = None
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_fh, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 479, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 479, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/io-hdfs.pxi":478
 *     def __dealloc__(self):
 *         fh = self.file_handle_ref()
 *         if fh:             # <<<<<<<<<<<<<<
 *             fh.close()
 *         # avoid cyclic GC
 */
  }

  /* "pyarrow/io-hdfs.pxi":481
 *             fh.close()
 *         # avoid cyclic GC
 *         self.file_handle_ref = None             # <<<<<<<<<<<<<<
 *         self.client = None
 * 
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->file_handle_ref);
  __Pyx_DECREF(__pyx_v_self->file_handle_ref);
  __pyx_v_self->file_handle_ref = Py_None;

  /* "pyarrow/io-hdfs.pxi":482
 *         # avoid cyclic GC
 *         self.file_handle_ref = None
 *         self.client = None             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->client);
  __Pyx_DECREF(__pyx_v_self->client);
  __pyx_v_self->client = Py_None;

  /* "pyarrow/io-hdfs.pxi":476
 *         self.file_handle_ref = weakref.ref(file_handle)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         fh = self.file_handle_ref()
 *         if fh:
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("pyarrow.lib._HdfsFileNanny.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_fh);
  __Pyx_RefNannyFinishContext();
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_HdfsFileNanny_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14_HdfsFileNanny_4__reduce_cython__[] = "_HdfsFileNanny.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_14_HdfsFileNanny_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_HdfsFileNanny_4__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_HdfsFileNanny_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__244, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._HdfsFileNanny.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14_HdfsFileNanny_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14_HdfsFileNanny_6__setstate_cython__[] = "_HdfsFileNanny.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_14_HdfsFileNanny_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14_HdfsFileNanny_6__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_14_HdfsFileNanny_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__245, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._HdfsFileNanny.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":491
 *         object parent
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         self.parent = None
 */

/* Python wrapper */
static void __pyx_pw_7pyarrow_3lib_8HdfsFile_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7pyarrow_3lib_8HdfsFile_1__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_7pyarrow_3lib_8HdfsFile___dealloc__(((struct __pyx_obj_7pyarrow_3lib_HdfsFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_7pyarrow_3lib_8HdfsFile___dealloc__(struct __pyx_obj_7pyarrow_3lib_HdfsFile *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pyarrow/io-hdfs.pxi":492
 * 
 *     def __dealloc__(self):
 *         self.parent = None             # <<<<<<<<<<<<<<
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->parent);
  __Pyx_DECREF(__pyx_v_self->parent);
  __pyx_v_self->parent = Py_None;

  /* "pyarrow/io-hdfs.pxi":491
 *         object parent
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         self.parent = None
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/io-hdfs.pxi":487
 * cdef class HdfsFile(NativeFile):
 *     cdef readonly:
 *         int32_t buffer_size             # <<<<<<<<<<<<<<
 *         object mode
 *         object parent
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8HdfsFile_11buffer_size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_8HdfsFile_11buffer_size_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8HdfsFile_11buffer_size___get__(((struct __pyx_obj_7pyarrow_3lib_HdfsFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8HdfsFile_11buffer_size___get__(struct __pyx_obj_7pyarrow_3lib_HdfsFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_self->buffer_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 487, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.HdfsFile.buffer_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":488
 *     cdef readonly:
 *         int32_t buffer_size
 *         object mode             # <<<<<<<<<<<<<<
 *         object parent
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8HdfsFile_4mode_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_8HdfsFile_4mode_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8HdfsFile_4mode___get__(((struct __pyx_obj_7pyarrow_3lib_HdfsFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8HdfsFile_4mode___get__(struct __pyx_obj_7pyarrow_3lib_HdfsFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->mode);
  __pyx_r = __pyx_v_self->mode;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io-hdfs.pxi":489
 *         int32_t buffer_size
 *         object mode
 *         object parent             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8HdfsFile_6parent_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_8HdfsFile_6parent_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8HdfsFile_6parent___get__(((struct __pyx_obj_7pyarrow_3lib_HdfsFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8HdfsFile_6parent___get__(struct __pyx_obj_7pyarrow_3lib_HdfsFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->parent);
  __pyx_r = __pyx_v_self->parent;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8HdfsFile_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_8HdfsFile_2__reduce_cython__[] = "HdfsFile.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_8HdfsFile_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8HdfsFile_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_HdfsFile *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8HdfsFile_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_HdfsFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__246, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.HdfsFile.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_8HdfsFile_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_8HdfsFile_4__setstate_cython__[] = "HdfsFile.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_8HdfsFile_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_8HdfsFile_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_HdfsFile *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_8HdfsFile_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_HdfsFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__247, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.HdfsFile.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":25
 *     Container for an Arrow IPC message with metadata and optional body
 *     """
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_7Message_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_7Message_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_7Message___cinit__(((struct __pyx_obj_7pyarrow_3lib_Message *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_7Message___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":28
 *         pass
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly, use "
 *                         "`pyarrow.ipc.read_message` function instead."
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_7Message_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_7Message_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_7Message_2__init__(((struct __pyx_obj_7pyarrow_3lib_Message *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_7Message_2__init__(struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/ipc.pxi":31
 *         raise TypeError("Do not call {}'s constructor directly, use "
 *                         "`pyarrow.ipc.read_message` function instead."
 *                         .format(self.__class__.__name__))             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Do_not_call_s_constructor_direct_8, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/ipc.pxi":29
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call {}'s constructor directly, use "             # <<<<<<<<<<<<<<
 *                         "`pyarrow.ipc.read_message` function instead."
 *                         .format(self.__class__.__name__))
 */
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __PYX_ERR(8, 29, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":28
 *         pass
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly, use "
 *                         "`pyarrow.ipc.read_message` function instead."
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.Message.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":34
 * 
 *     @property
 *     def type(self):             # <<<<<<<<<<<<<<
 *         return frombytes(FormatMessageType(self.message.get().type()))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_7Message_4type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_7Message_4type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_7Message_4type___get__(((struct __pyx_obj_7pyarrow_3lib_Message *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_7Message_4type___get__(struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/ipc.pxi":35
 *     @property
 *     def type(self):
 *         return frombytes(FormatMessageType(self.message.get().type()))             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(arrow::ipc::FormatMessageType(__pyx_v_self->message.get()->type())); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":34
 * 
 *     @property
 *     def type(self):             # <<<<<<<<<<<<<<
 *         return frombytes(FormatMessageType(self.message.get().type()))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.Message.type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":38
 * 
 *     @property
 *     def metadata(self):             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_buffer(self.message.get().metadata())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_7Message_8metadata_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_7Message_8metadata_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_7Message_8metadata___get__(((struct __pyx_obj_7pyarrow_3lib_Message *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_7Message_8metadata___get__(struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/ipc.pxi":39
 *     @property
 *     def metadata(self):
 *         return pyarrow_wrap_buffer(self.message.get().metadata())             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_self->message.get()->metadata()); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":38
 * 
 *     @property
 *     def metadata(self):             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_buffer(self.message.get().metadata())
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Message.metadata.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":42
 * 
 *     @property
 *     def body(self):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[CBuffer] body = self.message.get().body()
 *         if body.get() == NULL:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_7Message_4body_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_7Message_4body_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_7Message_4body___get__(((struct __pyx_obj_7pyarrow_3lib_Message *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_7Message_4body___get__(struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self) {
  std::shared_ptr< arrow::Buffer>  __pyx_v_body;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/ipc.pxi":43
 *     @property
 *     def body(self):
 *         cdef shared_ptr[CBuffer] body = self.message.get().body()             # <<<<<<<<<<<<<<
 *         if body.get() == NULL:
 *             return None
 */
  __pyx_v_body = __pyx_v_self->message.get()->body();

  /* "pyarrow/ipc.pxi":44
 *     def body(self):
 *         cdef shared_ptr[CBuffer] body = self.message.get().body()
 *         if body.get() == NULL:             # <<<<<<<<<<<<<<
 *             return None
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_body.get() == NULL) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/ipc.pxi":45
 *         cdef shared_ptr[CBuffer] body = self.message.get().body()
 *         if body.get() == NULL:
 *             return None             # <<<<<<<<<<<<<<
 *         else:
 *             return pyarrow_wrap_buffer(body)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/ipc.pxi":44
 *     def body(self):
 *         cdef shared_ptr[CBuffer] body = self.message.get().body()
 *         if body.get() == NULL:             # <<<<<<<<<<<<<<
 *             return None
 *         else:
 */
  }

  /* "pyarrow/ipc.pxi":47
 *             return None
 *         else:
 *             return pyarrow_wrap_buffer(body)             # <<<<<<<<<<<<<<
 * 
 *     def equals(self, Message other):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_body); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 47, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/ipc.pxi":42
 * 
 *     @property
 *     def body(self):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[CBuffer] body = self.message.get().body()
 *         if body.get() == NULL:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.Message.body.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":49
 *             return pyarrow_wrap_buffer(body)
 * 
 *     def equals(self, Message other):             # <<<<<<<<<<<<<<
 *         """
 *         Returns True if the message contents (metadata and body) are identical
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_7Message_5equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static char __pyx_doc_7pyarrow_3lib_7Message_4equals[] = "Message.equals(self, Message other)\n\n        Returns True if the message contents (metadata and body) are identical\n\n        Parameters\n        ----------\n        other : Message\n\n        Returns\n        -------\n        are_equal : bool\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_7Message_5equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("equals (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_7pyarrow_3lib_Message, 1, "other", 0))) __PYX_ERR(8, 49, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_7Message_4equals(((struct __pyx_obj_7pyarrow_3lib_Message *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_3lib_Message *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_7Message_4equals(struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_other) {
  bool __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("equals", 0);

  /* "pyarrow/ipc.pxi":62
 *         """
 *         cdef c_bool result
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = self.message.get().Equals(deref(other.message.get()))
 *         return result
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":63
 *         cdef c_bool result
 *         with nogil:
 *             result = self.message.get().Equals(deref(other.message.get()))             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
        __pyx_v_result = __pyx_v_self->message.get()->Equals((*__pyx_v_other->message.get()));
      }

      /* "pyarrow/ipc.pxi":62
 *         """
 *         cdef c_bool result
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = self.message.get().Equals(deref(other.message.get()))
 *         return result
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/ipc.pxi":64
 *         with nogil:
 *             result = self.message.get().Equals(deref(other.message.get()))
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def serialize_to(self, NativeFile sink, alignment=8, memory_pool=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":49
 *             return pyarrow_wrap_buffer(body)
 * 
 *     def equals(self, Message other):             # <<<<<<<<<<<<<<
 *         """
 *         Returns True if the message contents (metadata and body) are identical
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Message.equals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":66
 *         return result
 * 
 *     def serialize_to(self, NativeFile sink, alignment=8, memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Write message to generic OutputStream
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_7Message_7serialize_to(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_7Message_6serialize_to[] = "Message.serialize_to(self, NativeFile sink, alignment=8, memory_pool=None)\n\n        Write message to generic OutputStream\n\n        Parameters\n        ----------\n        sink : NativeFile\n        alignment : int, default 8\n            Byte alignment for metadata and body\n        memory_pool : MemoryPool, default None\n            Uses default memory pool if not specified\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_7Message_7serialize_to(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_sink = 0;
  PyObject *__pyx_v_alignment = 0;
  CYTHON_UNUSED PyObject *__pyx_v_memory_pool = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("serialize_to (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sink,&__pyx_n_s_alignment,&__pyx_n_s_memory_pool,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)__pyx_int_8);
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sink)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alignment);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "serialize_to") < 0)) __PYX_ERR(8, 66, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_sink = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)values[0]);
    __pyx_v_alignment = values[1];
    __pyx_v_memory_pool = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("serialize_to", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 66, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Message.serialize_to", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sink), __pyx_ptype_7pyarrow_3lib_NativeFile, 1, "sink", 0))) __PYX_ERR(8, 66, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_7Message_6serialize_to(((struct __pyx_obj_7pyarrow_3lib_Message *)__pyx_v_self), __pyx_v_sink, __pyx_v_alignment, __pyx_v_memory_pool);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_7Message_6serialize_to(struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_sink, PyObject *__pyx_v_alignment, CYTHON_UNUSED PyObject *__pyx_v_memory_pool) {
  int64_t __pyx_v_output_length;
   arrow::io::OutputStream *__pyx_v_out;
   arrow::ipc::IpcOptions __pyx_v_options;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int32_t __pyx_t_1;
  std::shared_ptr< arrow::io::OutputStream>  __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("serialize_to", 0);

  /* "pyarrow/ipc.pxi":79
 *         """
 *         cdef:
 *             int64_t output_length = 0             # <<<<<<<<<<<<<<
 *             COutputStream* out
 *             CIpcOptions options
 */
  __pyx_v_output_length = 0;

  /* "pyarrow/ipc.pxi":83
 *             CIpcOptions options
 * 
 *         options.alignment = alignment             # <<<<<<<<<<<<<<
 *         out = sink.get_output_stream().get()
 *         with nogil:
 */
  __pyx_t_1 = __Pyx_PyInt_As_int32_t(__pyx_v_alignment); if (unlikely((__pyx_t_1 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(8, 83, __pyx_L1_error)
  __pyx_v_options.alignment = __pyx_t_1;

  /* "pyarrow/ipc.pxi":84
 * 
 *         options.alignment = alignment
 *         out = sink.get_output_stream().get()             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(self.message.get()
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_sink->__pyx_vtab)->get_output_stream(__pyx_v_sink); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 84, __pyx_L1_error)
  __pyx_v_out = __pyx_t_2.get();

  /* "pyarrow/ipc.pxi":85
 *         options.alignment = alignment
 *         out = sink.get_output_stream().get()
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.message.get()
 *                          .SerializeTo(out, options, &output_length))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":86
 *         out = sink.get_output_stream().get()
 *         with nogil:
 *             check_status(self.message.get()             # <<<<<<<<<<<<<<
 *                          .SerializeTo(out, options, &output_length))
 * 
 */
        __pyx_t_3 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->message.get()->SerializeTo(__pyx_v_out, __pyx_v_options, (&__pyx_v_output_length))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(8, 86, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":85
 *         options.alignment = alignment
 *         out = sink.get_output_stream().get()
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.message.get()
 *                          .SerializeTo(out, options, &output_length))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/ipc.pxi":66
 *         return result
 * 
 *     def serialize_to(self, NativeFile sink, alignment=8, memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Write message to generic OutputStream
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.Message.serialize_to", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":89
 *                          .SerializeTo(out, options, &output_length))
 * 
 *     def serialize(self, alignment=8, memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Write message as encapsulated IPC message
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_7Message_9serialize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_7Message_8serialize[] = "Message.serialize(self, alignment=8, memory_pool=None)\n\n        Write message as encapsulated IPC message\n\n        Parameters\n        ----------\n        alignment : int, default 8\n            Byte alignment for metadata and body\n        memory_pool : MemoryPool, default None\n            Uses default memory pool if not specified\n\n        Returns\n        -------\n        serialized : Buffer\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_7Message_9serialize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_alignment = 0;
  PyObject *__pyx_v_memory_pool = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("serialize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alignment,&__pyx_n_s_memory_pool,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)__pyx_int_8);
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alignment);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "serialize") < 0)) __PYX_ERR(8, 89, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_alignment = values[0];
    __pyx_v_memory_pool = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("serialize", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 89, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Message.serialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_7Message_8serialize(((struct __pyx_obj_7pyarrow_3lib_Message *)__pyx_v_self), __pyx_v_alignment, __pyx_v_memory_pool);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_7Message_8serialize(struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self, PyObject *__pyx_v_alignment, PyObject *__pyx_v_memory_pool) {
  struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *__pyx_v_stream = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("serialize", 0);

  /* "pyarrow/ipc.pxi":104
 *         serialized : Buffer
 *         """
 *         stream = BufferOutputStream(memory_pool)             # <<<<<<<<<<<<<<
 *         self.serialize_to(stream, alignment=alignment, memory_pool=memory_pool)
 *         return stream.getvalue()
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_BufferOutputStream), __pyx_v_memory_pool); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_stream = ((struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/ipc.pxi":105
 *         """
 *         stream = BufferOutputStream(memory_pool)
 *         self.serialize_to(stream, alignment=alignment, memory_pool=memory_pool)             # <<<<<<<<<<<<<<
 *         return stream.getvalue()
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_serialize_to); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_stream));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_stream));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_stream));
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_alignment, __pyx_v_alignment) < 0) __PYX_ERR(8, 105, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_memory_pool, __pyx_v_memory_pool) < 0) __PYX_ERR(8, 105, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/ipc.pxi":106
 *         stream = BufferOutputStream(memory_pool)
 *         self.serialize_to(stream, alignment=alignment, memory_pool=memory_pool)
 *         return stream.getvalue()             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_stream), __pyx_n_s_getvalue); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":89
 *                          .SerializeTo(out, options, &output_length))
 * 
 *     def serialize(self, alignment=8, memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Write message as encapsulated IPC message
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.Message.serialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_stream);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":108
 *         return stream.getvalue()
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if self.message == nullptr:
 *             return """pyarrow.Message(unitialized)"""
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_7Message_11__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_7Message_11__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_7Message_10__repr__(((struct __pyx_obj_7pyarrow_3lib_Message *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_7Message_10__repr__(struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self) {
  PyObject *__pyx_v_metadata_len = NULL;
  PyObject *__pyx_v_body = NULL;
  PyObject *__pyx_v_body_len = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pyarrow/ipc.pxi":109
 * 
 *     def __repr__(self):
 *         if self.message == nullptr:             # <<<<<<<<<<<<<<
 *             return """pyarrow.Message(unitialized)"""
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->message == nullptr) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/ipc.pxi":110
 *     def __repr__(self):
 *         if self.message == nullptr:
 *             return """pyarrow.Message(unitialized)"""             # <<<<<<<<<<<<<<
 * 
 *         metadata_len = self.metadata.size
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_kp_u_pyarrow_Message_unitialized);
    __pyx_r = __pyx_kp_u_pyarrow_Message_unitialized;
    goto __pyx_L0;

    /* "pyarrow/ipc.pxi":109
 * 
 *     def __repr__(self):
 *         if self.message == nullptr:             # <<<<<<<<<<<<<<
 *             return """pyarrow.Message(unitialized)"""
 * 
 */
  }

  /* "pyarrow/ipc.pxi":112
 *             return """pyarrow.Message(unitialized)"""
 * 
 *         metadata_len = self.metadata.size             # <<<<<<<<<<<<<<
 *         body = self.body
 *         body_len = 0 if body is None else body.size
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_metadata); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_metadata_len = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyarrow/ipc.pxi":113
 * 
 *         metadata_len = self.metadata.size
 *         body = self.body             # <<<<<<<<<<<<<<
 *         body_len = 0 if body is None else body.size
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_body); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_body = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyarrow/ipc.pxi":114
 *         metadata_len = self.metadata.size
 *         body = self.body
 *         body_len = 0 if body is None else body.size             # <<<<<<<<<<<<<<
 * 
 *         return """pyarrow.Message
 */
  __pyx_t_1 = (__pyx_v_body == Py_None);
  if ((__pyx_t_1 != 0)) {
    __Pyx_INCREF(__pyx_int_0);
    __pyx_t_3 = __pyx_int_0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_body, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 114, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  __pyx_v_body_len = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyarrow/ipc.pxi":116
 *         body_len = 0 if body is None else body.size
 * 
 *         return """pyarrow.Message             # <<<<<<<<<<<<<<
 * type: {0}
 * metadata length: {1}
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/ipc.pxi":119
 * type: {0}
 * metadata length: {1}
 * body length: {2}""".format(self.type, metadata_len, body_len)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_pyarrow_Message_type_0_metadata, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_4, __pyx_v_metadata_len, __pyx_v_body_len};
    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 119, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_4, __pyx_v_metadata_len, __pyx_v_body_len};
    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 119, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_4);
    __Pyx_INCREF(__pyx_v_metadata_len);
    __Pyx_GIVEREF(__pyx_v_metadata_len);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_metadata_len);
    __Pyx_INCREF(__pyx_v_body_len);
    __Pyx_GIVEREF(__pyx_v_body_len);
    PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_body_len);
    __pyx_t_4 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":108
 *         return stream.getvalue()
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if self.message == nullptr:
 *             return """pyarrow.Message(unitialized)"""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.Message.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_metadata_len);
  __Pyx_XDECREF(__pyx_v_body);
  __Pyx_XDECREF(__pyx_v_body_len);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_7Message_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_7Message_12__reduce_cython__[] = "Message.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_7Message_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_7Message_12__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_Message *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_7Message_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__248, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Message.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_7Message_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_7Message_14__setstate_cython__[] = "Message.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_7Message_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_7Message_14__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_Message *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_7Message_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__249, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Message.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":130
 *         unique_ptr[CMessageReader] reader
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_13MessageReader_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_13MessageReader_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_13MessageReader___cinit__(((struct __pyx_obj_7pyarrow_3lib_MessageReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_13MessageReader___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MessageReader *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":133
 *         pass
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly, use "
 *                         "`pyarrow.ipc.MessageReader.open_stream` function "
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_13MessageReader_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_13MessageReader_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_13MessageReader_2__init__(((struct __pyx_obj_7pyarrow_3lib_MessageReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_13MessageReader_2__init__(struct __pyx_obj_7pyarrow_3lib_MessageReader *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/ipc.pxi":136
 *         raise TypeError("Do not call {}'s constructor directly, use "
 *                         "`pyarrow.ipc.MessageReader.open_stream` function "
 *                         "instead.".format(self.__class__.__name__))             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Do_not_call_s_constructor_direct_9, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/ipc.pxi":134
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call {}'s constructor directly, use "             # <<<<<<<<<<<<<<
 *                         "`pyarrow.ipc.MessageReader.open_stream` function "
 *                         "instead.".format(self.__class__.__name__))
 */
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __PYX_ERR(8, 134, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":133
 *         pass
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly, use "
 *                         "`pyarrow.ipc.MessageReader.open_stream` function "
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.MessageReader.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":139
 * 
 *     @staticmethod
 *     def open_stream(source):             # <<<<<<<<<<<<<<
 *         cdef:
 *             MessageReader result = MessageReader.__new__(MessageReader)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13MessageReader_5open_stream(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13MessageReader_4open_stream[] = "MessageReader.open_stream(source)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_13MessageReader_5open_stream = {"open_stream", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_13MessageReader_5open_stream, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_13MessageReader_4open_stream};
static PyObject *__pyx_pw_7pyarrow_3lib_13MessageReader_5open_stream(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_source = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("open_stream (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "open_stream") < 0)) __PYX_ERR(8, 139, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_source = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("open_stream", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 139, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.MessageReader.open_stream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_13MessageReader_4open_stream(__pyx_v_source);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13MessageReader_4open_stream(PyObject *__pyx_v_source) {
  struct __pyx_obj_7pyarrow_3lib_MessageReader *__pyx_v_result = 0;
  std::shared_ptr< arrow::io::InputStream>  __pyx_v_in_stream;
  std::unique_ptr< arrow::ipc::MessageReader>  __pyx_v_reader;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("open_stream", 0);

  /* "pyarrow/ipc.pxi":141
 *     def open_stream(source):
 *         cdef:
 *             MessageReader result = MessageReader.__new__(MessageReader)             # <<<<<<<<<<<<<<
 *             shared_ptr[CInputStream] in_stream
 *             unique_ptr[CMessageReader] reader
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_MessageReader(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_MessageReader), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 141, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_3lib_MessageReader *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/ipc.pxi":145
 *             unique_ptr[CMessageReader] reader
 * 
 *         _get_input_stream(source, &in_stream)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             reader = CMessageReader.Open(in_stream)
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__get_input_stream(__pyx_v_source, (&__pyx_v_in_stream)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/ipc.pxi":146
 * 
 *         _get_input_stream(source, &in_stream)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             reader = CMessageReader.Open(in_stream)
 *             result.reader.reset(reader.release())
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":147
 *         _get_input_stream(source, &in_stream)
 *         with nogil:
 *             reader = CMessageReader.Open(in_stream)             # <<<<<<<<<<<<<<
 *             result.reader.reset(reader.release())
 * 
 */
        __pyx_v_reader =  arrow::ipc::MessageReader::Open(__pyx_v_in_stream);

        /* "pyarrow/ipc.pxi":148
 *         with nogil:
 *             reader = CMessageReader.Open(in_stream)
 *             result.reader.reset(reader.release())             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
        __pyx_v_result->reader.reset(__pyx_v_reader.release());
      }

      /* "pyarrow/ipc.pxi":146
 * 
 *         _get_input_stream(source, &in_stream)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             reader = CMessageReader.Open(in_stream)
 *             result.reader.reset(reader.release())
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/ipc.pxi":150
 *             result.reader.reset(reader.release())
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":139
 * 
 *     @staticmethod
 *     def open_stream(source):             # <<<<<<<<<<<<<<
 *         cdef:
 *             MessageReader result = MessageReader.__new__(MessageReader)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.MessageReader.open_stream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pyarrow_3lib_13MessageReader_8generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/ipc.pxi":152
 *         return result
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         while True:
 *             yield self.read_next_message()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13MessageReader_7__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_13MessageReader_7__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13MessageReader_6__iter__(((struct __pyx_obj_7pyarrow_3lib_MessageReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13MessageReader_6__iter__(struct __pyx_obj_7pyarrow_3lib_MessageReader *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_19___iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_19___iter__ *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_19___iter__(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_19___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_19___iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(8, 152, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7pyarrow_3lib_13MessageReader_8generator11, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_MessageReader___iter, __pyx_n_s_pyarrow_lib); if (unlikely(!gen)) __PYX_ERR(8, 152, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.MessageReader.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7pyarrow_3lib_13MessageReader_8generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_19___iter__ *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_19___iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(8, 152, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":153
 * 
 *     def __iter__(self):
 *         while True:             # <<<<<<<<<<<<<<
 *             yield self.read_next_message()
 * 
 */
  while (1) {

    /* "pyarrow/ipc.pxi":154
 *     def __iter__(self):
 *         while True:
 *             yield self.read_next_message()             # <<<<<<<<<<<<<<
 * 
 *     def read_next_message(self):
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_read_next_message); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 154, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 154, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(8, 154, __pyx_L1_error)
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "pyarrow/ipc.pxi":152
 *         return result
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         while True:
 *             yield self.read_next_message()
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":156
 *             yield self.read_next_message()
 * 
 *     def read_next_message(self):             # <<<<<<<<<<<<<<
 *         """
 *         Read next Message from the stream. Raises StopIteration at end of
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13MessageReader_10read_next_message(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13MessageReader_9read_next_message[] = "MessageReader.read_next_message(self)\n\n        Read next Message from the stream. Raises StopIteration at end of\n        stream\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_13MessageReader_10read_next_message(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_next_message (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13MessageReader_9read_next_message(((struct __pyx_obj_7pyarrow_3lib_MessageReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13MessageReader_9read_next_message(struct __pyx_obj_7pyarrow_3lib_MessageReader *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("read_next_message", 0);

  /* "pyarrow/ipc.pxi":161
 *         stream
 *         """
 *         cdef Message result = Message.__new__(Message)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_Message(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_Message), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 161, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_3lib_Message *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/ipc.pxi":163
 *         cdef Message result = Message.__new__(Message)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.reader.get().ReadNextMessage(&result.message))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":164
 * 
 *         with nogil:
 *             check_status(self.reader.get().ReadNextMessage(&result.message))             # <<<<<<<<<<<<<<
 * 
 *         if result.message.get() == NULL:
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->reader.get()->ReadNextMessage((&__pyx_v_result->message))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(8, 164, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":163
 *         cdef Message result = Message.__new__(Message)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.reader.get().ReadNextMessage(&result.message))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/ipc.pxi":166
 *             check_status(self.reader.get().ReadNextMessage(&result.message))
 * 
 *         if result.message.get() == NULL:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 * 
 */
  __pyx_t_3 = ((__pyx_v_result->message.get() == NULL) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "pyarrow/ipc.pxi":167
 * 
 *         if result.message.get() == NULL:
 *             raise StopIteration             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
    __PYX_ERR(8, 167, __pyx_L1_error)

    /* "pyarrow/ipc.pxi":166
 *             check_status(self.reader.get().ReadNextMessage(&result.message))
 * 
 *         if result.message.get() == NULL:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 * 
 */
  }

  /* "pyarrow/ipc.pxi":169
 *             raise StopIteration
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * # ----------------------------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":156
 *             yield self.read_next_message()
 * 
 *     def read_next_message(self):             # <<<<<<<<<<<<<<
 *         """
 *         Read next Message from the stream. Raises StopIteration at end of
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.MessageReader.read_next_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13MessageReader_12__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13MessageReader_11__reduce_cython__[] = "MessageReader.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_13MessageReader_12__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13MessageReader_11__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_MessageReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13MessageReader_11__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MessageReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__250, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.MessageReader.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13MessageReader_14__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13MessageReader_13__setstate_cython__[] = "MessageReader.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_13MessageReader_14__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13MessageReader_13__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_MessageReader *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13MessageReader_13__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MessageReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__251, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.MessageReader.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":183
 *     # cdef block is in lib.pxd
 * 
 *     def write(self, table_or_batch):             # <<<<<<<<<<<<<<
 *         """
 *         Write RecordBatch or Table to stream
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_1write(PyObject *__pyx_v_self, PyObject *__pyx_v_table_or_batch); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_write[] = "_CRecordBatchWriter.write(self, table_or_batch)\n\n        Write RecordBatch or Table to stream\n\n        Parameters\n        ----------\n        table_or_batch : {RecordBatch, Table}\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_1write(PyObject *__pyx_v_self, PyObject *__pyx_v_table_or_batch) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_write(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *)__pyx_v_self), ((PyObject *)__pyx_v_table_or_batch));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_write(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self, PyObject *__pyx_v_table_or_batch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("write", 0);

  /* "pyarrow/ipc.pxi":191
 *         table_or_batch : {RecordBatch, Table}
 *         """
 *         if isinstance(table_or_batch, RecordBatch):             # <<<<<<<<<<<<<<
 *             self.write_batch(table_or_batch)
 *         elif isinstance(table_or_batch, Table):
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_table_or_batch, __pyx_ptype_7pyarrow_3lib_RecordBatch); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/ipc.pxi":192
 *         """
 *         if isinstance(table_or_batch, RecordBatch):
 *             self.write_batch(table_or_batch)             # <<<<<<<<<<<<<<
 *         elif isinstance(table_or_batch, Table):
 *             self.write_table(table_or_batch)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write_batch); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_table_or_batch) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_table_or_batch);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "pyarrow/ipc.pxi":191
 *         table_or_batch : {RecordBatch, Table}
 *         """
 *         if isinstance(table_or_batch, RecordBatch):             # <<<<<<<<<<<<<<
 *             self.write_batch(table_or_batch)
 *         elif isinstance(table_or_batch, Table):
 */
    goto __pyx_L3;
  }

  /* "pyarrow/ipc.pxi":193
 *         if isinstance(table_or_batch, RecordBatch):
 *             self.write_batch(table_or_batch)
 *         elif isinstance(table_or_batch, Table):             # <<<<<<<<<<<<<<
 *             self.write_table(table_or_batch)
 *         else:
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_table_or_batch, __pyx_ptype_7pyarrow_3lib_Table); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (likely(__pyx_t_1)) {

    /* "pyarrow/ipc.pxi":194
 *             self.write_batch(table_or_batch)
 *         elif isinstance(table_or_batch, Table):
 *             self.write_table(table_or_batch)             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError(type(table_or_batch))
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write_table); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 194, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_table_or_batch) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_table_or_batch);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 194, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "pyarrow/ipc.pxi":193
 *         if isinstance(table_or_batch, RecordBatch):
 *             self.write_batch(table_or_batch)
 *         elif isinstance(table_or_batch, Table):             # <<<<<<<<<<<<<<
 *             self.write_table(table_or_batch)
 *         else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/ipc.pxi":196
 *             self.write_table(table_or_batch)
 *         else:
 *             raise ValueError(type(table_or_batch))             # <<<<<<<<<<<<<<
 * 
 *     def write_batch(self, RecordBatch batch):
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, ((PyObject *)Py_TYPE(__pyx_v_table_or_batch))); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 196, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(8, 196, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "pyarrow/ipc.pxi":183
 *     # cdef block is in lib.pxd
 * 
 *     def write(self, table_or_batch):             # <<<<<<<<<<<<<<
 *         """
 *         Write RecordBatch or Table to stream
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib._CRecordBatchWriter.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":198
 *             raise ValueError(type(table_or_batch))
 * 
 *     def write_batch(self, RecordBatch batch):             # <<<<<<<<<<<<<<
 *         """
 *         Write RecordBatch to stream
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_3write_batch(PyObject *__pyx_v_self, PyObject *__pyx_v_batch); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_2write_batch[] = "_CRecordBatchWriter.write_batch(self, RecordBatch batch)\n\n        Write RecordBatch to stream\n\n        Parameters\n        ----------\n        batch : RecordBatch\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_3write_batch(PyObject *__pyx_v_self, PyObject *__pyx_v_batch) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write_batch (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_batch), __pyx_ptype_7pyarrow_3lib_RecordBatch, 1, "batch", 0))) __PYX_ERR(8, 198, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_2write_batch(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_batch));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_2write_batch(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_batch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("write_batch", 0);

  /* "pyarrow/ipc.pxi":206
 *         batch : RecordBatch
 *         """
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.writer.get()
 *                          .WriteRecordBatch(deref(batch.batch)))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":207
 *         """
 *         with nogil:
 *             check_status(self.writer.get()             # <<<<<<<<<<<<<<
 *                          .WriteRecordBatch(deref(batch.batch)))
 * 
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->writer.get()->WriteRecordBatch((*__pyx_v_batch->batch))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(8, 207, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":206
 *         batch : RecordBatch
 *         """
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.writer.get()
 *                          .WriteRecordBatch(deref(batch.batch)))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/ipc.pxi":198
 *             raise ValueError(type(table_or_batch))
 * 
 *     def write_batch(self, RecordBatch batch):             # <<<<<<<<<<<<<<
 *         """
 *         Write RecordBatch to stream
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib._CRecordBatchWriter.write_batch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":210
 *                          .WriteRecordBatch(deref(batch.batch)))
 * 
 *     def write_table(self, Table table, max_chunksize=None, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Write Table to stream in (contiguous) RecordBatch objects, with maximum
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_5write_table(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_4write_table[] = "_CRecordBatchWriter.write_table(self, Table table, max_chunksize=None, **kwargs)\n\n        Write Table to stream in (contiguous) RecordBatch objects, with maximum\n        chunk size\n\n        Parameters\n        ----------\n        table : Table\n        max_chunksize : int, default None\n            Maximum size for RecordBatch chunks. Individual chunks may be\n            smaller depending on the chunk layout of individual columns\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_5write_table(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_table = 0;
  PyObject *__pyx_v_max_chunksize = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write_table (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_table,&__pyx_n_s_max_chunksize,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_table)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_chunksize);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "write_table") < 0)) __PYX_ERR(8, 210, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_table = ((struct __pyx_obj_7pyarrow_3lib_Table *)values[0]);
    __pyx_v_max_chunksize = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write_table", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 210, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("pyarrow.lib._CRecordBatchWriter.write_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_table), __pyx_ptype_7pyarrow_3lib_Table, 1, "table", 0))) __PYX_ERR(8, 210, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_4write_table(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *)__pyx_v_self), __pyx_v_table, __pyx_v_max_chunksize, __pyx_v_kwargs);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_4write_table(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_table, PyObject *__pyx_v_max_chunksize, PyObject *__pyx_v_kwargs) {
  int64_t __pyx_v_c_max_chunksize;
  PyObject *__pyx_v_msg = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int64_t __pyx_t_8;
  __Pyx_RefNannySetupContext("write_table", 0);
  __Pyx_INCREF(__pyx_v_max_chunksize);

  /* "pyarrow/ipc.pxi":224
 *         cdef:
 *             # max_chunksize must be > 0 to have any impact
 *             int64_t c_max_chunksize = -1             # <<<<<<<<<<<<<<
 * 
 *         if 'chunksize' in kwargs:
 */
  __pyx_v_c_max_chunksize = -1L;

  /* "pyarrow/ipc.pxi":226
 *             int64_t c_max_chunksize = -1
 * 
 *         if 'chunksize' in kwargs:             # <<<<<<<<<<<<<<
 *             max_chunksize = kwargs['chunksize']
 *             msg = ('The parameter chunksize is deprecated for the write_table '
 */
  __pyx_t_1 = (__Pyx_PyDict_ContainsTF(__pyx_n_u_chunksize, __pyx_v_kwargs, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(8, 226, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/ipc.pxi":227
 * 
 *         if 'chunksize' in kwargs:
 *             max_chunksize = kwargs['chunksize']             # <<<<<<<<<<<<<<
 *             msg = ('The parameter chunksize is deprecated for the write_table '
 *                    'methods as of 0.15, please use parameter '
 */
    __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_kwargs, __pyx_n_u_chunksize); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 227, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_max_chunksize, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/ipc.pxi":228
 *         if 'chunksize' in kwargs:
 *             max_chunksize = kwargs['chunksize']
 *             msg = ('The parameter chunksize is deprecated for the write_table '             # <<<<<<<<<<<<<<
 *                    'methods as of 0.15, please use parameter '
 *                    'max_chunksize instead')
 */
    __Pyx_INCREF(__pyx_kp_u_The_parameter_chunksize_is_depre_2);
    __pyx_v_msg = __pyx_kp_u_The_parameter_chunksize_is_depre_2;

    /* "pyarrow/ipc.pxi":231
 *                    'methods as of 0.15, please use parameter '
 *                    'max_chunksize instead')
 *             warnings.warn(msg, FutureWarning)             # <<<<<<<<<<<<<<
 * 
 *         if max_chunksize is not None:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_warnings); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_warn); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_msg, __pyx_builtin_FutureWarning};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 231, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_msg, __pyx_builtin_FutureWarning};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 231, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 231, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(__pyx_v_msg);
      __Pyx_GIVEREF(__pyx_v_msg);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_msg);
      __Pyx_INCREF(__pyx_builtin_FutureWarning);
      __Pyx_GIVEREF(__pyx_builtin_FutureWarning);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_builtin_FutureWarning);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 231, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "pyarrow/ipc.pxi":226
 *             int64_t c_max_chunksize = -1
 * 
 *         if 'chunksize' in kwargs:             # <<<<<<<<<<<<<<
 *             max_chunksize = kwargs['chunksize']
 *             msg = ('The parameter chunksize is deprecated for the write_table '
 */
  }

  /* "pyarrow/ipc.pxi":233
 *             warnings.warn(msg, FutureWarning)
 * 
 *         if max_chunksize is not None:             # <<<<<<<<<<<<<<
 *             c_max_chunksize = max_chunksize
 * 
 */
  __pyx_t_2 = (__pyx_v_max_chunksize != Py_None);
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pyarrow/ipc.pxi":234
 * 
 *         if max_chunksize is not None:
 *             c_max_chunksize = max_chunksize             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
    __pyx_t_8 = __Pyx_PyInt_As_int64_t(__pyx_v_max_chunksize); if (unlikely((__pyx_t_8 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(8, 234, __pyx_L1_error)
    __pyx_v_c_max_chunksize = __pyx_t_8;

    /* "pyarrow/ipc.pxi":233
 *             warnings.warn(msg, FutureWarning)
 * 
 *         if max_chunksize is not None:             # <<<<<<<<<<<<<<
 *             c_max_chunksize = max_chunksize
 * 
 */
  }

  /* "pyarrow/ipc.pxi":236
 *             c_max_chunksize = max_chunksize
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.writer.get().WriteTable(table.table[0],
 *                                                       c_max_chunksize))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":237
 * 
 *         with nogil:
 *             check_status(self.writer.get().WriteTable(table.table[0],             # <<<<<<<<<<<<<<
 *                                                       c_max_chunksize))
 * 
 */
        __pyx_t_6 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->writer.get()->WriteTable((__pyx_v_table->table[0]), __pyx_v_c_max_chunksize)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(8, 237, __pyx_L6_error)
      }

      /* "pyarrow/ipc.pxi":236
 *             c_max_chunksize = max_chunksize
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.writer.get().WriteTable(table.table[0],
 *                                                       c_max_chunksize))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L7;
        }
        __pyx_L6_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L7:;
      }
  }

  /* "pyarrow/ipc.pxi":210
 *                          .WriteRecordBatch(deref(batch.batch)))
 * 
 *     def write_table(self, Table table, max_chunksize=None, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Write Table to stream in (contiguous) RecordBatch objects, with maximum
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib._CRecordBatchWriter.write_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_XDECREF(__pyx_v_max_chunksize);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":240
 *                                                       c_max_chunksize))
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         """
 *         Close stream and write end-of-stream 0 marker
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_7close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_6close[] = "_CRecordBatchWriter.close(self)\n\n        Close stream and write end-of-stream 0 marker\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_7close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("close (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_6close(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_6close(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("close", 0);

  /* "pyarrow/ipc.pxi":244
 *         Close stream and write end-of-stream 0 marker
 *         """
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.writer.get().Close())
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":245
 *         """
 *         with nogil:
 *             check_status(self.writer.get().Close())             # <<<<<<<<<<<<<<
 * 
 *     def __enter__(self):
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->writer.get()->Close()); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(8, 245, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":244
 *         Close stream and write end-of-stream 0 marker
 *         """
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.writer.get().Close())
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/ipc.pxi":240
 *                                                       c_max_chunksize))
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         """
 *         Close stream and write end-of-stream 0 marker
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib._CRecordBatchWriter.close", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":247
 *             check_status(self.writer.get().Close())
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_9__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_8__enter__[] = "_CRecordBatchWriter.__enter__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_9__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_8__enter__(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_8__enter__(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__", 0);

  /* "pyarrow/ipc.pxi":248
 * 
 *     def __enter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __exit__(self, exc_type, exc_val, exc_tb):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":247
 *             check_status(self.writer.get().Close())
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":250
 *         return self
 * 
 *     def __exit__(self, exc_type, exc_val, exc_tb):             # <<<<<<<<<<<<<<
 *         self.close()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_11__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_10__exit__[] = "_CRecordBatchWriter.__exit__(self, exc_type, exc_val, exc_tb)";
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_11__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_exc_type = 0;
  CYTHON_UNUSED PyObject *__pyx_v_exc_val = 0;
  CYTHON_UNUSED PyObject *__pyx_v_exc_tb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exc_type,&__pyx_n_s_exc_val,&__pyx_n_s_exc_tb,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc_val)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(8, 250, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc_tb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(8, 250, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) __PYX_ERR(8, 250, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_exc_type = values[0];
    __pyx_v_exc_val = values[1];
    __pyx_v_exc_tb = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 250, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._CRecordBatchWriter.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_10__exit__(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *)__pyx_v_self), __pyx_v_exc_type, __pyx_v_exc_val, __pyx_v_exc_tb);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_10__exit__(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc_type, CYTHON_UNUSED PyObject *__pyx_v_exc_val, CYTHON_UNUSED PyObject *__pyx_v_exc_tb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__exit__", 0);

  /* "pyarrow/ipc.pxi":251
 * 
 *     def __exit__(self, exc_type, exc_val, exc_tb):
 *         self.close()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/ipc.pxi":250
 *         return self
 * 
 *     def __exit__(self, exc_type, exc_val, exc_tb):             # <<<<<<<<<<<<<<
 *         self.close()
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib._CRecordBatchWriter.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.writer cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_12__reduce_cython__[] = "_CRecordBatchWriter.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_12__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.writer cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.writer cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__252, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.writer cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._CRecordBatchWriter.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.writer cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.writer cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_14__setstate_cython__[] = "_CRecordBatchWriter.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_14__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchWriter_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.writer cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.writer cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__253, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.writer cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.writer cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._CRecordBatchWriter.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":260
 *         bint closed
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter___cinit__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":263
 *         pass
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static void __pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter_2__dealloc__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter_2__dealloc__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/ipc.pxi":267
 * 
 *     @property
 *     def _use_legacy_format(self):             # <<<<<<<<<<<<<<
 *         return self.options.write_legacy_ipc_format
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_18_use_legacy_format_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_18_use_legacy_format_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter_18_use_legacy_format___get__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter_18_use_legacy_format___get__(struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/ipc.pxi":268
 *     @property
 *     def _use_legacy_format(self):
 *         return self.options.write_legacy_ipc_format             # <<<<<<<<<<<<<<
 * 
 *     def _open(self, sink, Schema schema, use_legacy_format=False):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->options.write_legacy_ipc_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":267
 * 
 *     @property
 *     def _use_legacy_format(self):             # <<<<<<<<<<<<<<
 *         return self.options.write_legacy_ipc_format
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchStreamWriter._use_legacy_format.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":270
 *         return self.options.write_legacy_ipc_format
 * 
 *     def _open(self, sink, Schema schema, use_legacy_format=False):             # <<<<<<<<<<<<<<
 *         self.options.write_legacy_ipc_format = use_legacy_format
 *         get_writer(sink, &self.sink)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_5_open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_24_RecordBatchStreamWriter_4_open[] = "_RecordBatchStreamWriter._open(self, sink, Schema schema, use_legacy_format=False)";
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_5_open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_sink = 0;
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema = 0;
  PyObject *__pyx_v_use_legacy_format = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_open (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sink,&__pyx_n_s_schema,&__pyx_n_s_use_legacy_format,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sink)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_schema)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_open", 0, 2, 3, 1); __PYX_ERR(8, 270, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_use_legacy_format);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_open") < 0)) __PYX_ERR(8, 270, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_sink = values[0];
    __pyx_v_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)values[1]);
    __pyx_v_use_legacy_format = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_open", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 270, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchStreamWriter._open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_schema), __pyx_ptype_7pyarrow_3lib_Schema, 1, "schema", 0))) __PYX_ERR(8, 270, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter_4_open(((struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *)__pyx_v_self), __pyx_v_sink, __pyx_v_schema, __pyx_v_use_legacy_format);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter_4_open(struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *__pyx_v_self, PyObject *__pyx_v_sink, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, PyObject *__pyx_v_use_legacy_format) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  bool __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  std::shared_ptr< arrow::ipc::RecordBatchWriter>  __pyx_t_3;
  __Pyx_RefNannySetupContext("_open", 0);

  /* "pyarrow/ipc.pxi":271
 * 
 *     def _open(self, sink, Schema schema, use_legacy_format=False):
 *         self.options.write_legacy_ipc_format = use_legacy_format             # <<<<<<<<<<<<<<
 *         get_writer(sink, &self.sink)
 *         with nogil:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_use_legacy_format); if (unlikely((__pyx_t_1 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(8, 271, __pyx_L1_error)
  __pyx_v_self->options.write_legacy_ipc_format = __pyx_t_1;

  /* "pyarrow/ipc.pxi":272
 *     def _open(self, sink, Schema schema, use_legacy_format=False):
 *         self.options.write_legacy_ipc_format = use_legacy_format
 *         get_writer(sink, &self.sink)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             self.writer = GetResultValue(
 */
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_get_writer(__pyx_v_sink, (&__pyx_v_self->sink)); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 272, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/ipc.pxi":273
 *         self.options.write_legacy_ipc_format = use_legacy_format
 *         get_writer(sink, &self.sink)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             self.writer = GetResultValue(
 *                 CRecordBatchStreamWriter.Open(
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":274
 *         get_writer(sink, &self.sink)
 *         with nogil:
 *             self.writer = GetResultValue(             # <<<<<<<<<<<<<<
 *                 CRecordBatchStreamWriter.Open(
 *                     self.sink.get(), schema.sp_schema, self.options))
 */
        __pyx_t_3 = arrow::py::GetResultValue<std::shared_ptr< arrow::ipc::RecordBatchWriter> >( arrow::ipc::RecordBatchStreamWriter::Open(__pyx_v_self->sink.get(), __pyx_v_schema->sp_schema, __pyx_v_self->options)); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(8, 274, __pyx_L4_error)
        __pyx_v_self->__pyx_base.writer = __pyx_t_3;
      }

      /* "pyarrow/ipc.pxi":273
 *         self.options.write_legacy_ipc_format = use_legacy_format
 *         get_writer(sink, &self.sink)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             self.writer = GetResultValue(
 *                 CRecordBatchStreamWriter.Open(
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/ipc.pxi":270
 *         return self.options.write_legacy_ipc_format
 * 
 *     def _open(self, sink, Schema schema, use_legacy_format=False):             # <<<<<<<<<<<<<<
 *         self.options.write_legacy_ipc_format = use_legacy_format
 *         get_writer(sink, &self.sink)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchStreamWriter._open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_24_RecordBatchStreamWriter_6__reduce_cython__[] = "_RecordBatchStreamWriter.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter_6__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__254, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchStreamWriter.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_24_RecordBatchStreamWriter_8__setstate_cython__[] = "_RecordBatchStreamWriter.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter_8__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamWriter_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__255, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchStreamWriter.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":279
 * 
 * 
 * cdef _get_input_stream(object source, shared_ptr[CInputStream]* out):             # <<<<<<<<<<<<<<
 *     try:
 *         source = as_buffer(source)
 */

static PyObject *__pyx_f_7pyarrow_3lib__get_input_stream(PyObject *__pyx_v_source, std::shared_ptr< arrow::io::InputStream>  *__pyx_v_out) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("_get_input_stream", 0);
  __Pyx_INCREF(__pyx_v_source);

  /* "pyarrow/ipc.pxi":280
 * 
 * cdef _get_input_stream(object source, shared_ptr[CInputStream]* out):
 *     try:             # <<<<<<<<<<<<<<
 *         source = as_buffer(source)
 *     except TypeError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "pyarrow/ipc.pxi":281
 * cdef _get_input_stream(object source, shared_ptr[CInputStream]* out):
 *     try:
 *         source = as_buffer(source)             # <<<<<<<<<<<<<<
 *     except TypeError:
 *         # Non-buffer-like
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_as_buffer); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 281, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_source);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 281, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "pyarrow/ipc.pxi":280
 * 
 * cdef _get_input_stream(object source, shared_ptr[CInputStream]* out):
 *     try:             # <<<<<<<<<<<<<<
 *         source = as_buffer(source)
 *     except TypeError:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/ipc.pxi":282
 *     try:
 *         source = as_buffer(source)
 *     except TypeError:             # <<<<<<<<<<<<<<
 *         # Non-buffer-like
 *         pass
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_7) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/ipc.pxi":280
 * 
 * cdef _get_input_stream(object source, shared_ptr[CInputStream]* out):
 *     try:             # <<<<<<<<<<<<<<
 *         source = as_buffer(source)
 *     except TypeError:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "pyarrow/ipc.pxi":286
 *         pass
 * 
 *     get_input_stream(source, True, out)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = __pyx_f_7pyarrow_3lib_get_input_stream(__pyx_v_source, 1, __pyx_v_out); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/ipc.pxi":279
 * 
 * 
 * cdef _get_input_stream(object source, shared_ptr[CInputStream]* out):             # <<<<<<<<<<<<<<
 *     try:
 *         source = as_buffer(source)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib._get_input_stream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_source);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pyarrow_3lib_19_CRecordBatchReader_2generator12(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/ipc.pxi":298
 *     # cdef block is in lib.pxd
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         while True:
 *             yield self.read_next_batch()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_1__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_1__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_19_CRecordBatchReader___iter__(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchReader___iter__(struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_20___iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_20___iter__ *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_20___iter__(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_20___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_20___iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(8, 298, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7pyarrow_3lib_19_CRecordBatchReader_2generator12, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_CRecordBatchReader___iter, __pyx_n_s_pyarrow_lib); if (unlikely(!gen)) __PYX_ERR(8, 298, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib._CRecordBatchReader.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7pyarrow_3lib_19_CRecordBatchReader_2generator12(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_20___iter__ *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_20___iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(8, 298, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":299
 * 
 *     def __iter__(self):
 *         while True:             # <<<<<<<<<<<<<<
 *             yield self.read_next_batch()
 * 
 */
  while (1) {

    /* "pyarrow/ipc.pxi":300
 *     def __iter__(self):
 *         while True:
 *             yield self.read_next_batch()             # <<<<<<<<<<<<<<
 * 
 *     def get_next_batch(self):
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_read_next_batch); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 300, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 300, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(8, 300, __pyx_L1_error)
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "pyarrow/ipc.pxi":298
 *     # cdef block is in lib.pxd
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         while True:
 *             yield self.read_next_batch()
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":302
 *             yield self.read_next_batch()
 * 
 *     def get_next_batch(self):             # <<<<<<<<<<<<<<
 *         import warnings
 *         warnings.warn('Please use read_next_batch instead of '
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_4get_next_batch(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19_CRecordBatchReader_3get_next_batch[] = "_CRecordBatchReader.get_next_batch(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_4get_next_batch(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_next_batch (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_3get_next_batch(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_3get_next_batch(struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *__pyx_v_self) {
  PyObject *__pyx_v_warnings = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("get_next_batch", 0);

  /* "pyarrow/ipc.pxi":303
 * 
 *     def get_next_batch(self):
 *         import warnings             # <<<<<<<<<<<<<<
 *         warnings.warn('Please use read_next_batch instead of '
 *                       'get_next_batch', FutureWarning)
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_warnings, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_warnings = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/ipc.pxi":304
 *     def get_next_batch(self):
 *         import warnings
 *         warnings.warn('Please use read_next_batch instead of '             # <<<<<<<<<<<<<<
 *                       'get_next_batch', FutureWarning)
 *         return self.read_next_batch()
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_warnings, __pyx_n_s_warn); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyarrow/ipc.pxi":305
 *         import warnings
 *         warnings.warn('Please use read_next_batch instead of '
 *                       'get_next_batch', FutureWarning)             # <<<<<<<<<<<<<<
 *         return self.read_next_batch()
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__256, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/ipc.pxi":306
 *         warnings.warn('Please use read_next_batch instead of '
 *                       'get_next_batch', FutureWarning)
 *         return self.read_next_batch()             # <<<<<<<<<<<<<<
 * 
 *     def read_next_batch(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read_next_batch); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":302
 *             yield self.read_next_batch()
 * 
 *     def get_next_batch(self):             # <<<<<<<<<<<<<<
 *         import warnings
 *         warnings.warn('Please use read_next_batch instead of '
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib._CRecordBatchReader.get_next_batch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_warnings);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":308
 *         return self.read_next_batch()
 * 
 *     def read_next_batch(self):             # <<<<<<<<<<<<<<
 *         """
 *         Read next RecordBatch from the stream. Raises StopIteration at end of
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_6read_next_batch(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19_CRecordBatchReader_5read_next_batch[] = "_CRecordBatchReader.read_next_batch(self)\n\n        Read next RecordBatch from the stream. Raises StopIteration at end of\n        stream\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_6read_next_batch(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_next_batch (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_5read_next_batch(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_5read_next_batch(struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *__pyx_v_self) {
  std::shared_ptr< arrow::RecordBatch>  __pyx_v_batch;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("read_next_batch", 0);

  /* "pyarrow/ipc.pxi":315
 *         cdef shared_ptr[CRecordBatch] batch
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.reader.get().ReadNext(&batch))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":316
 * 
 *         with nogil:
 *             check_status(self.reader.get().ReadNext(&batch))             # <<<<<<<<<<<<<<
 * 
 *         if batch.get() == NULL:
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->reader.get()->ReadNext((&__pyx_v_batch))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(8, 316, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":315
 *         cdef shared_ptr[CRecordBatch] batch
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.reader.get().ReadNext(&batch))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/ipc.pxi":318
 *             check_status(self.reader.get().ReadNext(&batch))
 * 
 *         if batch.get() == NULL:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 * 
 */
  __pyx_t_2 = ((__pyx_v_batch.get() == NULL) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/ipc.pxi":319
 * 
 *         if batch.get() == NULL:
 *             raise StopIteration             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_batch(batch)
 */
    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
    __PYX_ERR(8, 319, __pyx_L1_error)

    /* "pyarrow/ipc.pxi":318
 *             check_status(self.reader.get().ReadNext(&batch))
 * 
 *         if batch.get() == NULL:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 * 
 */
  }

  /* "pyarrow/ipc.pxi":321
 *             raise StopIteration
 * 
 *         return pyarrow_wrap_batch(batch)             # <<<<<<<<<<<<<<
 * 
 *     def read_all(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_batch(__pyx_v_batch); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 321, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":308
 *         return self.read_next_batch()
 * 
 *     def read_next_batch(self):             # <<<<<<<<<<<<<<
 *         """
 *         Read next RecordBatch from the stream. Raises StopIteration at end of
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib._CRecordBatchReader.read_next_batch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":323
 *         return pyarrow_wrap_batch(batch)
 * 
 *     def read_all(self):             # <<<<<<<<<<<<<<
 *         """
 *         Read all record batches as a pyarrow.Table
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_8read_all(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19_CRecordBatchReader_7read_all[] = "_CRecordBatchReader.read_all(self)\n\n        Read all record batches as a pyarrow.Table\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_8read_all(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_all (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_7read_all(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_7read_all(struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *__pyx_v_self) {
  std::shared_ptr< arrow::Table>  __pyx_v_table;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("read_all", 0);

  /* "pyarrow/ipc.pxi":328
 *         """
 *         cdef shared_ptr[CTable] table
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.reader.get().ReadAll(&table))
 *         return pyarrow_wrap_table(table)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":329
 *         cdef shared_ptr[CTable] table
 *         with nogil:
 *             check_status(self.reader.get().ReadAll(&table))             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_table(table)
 * 
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->reader.get()->ReadAll((&__pyx_v_table))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(8, 329, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":328
 *         """
 *         cdef shared_ptr[CTable] table
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.reader.get().ReadAll(&table))
 *         return pyarrow_wrap_table(table)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/ipc.pxi":330
 *         with nogil:
 *             check_status(self.reader.get().ReadAll(&table))
 *         return pyarrow_wrap_table(table)             # <<<<<<<<<<<<<<
 * 
 *     def __enter__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table(__pyx_v_table); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":323
 *         return pyarrow_wrap_batch(batch)
 * 
 *     def read_all(self):             # <<<<<<<<<<<<<<
 *         """
 *         Read all record batches as a pyarrow.Table
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib._CRecordBatchReader.read_all", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":332
 *         return pyarrow_wrap_table(table)
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_10__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19_CRecordBatchReader_9__enter__[] = "_CRecordBatchReader.__enter__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_10__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_9__enter__(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_9__enter__(struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__", 0);

  /* "pyarrow/ipc.pxi":333
 * 
 *     def __enter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __exit__(self, exc_type, exc_val, exc_tb):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":332
 *         return pyarrow_wrap_table(table)
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":335
 *         return self
 * 
 *     def __exit__(self, exc_type, exc_val, exc_tb):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_12__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19_CRecordBatchReader_11__exit__[] = "_CRecordBatchReader.__exit__(self, exc_type, exc_val, exc_tb)";
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_12__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_exc_type = 0;
  CYTHON_UNUSED PyObject *__pyx_v_exc_val = 0;
  CYTHON_UNUSED PyObject *__pyx_v_exc_tb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exc_type,&__pyx_n_s_exc_val,&__pyx_n_s_exc_tb,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc_val)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(8, 335, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc_tb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(8, 335, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) __PYX_ERR(8, 335, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_exc_type = values[0];
    __pyx_v_exc_val = values[1];
    __pyx_v_exc_tb = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 335, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._CRecordBatchReader.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_11__exit__(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *)__pyx_v_self), __pyx_v_exc_type, __pyx_v_exc_val, __pyx_v_exc_tb);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_11__exit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc_type, CYTHON_UNUSED PyObject *__pyx_v_exc_val, CYTHON_UNUSED PyObject *__pyx_v_exc_tb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__exit__", 0);

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.reader cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_14__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19_CRecordBatchReader_13__reduce_cython__[] = "_CRecordBatchReader.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_14__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_13__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_13__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.reader cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.reader cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__257, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.reader cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._CRecordBatchReader.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.reader cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.reader cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_16__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_19_CRecordBatchReader_15__setstate_cython__[] = "_CRecordBatchReader.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_16__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_15__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_19_CRecordBatchReader_15__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.reader cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.reader cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__258, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.reader cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.reader cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._CRecordBatchReader.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":346
 *         Schema schema
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader___cinit__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":349
 *         pass
 * 
 *     def _open(self, source):             # <<<<<<<<<<<<<<
 *         _get_input_stream(source, &self.in_stream)
 *         with nogil:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_3_open(PyObject *__pyx_v_self, PyObject *__pyx_v_source); /*proto*/
static char __pyx_doc_7pyarrow_3lib_24_RecordBatchStreamReader_2_open[] = "_RecordBatchStreamReader._open(self, source)";
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_3_open(PyObject *__pyx_v_self, PyObject *__pyx_v_source) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_open (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader_2_open(((struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *)__pyx_v_self), ((PyObject *)__pyx_v_source));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader_2_open(struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *__pyx_v_self, PyObject *__pyx_v_source) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("_open", 0);

  /* "pyarrow/ipc.pxi":350
 * 
 *     def _open(self, source):
 *         _get_input_stream(source, &self.in_stream)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(CRecordBatchStreamReader.Open(
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__get_input_stream(__pyx_v_source, (&__pyx_v_self->in_stream)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/ipc.pxi":351
 *     def _open(self, source):
 *         _get_input_stream(source, &self.in_stream)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CRecordBatchStreamReader.Open(
 *                 self.in_stream.get(), &self.reader))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":352
 *         _get_input_stream(source, &self.in_stream)
 *         with nogil:
 *             check_status(CRecordBatchStreamReader.Open(             # <<<<<<<<<<<<<<
 *                 self.in_stream.get(), &self.reader))
 * 
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status( arrow::ipc::RecordBatchStreamReader::Open(__pyx_v_self->in_stream.get(), (&__pyx_v_self->__pyx_base.reader))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(8, 352, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":351
 *     def _open(self, source):
 *         _get_input_stream(source, &self.in_stream)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CRecordBatchStreamReader.Open(
 *                 self.in_stream.get(), &self.reader))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/ipc.pxi":355
 *                 self.in_stream.get(), &self.reader))
 * 
 *         self.schema = pyarrow_wrap_schema(self.reader.get().schema())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(__pyx_v_self->__pyx_base.reader.get()->schema()); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_Schema))))) __PYX_ERR(8, 355, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->schema);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->schema));
  __pyx_v_self->schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/ipc.pxi":349
 *         pass
 * 
 *     def _open(self, source):             # <<<<<<<<<<<<<<
 *         _get_input_stream(source, &self.in_stream)
 *         with nogil:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchStreamReader._open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":344
 * 
 *     cdef readonly:
 *         Schema schema             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_6schema_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_6schema_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader_6schema___get__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader_6schema___get__(struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->schema));
  __pyx_r = ((PyObject *)__pyx_v_self->schema);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_24_RecordBatchStreamReader_4__reduce_cython__[] = "_RecordBatchStreamReader.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader_4__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__259, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchStreamReader.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_24_RecordBatchStreamReader_6__setstate_cython__[] = "_RecordBatchStreamReader.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader_6__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_24_RecordBatchStreamReader_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__260, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchStreamReader.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":360
 * cdef class _RecordBatchFileWriter(_RecordBatchStreamWriter):
 * 
 *     def _open(self, sink, Schema schema, use_legacy_format=False):             # <<<<<<<<<<<<<<
 *         self.options.write_legacy_ipc_format = use_legacy_format
 *         get_writer(sink, &self.sink)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileWriter_1_open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_22_RecordBatchFileWriter__open[] = "_RecordBatchFileWriter._open(self, sink, Schema schema, use_legacy_format=False)";
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileWriter_1_open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_sink = 0;
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema = 0;
  PyObject *__pyx_v_use_legacy_format = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_open (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sink,&__pyx_n_s_schema,&__pyx_n_s_use_legacy_format,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sink)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_schema)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_open", 0, 2, 3, 1); __PYX_ERR(8, 360, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_use_legacy_format);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_open") < 0)) __PYX_ERR(8, 360, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_sink = values[0];
    __pyx_v_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)values[1]);
    __pyx_v_use_legacy_format = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_open", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 360, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchFileWriter._open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_schema), __pyx_ptype_7pyarrow_3lib_Schema, 1, "schema", 0))) __PYX_ERR(8, 360, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_22_RecordBatchFileWriter__open(((struct __pyx_obj_7pyarrow_3lib__RecordBatchFileWriter *)__pyx_v_self), __pyx_v_sink, __pyx_v_schema, __pyx_v_use_legacy_format);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileWriter__open(struct __pyx_obj_7pyarrow_3lib__RecordBatchFileWriter *__pyx_v_self, PyObject *__pyx_v_sink, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, PyObject *__pyx_v_use_legacy_format) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  bool __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  std::shared_ptr< arrow::ipc::RecordBatchWriter>  __pyx_t_3;
  __Pyx_RefNannySetupContext("_open", 0);

  /* "pyarrow/ipc.pxi":361
 * 
 *     def _open(self, sink, Schema schema, use_legacy_format=False):
 *         self.options.write_legacy_ipc_format = use_legacy_format             # <<<<<<<<<<<<<<
 *         get_writer(sink, &self.sink)
 *         with nogil:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_use_legacy_format); if (unlikely((__pyx_t_1 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(8, 361, __pyx_L1_error)
  __pyx_v_self->__pyx_base.options.write_legacy_ipc_format = __pyx_t_1;

  /* "pyarrow/ipc.pxi":362
 *     def _open(self, sink, Schema schema, use_legacy_format=False):
 *         self.options.write_legacy_ipc_format = use_legacy_format
 *         get_writer(sink, &self.sink)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             self.writer = GetResultValue(
 */
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_get_writer(__pyx_v_sink, (&__pyx_v_self->__pyx_base.sink)); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/ipc.pxi":363
 *         self.options.write_legacy_ipc_format = use_legacy_format
 *         get_writer(sink, &self.sink)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             self.writer = GetResultValue(
 *                 CRecordBatchFileWriter.Open(
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":364
 *         get_writer(sink, &self.sink)
 *         with nogil:
 *             self.writer = GetResultValue(             # <<<<<<<<<<<<<<
 *                 CRecordBatchFileWriter.Open(
 *                     self.sink.get(), schema.sp_schema, self.options))
 */
        __pyx_t_3 = arrow::py::GetResultValue<std::shared_ptr< arrow::ipc::RecordBatchWriter> >( arrow::ipc::RecordBatchFileWriter::Open(__pyx_v_self->__pyx_base.sink.get(), __pyx_v_schema->sp_schema, __pyx_v_self->__pyx_base.options)); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(8, 364, __pyx_L4_error)
        __pyx_v_self->__pyx_base.__pyx_base.writer = __pyx_t_3;
      }

      /* "pyarrow/ipc.pxi":363
 *         self.options.write_legacy_ipc_format = use_legacy_format
 *         get_writer(sink, &self.sink)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             self.writer = GetResultValue(
 *                 CRecordBatchFileWriter.Open(
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/ipc.pxi":360
 * cdef class _RecordBatchFileWriter(_RecordBatchStreamWriter):
 * 
 *     def _open(self, sink, Schema schema, use_legacy_format=False):             # <<<<<<<<<<<<<<
 *         self.options.write_legacy_ipc_format = use_legacy_format
 *         get_writer(sink, &self.sink)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchFileWriter._open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileWriter_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_22_RecordBatchFileWriter_2__reduce_cython__[] = "_RecordBatchFileWriter.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileWriter_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_22_RecordBatchFileWriter_2__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchFileWriter *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileWriter_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchFileWriter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__261, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchFileWriter.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileWriter_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_22_RecordBatchFileWriter_4__setstate_cython__[] = "_RecordBatchFileWriter.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileWriter_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_22_RecordBatchFileWriter_4__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchFileWriter *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileWriter_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchFileWriter *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__262, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchFileWriter.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":377
 *         Schema schema
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader___cinit__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":380
 *         pass
 * 
 *     def _open(self, source, footer_offset=None):             # <<<<<<<<<<<<<<
 *         try:
 *             source = as_buffer(source)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_3_open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_22_RecordBatchFileReader_2_open[] = "_RecordBatchFileReader._open(self, source, footer_offset=None)";
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_3_open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_source = 0;
  PyObject *__pyx_v_footer_offset = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_open (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,&__pyx_n_s_footer_offset,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_footer_offset);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_open") < 0)) __PYX_ERR(8, 380, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_source = values[0];
    __pyx_v_footer_offset = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_open", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 380, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchFileReader._open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_2_open(((struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *)__pyx_v_self), __pyx_v_source, __pyx_v_footer_offset);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_2_open(struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *__pyx_v_self, PyObject *__pyx_v_source, PyObject *__pyx_v_footer_offset) {
  int64_t __pyx_v_offset;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int64_t __pyx_t_10;
  __Pyx_RefNannySetupContext("_open", 0);
  __Pyx_INCREF(__pyx_v_source);

  /* "pyarrow/ipc.pxi":381
 * 
 *     def _open(self, source, footer_offset=None):
 *         try:             # <<<<<<<<<<<<<<
 *             source = as_buffer(source)
 *         except TypeError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "pyarrow/ipc.pxi":382
 *     def _open(self, source, footer_offset=None):
 *         try:
 *             source = as_buffer(source)             # <<<<<<<<<<<<<<
 *         except TypeError:
 *             pass
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_as_buffer); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 382, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_source);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 382, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "pyarrow/ipc.pxi":381
 * 
 *     def _open(self, source, footer_offset=None):
 *         try:             # <<<<<<<<<<<<<<
 *             source = as_buffer(source)
 *         except TypeError:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/ipc.pxi":383
 *         try:
 *             source = as_buffer(source)
 *         except TypeError:             # <<<<<<<<<<<<<<
 *             pass
 * 
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_7) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/ipc.pxi":381
 * 
 *     def _open(self, source, footer_offset=None):
 *         try:             # <<<<<<<<<<<<<<
 *             source = as_buffer(source)
 *         except TypeError:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "pyarrow/ipc.pxi":386
 *             pass
 * 
 *         get_reader(source, True, &self.file)             # <<<<<<<<<<<<<<
 * 
 *         cdef int64_t offset = 0
 */
  __pyx_t_4 = __pyx_f_7pyarrow_3lib_get_reader(__pyx_v_source, 1, (&__pyx_v_self->file)); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/ipc.pxi":388
 *         get_reader(source, True, &self.file)
 * 
 *         cdef int64_t offset = 0             # <<<<<<<<<<<<<<
 *         if footer_offset is not None:
 *             offset = footer_offset
 */
  __pyx_v_offset = 0;

  /* "pyarrow/ipc.pxi":389
 * 
 *         cdef int64_t offset = 0
 *         if footer_offset is not None:             # <<<<<<<<<<<<<<
 *             offset = footer_offset
 * 
 */
  __pyx_t_8 = (__pyx_v_footer_offset != Py_None);
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (__pyx_t_9) {

    /* "pyarrow/ipc.pxi":390
 *         cdef int64_t offset = 0
 *         if footer_offset is not None:
 *             offset = footer_offset             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
    __pyx_t_10 = __Pyx_PyInt_As_int64_t(__pyx_v_footer_offset); if (unlikely((__pyx_t_10 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(8, 390, __pyx_L1_error)
    __pyx_v_offset = __pyx_t_10;

    /* "pyarrow/ipc.pxi":389
 * 
 *         cdef int64_t offset = 0
 *         if footer_offset is not None:             # <<<<<<<<<<<<<<
 *             offset = footer_offset
 * 
 */
  }

  /* "pyarrow/ipc.pxi":392
 *             offset = footer_offset
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             if offset != 0:
 *                 check_status(
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":393
 * 
 *         with nogil:
 *             if offset != 0:             # <<<<<<<<<<<<<<
 *                 check_status(
 *                     CRecordBatchFileReader.Open2(self.file.get(), offset,
 */
        __pyx_t_9 = ((__pyx_v_offset != 0) != 0);
        if (__pyx_t_9) {

          /* "pyarrow/ipc.pxi":394
 *         with nogil:
 *             if offset != 0:
 *                 check_status(             # <<<<<<<<<<<<<<
 *                     CRecordBatchFileReader.Open2(self.file.get(), offset,
 *                                                  &self.reader))
 */
          __pyx_t_7 = __pyx_f_7pyarrow_3lib_check_status( arrow::ipc::RecordBatchFileReader:: Open(__pyx_v_self->file.get(), __pyx_v_offset, (&__pyx_v_self->reader))); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(8, 394, __pyx_L11_error)

          /* "pyarrow/ipc.pxi":393
 * 
 *         with nogil:
 *             if offset != 0:             # <<<<<<<<<<<<<<
 *                 check_status(
 *                     CRecordBatchFileReader.Open2(self.file.get(), offset,
 */
          goto __pyx_L13;
        }

        /* "pyarrow/ipc.pxi":398
 *                                                  &self.reader))
 *             else:
 *                 check_status(             # <<<<<<<<<<<<<<
 *                     CRecordBatchFileReader.Open(self.file.get(), &self.reader))
 * 
 */
        /*else*/ {

          /* "pyarrow/ipc.pxi":399
 *             else:
 *                 check_status(
 *                     CRecordBatchFileReader.Open(self.file.get(), &self.reader))             # <<<<<<<<<<<<<<
 * 
 *         self.schema = pyarrow_wrap_schema(self.reader.get().schema())
 */
          __pyx_t_7 = __pyx_f_7pyarrow_3lib_check_status( arrow::ipc::RecordBatchFileReader::Open(__pyx_v_self->file.get(), (&__pyx_v_self->reader))); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(8, 398, __pyx_L11_error)
        }
        __pyx_L13:;
      }

      /* "pyarrow/ipc.pxi":392
 *             offset = footer_offset
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             if offset != 0:
 *                 check_status(
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L12;
        }
        __pyx_L11_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L12:;
      }
  }

  /* "pyarrow/ipc.pxi":401
 *                     CRecordBatchFileReader.Open(self.file.get(), &self.reader))
 * 
 *         self.schema = pyarrow_wrap_schema(self.reader.get().schema())             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_4 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(__pyx_v_self->reader.get()->schema()); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_Schema))))) __PYX_ERR(8, 401, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_self->schema);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->schema));
  __pyx_v_self->schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyarrow/ipc.pxi":380
 *         pass
 * 
 *     def _open(self, source, footer_offset=None):             # <<<<<<<<<<<<<<
 *         try:
 *             source = as_buffer(source)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchFileReader._open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_source);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":404
 * 
 *     @property
 *     def num_record_batches(self):             # <<<<<<<<<<<<<<
 *         return self.reader.get().num_record_batches()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_18num_record_batches_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_18num_record_batches_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_18num_record_batches___get__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_18num_record_batches___get__(struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/ipc.pxi":405
 *     @property
 *     def num_record_batches(self):
 *         return self.reader.get().num_record_batches()             # <<<<<<<<<<<<<<
 * 
 *     def get_batch(self, int i):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->reader.get()->num_record_batches()); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":404
 * 
 *     @property
 *     def num_record_batches(self):             # <<<<<<<<<<<<<<
 *         return self.reader.get().num_record_batches()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchFileReader.num_record_batches.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":407
 *         return self.reader.get().num_record_batches()
 * 
 *     def get_batch(self, int i):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[CRecordBatch] batch
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_5get_batch(PyObject *__pyx_v_self, PyObject *__pyx_arg_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_22_RecordBatchFileReader_4get_batch[] = "_RecordBatchFileReader.get_batch(self, int i)";
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_5get_batch(PyObject *__pyx_v_self, PyObject *__pyx_arg_i) {
  int __pyx_v_i;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_batch (wrapper)", 0);
  assert(__pyx_arg_i); {
    __pyx_v_i = __Pyx_PyInt_As_int(__pyx_arg_i); if (unlikely((__pyx_v_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(8, 407, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchFileReader.get_batch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_4get_batch(((struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *)__pyx_v_self), ((int)__pyx_v_i));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_4get_batch(struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *__pyx_v_self, int __pyx_v_i) {
  std::shared_ptr< arrow::RecordBatch>  __pyx_v_batch;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("get_batch", 0);

  /* "pyarrow/ipc.pxi":410
 *         cdef shared_ptr[CRecordBatch] batch
 * 
 *         if i < 0 or i >= self.num_record_batches:             # <<<<<<<<<<<<<<
 *             raise ValueError('Batch number {0} out of range'.format(i))
 * 
 */
  __pyx_t_2 = ((__pyx_v_i < 0) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_record_batches); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 410, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(8, 410, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/ipc.pxi":411
 * 
 *         if i < 0 or i >= self.num_record_batches:
 *             raise ValueError('Batch number {0} out of range'.format(i))             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Batch_number_0_out_of_range, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 411, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 411, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 411, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 411, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(8, 411, __pyx_L1_error)

    /* "pyarrow/ipc.pxi":410
 *         cdef shared_ptr[CRecordBatch] batch
 * 
 *         if i < 0 or i >= self.num_record_batches:             # <<<<<<<<<<<<<<
 *             raise ValueError('Batch number {0} out of range'.format(i))
 * 
 */
  }

  /* "pyarrow/ipc.pxi":413
 *             raise ValueError('Batch number {0} out of range'.format(i))
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.reader.get().ReadRecordBatch(i, &batch))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":414
 * 
 *         with nogil:
 *             check_status(self.reader.get().ReadRecordBatch(i, &batch))             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_batch(batch)
 */
        __pyx_t_7 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->reader.get()->ReadRecordBatch(__pyx_v_i, (&__pyx_v_batch))); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(8, 414, __pyx_L7_error)
      }

      /* "pyarrow/ipc.pxi":413
 *             raise ValueError('Batch number {0} out of range'.format(i))
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.reader.get().ReadRecordBatch(i, &batch))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L8;
        }
        __pyx_L7_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L8:;
      }
  }

  /* "pyarrow/ipc.pxi":416
 *             check_status(self.reader.get().ReadRecordBatch(i, &batch))
 * 
 *         return pyarrow_wrap_batch(batch)             # <<<<<<<<<<<<<<
 * 
 *     # TODO(wesm): ARROW-503: Function was renamed. Remove after a period of
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_batch(__pyx_v_batch); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":407
 *         return self.reader.get().num_record_batches()
 * 
 *     def get_batch(self, int i):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[CRecordBatch] batch
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchFileReader.get_batch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":422
 *     get_record_batch = get_batch
 * 
 *     def read_all(self):             # <<<<<<<<<<<<<<
 *         """
 *         Read all record batches as a pyarrow.Table
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_7read_all(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_22_RecordBatchFileReader_6read_all[] = "_RecordBatchFileReader.read_all(self)\n\n        Read all record batches as a pyarrow.Table\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_7read_all(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_all (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_6read_all(((struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_6read_all(struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *__pyx_v_self) {
  std::vector<std::shared_ptr< arrow::RecordBatch> >  __pyx_v_batches;
  std::shared_ptr< arrow::Table>  __pyx_v_table;
  int __pyx_v_i;
  int __pyx_v_nbatches;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("read_all", 0);

  /* "pyarrow/ipc.pxi":431
 *             int i, nbatches
 * 
 *         nbatches = self.num_record_batches             # <<<<<<<<<<<<<<
 * 
 *         batches.resize(nbatches)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_record_batches); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(8, 431, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_nbatches = __pyx_t_2;

  /* "pyarrow/ipc.pxi":433
 *         nbatches = self.num_record_batches
 * 
 *         batches.resize(nbatches)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             for i in range(nbatches):
 */
  try {
    __pyx_v_batches.resize(__pyx_v_nbatches);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(8, 433, __pyx_L1_error)
  }

  /* "pyarrow/ipc.pxi":434
 * 
 *         batches.resize(nbatches)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             for i in range(nbatches):
 *                 check_status(self.reader.get().ReadRecordBatch(i, &batches[i]))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":435
 *         batches.resize(nbatches)
 *         with nogil:
 *             for i in range(nbatches):             # <<<<<<<<<<<<<<
 *                 check_status(self.reader.get().ReadRecordBatch(i, &batches[i]))
 *             check_status(CTable.FromRecordBatches(self.schema.sp_schema,
 */
        __pyx_t_2 = __pyx_v_nbatches;
        __pyx_t_3 = __pyx_t_2;
        for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
          __pyx_v_i = __pyx_t_4;

          /* "pyarrow/ipc.pxi":436
 *         with nogil:
 *             for i in range(nbatches):
 *                 check_status(self.reader.get().ReadRecordBatch(i, &batches[i]))             # <<<<<<<<<<<<<<
 *             check_status(CTable.FromRecordBatches(self.schema.sp_schema,
 *                                                   batches, &table))
 */
          __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->reader.get()->ReadRecordBatch(__pyx_v_i, (&(__pyx_v_batches[__pyx_v_i])))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(8, 436, __pyx_L4_error)
        }

        /* "pyarrow/ipc.pxi":437
 *             for i in range(nbatches):
 *                 check_status(self.reader.get().ReadRecordBatch(i, &batches[i]))
 *             check_status(CTable.FromRecordBatches(self.schema.sp_schema,             # <<<<<<<<<<<<<<
 *                                                   batches, &table))
 * 
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status( arrow::Table::FromRecordBatches(__pyx_v_self->schema->sp_schema, __pyx_v_batches, (&__pyx_v_table))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(8, 437, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":434
 * 
 *         batches.resize(nbatches)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             for i in range(nbatches):
 *                 check_status(self.reader.get().ReadRecordBatch(i, &batches[i]))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/ipc.pxi":440
 *                                                   batches, &table))
 * 
 *         return pyarrow_wrap_table(table)             # <<<<<<<<<<<<<<
 * 
 *     def __enter__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table(__pyx_v_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 440, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":422
 *     get_record_batch = get_batch
 * 
 *     def read_all(self):             # <<<<<<<<<<<<<<
 *         """
 *         Read all record batches as a pyarrow.Table
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchFileReader.read_all", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":442
 *         return pyarrow_wrap_table(table)
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_9__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_22_RecordBatchFileReader_8__enter__[] = "_RecordBatchFileReader.__enter__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_9__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_8__enter__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_8__enter__(struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__", 0);

  /* "pyarrow/ipc.pxi":443
 * 
 *     def __enter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __exit__(self, exc_type, exc_value, traceback):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":442
 *         return pyarrow_wrap_table(table)
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":445
 *         return self
 * 
 *     def __exit__(self, exc_type, exc_value, traceback):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_11__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_22_RecordBatchFileReader_10__exit__[] = "_RecordBatchFileReader.__exit__(self, exc_type, exc_value, traceback)";
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_11__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_exc_type = 0;
  CYTHON_UNUSED PyObject *__pyx_v_exc_value = 0;
  CYTHON_UNUSED PyObject *__pyx_v_traceback = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exc_type,&__pyx_n_s_exc_value,&__pyx_n_s_traceback,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(8, 445, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_traceback)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(8, 445, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) __PYX_ERR(8, 445, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_exc_type = values[0];
    __pyx_v_exc_value = values[1];
    __pyx_v_traceback = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 445, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchFileReader.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_10__exit__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *)__pyx_v_self), __pyx_v_exc_type, __pyx_v_exc_value, __pyx_v_traceback);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_10__exit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc_type, CYTHON_UNUSED PyObject *__pyx_v_exc_value, CYTHON_UNUSED PyObject *__pyx_v_traceback) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__exit__", 0);

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":375
 * 
 *     cdef readonly:
 *         Schema schema             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_6schema_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_6schema_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_6schema___get__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_6schema___get__(struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->schema));
  __pyx_r = ((PyObject *)__pyx_v_self->schema);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_22_RecordBatchFileReader_12__reduce_cython__[] = "_RecordBatchFileReader.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_12__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__263, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchFileReader.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_22_RecordBatchFileReader_14__setstate_cython__[] = "_RecordBatchFileReader.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_14__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__264, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchFileReader.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":449
 * 
 * 
 * def get_tensor_size(Tensor tensor):             # <<<<<<<<<<<<<<
 *     """
 *     Return total size of serialized Tensor including metadata and padding
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_187get_tensor_size(PyObject *__pyx_self, PyObject *__pyx_v_tensor); /*proto*/
static char __pyx_doc_7pyarrow_3lib_186get_tensor_size[] = "get_tensor_size(Tensor tensor)\n\n    Return total size of serialized Tensor including metadata and padding\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_187get_tensor_size = {"get_tensor_size", (PyCFunction)__pyx_pw_7pyarrow_3lib_187get_tensor_size, METH_O, __pyx_doc_7pyarrow_3lib_186get_tensor_size};
static PyObject *__pyx_pw_7pyarrow_3lib_187get_tensor_size(PyObject *__pyx_self, PyObject *__pyx_v_tensor) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_tensor_size (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tensor), __pyx_ptype_7pyarrow_3lib_Tensor, 1, "tensor", 0))) __PYX_ERR(8, 449, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_186get_tensor_size(__pyx_self, ((struct __pyx_obj_7pyarrow_3lib_Tensor *)__pyx_v_tensor));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_186get_tensor_size(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_tensor) {
  int64_t __pyx_v_size;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("get_tensor_size", 0);

  /* "pyarrow/ipc.pxi":454
 *     """
 *     cdef int64_t size
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(GetTensorSize(deref(tensor.tp), &size))
 *     return size
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":455
 *     cdef int64_t size
 *     with nogil:
 *         check_status(GetTensorSize(deref(tensor.tp), &size))             # <<<<<<<<<<<<<<
 *     return size
 * 
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::ipc::GetTensorSize((*__pyx_v_tensor->tp), (&__pyx_v_size))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(8, 455, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":454
 *     """
 *     cdef int64_t size
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(GetTensorSize(deref(tensor.tp), &size))
 *     return size
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/ipc.pxi":456
 *     with nogil:
 *         check_status(GetTensorSize(deref(tensor.tp), &size))
 *     return size             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":449
 * 
 * 
 * def get_tensor_size(Tensor tensor):             # <<<<<<<<<<<<<<
 *     """
 *     Return total size of serialized Tensor including metadata and padding
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.get_tensor_size", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":459
 * 
 * 
 * def get_record_batch_size(RecordBatch batch):             # <<<<<<<<<<<<<<
 *     """
 *     Return total size of serialized RecordBatch including metadata and padding
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_189get_record_batch_size(PyObject *__pyx_self, PyObject *__pyx_v_batch); /*proto*/
static char __pyx_doc_7pyarrow_3lib_188get_record_batch_size[] = "get_record_batch_size(RecordBatch batch)\n\n    Return total size of serialized RecordBatch including metadata and padding\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_189get_record_batch_size = {"get_record_batch_size", (PyCFunction)__pyx_pw_7pyarrow_3lib_189get_record_batch_size, METH_O, __pyx_doc_7pyarrow_3lib_188get_record_batch_size};
static PyObject *__pyx_pw_7pyarrow_3lib_189get_record_batch_size(PyObject *__pyx_self, PyObject *__pyx_v_batch) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_record_batch_size (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_batch), __pyx_ptype_7pyarrow_3lib_RecordBatch, 1, "batch", 0))) __PYX_ERR(8, 459, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_188get_record_batch_size(__pyx_self, ((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_batch));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_188get_record_batch_size(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_batch) {
  int64_t __pyx_v_size;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("get_record_batch_size", 0);

  /* "pyarrow/ipc.pxi":464
 *     """
 *     cdef int64_t size
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(GetRecordBatchSize(deref(batch.batch), &size))
 *     return size
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":465
 *     cdef int64_t size
 *     with nogil:
 *         check_status(GetRecordBatchSize(deref(batch.batch), &size))             # <<<<<<<<<<<<<<
 *     return size
 * 
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::ipc::GetRecordBatchSize((*__pyx_v_batch->batch), (&__pyx_v_size))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(8, 465, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":464
 *     """
 *     cdef int64_t size
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(GetRecordBatchSize(deref(batch.batch), &size))
 *     return size
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/ipc.pxi":466
 *     with nogil:
 *         check_status(GetRecordBatchSize(deref(batch.batch), &size))
 *     return size             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":459
 * 
 * 
 * def get_record_batch_size(RecordBatch batch):             # <<<<<<<<<<<<<<
 *     """
 *     Return total size of serialized RecordBatch including metadata and padding
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.get_record_batch_size", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":469
 * 
 * 
 * def write_tensor(Tensor tensor, NativeFile dest):             # <<<<<<<<<<<<<<
 *     """
 *     Write pyarrow.Tensor to pyarrow.NativeFile object its current position
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_191write_tensor(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_190write_tensor[] = "write_tensor(Tensor tensor, NativeFile dest)\n\n    Write pyarrow.Tensor to pyarrow.NativeFile object its current position\n\n    Parameters\n    ----------\n    tensor : pyarrow.Tensor\n    dest : pyarrow.NativeFile\n\n    Returns\n    -------\n    bytes_written : int\n        Total number of bytes written to the file\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_191write_tensor = {"write_tensor", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_191write_tensor, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_190write_tensor};
static PyObject *__pyx_pw_7pyarrow_3lib_191write_tensor(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_tensor = 0;
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_dest = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write_tensor (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tensor,&__pyx_n_s_dest,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tensor)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dest)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("write_tensor", 1, 2, 2, 1); __PYX_ERR(8, 469, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_tensor") < 0)) __PYX_ERR(8, 469, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_tensor = ((struct __pyx_obj_7pyarrow_3lib_Tensor *)values[0]);
    __pyx_v_dest = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write_tensor", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 469, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.write_tensor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tensor), __pyx_ptype_7pyarrow_3lib_Tensor, 1, "tensor", 0))) __PYX_ERR(8, 469, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dest), __pyx_ptype_7pyarrow_3lib_NativeFile, 1, "dest", 0))) __PYX_ERR(8, 469, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_190write_tensor(__pyx_self, __pyx_v_tensor, __pyx_v_dest);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_190write_tensor(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_tensor, struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_dest) {
  int32_t __pyx_v_metadata_length;
  int64_t __pyx_v_body_length;
  std::shared_ptr< arrow::io::OutputStream>  __pyx_v_handle;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr< arrow::io::OutputStream>  __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("write_tensor", 0);

  /* "pyarrow/ipc.pxi":487
 *         int64_t body_length
 * 
 *     handle = dest.get_output_stream()             # <<<<<<<<<<<<<<
 * 
 *     with nogil:
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_dest->__pyx_vtab)->get_output_stream(__pyx_v_dest); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 487, __pyx_L1_error)
  __pyx_v_handle = __pyx_t_1;

  /* "pyarrow/ipc.pxi":489
 *     handle = dest.get_output_stream()
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(
 *             WriteTensor(deref(tensor.tp), handle.get(),
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":490
 * 
 *     with nogil:
 *         check_status(             # <<<<<<<<<<<<<<
 *             WriteTensor(deref(tensor.tp), handle.get(),
 *                         &metadata_length, &body_length))
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(arrow::ipc::WriteTensor((*__pyx_v_tensor->tp), __pyx_v_handle.get(), (&__pyx_v_metadata_length), (&__pyx_v_body_length))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(8, 490, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":489
 *     handle = dest.get_output_stream()
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(
 *             WriteTensor(deref(tensor.tp), handle.get(),
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/ipc.pxi":494
 *                         &metadata_length, &body_length))
 * 
 *     return metadata_length + body_length             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyInt_From_int64_t((__pyx_v_metadata_length + __pyx_v_body_length)); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 494, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":469
 * 
 * 
 * def write_tensor(Tensor tensor, NativeFile dest):             # <<<<<<<<<<<<<<
 *     """
 *     Write pyarrow.Tensor to pyarrow.NativeFile object its current position
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.write_tensor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":497
 * 
 * 
 * cdef NativeFile as_native_file(source):             # <<<<<<<<<<<<<<
 *     if not isinstance(source, NativeFile):
 *         if hasattr(source, 'read'):
 */

static struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_f_7pyarrow_3lib_as_native_file(PyObject *__pyx_v_source) {
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("as_native_file", 0);
  __Pyx_INCREF(__pyx_v_source);

  /* "pyarrow/ipc.pxi":498
 * 
 * cdef NativeFile as_native_file(source):
 *     if not isinstance(source, NativeFile):             # <<<<<<<<<<<<<<
 *         if hasattr(source, 'read'):
 *             source = PythonFile(source)
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_NativeFile); 
  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
  if (__pyx_t_2) {

    /* "pyarrow/ipc.pxi":499
 * cdef NativeFile as_native_file(source):
 *     if not isinstance(source, NativeFile):
 *         if hasattr(source, 'read'):             # <<<<<<<<<<<<<<
 *             source = PythonFile(source)
 *         else:
 */
    __pyx_t_2 = __Pyx_HasAttr(__pyx_v_source, __pyx_n_u_read); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(8, 499, __pyx_L1_error)
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "pyarrow/ipc.pxi":500
 *     if not isinstance(source, NativeFile):
 *         if hasattr(source, 'read'):
 *             source = PythonFile(source)             # <<<<<<<<<<<<<<
 *         else:
 *             source = BufferReader(source)
 */
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_PythonFile), __pyx_v_source); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 500, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "pyarrow/ipc.pxi":499
 * cdef NativeFile as_native_file(source):
 *     if not isinstance(source, NativeFile):
 *         if hasattr(source, 'read'):             # <<<<<<<<<<<<<<
 *             source = PythonFile(source)
 *         else:
 */
      goto __pyx_L4;
    }

    /* "pyarrow/ipc.pxi":502
 *             source = PythonFile(source)
 *         else:
 *             source = BufferReader(source)             # <<<<<<<<<<<<<<
 * 
 *     if not isinstance(source, NativeFile):
 */
    /*else*/ {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_BufferReader), __pyx_v_source); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 502, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_3);
      __pyx_t_3 = 0;
    }
    __pyx_L4:;

    /* "pyarrow/ipc.pxi":498
 * 
 * cdef NativeFile as_native_file(source):
 *     if not isinstance(source, NativeFile):             # <<<<<<<<<<<<<<
 *         if hasattr(source, 'read'):
 *             source = PythonFile(source)
 */
  }

  /* "pyarrow/ipc.pxi":504
 *             source = BufferReader(source)
 * 
 *     if not isinstance(source, NativeFile):             # <<<<<<<<<<<<<<
 *         raise ValueError('Unable to read message from object with type: {0}'
 *                          .format(type(source)))
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_NativeFile); 
  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/ipc.pxi":506
 *     if not isinstance(source, NativeFile):
 *         raise ValueError('Unable to read message from object with type: {0}'
 *                          .format(type(source)))             # <<<<<<<<<<<<<<
 *     return source
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Unable_to_read_message_from_obje, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 506, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)Py_TYPE(__pyx_v_source))) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)Py_TYPE(__pyx_v_source)));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 506, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/ipc.pxi":505
 * 
 *     if not isinstance(source, NativeFile):
 *         raise ValueError('Unable to read message from object with type: {0}'             # <<<<<<<<<<<<<<
 *                          .format(type(source)))
 *     return source
 */
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(8, 505, __pyx_L1_error)

    /* "pyarrow/ipc.pxi":504
 *             source = BufferReader(source)
 * 
 *     if not isinstance(source, NativeFile):             # <<<<<<<<<<<<<<
 *         raise ValueError('Unable to read message from object with type: {0}'
 *                          .format(type(source)))
 */
  }

  /* "pyarrow/ipc.pxi":507
 *         raise ValueError('Unable to read message from object with type: {0}'
 *                          .format(type(source)))
 *     return source             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  if (!(likely(((__pyx_v_source) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_NativeFile))))) __PYX_ERR(8, 507, __pyx_L1_error)
  __Pyx_INCREF(__pyx_v_source);
  __pyx_r = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_source);
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":497
 * 
 * 
 * cdef NativeFile as_native_file(source):             # <<<<<<<<<<<<<<
 *     if not isinstance(source, NativeFile):
 *         if hasattr(source, 'read'):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.as_native_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_source);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":510
 * 
 * 
 * def read_tensor(source):             # <<<<<<<<<<<<<<
 *     """Read pyarrow.Tensor from pyarrow.NativeFile object from current
 *     position. If the file source supports zero copy (e.g. a memory map), then
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_193read_tensor(PyObject *__pyx_self, PyObject *__pyx_v_source); /*proto*/
static char __pyx_doc_7pyarrow_3lib_192read_tensor[] = "read_tensor(source)\nRead pyarrow.Tensor from pyarrow.NativeFile object from current\n    position. If the file source supports zero copy (e.g. a memory map), then\n    this operation does not allocate any memory. This function not assume that\n    the stream is aligned\n\n    Parameters\n    ----------\n    source : pyarrow.NativeFile\n\n    Returns\n    -------\n    tensor : Tensor\n\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_193read_tensor = {"read_tensor", (PyCFunction)__pyx_pw_7pyarrow_3lib_193read_tensor, METH_O, __pyx_doc_7pyarrow_3lib_192read_tensor};
static PyObject *__pyx_pw_7pyarrow_3lib_193read_tensor(PyObject *__pyx_self, PyObject *__pyx_v_source) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_tensor (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_192read_tensor(__pyx_self, ((PyObject *)__pyx_v_source));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_192read_tensor(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source) {
  std::shared_ptr< arrow::Tensor>  __pyx_v_sp_tensor;
   arrow::io::InputStream *__pyx_v_c_stream;
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_nf = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  std::shared_ptr< arrow::io::InputStream>  __pyx_t_2;
  std::shared_ptr< arrow::Tensor>  __pyx_t_3;
  __Pyx_RefNannySetupContext("read_tensor", 0);

  /* "pyarrow/ipc.pxi":528
 *         shared_ptr[CTensor] sp_tensor
 *         CInputStream* c_stream
 *         NativeFile nf = as_native_file(source)             # <<<<<<<<<<<<<<
 * 
 *     c_stream = nf.get_input_stream().get()
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_as_native_file(__pyx_v_source)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_nf = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/ipc.pxi":530
 *         NativeFile nf = as_native_file(source)
 * 
 *     c_stream = nf.get_input_stream().get()             # <<<<<<<<<<<<<<
 *     with nogil:
 *         sp_tensor = GetResultValue(ReadTensor(c_stream))
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_nf->__pyx_vtab)->get_input_stream(__pyx_v_nf); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 530, __pyx_L1_error)
  __pyx_v_c_stream = __pyx_t_2.get();

  /* "pyarrow/ipc.pxi":531
 * 
 *     c_stream = nf.get_input_stream().get()
 *     with nogil:             # <<<<<<<<<<<<<<
 *         sp_tensor = GetResultValue(ReadTensor(c_stream))
 *     return pyarrow_wrap_tensor(sp_tensor)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":532
 *     c_stream = nf.get_input_stream().get()
 *     with nogil:
 *         sp_tensor = GetResultValue(ReadTensor(c_stream))             # <<<<<<<<<<<<<<
 *     return pyarrow_wrap_tensor(sp_tensor)
 * 
 */
        __pyx_t_3 = arrow::py::GetResultValue<std::shared_ptr< arrow::Tensor> >(arrow::ipc::ReadTensor(__pyx_v_c_stream)); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(8, 532, __pyx_L4_error)
        __pyx_v_sp_tensor = __pyx_t_3;
      }

      /* "pyarrow/ipc.pxi":531
 * 
 *     c_stream = nf.get_input_stream().get()
 *     with nogil:             # <<<<<<<<<<<<<<
 *         sp_tensor = GetResultValue(ReadTensor(c_stream))
 *     return pyarrow_wrap_tensor(sp_tensor)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/ipc.pxi":533
 *     with nogil:
 *         sp_tensor = GetResultValue(ReadTensor(c_stream))
 *     return pyarrow_wrap_tensor(sp_tensor)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_tensor(__pyx_v_sp_tensor); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":510
 * 
 * 
 * def read_tensor(source):             # <<<<<<<<<<<<<<
 *     """Read pyarrow.Tensor from pyarrow.NativeFile object from current
 *     position. If the file source supports zero copy (e.g. a memory map), then
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.read_tensor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_nf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":536
 * 
 * 
 * def read_message(source):             # <<<<<<<<<<<<<<
 *     """
 *     Read length-prefixed message from file or buffer-like object
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_195read_message(PyObject *__pyx_self, PyObject *__pyx_v_source); /*proto*/
static char __pyx_doc_7pyarrow_3lib_194read_message[] = "read_message(source)\n\n    Read length-prefixed message from file or buffer-like object\n\n    Parameters\n    ----------\n    source : pyarrow.NativeFile, file-like object, or buffer-like object\n\n    Returns\n    -------\n    message : Message\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_195read_message = {"read_message", (PyCFunction)__pyx_pw_7pyarrow_3lib_195read_message, METH_O, __pyx_doc_7pyarrow_3lib_194read_message};
static PyObject *__pyx_pw_7pyarrow_3lib_195read_message(PyObject *__pyx_self, PyObject *__pyx_v_source) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_message (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_194read_message(__pyx_self, ((PyObject *)__pyx_v_source));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_194read_message(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source) {
  struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_result = 0;
   arrow::io::InputStream *__pyx_v_c_stream;
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_nf = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  std::shared_ptr< arrow::io::InputStream>  __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("read_message", 0);

  /* "pyarrow/ipc.pxi":549
 *     """
 *     cdef:
 *         Message result = Message.__new__(Message)             # <<<<<<<<<<<<<<
 *         CInputStream* c_stream
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_Message(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_Message), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 549, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_3lib_Message *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/ipc.pxi":552
 *         CInputStream* c_stream
 * 
 *     cdef NativeFile nf = as_native_file(source)             # <<<<<<<<<<<<<<
 *     c_stream = nf.get_input_stream().get()
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_as_native_file(__pyx_v_source)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_nf = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/ipc.pxi":553
 * 
 *     cdef NativeFile nf = as_native_file(source)
 *     c_stream = nf.get_input_stream().get()             # <<<<<<<<<<<<<<
 * 
 *     with nogil:
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_nf->__pyx_vtab)->get_input_stream(__pyx_v_nf); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 553, __pyx_L1_error)
  __pyx_v_c_stream = __pyx_t_2.get();

  /* "pyarrow/ipc.pxi":555
 *     c_stream = nf.get_input_stream().get()
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(ReadMessage(c_stream, &result.message))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":556
 * 
 *     with nogil:
 *         check_status(ReadMessage(c_stream, &result.message))             # <<<<<<<<<<<<<<
 * 
 *     if result.message == nullptr:
 */
        __pyx_t_3 = __pyx_f_7pyarrow_3lib_check_status(arrow::ipc::ReadMessage(__pyx_v_c_stream, (&__pyx_v_result->message))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(8, 556, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":555
 *     c_stream = nf.get_input_stream().get()
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(ReadMessage(c_stream, &result.message))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/ipc.pxi":558
 *         check_status(ReadMessage(c_stream, &result.message))
 * 
 *     if result.message == nullptr:             # <<<<<<<<<<<<<<
 *         raise EOFError("End of Arrow stream")
 * 
 */
  __pyx_t_4 = ((__pyx_v_result->message == nullptr) != 0);
  if (unlikely(__pyx_t_4)) {

    /* "pyarrow/ipc.pxi":559
 * 
 *     if result.message == nullptr:
 *         raise EOFError("End of Arrow stream")             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_EOFError, __pyx_tuple__265, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 559, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(8, 559, __pyx_L1_error)

    /* "pyarrow/ipc.pxi":558
 *         check_status(ReadMessage(c_stream, &result.message))
 * 
 *     if result.message == nullptr:             # <<<<<<<<<<<<<<
 *         raise EOFError("End of Arrow stream")
 * 
 */
  }

  /* "pyarrow/ipc.pxi":561
 *         raise EOFError("End of Arrow stream")
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":536
 * 
 * 
 * def read_message(source):             # <<<<<<<<<<<<<<
 *     """
 *     Read length-prefixed message from file or buffer-like object
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.read_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF((PyObject *)__pyx_v_nf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":564
 * 
 * 
 * def read_schema(obj, DictionaryMemo dictionary_memo=None):             # <<<<<<<<<<<<<<
 *     """
 *     Read Schema from message or buffer
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_197read_schema(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_196read_schema[] = "read_schema(obj, DictionaryMemo dictionary_memo=None)\n\n    Read Schema from message or buffer\n\n    Parameters\n    ----------\n    obj : buffer or Message\n    dictionary_memo : DictionaryMemo, optional\n        Needed to be able to reconstruct dictionary-encoded fields\n        with read_record_batch\n\n    Returns\n    -------\n    schema : Schema\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_197read_schema = {"read_schema", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_197read_schema, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_196read_schema};
static PyObject *__pyx_pw_7pyarrow_3lib_197read_schema(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_obj = 0;
  struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *__pyx_v_dictionary_memo = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_schema (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_dictionary_memo,0};
    PyObject* values[2] = {0,0};
    values[1] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dictionary_memo);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_schema") < 0)) __PYX_ERR(8, 564, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_obj = values[0];
    __pyx_v_dictionary_memo = ((struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("read_schema", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 564, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.read_schema", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dictionary_memo), __pyx_ptype_7pyarrow_3lib_DictionaryMemo, 1, "dictionary_memo", 0))) __PYX_ERR(8, 564, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_196read_schema(__pyx_self, __pyx_v_obj, __pyx_v_dictionary_memo);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_196read_schema(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *__pyx_v_dictionary_memo) {
  std::shared_ptr< arrow::Schema>  __pyx_v_result;
  std::shared_ptr< arrow::io::RandomAccessFile>  __pyx_v_cpp_file;
   arrow::ipc::DictionaryMemo __pyx_v_temp_memo;
   arrow::ipc::DictionaryMemo *__pyx_v_arg_dict_memo;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
   arrow::ipc::DictionaryMemo *__pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("read_schema", 0);

  /* "pyarrow/ipc.pxi":585
 *         CDictionaryMemo* arg_dict_memo
 * 
 *     if isinstance(obj, Message):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError(type(obj))
 * 
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_ptype_7pyarrow_3lib_Message); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/ipc.pxi":586
 * 
 *     if isinstance(obj, Message):
 *         raise NotImplementedError(type(obj))             # <<<<<<<<<<<<<<
 * 
 *     get_reader(obj, True, &cpp_file)
 */
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, ((PyObject *)Py_TYPE(__pyx_v_obj))); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 586, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(8, 586, __pyx_L1_error)

    /* "pyarrow/ipc.pxi":585
 *         CDictionaryMemo* arg_dict_memo
 * 
 *     if isinstance(obj, Message):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError(type(obj))
 * 
 */
  }

  /* "pyarrow/ipc.pxi":588
 *         raise NotImplementedError(type(obj))
 * 
 *     get_reader(obj, True, &cpp_file)             # <<<<<<<<<<<<<<
 * 
 *     if dictionary_memo is not None:
 */
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_get_reader(__pyx_v_obj, 1, (&__pyx_v_cpp_file)); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/ipc.pxi":590
 *     get_reader(obj, True, &cpp_file)
 * 
 *     if dictionary_memo is not None:             # <<<<<<<<<<<<<<
 *         arg_dict_memo = dictionary_memo.memo
 *     else:
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_dictionary_memo) != Py_None);
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pyarrow/ipc.pxi":591
 * 
 *     if dictionary_memo is not None:
 *         arg_dict_memo = dictionary_memo.memo             # <<<<<<<<<<<<<<
 *     else:
 *         arg_dict_memo = &temp_memo
 */
    __pyx_t_4 = __pyx_v_dictionary_memo->memo;
    __pyx_v_arg_dict_memo = __pyx_t_4;

    /* "pyarrow/ipc.pxi":590
 *     get_reader(obj, True, &cpp_file)
 * 
 *     if dictionary_memo is not None:             # <<<<<<<<<<<<<<
 *         arg_dict_memo = dictionary_memo.memo
 *     else:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/ipc.pxi":593
 *         arg_dict_memo = dictionary_memo.memo
 *     else:
 *         arg_dict_memo = &temp_memo             # <<<<<<<<<<<<<<
 * 
 *     with nogil:
 */
  /*else*/ {
    __pyx_v_arg_dict_memo = (&__pyx_v_temp_memo);
  }
  __pyx_L4:;

  /* "pyarrow/ipc.pxi":595
 *         arg_dict_memo = &temp_memo
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(ReadSchema(cpp_file.get(), arg_dict_memo, &result))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":596
 * 
 *     with nogil:
 *         check_status(ReadSchema(cpp_file.get(), arg_dict_memo, &result))             # <<<<<<<<<<<<<<
 * 
 *     return pyarrow_wrap_schema(result)
 */
        __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(arrow::ipc::ReadSchema(__pyx_v_cpp_file.get(), __pyx_v_arg_dict_memo, (&__pyx_v_result))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(8, 596, __pyx_L6_error)
      }

      /* "pyarrow/ipc.pxi":595
 *         arg_dict_memo = &temp_memo
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(ReadSchema(cpp_file.get(), arg_dict_memo, &result))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L7;
        }
        __pyx_L6_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L7:;
      }
  }

  /* "pyarrow/ipc.pxi":598
 *         check_status(ReadSchema(cpp_file.get(), arg_dict_memo, &result))
 * 
 *     return pyarrow_wrap_schema(result)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(__pyx_v_result); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":564
 * 
 * 
 * def read_schema(obj, DictionaryMemo dictionary_memo=None):             # <<<<<<<<<<<<<<
 *     """
 *     Read Schema from message or buffer
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.read_schema", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":601
 * 
 * 
 * def read_record_batch(obj, Schema schema,             # <<<<<<<<<<<<<<
 *                       DictionaryMemo dictionary_memo=None):
 *     """
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_199read_record_batch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_198read_record_batch[] = "read_record_batch(obj, Schema schema, DictionaryMemo dictionary_memo=None)\n\n    Read RecordBatch from message, given a known schema. If reading data from a\n    complete IPC stream, use ipc.open_stream instead\n\n    Parameters\n    ----------\n    obj : Message or Buffer-like\n    schema : Schema\n    dictionary_memo : DictionaryMemo, optional\n        If message contains dictionaries, must pass a populated\n        DictionaryMemo\n\n    Returns\n    -------\n    batch : RecordBatch\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_199read_record_batch = {"read_record_batch", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_199read_record_batch, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_198read_record_batch};
static PyObject *__pyx_pw_7pyarrow_3lib_199read_record_batch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_obj = 0;
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema = 0;
  struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *__pyx_v_dictionary_memo = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_record_batch (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_schema,&__pyx_n_s_dictionary_memo,0};
    PyObject* values[3] = {0,0,0};

    /* "pyarrow/ipc.pxi":602
 * 
 * def read_record_batch(obj, Schema schema,
 *                       DictionaryMemo dictionary_memo=None):             # <<<<<<<<<<<<<<
 *     """
 *     Read RecordBatch from message, given a known schema. If reading data from a
 */
    values[2] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_schema)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("read_record_batch", 0, 2, 3, 1); __PYX_ERR(8, 601, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dictionary_memo);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_record_batch") < 0)) __PYX_ERR(8, 601, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_obj = values[0];
    __pyx_v_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)values[1]);
    __pyx_v_dictionary_memo = ((struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("read_record_batch", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 601, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.read_record_batch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_schema), __pyx_ptype_7pyarrow_3lib_Schema, 1, "schema", 0))) __PYX_ERR(8, 601, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dictionary_memo), __pyx_ptype_7pyarrow_3lib_DictionaryMemo, 1, "dictionary_memo", 0))) __PYX_ERR(8, 602, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_198read_record_batch(__pyx_self, __pyx_v_obj, __pyx_v_schema, __pyx_v_dictionary_memo);

  /* "pyarrow/ipc.pxi":601
 * 
 * 
 * def read_record_batch(obj, Schema schema,             # <<<<<<<<<<<<<<
 *                       DictionaryMemo dictionary_memo=None):
 *     """
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_198read_record_batch(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *__pyx_v_dictionary_memo) {
  std::shared_ptr< arrow::RecordBatch>  __pyx_v_result;
  struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_message = 0;
   arrow::ipc::DictionaryMemo __pyx_v_temp_memo;
   arrow::ipc::DictionaryMemo *__pyx_v_arg_dict_memo;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
   arrow::ipc::DictionaryMemo *__pyx_t_6;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("read_record_batch", 0);

  /* "pyarrow/ipc.pxi":625
 *         CDictionaryMemo* arg_dict_memo
 * 
 *     if isinstance(obj, Message):             # <<<<<<<<<<<<<<
 *         message = obj
 *     else:
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_ptype_7pyarrow_3lib_Message); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/ipc.pxi":626
 * 
 *     if isinstance(obj, Message):
 *         message = obj             # <<<<<<<<<<<<<<
 *     else:
 *         message = read_message(obj)
 */
    if (!(likely(((__pyx_v_obj) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_obj, __pyx_ptype_7pyarrow_3lib_Message))))) __PYX_ERR(8, 626, __pyx_L1_error)
    __pyx_t_3 = __pyx_v_obj;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v_message = ((struct __pyx_obj_7pyarrow_3lib_Message *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/ipc.pxi":625
 *         CDictionaryMemo* arg_dict_memo
 * 
 *     if isinstance(obj, Message):             # <<<<<<<<<<<<<<
 *         message = obj
 *     else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/ipc.pxi":628
 *         message = obj
 *     else:
 *         message = read_message(obj)             # <<<<<<<<<<<<<<
 * 
 *     if dictionary_memo is not None:
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_read_message); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 628, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_obj);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 628, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_Message))))) __PYX_ERR(8, 628, __pyx_L1_error)
    __pyx_v_message = ((struct __pyx_obj_7pyarrow_3lib_Message *)__pyx_t_3);
    __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "pyarrow/ipc.pxi":630
 *         message = read_message(obj)
 * 
 *     if dictionary_memo is not None:             # <<<<<<<<<<<<<<
 *         arg_dict_memo = dictionary_memo.memo
 *     else:
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_dictionary_memo) != Py_None);
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pyarrow/ipc.pxi":631
 * 
 *     if dictionary_memo is not None:
 *         arg_dict_memo = dictionary_memo.memo             # <<<<<<<<<<<<<<
 *     else:
 *         arg_dict_memo = &temp_memo
 */
    __pyx_t_6 = __pyx_v_dictionary_memo->memo;
    __pyx_v_arg_dict_memo = __pyx_t_6;

    /* "pyarrow/ipc.pxi":630
 *         message = read_message(obj)
 * 
 *     if dictionary_memo is not None:             # <<<<<<<<<<<<<<
 *         arg_dict_memo = dictionary_memo.memo
 *     else:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/ipc.pxi":633
 *         arg_dict_memo = dictionary_memo.memo
 *     else:
 *         arg_dict_memo = &temp_memo             # <<<<<<<<<<<<<<
 * 
 *     with nogil:
 */
  /*else*/ {
    __pyx_v_arg_dict_memo = (&__pyx_v_temp_memo);
  }
  __pyx_L4:;

  /* "pyarrow/ipc.pxi":635
 *         arg_dict_memo = &temp_memo
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(ReadRecordBatch(deref(message.message.get()),
 *                                      schema.sp_schema,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":636
 * 
 *     with nogil:
 *         check_status(ReadRecordBatch(deref(message.message.get()),             # <<<<<<<<<<<<<<
 *                                      schema.sp_schema,
 *                                      arg_dict_memo, &result))
 */
        __pyx_t_7 = __pyx_f_7pyarrow_3lib_check_status(arrow::ipc::ReadRecordBatch((*__pyx_v_message->message.get()), __pyx_v_schema->sp_schema, __pyx_v_arg_dict_memo, (&__pyx_v_result))); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(8, 636, __pyx_L6_error)
      }

      /* "pyarrow/ipc.pxi":635
 *         arg_dict_memo = &temp_memo
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(ReadRecordBatch(deref(message.message.get()),
 *                                      schema.sp_schema,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L7;
        }
        __pyx_L6_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L7:;
      }
  }

  /* "pyarrow/ipc.pxi":640
 *                                      arg_dict_memo, &result))
 * 
 *     return pyarrow_wrap_batch(result)             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_batch(__pyx_v_result); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":601
 * 
 * 
 * def read_record_batch(obj, Schema schema,             # <<<<<<<<<<<<<<
 *                       DictionaryMemo dictionary_memo=None):
 *     """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.read_record_batch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_message);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/feather.pxi":33
 *         int64_t num_rows
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.num_rows = -1
 * 
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_13FeatherWriter_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_13FeatherWriter_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_13FeatherWriter___cinit__(((struct __pyx_obj_7pyarrow_3lib_FeatherWriter *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_13FeatherWriter___cinit__(struct __pyx_obj_7pyarrow_3lib_FeatherWriter *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/feather.pxi":34
 * 
 *     def __cinit__(self):
 *         self.num_rows = -1             # <<<<<<<<<<<<<<
 * 
 *     def open(self, object dest):
 */
  __pyx_v_self->num_rows = -1L;

  /* "pyarrow/feather.pxi":33
 *         int64_t num_rows
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.num_rows = -1
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/feather.pxi":36
 *         self.num_rows = -1
 * 
 *     def open(self, object dest):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[COutputStream] sink
 *         get_writer(dest, &sink)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherWriter_3open(PyObject *__pyx_v_self, PyObject *__pyx_v_dest); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13FeatherWriter_2open[] = "FeatherWriter.open(self, dest)";
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherWriter_3open(PyObject *__pyx_v_self, PyObject *__pyx_v_dest) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("open (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13FeatherWriter_2open(((struct __pyx_obj_7pyarrow_3lib_FeatherWriter *)__pyx_v_self), ((PyObject *)__pyx_v_dest));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherWriter_2open(struct __pyx_obj_7pyarrow_3lib_FeatherWriter *__pyx_v_self, PyObject *__pyx_v_dest) {
  std::shared_ptr< arrow::io::OutputStream>  __pyx_v_sink;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("open", 0);

  /* "pyarrow/feather.pxi":38
 *     def open(self, object dest):
 *         cdef shared_ptr[COutputStream] sink
 *         get_writer(dest, &sink)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_get_writer(__pyx_v_dest, (&__pyx_v_sink)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/feather.pxi":40
 *         get_writer(dest, &sink)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CFeatherWriter.Open(sink, &self.writer))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/feather.pxi":41
 * 
 *         with nogil:
 *             check_status(CFeatherWriter.Open(sink, &self.writer))             # <<<<<<<<<<<<<<
 * 
 *     def close(self):
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status( arrow::ipc::feather::TableWriter::Open(__pyx_v_sink, (&__pyx_v_self->writer))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(15, 41, __pyx_L4_error)
      }

      /* "pyarrow/feather.pxi":40
 *         get_writer(dest, &sink)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CFeatherWriter.Open(sink, &self.writer))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/feather.pxi":36
 *         self.num_rows = -1
 * 
 *     def open(self, object dest):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[COutputStream] sink
 *         get_writer(dest, &sink)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FeatherWriter.open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/feather.pxi":43
 *             check_status(CFeatherWriter.Open(sink, &self.writer))
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         if self.num_rows < 0:
 *             self.num_rows = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherWriter_5close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13FeatherWriter_4close[] = "FeatherWriter.close(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherWriter_5close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("close (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13FeatherWriter_4close(((struct __pyx_obj_7pyarrow_3lib_FeatherWriter *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherWriter_4close(struct __pyx_obj_7pyarrow_3lib_FeatherWriter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("close", 0);

  /* "pyarrow/feather.pxi":44
 * 
 *     def close(self):
 *         if self.num_rows < 0:             # <<<<<<<<<<<<<<
 *             self.num_rows = 0
 *         self.writer.get().SetNumRows(self.num_rows)
 */
  __pyx_t_1 = ((__pyx_v_self->num_rows < 0) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/feather.pxi":45
 *     def close(self):
 *         if self.num_rows < 0:
 *             self.num_rows = 0             # <<<<<<<<<<<<<<
 *         self.writer.get().SetNumRows(self.num_rows)
 *         with nogil:
 */
    __pyx_v_self->num_rows = 0;

    /* "pyarrow/feather.pxi":44
 * 
 *     def close(self):
 *         if self.num_rows < 0:             # <<<<<<<<<<<<<<
 *             self.num_rows = 0
 *         self.writer.get().SetNumRows(self.num_rows)
 */
  }

  /* "pyarrow/feather.pxi":46
 *         if self.num_rows < 0:
 *             self.num_rows = 0
 *         self.writer.get().SetNumRows(self.num_rows)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(self.writer.get().Finalize())
 */
  __pyx_v_self->writer.get()->SetNumRows(__pyx_v_self->num_rows);

  /* "pyarrow/feather.pxi":47
 *             self.num_rows = 0
 *         self.writer.get().SetNumRows(self.num_rows)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.writer.get().Finalize())
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/feather.pxi":48
 *         self.writer.get().SetNumRows(self.num_rows)
 *         with nogil:
 *             check_status(self.writer.get().Finalize())             # <<<<<<<<<<<<<<
 * 
 *     def write_array(self, object name, object col, object mask=None):
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->writer.get()->Finalize()); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(15, 48, __pyx_L5_error)
      }

      /* "pyarrow/feather.pxi":47
 *             self.num_rows = 0
 *         self.writer.get().SetNumRows(self.num_rows)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.writer.get().Finalize())
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L6;
        }
        __pyx_L5_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L6:;
      }
  }

  /* "pyarrow/feather.pxi":43
 *             check_status(CFeatherWriter.Open(sink, &self.writer))
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         if self.num_rows < 0:
 *             self.num_rows = 0
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.FeatherWriter.close", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/feather.pxi":50
 *             check_status(self.writer.get().Finalize())
 * 
 *     def write_array(self, object name, object col, object mask=None):             # <<<<<<<<<<<<<<
 *         cdef Array arr
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherWriter_7write_array(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13FeatherWriter_6write_array[] = "FeatherWriter.write_array(self, name, col, mask=None)";
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherWriter_7write_array(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_col = 0;
  PyObject *__pyx_v_mask = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write_array (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_col,&__pyx_n_s_mask,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_col)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("write_array", 0, 2, 3, 1); __PYX_ERR(15, 50, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mask);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_array") < 0)) __PYX_ERR(15, 50, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_name = values[0];
    __pyx_v_col = values[1];
    __pyx_v_mask = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write_array", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(15, 50, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.FeatherWriter.write_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_13FeatherWriter_6write_array(((struct __pyx_obj_7pyarrow_3lib_FeatherWriter *)__pyx_v_self), __pyx_v_name, __pyx_v_col, __pyx_v_mask);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherWriter_6write_array(struct __pyx_obj_7pyarrow_3lib_FeatherWriter *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_col, PyObject *__pyx_v_mask) {
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_arr = 0;
  std::string __pyx_v_c_name;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  std::string __pyx_t_8;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("write_array", 0);

  /* "pyarrow/feather.pxi":53
 *         cdef Array arr
 * 
 *         if self.num_rows >= 0:             # <<<<<<<<<<<<<<
 *             if len(col) != self.num_rows:
 *                 raise ValueError('prior column had a different number of rows')
 */
  __pyx_t_1 = ((__pyx_v_self->num_rows >= 0) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/feather.pxi":54
 * 
 *         if self.num_rows >= 0:
 *             if len(col) != self.num_rows:             # <<<<<<<<<<<<<<
 *                 raise ValueError('prior column had a different number of rows')
 *         else:
 */
    __pyx_t_2 = PyObject_Length(__pyx_v_col); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(15, 54, __pyx_L1_error)
    __pyx_t_1 = ((__pyx_t_2 != __pyx_v_self->num_rows) != 0);
    if (unlikely(__pyx_t_1)) {

      /* "pyarrow/feather.pxi":55
 *         if self.num_rows >= 0:
 *             if len(col) != self.num_rows:
 *                 raise ValueError('prior column had a different number of rows')             # <<<<<<<<<<<<<<
 *         else:
 *             self.num_rows = len(col)
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__266, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 55, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(15, 55, __pyx_L1_error)

      /* "pyarrow/feather.pxi":54
 * 
 *         if self.num_rows >= 0:
 *             if len(col) != self.num_rows:             # <<<<<<<<<<<<<<
 *                 raise ValueError('prior column had a different number of rows')
 *         else:
 */
    }

    /* "pyarrow/feather.pxi":53
 *         cdef Array arr
 * 
 *         if self.num_rows >= 0:             # <<<<<<<<<<<<<<
 *             if len(col) != self.num_rows:
 *                 raise ValueError('prior column had a different number of rows')
 */
    goto __pyx_L3;
  }

  /* "pyarrow/feather.pxi":57
 *                 raise ValueError('prior column had a different number of rows')
 *         else:
 *             self.num_rows = len(col)             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(col, Array):
 */
  /*else*/ {
    __pyx_t_2 = PyObject_Length(__pyx_v_col); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(15, 57, __pyx_L1_error)
    __pyx_v_self->num_rows = __pyx_t_2;
  }
  __pyx_L3:;

  /* "pyarrow/feather.pxi":59
 *             self.num_rows = len(col)
 * 
 *         if isinstance(col, Array):             # <<<<<<<<<<<<<<
 *             arr = col
 *         else:
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_col, __pyx_ptype_7pyarrow_3lib_Array); 
  __pyx_t_4 = (__pyx_t_1 != 0);
  if (__pyx_t_4) {

    /* "pyarrow/feather.pxi":60
 * 
 *         if isinstance(col, Array):
 *             arr = col             # <<<<<<<<<<<<<<
 *         else:
 *             arr = Array.from_pandas(col, mask=mask)
 */
    if (!(likely(((__pyx_v_col) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_col, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(15, 60, __pyx_L1_error)
    __pyx_t_3 = __pyx_v_col;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v_arr = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/feather.pxi":59
 *             self.num_rows = len(col)
 * 
 *         if isinstance(col, Array):             # <<<<<<<<<<<<<<
 *             arr = col
 *         else:
 */
    goto __pyx_L5;
  }

  /* "pyarrow/feather.pxi":62
 *             arr = col
 *         else:
 *             arr = Array.from_pandas(col, mask=mask)             # <<<<<<<<<<<<<<
 * 
 *         cdef c_string c_name = tobytes(name)
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_Array), __pyx_n_s_from_pandas); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 62, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 62, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_col);
    __Pyx_GIVEREF(__pyx_v_col);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_col);
    __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(15, 62, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_mask, __pyx_v_mask) < 0) __PYX_ERR(15, 62, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(15, 62, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(15, 62, __pyx_L1_error)
    __pyx_v_arr = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_7);
    __pyx_t_7 = 0;
  }
  __pyx_L5:;

  /* "pyarrow/feather.pxi":64
 *             arr = Array.from_pandas(col, mask=mask)
 * 
 *         cdef c_string c_name = tobytes(name)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_6)) __PYX_ERR(15, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_7 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_name);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_7)) __PYX_ERR(15, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = __pyx_convert_string_from_py_std__in_string(__pyx_t_7); if (unlikely(PyErr_Occurred())) __PYX_ERR(15, 64, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_c_name = __pyx_t_8;

  /* "pyarrow/feather.pxi":66
 *         cdef c_string c_name = tobytes(name)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(
 *                 self.writer.get().Append(c_name, deref(arr.sp_array)))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/feather.pxi":67
 * 
 *         with nogil:
 *             check_status(             # <<<<<<<<<<<<<<
 *                 self.writer.get().Append(c_name, deref(arr.sp_array)))
 * 
 */
        __pyx_t_9 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->writer.get()->Append(__pyx_v_c_name, (*__pyx_v_arr->sp_array))); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(15, 67, __pyx_L7_error)
      }

      /* "pyarrow/feather.pxi":66
 *         cdef c_string c_name = tobytes(name)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(
 *                 self.writer.get().Append(c_name, deref(arr.sp_array)))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L8;
        }
        __pyx_L7_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L8:;
      }
  }

  /* "pyarrow/feather.pxi":50
 *             check_status(self.writer.get().Finalize())
 * 
 *     def write_array(self, object name, object col, object mask=None):             # <<<<<<<<<<<<<<
 *         cdef Array arr
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.FeatherWriter.write_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/feather.pxi":31
 * 
 *     cdef public:
 *         int64_t num_rows             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherWriter_8num_rows_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherWriter_8num_rows_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13FeatherWriter_8num_rows___get__(((struct __pyx_obj_7pyarrow_3lib_FeatherWriter *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherWriter_8num_rows___get__(struct __pyx_obj_7pyarrow_3lib_FeatherWriter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->num_rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FeatherWriter.num_rows.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_13FeatherWriter_8num_rows_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7pyarrow_3lib_13FeatherWriter_8num_rows_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13FeatherWriter_8num_rows_2__set__(((struct __pyx_obj_7pyarrow_3lib_FeatherWriter *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_13FeatherWriter_8num_rows_2__set__(struct __pyx_obj_7pyarrow_3lib_FeatherWriter *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int64_t __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int64_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(15, 31, __pyx_L1_error)
  __pyx_v_self->num_rows = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.FeatherWriter.num_rows.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherWriter_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13FeatherWriter_8__reduce_cython__[] = "FeatherWriter.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherWriter_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13FeatherWriter_8__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_FeatherWriter *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherWriter_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FeatherWriter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__267, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FeatherWriter.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherWriter_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13FeatherWriter_10__setstate_cython__[] = "FeatherWriter.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherWriter_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13FeatherWriter_10__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_FeatherWriter *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherWriter_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FeatherWriter *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__268, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FeatherWriter.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/feather.pxi":75
 *         unique_ptr[CFeatherReader] reader
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_13FeatherReader_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_13FeatherReader_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_13FeatherReader___cinit__(((struct __pyx_obj_7pyarrow_3lib_FeatherReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_13FeatherReader___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/feather.pxi":78
 *         pass
 * 
 *     def open(self, source, c_bool use_memory_map=True):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[CRandomAccessFile] reader
 *         get_reader(source, use_memory_map, &reader)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_3open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13FeatherReader_2open[] = "FeatherReader.open(self, source, bool use_memory_map=True)";
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_3open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_source = 0;
  bool __pyx_v_use_memory_map;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("open (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,&__pyx_n_s_use_memory_map,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_use_memory_map);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "open") < 0)) __PYX_ERR(15, 78, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_source = values[0];
    if (values[1]) {
      __pyx_v_use_memory_map = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_use_memory_map == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(15, 78, __pyx_L3_error)
    } else {
      __pyx_v_use_memory_map = ((bool)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("open", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(15, 78, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.FeatherReader.open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_13FeatherReader_2open(((struct __pyx_obj_7pyarrow_3lib_FeatherReader *)__pyx_v_self), __pyx_v_source, __pyx_v_use_memory_map);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_2open(struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self, PyObject *__pyx_v_source, bool __pyx_v_use_memory_map) {
  std::shared_ptr< arrow::io::RandomAccessFile>  __pyx_v_reader;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("open", 0);

  /* "pyarrow/feather.pxi":80
 *     def open(self, source, c_bool use_memory_map=True):
 *         cdef shared_ptr[CRandomAccessFile] reader
 *         get_reader(source, use_memory_map, &reader)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_get_reader(__pyx_v_source, __pyx_v_use_memory_map, (&__pyx_v_reader)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/feather.pxi":82
 *         get_reader(source, use_memory_map, &reader)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CFeatherReader.Open(reader, &self.reader))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/feather.pxi":83
 * 
 *         with nogil:
 *             check_status(CFeatherReader.Open(reader, &self.reader))             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status( arrow::ipc::feather::TableReader::Open(__pyx_v_reader, (&__pyx_v_self->reader))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(15, 83, __pyx_L4_error)
      }

      /* "pyarrow/feather.pxi":82
 *         get_reader(source, use_memory_map, &reader)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CFeatherReader.Open(reader, &self.reader))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/feather.pxi":78
 *         pass
 * 
 *     def open(self, source, c_bool use_memory_map=True):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[CRandomAccessFile] reader
 *         get_reader(source, use_memory_map, &reader)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FeatherReader.open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/feather.pxi":86
 * 
 *     @property
 *     def num_rows(self):             # <<<<<<<<<<<<<<
 *         return self.reader.get().num_rows()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_8num_rows_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_8num_rows_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13FeatherReader_8num_rows___get__(((struct __pyx_obj_7pyarrow_3lib_FeatherReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_8num_rows___get__(struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/feather.pxi":87
 *     @property
 *     def num_rows(self):
 *         return self.reader.get().num_rows()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->reader.get()->num_rows()); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/feather.pxi":86
 * 
 *     @property
 *     def num_rows(self):             # <<<<<<<<<<<<<<
 *         return self.reader.get().num_rows()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FeatherReader.num_rows.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/feather.pxi":90
 * 
 *     @property
 *     def num_columns(self):             # <<<<<<<<<<<<<<
 *         return self.reader.get().num_columns()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_11num_columns_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_11num_columns_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13FeatherReader_11num_columns___get__(((struct __pyx_obj_7pyarrow_3lib_FeatherReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_11num_columns___get__(struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/feather.pxi":91
 *     @property
 *     def num_columns(self):
 *         return self.reader.get().num_columns()             # <<<<<<<<<<<<<<
 * 
 *     def get_column_name(self, int i):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->reader.get()->num_columns()); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/feather.pxi":90
 * 
 *     @property
 *     def num_columns(self):             # <<<<<<<<<<<<<<
 *         return self.reader.get().num_columns()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FeatherReader.num_columns.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/feather.pxi":93
 *         return self.reader.get().num_columns()
 * 
 *     def get_column_name(self, int i):             # <<<<<<<<<<<<<<
 *         cdef c_string name = self.reader.get().GetColumnName(i)
 *         return frombytes(name)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_5get_column_name(PyObject *__pyx_v_self, PyObject *__pyx_arg_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13FeatherReader_4get_column_name[] = "FeatherReader.get_column_name(self, int i)";
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_5get_column_name(PyObject *__pyx_v_self, PyObject *__pyx_arg_i) {
  int __pyx_v_i;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_column_name (wrapper)", 0);
  assert(__pyx_arg_i); {
    __pyx_v_i = __Pyx_PyInt_As_int(__pyx_arg_i); if (unlikely((__pyx_v_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(15, 93, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.FeatherReader.get_column_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_13FeatherReader_4get_column_name(((struct __pyx_obj_7pyarrow_3lib_FeatherReader *)__pyx_v_self), ((int)__pyx_v_i));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_4get_column_name(struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self, int __pyx_v_i) {
  std::string __pyx_v_name;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("get_column_name", 0);

  /* "pyarrow/feather.pxi":94
 * 
 *     def get_column_name(self, int i):
 *         cdef c_string name = self.reader.get().GetColumnName(i)             # <<<<<<<<<<<<<<
 *         return frombytes(name)
 * 
 */
  __pyx_v_name = __pyx_v_self->reader.get()->GetColumnName(__pyx_v_i);

  /* "pyarrow/feather.pxi":95
 *     def get_column_name(self, int i):
 *         cdef c_string name = self.reader.get().GetColumnName(i)
 *         return frombytes(name)             # <<<<<<<<<<<<<<
 * 
 *     def get_column(self, int i):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/feather.pxi":93
 *         return self.reader.get().num_columns()
 * 
 *     def get_column_name(self, int i):             # <<<<<<<<<<<<<<
 *         cdef c_string name = self.reader.get().GetColumnName(i)
 *         return frombytes(name)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.FeatherReader.get_column_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/feather.pxi":97
 *         return frombytes(name)
 * 
 *     def get_column(self, int i):             # <<<<<<<<<<<<<<
 *         if i < 0 or i >= self.num_columns:
 *             raise IndexError(i)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_7get_column(PyObject *__pyx_v_self, PyObject *__pyx_arg_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13FeatherReader_6get_column[] = "FeatherReader.get_column(self, int i)";
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_7get_column(PyObject *__pyx_v_self, PyObject *__pyx_arg_i) {
  int __pyx_v_i;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_column (wrapper)", 0);
  assert(__pyx_arg_i); {
    __pyx_v_i = __Pyx_PyInt_As_int(__pyx_arg_i); if (unlikely((__pyx_v_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(15, 97, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.FeatherReader.get_column", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_13FeatherReader_6get_column(((struct __pyx_obj_7pyarrow_3lib_FeatherReader *)__pyx_v_self), ((int)__pyx_v_i));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_6get_column(struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self, int __pyx_v_i) {
  std::shared_ptr< arrow::ChunkedArray>  __pyx_v_sp_chunked_array;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("get_column", 0);

  /* "pyarrow/feather.pxi":98
 * 
 *     def get_column(self, int i):
 *         if i < 0 or i >= self.num_columns:             # <<<<<<<<<<<<<<
 *             raise IndexError(i)
 * 
 */
  __pyx_t_2 = ((__pyx_v_i < 0) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_columns); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 98, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(15, 98, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/feather.pxi":99
 *     def get_column(self, int i):
 *         if i < 0 or i >= self.num_columns:
 *             raise IndexError(i)             # <<<<<<<<<<<<<<
 * 
 *         cdef shared_ptr[CChunkedArray] sp_chunked_array
 */
    __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 99, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 99, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(15, 99, __pyx_L1_error)

    /* "pyarrow/feather.pxi":98
 * 
 *     def get_column(self, int i):
 *         if i < 0 or i >= self.num_columns:             # <<<<<<<<<<<<<<
 *             raise IndexError(i)
 * 
 */
  }

  /* "pyarrow/feather.pxi":102
 * 
 *         cdef shared_ptr[CChunkedArray] sp_chunked_array
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.reader.get()
 *                          .GetColumn(i, &sp_chunked_array))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/feather.pxi":103
 *         cdef shared_ptr[CChunkedArray] sp_chunked_array
 *         with nogil:
 *             check_status(self.reader.get()             # <<<<<<<<<<<<<<
 *                          .GetColumn(i, &sp_chunked_array))
 * 
 */
        __pyx_t_6 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->reader.get()->GetColumn(__pyx_v_i, (&__pyx_v_sp_chunked_array))); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(15, 103, __pyx_L7_error)
      }

      /* "pyarrow/feather.pxi":102
 * 
 *         cdef shared_ptr[CChunkedArray] sp_chunked_array
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.reader.get()
 *                          .GetColumn(i, &sp_chunked_array))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L8;
        }
        __pyx_L7_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L8:;
      }
  }

  /* "pyarrow/feather.pxi":106
 *                          .GetColumn(i, &sp_chunked_array))
 * 
 *         return pyarrow_wrap_chunked_array(sp_chunked_array)             # <<<<<<<<<<<<<<
 * 
 *     def _read(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_chunked_array(__pyx_v_sp_chunked_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/feather.pxi":97
 *         return frombytes(name)
 * 
 *     def get_column(self, int i):             # <<<<<<<<<<<<<<
 *         if i < 0 or i >= self.num_columns:
 *             raise IndexError(i)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.FeatherReader.get_column", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/feather.pxi":108
 *         return pyarrow_wrap_chunked_array(sp_chunked_array)
 * 
 *     def _read(self):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[CTable] sp_table
 *         with nogil:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_9_read(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13FeatherReader_8_read[] = "FeatherReader._read(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_9_read(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_read (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13FeatherReader_8_read(((struct __pyx_obj_7pyarrow_3lib_FeatherReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_8_read(struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self) {
  std::shared_ptr< arrow::Table>  __pyx_v_sp_table;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("_read", 0);

  /* "pyarrow/feather.pxi":110
 *     def _read(self):
 *         cdef shared_ptr[CTable] sp_table
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.reader.get()
 *                          .Read(&sp_table))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/feather.pxi":111
 *         cdef shared_ptr[CTable] sp_table
 *         with nogil:
 *             check_status(self.reader.get()             # <<<<<<<<<<<<<<
 *                          .Read(&sp_table))
 * 
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->reader.get()->Read((&__pyx_v_sp_table))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(15, 111, __pyx_L4_error)
      }

      /* "pyarrow/feather.pxi":110
 *     def _read(self):
 *         cdef shared_ptr[CTable] sp_table
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.reader.get()
 *                          .Read(&sp_table))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/feather.pxi":114
 *                          .Read(&sp_table))
 * 
 *         return pyarrow_wrap_table(sp_table)             # <<<<<<<<<<<<<<
 * 
 *     def _read_indices(self, indices):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table(__pyx_v_sp_table); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/feather.pxi":108
 *         return pyarrow_wrap_chunked_array(sp_chunked_array)
 * 
 *     def _read(self):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[CTable] sp_table
 *         with nogil:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.FeatherReader._read", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/feather.pxi":116
 *         return pyarrow_wrap_table(sp_table)
 * 
 *     def _read_indices(self, indices):             # <<<<<<<<<<<<<<
 *         cdef:
 *             shared_ptr[CTable] sp_table
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_11_read_indices(PyObject *__pyx_v_self, PyObject *__pyx_v_indices); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13FeatherReader_10_read_indices[] = "FeatherReader._read_indices(self, indices)";
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_11_read_indices(PyObject *__pyx_v_self, PyObject *__pyx_v_indices) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_read_indices (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13FeatherReader_10_read_indices(((struct __pyx_obj_7pyarrow_3lib_FeatherReader *)__pyx_v_self), ((PyObject *)__pyx_v_indices));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_10_read_indices(struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self, PyObject *__pyx_v_indices) {
  std::shared_ptr< arrow::Table>  __pyx_v_sp_table;
  std::vector<int>  __pyx_v_c_indices;
  PyObject *__pyx_v_index = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("_read_indices", 0);

  /* "pyarrow/feather.pxi":121
 *             vector[int] c_indices
 * 
 *         for index in indices:             # <<<<<<<<<<<<<<
 *             c_indices.push_back(index)
 *         with nogil:
 */
  if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
    __pyx_t_1 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 121, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 121, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(15, 121, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 121, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(15, 121, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 121, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(15, 121, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/feather.pxi":122
 * 
 *         for index in indices:
 *             c_indices.push_back(index)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(self.reader.get()
 */
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_index); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(15, 122, __pyx_L1_error)
    try {
      __pyx_v_c_indices.push_back(__pyx_t_5);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(15, 122, __pyx_L1_error)
    }

    /* "pyarrow/feather.pxi":121
 *             vector[int] c_indices
 * 
 *         for index in indices:             # <<<<<<<<<<<<<<
 *             c_indices.push_back(index)
 *         with nogil:
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/feather.pxi":123
 *         for index in indices:
 *             c_indices.push_back(index)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.reader.get()
 *                          .Read(c_indices, &sp_table))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/feather.pxi":124
 *             c_indices.push_back(index)
 *         with nogil:
 *             check_status(self.reader.get()             # <<<<<<<<<<<<<<
 *                          .Read(c_indices, &sp_table))
 * 
 */
        __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->reader.get()->Read(__pyx_v_c_indices, (&__pyx_v_sp_table))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(15, 124, __pyx_L6_error)
      }

      /* "pyarrow/feather.pxi":123
 *         for index in indices:
 *             c_indices.push_back(index)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.reader.get()
 *                          .Read(c_indices, &sp_table))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L7;
        }
        __pyx_L6_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L7:;
      }
  }

  /* "pyarrow/feather.pxi":127
 *                          .Read(c_indices, &sp_table))
 * 
 *         return pyarrow_wrap_table(sp_table)             # <<<<<<<<<<<<<<
 * 
 *     def _read_names(self, names):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table(__pyx_v_sp_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/feather.pxi":116
 *         return pyarrow_wrap_table(sp_table)
 * 
 *     def _read_indices(self, indices):             # <<<<<<<<<<<<<<
 *         cdef:
 *             shared_ptr[CTable] sp_table
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.FeatherReader._read_indices", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/feather.pxi":129
 *         return pyarrow_wrap_table(sp_table)
 * 
 *     def _read_names(self, names):             # <<<<<<<<<<<<<<
 *         cdef:
 *             shared_ptr[CTable] sp_table
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_13_read_names(PyObject *__pyx_v_self, PyObject *__pyx_v_names); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13FeatherReader_12_read_names[] = "FeatherReader._read_names(self, names)";
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_13_read_names(PyObject *__pyx_v_self, PyObject *__pyx_v_names) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_read_names (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13FeatherReader_12_read_names(((struct __pyx_obj_7pyarrow_3lib_FeatherReader *)__pyx_v_self), ((PyObject *)__pyx_v_names));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_12_read_names(struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self, PyObject *__pyx_v_names) {
  std::shared_ptr< arrow::Table>  __pyx_v_sp_table;
  std::vector<std::string>  __pyx_v_c_names;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  std::string __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("_read_names", 0);

  /* "pyarrow/feather.pxi":134
 *             vector[c_string] c_names
 * 
 *         for name in names:             # <<<<<<<<<<<<<<
 *             c_names.push_back(tobytes(name))
 *         with nogil:
 */
  if (likely(PyList_CheckExact(__pyx_v_names)) || PyTuple_CheckExact(__pyx_v_names)) {
    __pyx_t_1 = __pyx_v_names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_names); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 134, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 134, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(15, 134, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 134, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(15, 134, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 134, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(15, 134, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/feather.pxi":135
 * 
 *         for name in names:
 *             c_names.push_back(tobytes(name))             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(self.reader.get()
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_name);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = __pyx_convert_string_from_py_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(15, 135, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    try {
      __pyx_v_c_names.push_back(__pyx_t_7);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(15, 135, __pyx_L1_error)
    }

    /* "pyarrow/feather.pxi":134
 *             vector[c_string] c_names
 * 
 *         for name in names:             # <<<<<<<<<<<<<<
 *             c_names.push_back(tobytes(name))
 *         with nogil:
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/feather.pxi":136
 *         for name in names:
 *             c_names.push_back(tobytes(name))
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.reader.get()
 *                          .Read(c_names, &sp_table))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/feather.pxi":137
 *             c_names.push_back(tobytes(name))
 *         with nogil:
 *             check_status(self.reader.get()             # <<<<<<<<<<<<<<
 *                          .Read(c_names, &sp_table))
 * 
 */
        __pyx_t_8 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->reader.get()->Read(__pyx_v_c_names, (&__pyx_v_sp_table))); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(15, 137, __pyx_L6_error)
      }

      /* "pyarrow/feather.pxi":136
 *         for name in names:
 *             c_names.push_back(tobytes(name))
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.reader.get()
 *                          .Read(c_names, &sp_table))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L7;
        }
        __pyx_L6_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L7:;
      }
  }

  /* "pyarrow/feather.pxi":140
 *                          .Read(c_names, &sp_table))
 * 
 *         return pyarrow_wrap_table(sp_table)             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table(__pyx_v_sp_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/feather.pxi":129
 *         return pyarrow_wrap_table(sp_table)
 * 
 *     def _read_names(self, names):             # <<<<<<<<<<<<<<
 *         cdef:
 *             shared_ptr[CTable] sp_table
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.FeatherReader._read_names", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_15__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13FeatherReader_14__reduce_cython__[] = "FeatherReader.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_15__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13FeatherReader_14__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_FeatherReader *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_14__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__269, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FeatherReader.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_17__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13FeatherReader_16__setstate_cython__[] = "FeatherReader.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_17__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_13FeatherReader_16__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_FeatherReader *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_16__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__270, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.FeatherReader.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":25
 * 
 * 
 * def is_named_tuple(cls):             # <<<<<<<<<<<<<<
 *     """Return True if cls is a namedtuple and False otherwise."""
 *     b = cls.__bases__
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_201is_named_tuple(PyObject *__pyx_self, PyObject *__pyx_v_cls); /*proto*/
static char __pyx_doc_7pyarrow_3lib_200is_named_tuple[] = "is_named_tuple(cls)\nReturn True if cls is a namedtuple and False otherwise.";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_201is_named_tuple = {"is_named_tuple", (PyCFunction)__pyx_pw_7pyarrow_3lib_201is_named_tuple, METH_O, __pyx_doc_7pyarrow_3lib_200is_named_tuple};
static PyObject *__pyx_pw_7pyarrow_3lib_201is_named_tuple(PyObject *__pyx_self, PyObject *__pyx_v_cls) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_named_tuple (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_200is_named_tuple(__pyx_self, ((PyObject *)__pyx_v_cls));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pyarrow_3lib_14is_named_tuple_2generator15(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/serialization.pxi":33
 *     if not isinstance(f, tuple):
 *         return False
 *     return all(isinstance(n, six.string_types) for n in f)             # <<<<<<<<<<<<<<
 * 
 * 
 */

static PyObject *__pyx_pf_7pyarrow_3lib_14is_named_tuple_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_22_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_22_genexpr *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_22_genexpr(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_22_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_22_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(16, 33, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7pyarrow_3lib_14is_named_tuple_2generator15, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_is_named_tuple_locals_genexpr, __pyx_n_s_pyarrow_lib); if (unlikely(!gen)) __PYX_ERR(16, 33, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.is_named_tuple.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7pyarrow_3lib_14is_named_tuple_2generator15(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_22_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_22_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(16, 33, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_f)) { __Pyx_RaiseClosureNameError("f"); __PYX_ERR(16, 33, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_f)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_f)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_f; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_f); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 33, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(16, 33, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(16, 33, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(16, 33, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(16, 33, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(16, 33, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(16, 33, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_n);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_n, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_six); if (unlikely(!__pyx_t_4)) __PYX_ERR(16, 33, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_string_types); if (unlikely(!__pyx_t_5)) __PYX_ERR(16, 33, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = PyObject_IsInstance(__pyx_cur_scope->__pyx_v_n, __pyx_t_5); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(16, 33, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = ((!(__pyx_t_6 != 0)) != 0);
    if (__pyx_t_7) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
  }
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":25
 * 
 * 
 * def is_named_tuple(cls):             # <<<<<<<<<<<<<<
 *     """Return True if cls is a namedtuple and False otherwise."""
 *     b = cls.__bases__
 */

static PyObject *__pyx_pf_7pyarrow_3lib_200is_named_tuple(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple *__pyx_cur_scope;
  PyObject *__pyx_v_b = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("is_named_tuple", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(16, 25, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }

  /* "pyarrow/serialization.pxi":27
 * def is_named_tuple(cls):
 *     """Return True if cls is a namedtuple and False otherwise."""
 *     b = cls.__bases__             # <<<<<<<<<<<<<<
 *     if len(b) != 1 or b[0] != tuple:
 *         return False
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_bases); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_b = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":28
 *     """Return True if cls is a namedtuple and False otherwise."""
 *     b = cls.__bases__
 *     if len(b) != 1 or b[0] != tuple:             # <<<<<<<<<<<<<<
 *         return False
 *     f = getattr(cls, "_fields", None)
 */
  __pyx_t_3 = PyObject_Length(__pyx_v_b); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(16, 28, __pyx_L1_error)
  __pyx_t_4 = ((__pyx_t_3 != 1) != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_b, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, ((PyObject *)(&PyTuple_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(16, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(16, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_2 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pyarrow/serialization.pxi":29
 *     b = cls.__bases__
 *     if len(b) != 1 or b[0] != tuple:
 *         return False             # <<<<<<<<<<<<<<
 *     f = getattr(cls, "_fields", None)
 *     if not isinstance(f, tuple):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "pyarrow/serialization.pxi":28
 *     """Return True if cls is a namedtuple and False otherwise."""
 *     b = cls.__bases__
 *     if len(b) != 1 or b[0] != tuple:             # <<<<<<<<<<<<<<
 *         return False
 *     f = getattr(cls, "_fields", None)
 */
  }

  /* "pyarrow/serialization.pxi":30
 *     if len(b) != 1 or b[0] != tuple:
 *         return False
 *     f = getattr(cls, "_fields", None)             # <<<<<<<<<<<<<<
 *     if not isinstance(f, tuple):
 *         return False
 */
  __pyx_t_5 = __Pyx_GetAttr3(__pyx_v_cls, __pyx_n_u_fields_2, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(16, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_cur_scope->__pyx_v_f = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "pyarrow/serialization.pxi":31
 *         return False
 *     f = getattr(cls, "_fields", None)
 *     if not isinstance(f, tuple):             # <<<<<<<<<<<<<<
 *         return False
 *     return all(isinstance(n, six.string_types) for n in f)
 */
  __pyx_t_5 = __pyx_cur_scope->__pyx_v_f;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_2 = PyTuple_Check(__pyx_t_5); 
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
  if (__pyx_t_4) {

    /* "pyarrow/serialization.pxi":32
 *     f = getattr(cls, "_fields", None)
 *     if not isinstance(f, tuple):
 *         return False             # <<<<<<<<<<<<<<
 *     return all(isinstance(n, six.string_types) for n in f)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "pyarrow/serialization.pxi":31
 *         return False
 *     f = getattr(cls, "_fields", None)
 *     if not isinstance(f, tuple):             # <<<<<<<<<<<<<<
 *         return False
 *     return all(isinstance(n, six.string_types) for n in f)
 */
  }

  /* "pyarrow/serialization.pxi":33
 *     if not isinstance(f, tuple):
 *         return False
 *     return all(isinstance(n, six.string_types) for n in f)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __pyx_pf_7pyarrow_3lib_14is_named_tuple_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_5)) __PYX_ERR(16, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":25
 * 
 * 
 * def is_named_tuple(cls):             # <<<<<<<<<<<<<<
 *     """Return True if cls is a namedtuple and False otherwise."""
 *     b = cls.__bases__
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.is_named_tuple", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_b);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":37
 * 
 * class SerializationCallbackError(ArrowSerializationError):
 *     def __init__(self, message, example_object):             # <<<<<<<<<<<<<<
 *         ArrowSerializationError.__init__(self, message)
 *         self.example_object = example_object
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_26SerializationCallbackError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_26SerializationCallbackError___init__[] = "SerializationCallbackError.__init__(self, message, example_object)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_26SerializationCallbackError_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_26SerializationCallbackError_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_26SerializationCallbackError___init__};
static PyObject *__pyx_pw_7pyarrow_3lib_26SerializationCallbackError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_message = 0;
  PyObject *__pyx_v_example_object = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_message,&__pyx_n_s_example_object,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_message)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(16, 37, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_example_object)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(16, 37, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(16, 37, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_message = values[1];
    __pyx_v_example_object = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(16, 37, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.SerializationCallbackError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_26SerializationCallbackError___init__(__pyx_self, __pyx_v_self, __pyx_v_message, __pyx_v_example_object);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_26SerializationCallbackError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message, PyObject *__pyx_v_example_object) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/serialization.pxi":38
 * class SerializationCallbackError(ArrowSerializationError):
 *     def __init__(self, message, example_object):
 *         ArrowSerializationError.__init__(self, message)             # <<<<<<<<<<<<<<
 *         self.example_object = example_object
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ArrowSerializationError); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(16, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_self, __pyx_v_message};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 38, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_self, __pyx_v_message};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 38, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(16, 38, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
    __Pyx_INCREF(__pyx_v_message);
    __Pyx_GIVEREF(__pyx_v_message);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_message);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 38, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":39
 *     def __init__(self, message, example_object):
 *         ArrowSerializationError.__init__(self, message)
 *         self.example_object = example_object             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_example_object, __pyx_v_example_object) < 0) __PYX_ERR(16, 39, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":37
 * 
 * class SerializationCallbackError(ArrowSerializationError):
 *     def __init__(self, message, example_object):             # <<<<<<<<<<<<<<
 *         ArrowSerializationError.__init__(self, message)
 *         self.example_object = example_object
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.SerializationCallbackError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":43
 * 
 * class DeserializationCallbackError(ArrowSerializationError):
 *     def __init__(self, message, type_id):             # <<<<<<<<<<<<<<
 *         ArrowSerializationError.__init__(self, message)
 *         self.type_id = type_id
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_28DeserializationCallbackError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_28DeserializationCallbackError___init__[] = "DeserializationCallbackError.__init__(self, message, type_id)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_28DeserializationCallbackError_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_28DeserializationCallbackError_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_28DeserializationCallbackError___init__};
static PyObject *__pyx_pw_7pyarrow_3lib_28DeserializationCallbackError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_message = 0;
  PyObject *__pyx_v_type_id = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_message,&__pyx_n_s_type_id,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_message)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(16, 43, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type_id)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(16, 43, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(16, 43, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_message = values[1];
    __pyx_v_type_id = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(16, 43, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.DeserializationCallbackError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_28DeserializationCallbackError___init__(__pyx_self, __pyx_v_self, __pyx_v_message, __pyx_v_type_id);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_28DeserializationCallbackError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message, PyObject *__pyx_v_type_id) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/serialization.pxi":44
 * class DeserializationCallbackError(ArrowSerializationError):
 *     def __init__(self, message, type_id):
 *         ArrowSerializationError.__init__(self, message)             # <<<<<<<<<<<<<<
 *         self.type_id = type_id
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ArrowSerializationError); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(16, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_self, __pyx_v_message};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 44, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_self, __pyx_v_message};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 44, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(16, 44, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
    __Pyx_INCREF(__pyx_v_message);
    __Pyx_GIVEREF(__pyx_v_message);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_message);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 44, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":45
 *     def __init__(self, message, type_id):
 *         ArrowSerializationError.__init__(self, message)
 *         self.type_id = type_id             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_type_id, __pyx_v_type_id) < 0) __PYX_ERR(16, 45, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":43
 * 
 * class DeserializationCallbackError(ArrowSerializationError):
 *     def __init__(self, message, type_id):             # <<<<<<<<<<<<<<
 *         ArrowSerializationError.__init__(self, message)
 *         self.type_id = type_id
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.DeserializationCallbackError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":58
 *         object pickle_deserializer
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         # Types with special serialization handlers
 *         self.type_to_type_id = dict()
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_20SerializationContext_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_20SerializationContext_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_7pyarrow_3lib_20SerializationContext___init__(((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_3lib_20SerializationContext___init__(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/serialization.pxi":60
 *     def __init__(self):
 *         # Types with special serialization handlers
 *         self.type_to_type_id = dict()             # <<<<<<<<<<<<<<
 *         self.whitelisted_types = dict()
 *         self.types_to_pickle = set()
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->type_to_type_id);
  __Pyx_DECREF(__pyx_v_self->type_to_type_id);
  __pyx_v_self->type_to_type_id = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":61
 *         # Types with special serialization handlers
 *         self.type_to_type_id = dict()
 *         self.whitelisted_types = dict()             # <<<<<<<<<<<<<<
 *         self.types_to_pickle = set()
 *         self.custom_serializers = dict()
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->whitelisted_types);
  __Pyx_DECREF(__pyx_v_self->whitelisted_types);
  __pyx_v_self->whitelisted_types = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":62
 *         self.type_to_type_id = dict()
 *         self.whitelisted_types = dict()
 *         self.types_to_pickle = set()             # <<<<<<<<<<<<<<
 *         self.custom_serializers = dict()
 *         self.custom_deserializers = dict()
 */
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->types_to_pickle);
  __Pyx_DECREF(__pyx_v_self->types_to_pickle);
  __pyx_v_self->types_to_pickle = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":63
 *         self.whitelisted_types = dict()
 *         self.types_to_pickle = set()
 *         self.custom_serializers = dict()             # <<<<<<<<<<<<<<
 *         self.custom_deserializers = dict()
 *         self.pickle_serializer = pickle.dumps
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->custom_serializers);
  __Pyx_DECREF(__pyx_v_self->custom_serializers);
  __pyx_v_self->custom_serializers = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":64
 *         self.types_to_pickle = set()
 *         self.custom_serializers = dict()
 *         self.custom_deserializers = dict()             # <<<<<<<<<<<<<<
 *         self.pickle_serializer = pickle.dumps
 *         self.pickle_deserializer = pickle.loads
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->custom_deserializers);
  __Pyx_DECREF(__pyx_v_self->custom_deserializers);
  __pyx_v_self->custom_deserializers = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":65
 *         self.custom_serializers = dict()
 *         self.custom_deserializers = dict()
 *         self.pickle_serializer = pickle.dumps             # <<<<<<<<<<<<<<
 *         self.pickle_deserializer = pickle.loads
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pickle); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dumps); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->pickle_serializer);
  __Pyx_DECREF(__pyx_v_self->pickle_serializer);
  __pyx_v_self->pickle_serializer = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/serialization.pxi":66
 *         self.custom_deserializers = dict()
 *         self.pickle_serializer = pickle.dumps
 *         self.pickle_deserializer = pickle.loads             # <<<<<<<<<<<<<<
 * 
 *     def set_pickle(self, serializer, deserializer):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pickle); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_loads); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->pickle_deserializer);
  __Pyx_DECREF(__pyx_v_self->pickle_deserializer);
  __pyx_v_self->pickle_deserializer = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":58
 *         object pickle_deserializer
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         # Types with special serialization handlers
 *         self.type_to_type_id = dict()
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.SerializationContext.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":68
 *         self.pickle_deserializer = pickle.loads
 * 
 *     def set_pickle(self, serializer, deserializer):             # <<<<<<<<<<<<<<
 *         """
 *         Set the serializer and deserializer to use for objects that are to be
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_3set_pickle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20SerializationContext_2set_pickle[] = "SerializationContext.set_pickle(self, serializer, deserializer)\n\n        Set the serializer and deserializer to use for objects that are to be\n        pickled.\n\n        Parameters\n        ----------\n        serializer : callable\n            The serializer to use (e.g., pickle.dumps or cloudpickle.dumps).\n        deserializer : callable\n            The deserializer to use (e.g., pickle.dumps or cloudpickle.dumps).\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_3set_pickle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_serializer = 0;
  PyObject *__pyx_v_deserializer = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_pickle (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_serializer,&__pyx_n_s_deserializer,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_serializer)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_deserializer)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_pickle", 1, 2, 2, 1); __PYX_ERR(16, 68, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_pickle") < 0)) __PYX_ERR(16, 68, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_serializer = values[0];
    __pyx_v_deserializer = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_pickle", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(16, 68, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.SerializationContext.set_pickle", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_20SerializationContext_2set_pickle(((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)__pyx_v_self), __pyx_v_serializer, __pyx_v_deserializer);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_2set_pickle(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self, PyObject *__pyx_v_serializer, PyObject *__pyx_v_deserializer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_pickle", 0);

  /* "pyarrow/serialization.pxi":80
 *             The deserializer to use (e.g., pickle.dumps or cloudpickle.dumps).
 *         """
 *         self.pickle_serializer = serializer             # <<<<<<<<<<<<<<
 *         self.pickle_deserializer = deserializer
 * 
 */
  __Pyx_INCREF(__pyx_v_serializer);
  __Pyx_GIVEREF(__pyx_v_serializer);
  __Pyx_GOTREF(__pyx_v_self->pickle_serializer);
  __Pyx_DECREF(__pyx_v_self->pickle_serializer);
  __pyx_v_self->pickle_serializer = __pyx_v_serializer;

  /* "pyarrow/serialization.pxi":81
 *         """
 *         self.pickle_serializer = serializer
 *         self.pickle_deserializer = deserializer             # <<<<<<<<<<<<<<
 * 
 *     def clone(self):
 */
  __Pyx_INCREF(__pyx_v_deserializer);
  __Pyx_GIVEREF(__pyx_v_deserializer);
  __Pyx_GOTREF(__pyx_v_self->pickle_deserializer);
  __Pyx_DECREF(__pyx_v_self->pickle_deserializer);
  __pyx_v_self->pickle_deserializer = __pyx_v_deserializer;

  /* "pyarrow/serialization.pxi":68
 *         self.pickle_deserializer = pickle.loads
 * 
 *     def set_pickle(self, serializer, deserializer):             # <<<<<<<<<<<<<<
 *         """
 *         Set the serializer and deserializer to use for objects that are to be
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":83
 *         self.pickle_deserializer = deserializer
 * 
 *     def clone(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return copy of this SerializationContext
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_5clone(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20SerializationContext_4clone[] = "SerializationContext.clone(self)\n\n        Return copy of this SerializationContext\n\n        Returns\n        -------\n        clone : SerializationContext\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_5clone(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clone (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_20SerializationContext_4clone(((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_4clone(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("clone", 0);

  /* "pyarrow/serialization.pxi":91
 *         clone : SerializationContext
 *         """
 *         result = SerializationContext()             # <<<<<<<<<<<<<<
 *         result.type_to_type_id = self.type_to_type_id.copy()
 *         result.whitelisted_types = self.whitelisted_types.copy()
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_SerializationContext)); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":92
 *         """
 *         result = SerializationContext()
 *         result.type_to_type_id = self.type_to_type_id.copy()             # <<<<<<<<<<<<<<
 *         result.whitelisted_types = self.whitelisted_types.copy()
 *         result.types_to_pickle = self.types_to_pickle.copy()
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->type_to_type_id, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_result->type_to_type_id);
  __Pyx_DECREF(__pyx_v_result->type_to_type_id);
  __pyx_v_result->type_to_type_id = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":93
 *         result = SerializationContext()
 *         result.type_to_type_id = self.type_to_type_id.copy()
 *         result.whitelisted_types = self.whitelisted_types.copy()             # <<<<<<<<<<<<<<
 *         result.types_to_pickle = self.types_to_pickle.copy()
 *         result.custom_serializers = self.custom_serializers.copy()
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->whitelisted_types, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_result->whitelisted_types);
  __Pyx_DECREF(__pyx_v_result->whitelisted_types);
  __pyx_v_result->whitelisted_types = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":94
 *         result.type_to_type_id = self.type_to_type_id.copy()
 *         result.whitelisted_types = self.whitelisted_types.copy()
 *         result.types_to_pickle = self.types_to_pickle.copy()             # <<<<<<<<<<<<<<
 *         result.custom_serializers = self.custom_serializers.copy()
 *         result.custom_deserializers = self.custom_deserializers.copy()
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->types_to_pickle, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_result->types_to_pickle);
  __Pyx_DECREF(__pyx_v_result->types_to_pickle);
  __pyx_v_result->types_to_pickle = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":95
 *         result.whitelisted_types = self.whitelisted_types.copy()
 *         result.types_to_pickle = self.types_to_pickle.copy()
 *         result.custom_serializers = self.custom_serializers.copy()             # <<<<<<<<<<<<<<
 *         result.custom_deserializers = self.custom_deserializers.copy()
 *         result.pickle_serializer = self.pickle_serializer
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->custom_serializers, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_result->custom_serializers);
  __Pyx_DECREF(__pyx_v_result->custom_serializers);
  __pyx_v_result->custom_serializers = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":96
 *         result.types_to_pickle = self.types_to_pickle.copy()
 *         result.custom_serializers = self.custom_serializers.copy()
 *         result.custom_deserializers = self.custom_deserializers.copy()             # <<<<<<<<<<<<<<
 *         result.pickle_serializer = self.pickle_serializer
 *         result.pickle_deserializer = self.pickle_deserializer
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->custom_deserializers, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_result->custom_deserializers);
  __Pyx_DECREF(__pyx_v_result->custom_deserializers);
  __pyx_v_result->custom_deserializers = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":97
 *         result.custom_serializers = self.custom_serializers.copy()
 *         result.custom_deserializers = self.custom_deserializers.copy()
 *         result.pickle_serializer = self.pickle_serializer             # <<<<<<<<<<<<<<
 *         result.pickle_deserializer = self.pickle_deserializer
 * 
 */
  __pyx_t_1 = __pyx_v_self->pickle_serializer;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_result->pickle_serializer);
  __Pyx_DECREF(__pyx_v_result->pickle_serializer);
  __pyx_v_result->pickle_serializer = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":98
 *         result.custom_deserializers = self.custom_deserializers.copy()
 *         result.pickle_serializer = self.pickle_serializer
 *         result.pickle_deserializer = self.pickle_deserializer             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  __pyx_t_1 = __pyx_v_self->pickle_deserializer;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_result->pickle_deserializer);
  __Pyx_DECREF(__pyx_v_result->pickle_deserializer);
  __pyx_v_result->pickle_deserializer = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":100
 *         result.pickle_deserializer = self.pickle_deserializer
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def register_type(self, type_, type_id, pickle=False,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":83
 *         self.pickle_deserializer = deserializer
 * 
 *     def clone(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return copy of this SerializationContext
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.SerializationContext.clone", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":102
 *         return result
 * 
 *     def register_type(self, type_, type_id, pickle=False,             # <<<<<<<<<<<<<<
 *                       custom_serializer=None, custom_deserializer=None):
 *         r"""EXPERIMENTAL: Add type to the list of types we can serialize.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_7register_type(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20SerializationContext_6register_type[] = "SerializationContext.register_type(self, type_, type_id, pickle=False, custom_serializer=None, custom_deserializer=None)\nEXPERIMENTAL: Add type to the list of types we can serialize.\n\n        Parameters\n        ----------\n        type\\_ : type\n            The type that we can serialize.\n        type_id : string\n            A string used to identify the type.\n        pickle : bool\n            True if the serialization should be done with pickle.\n            False if it should be done efficiently with Arrow.\n        custom_serializer : callable\n            This argument is optional, but can be provided to\n            serialize objects of the class in a particular way.\n        custom_deserializer : callable\n            This argument is optional, but can be provided to\n            deserialize objects of the class in a particular way.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_7register_type(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_type_ = 0;
  PyObject *__pyx_v_type_id = 0;
  PyObject *__pyx_v_pickle = 0;
  PyObject *__pyx_v_custom_serializer = 0;
  PyObject *__pyx_v_custom_deserializer = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("register_type (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_type_3,&__pyx_n_s_type_id,&__pyx_n_s_pickle,&__pyx_n_s_custom_serializer,&__pyx_n_s_custom_deserializer,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[2] = ((PyObject *)Py_False);

    /* "pyarrow/serialization.pxi":103
 * 
 *     def register_type(self, type_, type_id, pickle=False,
 *                       custom_serializer=None, custom_deserializer=None):             # <<<<<<<<<<<<<<
 *         r"""EXPERIMENTAL: Add type to the list of types we can serialize.
 * 
 */
    values[3] = ((PyObject *)Py_None);
    values[4] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type_3)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type_id)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("register_type", 0, 2, 5, 1); __PYX_ERR(16, 102, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pickle);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_custom_serializer);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_custom_deserializer);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "register_type") < 0)) __PYX_ERR(16, 102, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_type_ = values[0];
    __pyx_v_type_id = values[1];
    __pyx_v_pickle = values[2];
    __pyx_v_custom_serializer = values[3];
    __pyx_v_custom_deserializer = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("register_type", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(16, 102, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.SerializationContext.register_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_20SerializationContext_6register_type(((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)__pyx_v_self), __pyx_v_type_, __pyx_v_type_id, __pyx_v_pickle, __pyx_v_custom_serializer, __pyx_v_custom_deserializer);

  /* "pyarrow/serialization.pxi":102
 *         return result
 * 
 *     def register_type(self, type_, type_id, pickle=False,             # <<<<<<<<<<<<<<
 *                       custom_serializer=None, custom_deserializer=None):
 *         r"""EXPERIMENTAL: Add type to the list of types we can serialize.
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_6register_type(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self, PyObject *__pyx_v_type_, PyObject *__pyx_v_type_id, PyObject *__pyx_v_pickle, PyObject *__pyx_v_custom_serializer, PyObject *__pyx_v_custom_deserializer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("register_type", 0);

  /* "pyarrow/serialization.pxi":122
 *             deserialize objects of the class in a particular way.
 *         """
 *         if not isinstance(type_id, six.string_types):             # <<<<<<<<<<<<<<
 *             raise TypeError("The type_id argument must be a string. The value "
 *                             "passed in has type {}.".format(type(type_id)))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_six); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_string_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_type_id, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(16, 122, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = ((!(__pyx_t_3 != 0)) != 0);
  if (unlikely(__pyx_t_4)) {

    /* "pyarrow/serialization.pxi":124
 *         if not isinstance(type_id, six.string_types):
 *             raise TypeError("The type_id argument must be a string. The value "
 *                             "passed in has type {}.".format(type(type_id)))             # <<<<<<<<<<<<<<
 * 
 *         self.type_to_type_id[type_] = type_id
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_The_type_id_argument_must_be_a_s, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 124, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, ((PyObject *)Py_TYPE(__pyx_v_type_id))) : __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)Py_TYPE(__pyx_v_type_id)));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 124, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/serialization.pxi":123
 *         """
 *         if not isinstance(type_id, six.string_types):
 *             raise TypeError("The type_id argument must be a string. The value "             # <<<<<<<<<<<<<<
 *                             "passed in has type {}.".format(type(type_id)))
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 123, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(16, 123, __pyx_L1_error)

    /* "pyarrow/serialization.pxi":122
 *             deserialize objects of the class in a particular way.
 *         """
 *         if not isinstance(type_id, six.string_types):             # <<<<<<<<<<<<<<
 *             raise TypeError("The type_id argument must be a string. The value "
 *                             "passed in has type {}.".format(type(type_id)))
 */
  }

  /* "pyarrow/serialization.pxi":126
 *                             "passed in has type {}.".format(type(type_id)))
 * 
 *         self.type_to_type_id[type_] = type_id             # <<<<<<<<<<<<<<
 *         self.whitelisted_types[type_id] = type_
 *         if pickle:
 */
  if (unlikely(PyObject_SetItem(__pyx_v_self->type_to_type_id, __pyx_v_type_, __pyx_v_type_id) < 0)) __PYX_ERR(16, 126, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":127
 * 
 *         self.type_to_type_id[type_] = type_id
 *         self.whitelisted_types[type_id] = type_             # <<<<<<<<<<<<<<
 *         if pickle:
 *             self.types_to_pickle.add(type_id)
 */
  if (unlikely(PyObject_SetItem(__pyx_v_self->whitelisted_types, __pyx_v_type_id, __pyx_v_type_) < 0)) __PYX_ERR(16, 127, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":128
 *         self.type_to_type_id[type_] = type_id
 *         self.whitelisted_types[type_id] = type_
 *         if pickle:             # <<<<<<<<<<<<<<
 *             self.types_to_pickle.add(type_id)
 *         if custom_serializer is not None:
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_pickle); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(16, 128, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "pyarrow/serialization.pxi":129
 *         self.whitelisted_types[type_id] = type_
 *         if pickle:
 *             self.types_to_pickle.add(type_id)             # <<<<<<<<<<<<<<
 *         if custom_serializer is not None:
 *             self.custom_serializers[type_id] = custom_serializer
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->types_to_pickle, __pyx_n_s_add); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 129, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_v_type_id) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_type_id);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 129, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/serialization.pxi":128
 *         self.type_to_type_id[type_] = type_id
 *         self.whitelisted_types[type_id] = type_
 *         if pickle:             # <<<<<<<<<<<<<<
 *             self.types_to_pickle.add(type_id)
 *         if custom_serializer is not None:
 */
  }

  /* "pyarrow/serialization.pxi":130
 *         if pickle:
 *             self.types_to_pickle.add(type_id)
 *         if custom_serializer is not None:             # <<<<<<<<<<<<<<
 *             self.custom_serializers[type_id] = custom_serializer
 *             self.custom_deserializers[type_id] = custom_deserializer
 */
  __pyx_t_4 = (__pyx_v_custom_serializer != Py_None);
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/serialization.pxi":131
 *             self.types_to_pickle.add(type_id)
 *         if custom_serializer is not None:
 *             self.custom_serializers[type_id] = custom_serializer             # <<<<<<<<<<<<<<
 *             self.custom_deserializers[type_id] = custom_deserializer
 * 
 */
    if (unlikely(PyObject_SetItem(__pyx_v_self->custom_serializers, __pyx_v_type_id, __pyx_v_custom_serializer) < 0)) __PYX_ERR(16, 131, __pyx_L1_error)

    /* "pyarrow/serialization.pxi":132
 *         if custom_serializer is not None:
 *             self.custom_serializers[type_id] = custom_serializer
 *             self.custom_deserializers[type_id] = custom_deserializer             # <<<<<<<<<<<<<<
 * 
 *     def _serialize_callback(self, obj):
 */
    if (unlikely(PyObject_SetItem(__pyx_v_self->custom_deserializers, __pyx_v_type_id, __pyx_v_custom_deserializer) < 0)) __PYX_ERR(16, 132, __pyx_L1_error)

    /* "pyarrow/serialization.pxi":130
 *         if pickle:
 *             self.types_to_pickle.add(type_id)
 *         if custom_serializer is not None:             # <<<<<<<<<<<<<<
 *             self.custom_serializers[type_id] = custom_serializer
 *             self.custom_deserializers[type_id] = custom_deserializer
 */
  }

  /* "pyarrow/serialization.pxi":102
 *         return result
 * 
 *     def register_type(self, type_, type_id, pickle=False,             # <<<<<<<<<<<<<<
 *                       custom_serializer=None, custom_deserializer=None):
 *         r"""EXPERIMENTAL: Add type to the list of types we can serialize.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.SerializationContext.register_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":134
 *             self.custom_deserializers[type_id] = custom_deserializer
 * 
 *     def _serialize_callback(self, obj):             # <<<<<<<<<<<<<<
 *         found = False
 *         for type_ in type(obj).__mro__:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_9_serialize_callback(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20SerializationContext_8_serialize_callback[] = "SerializationContext._serialize_callback(self, obj)";
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_9_serialize_callback(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_serialize_callback (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_20SerializationContext_8_serialize_callback(((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_8_serialize_callback(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self, PyObject *__pyx_v_obj) {
  int __pyx_v_found;
  PyObject *__pyx_v_type_ = NULL;
  PyObject *__pyx_v_type_id = NULL;
  PyObject *__pyx_v_serialized_obj = NULL;
  PyObject *__pyx_v_msg = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("_serialize_callback", 0);

  /* "pyarrow/serialization.pxi":135
 * 
 *     def _serialize_callback(self, obj):
 *         found = False             # <<<<<<<<<<<<<<
 *         for type_ in type(obj).__mro__:
 *             if type_ in self.type_to_type_id:
 */
  __pyx_v_found = 0;

  /* "pyarrow/serialization.pxi":136
 *     def _serialize_callback(self, obj):
 *         found = False
 *         for type_ in type(obj).__mro__:             # <<<<<<<<<<<<<<
 *             if type_ in self.type_to_type_id:
 *                 found = True
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_obj)), __pyx_n_s_mro); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 136, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(16, 136, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(16, 136, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 136, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(16, 136, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 136, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(16, 136, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_type_, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/serialization.pxi":137
 *         found = False
 *         for type_ in type(obj).__mro__:
 *             if type_ in self.type_to_type_id:             # <<<<<<<<<<<<<<
 *                 found = True
 *                 break
 */
    __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_type_, __pyx_v_self->type_to_type_id, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(16, 137, __pyx_L1_error)
    __pyx_t_6 = (__pyx_t_5 != 0);
    if (__pyx_t_6) {

      /* "pyarrow/serialization.pxi":138
 *         for type_ in type(obj).__mro__:
 *             if type_ in self.type_to_type_id:
 *                 found = True             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
      __pyx_v_found = 1;

      /* "pyarrow/serialization.pxi":139
 *             if type_ in self.type_to_type_id:
 *                 found = True
 *                 break             # <<<<<<<<<<<<<<
 * 
 *         if not found:
 */
      goto __pyx_L4_break;

      /* "pyarrow/serialization.pxi":137
 *         found = False
 *         for type_ in type(obj).__mro__:
 *             if type_ in self.type_to_type_id:             # <<<<<<<<<<<<<<
 *                 found = True
 *                 break
 */
    }

    /* "pyarrow/serialization.pxi":136
 *     def _serialize_callback(self, obj):
 *         found = False
 *         for type_ in type(obj).__mro__:             # <<<<<<<<<<<<<<
 *             if type_ in self.type_to_type_id:
 *                 found = True
 */
  }
  __pyx_L4_break:;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/serialization.pxi":141
 *                 break
 * 
 *         if not found:             # <<<<<<<<<<<<<<
 *             raise SerializationCallbackError(
 *                 "pyarrow does not know how to "
 */
  __pyx_t_6 = ((!(__pyx_v_found != 0)) != 0);
  if (unlikely(__pyx_t_6)) {

    /* "pyarrow/serialization.pxi":142
 * 
 *         if not found:
 *             raise SerializationCallbackError(             # <<<<<<<<<<<<<<
 *                 "pyarrow does not know how to "
 *                 "serialize objects of type {}.".format(type(obj)), obj
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SerializationCallbackError); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 142, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "pyarrow/serialization.pxi":144
 *             raise SerializationCallbackError(
 *                 "pyarrow does not know how to "
 *                 "serialize objects of type {}.".format(type(obj)), obj             # <<<<<<<<<<<<<<
 *             )
 * 
 */
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_pyarrow_does_not_know_how_to_ser, __pyx_n_s_format); if (unlikely(!__pyx_t_8)) __PYX_ERR(16, 144, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    __pyx_t_7 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, ((PyObject *)Py_TYPE(__pyx_v_obj))) : __Pyx_PyObject_CallOneArg(__pyx_t_8, ((PyObject *)Py_TYPE(__pyx_v_obj)));
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(16, 144, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = NULL;
    __pyx_t_10 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_10 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_7, __pyx_v_obj};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 142, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_7, __pyx_v_obj};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 142, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    {
      __pyx_t_9 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(16, 142, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_8) {
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_10, __pyx_t_7);
      __Pyx_INCREF(__pyx_v_obj);
      __Pyx_GIVEREF(__pyx_v_obj);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_10, __pyx_v_obj);
      __pyx_t_7 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 142, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(16, 142, __pyx_L1_error)

    /* "pyarrow/serialization.pxi":141
 *                 break
 * 
 *         if not found:             # <<<<<<<<<<<<<<
 *             raise SerializationCallbackError(
 *                 "pyarrow does not know how to "
 */
  }

  /* "pyarrow/serialization.pxi":148
 * 
 *         # use the closest match to type(obj)
 *         type_id = self.type_to_type_id[type_]             # <<<<<<<<<<<<<<
 *         if type_id in self.types_to_pickle:
 *             serialized_obj = {"data": self.pickle_serializer(obj),
 */
  if (unlikely(!__pyx_v_type_)) { __Pyx_RaiseUnboundLocalError("type_"); __PYX_ERR(16, 148, __pyx_L1_error) }
  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_self->type_to_type_id, __pyx_v_type_); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_type_id = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/serialization.pxi":149
 *         # use the closest match to type(obj)
 *         type_id = self.type_to_type_id[type_]
 *         if type_id in self.types_to_pickle:             # <<<<<<<<<<<<<<
 *             serialized_obj = {"data": self.pickle_serializer(obj),
 *                               "pickle": True}
 */
  __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_v_type_id, __pyx_v_self->types_to_pickle, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(16, 149, __pyx_L1_error)
  __pyx_t_5 = (__pyx_t_6 != 0);
  if (__pyx_t_5) {

    /* "pyarrow/serialization.pxi":150
 *         type_id = self.type_to_type_id[type_]
 *         if type_id in self.types_to_pickle:
 *             serialized_obj = {"data": self.pickle_serializer(obj),             # <<<<<<<<<<<<<<
 *                               "pickle": True}
 *         elif type_id in self.custom_serializers:
 */
    __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_self->pickle_serializer);
    __pyx_t_9 = __pyx_v_self->pickle_serializer; __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_9, function);
      }
    }
    __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_7, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_data, __pyx_t_1) < 0) __PYX_ERR(16, 150, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/serialization.pxi":151
 *         if type_id in self.types_to_pickle:
 *             serialized_obj = {"data": self.pickle_serializer(obj),
 *                               "pickle": True}             # <<<<<<<<<<<<<<
 *         elif type_id in self.custom_serializers:
 *             serialized_obj = {"data": self.custom_serializers[type_id](obj)}
 */
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_pickle, Py_True) < 0) __PYX_ERR(16, 150, __pyx_L1_error)
    __pyx_v_serialized_obj = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pyarrow/serialization.pxi":149
 *         # use the closest match to type(obj)
 *         type_id = self.type_to_type_id[type_]
 *         if type_id in self.types_to_pickle:             # <<<<<<<<<<<<<<
 *             serialized_obj = {"data": self.pickle_serializer(obj),
 *                               "pickle": True}
 */
    goto __pyx_L7;
  }

  /* "pyarrow/serialization.pxi":152
 *             serialized_obj = {"data": self.pickle_serializer(obj),
 *                               "pickle": True}
 *         elif type_id in self.custom_serializers:             # <<<<<<<<<<<<<<
 *             serialized_obj = {"data": self.custom_serializers[type_id](obj)}
 *         else:
 */
  __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_type_id, __pyx_v_self->custom_serializers, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(16, 152, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {

    /* "pyarrow/serialization.pxi":153
 *                               "pickle": True}
 *         elif type_id in self.custom_serializers:
 *             serialized_obj = {"data": self.custom_serializers[type_id](obj)}             # <<<<<<<<<<<<<<
 *         else:
 *             if is_named_tuple(type_):
 */
    __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 153, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_self->custom_serializers, __pyx_v_type_id); if (unlikely(!__pyx_t_9)) __PYX_ERR(16, 153, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_9, function);
      }
    }
    __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_7, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_obj);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 153, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_data, __pyx_t_1) < 0) __PYX_ERR(16, 153, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_serialized_obj = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pyarrow/serialization.pxi":152
 *             serialized_obj = {"data": self.pickle_serializer(obj),
 *                               "pickle": True}
 *         elif type_id in self.custom_serializers:             # <<<<<<<<<<<<<<
 *             serialized_obj = {"data": self.custom_serializers[type_id](obj)}
 *         else:
 */
    goto __pyx_L7;
  }

  /* "pyarrow/serialization.pxi":155
 *             serialized_obj = {"data": self.custom_serializers[type_id](obj)}
 *         else:
 *             if is_named_tuple(type_):             # <<<<<<<<<<<<<<
 *                 serialized_obj = {}
 *                 serialized_obj["_pa_getnewargs_"] = obj.__getnewargs__()
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_is_named_tuple); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 155, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(!__pyx_v_type_)) { __Pyx_RaiseUnboundLocalError("type_"); __PYX_ERR(16, 155, __pyx_L1_error) }
    __pyx_t_9 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_9, __pyx_v_type_) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_type_);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 155, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(16, 155, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_6) {

      /* "pyarrow/serialization.pxi":156
 *         else:
 *             if is_named_tuple(type_):
 *                 serialized_obj = {}             # <<<<<<<<<<<<<<
 *                 serialized_obj["_pa_getnewargs_"] = obj.__getnewargs__()
 *             elif hasattr(obj, "__dict__"):
 */
      __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 156, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_v_serialized_obj = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "pyarrow/serialization.pxi":157
 *             if is_named_tuple(type_):
 *                 serialized_obj = {}
 *                 serialized_obj["_pa_getnewargs_"] = obj.__getnewargs__()             # <<<<<<<<<<<<<<
 *             elif hasattr(obj, "__dict__"):
 *                 serialized_obj = obj.__dict__
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_getnewargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 157, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_9 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 157, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(PyObject_SetItem(__pyx_v_serialized_obj, __pyx_n_u_pa_getnewargs, __pyx_t_2) < 0)) __PYX_ERR(16, 157, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "pyarrow/serialization.pxi":155
 *             serialized_obj = {"data": self.custom_serializers[type_id](obj)}
 *         else:
 *             if is_named_tuple(type_):             # <<<<<<<<<<<<<<
 *                 serialized_obj = {}
 *                 serialized_obj["_pa_getnewargs_"] = obj.__getnewargs__()
 */
      goto __pyx_L8;
    }

    /* "pyarrow/serialization.pxi":158
 *                 serialized_obj = {}
 *                 serialized_obj["_pa_getnewargs_"] = obj.__getnewargs__()
 *             elif hasattr(obj, "__dict__"):             # <<<<<<<<<<<<<<
 *                 serialized_obj = obj.__dict__
 *             else:
 */
    __pyx_t_6 = __Pyx_HasAttr(__pyx_v_obj, __pyx_n_u_dict); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(16, 158, __pyx_L1_error)
    __pyx_t_5 = (__pyx_t_6 != 0);
    if (likely(__pyx_t_5)) {

      /* "pyarrow/serialization.pxi":159
 *                 serialized_obj["_pa_getnewargs_"] = obj.__getnewargs__()
 *             elif hasattr(obj, "__dict__"):
 *                 serialized_obj = obj.__dict__             # <<<<<<<<<<<<<<
 *             else:
 *                 msg = "We do not know how to serialize " \
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 159, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_v_serialized_obj = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "pyarrow/serialization.pxi":158
 *                 serialized_obj = {}
 *                 serialized_obj["_pa_getnewargs_"] = obj.__getnewargs__()
 *             elif hasattr(obj, "__dict__"):             # <<<<<<<<<<<<<<
 *                 serialized_obj = obj.__dict__
 *             else:
 */
      goto __pyx_L8;
    }

    /* "pyarrow/serialization.pxi":161
 *                 serialized_obj = obj.__dict__
 *             else:
 *                 msg = "We do not know how to serialize " \             # <<<<<<<<<<<<<<
 *                       "the object '{}'".format(obj)
 *                 raise SerializationCallbackError(msg, obj)
 */
    /*else*/ {

      /* "pyarrow/serialization.pxi":162
 *             else:
 *                 msg = "We do not know how to serialize " \
 *                       "the object '{}'".format(obj)             # <<<<<<<<<<<<<<
 *                 raise SerializationCallbackError(msg, obj)
 *         return dict(serialized_obj, **{"_pytype_": type_id})
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_We_do_not_know_how_to_serialize, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 162, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_9 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_9, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_obj);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 162, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_msg = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "pyarrow/serialization.pxi":163
 *                 msg = "We do not know how to serialize " \
 *                       "the object '{}'".format(obj)
 *                 raise SerializationCallbackError(msg, obj)             # <<<<<<<<<<<<<<
 *         return dict(serialized_obj, **{"_pytype_": type_id})
 * 
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SerializationCallbackError); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 163, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_9 = NULL;
      __pyx_t_10 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
          __pyx_t_10 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_msg, __pyx_v_obj};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 163, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_msg, __pyx_v_obj};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 163, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(16, 163, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_9) {
          __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); __pyx_t_9 = NULL;
        }
        __Pyx_INCREF(__pyx_v_msg);
        __Pyx_GIVEREF(__pyx_v_msg);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_10, __pyx_v_msg);
        __Pyx_INCREF(__pyx_v_obj);
        __Pyx_GIVEREF(__pyx_v_obj);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_10, __pyx_v_obj);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 163, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(16, 163, __pyx_L1_error)
    }
    __pyx_L8:;
  }
  __pyx_L7:;

  /* "pyarrow/serialization.pxi":164
 *                       "the object '{}'".format(obj)
 *                 raise SerializationCallbackError(msg, obj)
 *         return dict(serialized_obj, **{"_pytype_": type_id})             # <<<<<<<<<<<<<<
 * 
 *     def _deserialize_callback(self, serialized_obj):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_serialized_obj);
  __Pyx_GIVEREF(__pyx_v_serialized_obj);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_serialized_obj);
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_pytype, __pyx_v_type_id) < 0) __PYX_ERR(16, 164, __pyx_L1_error)
  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)(&PyDict_Type)), __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(16, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":134
 *             self.custom_deserializers[type_id] = custom_deserializer
 * 
 *     def _serialize_callback(self, obj):             # <<<<<<<<<<<<<<
 *         found = False
 *         for type_ in type(obj).__mro__:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pyarrow.lib.SerializationContext._serialize_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_type_);
  __Pyx_XDECREF(__pyx_v_type_id);
  __Pyx_XDECREF(__pyx_v_serialized_obj);
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":166
 *         return dict(serialized_obj, **{"_pytype_": type_id})
 * 
 *     def _deserialize_callback(self, serialized_obj):             # <<<<<<<<<<<<<<
 *         type_id = serialized_obj["_pytype_"]
 *         if isinstance(type_id, bytes):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_11_deserialize_callback(PyObject *__pyx_v_self, PyObject *__pyx_v_serialized_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20SerializationContext_10_deserialize_callback[] = "SerializationContext._deserialize_callback(self, serialized_obj)";
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_11_deserialize_callback(PyObject *__pyx_v_self, PyObject *__pyx_v_serialized_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_deserialize_callback (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_20SerializationContext_10_deserialize_callback(((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)__pyx_v_self), ((PyObject *)__pyx_v_serialized_obj));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_10_deserialize_callback(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self, PyObject *__pyx_v_serialized_obj) {
  PyObject *__pyx_v_type_id = NULL;
  PyObject *__pyx_v_obj = NULL;
  PyObject *__pyx_v_msg = NULL;
  PyObject *__pyx_v_type_ = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("_deserialize_callback", 0);

  /* "pyarrow/serialization.pxi":167
 * 
 *     def _deserialize_callback(self, serialized_obj):
 *         type_id = serialized_obj["_pytype_"]             # <<<<<<<<<<<<<<
 *         if isinstance(type_id, bytes):
 *             # ARROW-4675: Python 2 serialized, read in Python 3
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_serialized_obj, __pyx_n_u_pytype); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_type_id = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":168
 *     def _deserialize_callback(self, serialized_obj):
 *         type_id = serialized_obj["_pytype_"]
 *         if isinstance(type_id, bytes):             # <<<<<<<<<<<<<<
 *             # ARROW-4675: Python 2 serialized, read in Python 3
 *             type_id = frombytes(type_id)
 */
  __pyx_t_2 = PyBytes_Check(__pyx_v_type_id); 
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/serialization.pxi":170
 *         if isinstance(type_id, bytes):
 *             # ARROW-4675: Python 2 serialized, read in Python 3
 *             type_id = frombytes(type_id)             # <<<<<<<<<<<<<<
 * 
 *         if "pickle" in serialized_obj:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(16, 170, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_type_id) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_type_id);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 170, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_type_id, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/serialization.pxi":168
 *     def _deserialize_callback(self, serialized_obj):
 *         type_id = serialized_obj["_pytype_"]
 *         if isinstance(type_id, bytes):             # <<<<<<<<<<<<<<
 *             # ARROW-4675: Python 2 serialized, read in Python 3
 *             type_id = frombytes(type_id)
 */
  }

  /* "pyarrow/serialization.pxi":172
 *             type_id = frombytes(type_id)
 * 
 *         if "pickle" in serialized_obj:             # <<<<<<<<<<<<<<
 *             # The object was pickled, so unpickle it.
 *             obj = self.pickle_deserializer(serialized_obj["data"])
 */
  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_n_u_pickle, __pyx_v_serialized_obj, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(16, 172, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/serialization.pxi":174
 *         if "pickle" in serialized_obj:
 *             # The object was pickled, so unpickle it.
 *             obj = self.pickle_deserializer(serialized_obj["data"])             # <<<<<<<<<<<<<<
 *         else:
 *             assert type_id not in self.types_to_pickle
 */
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_serialized_obj, __pyx_n_u_data); if (unlikely(!__pyx_t_4)) __PYX_ERR(16, 174, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_self->pickle_deserializer);
    __pyx_t_5 = __pyx_v_self->pickle_deserializer; __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 174, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_obj = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "pyarrow/serialization.pxi":172
 *             type_id = frombytes(type_id)
 * 
 *         if "pickle" in serialized_obj:             # <<<<<<<<<<<<<<
 *             # The object was pickled, so unpickle it.
 *             obj = self.pickle_deserializer(serialized_obj["data"])
 */
    goto __pyx_L4;
  }

  /* "pyarrow/serialization.pxi":176
 *             obj = self.pickle_deserializer(serialized_obj["data"])
 *         else:
 *             assert type_id not in self.types_to_pickle             # <<<<<<<<<<<<<<
 *             if type_id not in self.whitelisted_types:
 *                 msg = "Type ID " + type_id + " not registered in " \
 */
  /*else*/ {
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(!Py_OptimizeFlag)) {
      __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_type_id, __pyx_v_self->types_to_pickle, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(16, 176, __pyx_L1_error)
      if (unlikely(!(__pyx_t_2 != 0))) {
        PyErr_SetNone(PyExc_AssertionError);
        __PYX_ERR(16, 176, __pyx_L1_error)
      }
    }
    #endif

    /* "pyarrow/serialization.pxi":177
 *         else:
 *             assert type_id not in self.types_to_pickle
 *             if type_id not in self.whitelisted_types:             # <<<<<<<<<<<<<<
 *                 msg = "Type ID " + type_id + " not registered in " \
 *                       "deserialization callback"
 */
    __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_type_id, __pyx_v_self->whitelisted_types, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(16, 177, __pyx_L1_error)
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (unlikely(__pyx_t_3)) {

      /* "pyarrow/serialization.pxi":178
 *             assert type_id not in self.types_to_pickle
 *             if type_id not in self.whitelisted_types:
 *                 msg = "Type ID " + type_id + " not registered in " \             # <<<<<<<<<<<<<<
 *                       "deserialization callback"
 *                 raise DeserializationCallbackError(msg, type_id)
 */
      __pyx_t_1 = PyNumber_Add(__pyx_kp_u_Type_ID, __pyx_v_type_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 178, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_kp_u_not_registered_in_deserializati); if (unlikely(!__pyx_t_5)) __PYX_ERR(16, 178, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_msg = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "pyarrow/serialization.pxi":180
 *                 msg = "Type ID " + type_id + " not registered in " \
 *                       "deserialization callback"
 *                 raise DeserializationCallbackError(msg, type_id)             # <<<<<<<<<<<<<<
 *             type_ = self.whitelisted_types[type_id]
 *             if type_id in self.custom_deserializers:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_DeserializationCallbackError); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
          __pyx_t_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_msg, __pyx_v_type_id};
        __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(16, 180, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_msg, __pyx_v_type_id};
        __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(16, 180, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(16, 180, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_msg);
        __Pyx_GIVEREF(__pyx_v_msg);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_v_msg);
        __Pyx_INCREF(__pyx_v_type_id);
        __Pyx_GIVEREF(__pyx_v_type_id);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_v_type_id);
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(16, 180, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __PYX_ERR(16, 180, __pyx_L1_error)

      /* "pyarrow/serialization.pxi":177
 *         else:
 *             assert type_id not in self.types_to_pickle
 *             if type_id not in self.whitelisted_types:             # <<<<<<<<<<<<<<
 *                 msg = "Type ID " + type_id + " not registered in " \
 *                       "deserialization callback"
 */
    }

    /* "pyarrow/serialization.pxi":181
 *                       "deserialization callback"
 *                 raise DeserializationCallbackError(msg, type_id)
 *             type_ = self.whitelisted_types[type_id]             # <<<<<<<<<<<<<<
 *             if type_id in self.custom_deserializers:
 *                 obj = self.custom_deserializers[type_id](
 */
    __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_self->whitelisted_types, __pyx_v_type_id); if (unlikely(!__pyx_t_5)) __PYX_ERR(16, 181, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_v_type_ = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "pyarrow/serialization.pxi":182
 *                 raise DeserializationCallbackError(msg, type_id)
 *             type_ = self.whitelisted_types[type_id]
 *             if type_id in self.custom_deserializers:             # <<<<<<<<<<<<<<
 *                 obj = self.custom_deserializers[type_id](
 *                     serialized_obj["data"])
 */
    __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_type_id, __pyx_v_self->custom_deserializers, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(16, 182, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_3 != 0);
    if (__pyx_t_2) {

      /* "pyarrow/serialization.pxi":183
 *             type_ = self.whitelisted_types[type_id]
 *             if type_id in self.custom_deserializers:
 *                 obj = self.custom_deserializers[type_id](             # <<<<<<<<<<<<<<
 *                     serialized_obj["data"])
 *             else:
 */
      __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_self->custom_deserializers, __pyx_v_type_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 183, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);

      /* "pyarrow/serialization.pxi":184
 *             if type_id in self.custom_deserializers:
 *                 obj = self.custom_deserializers[type_id](
 *                     serialized_obj["data"])             # <<<<<<<<<<<<<<
 *             else:
 *                 # In this case, serialized_obj should just be
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_serialized_obj, __pyx_n_u_data); if (unlikely(!__pyx_t_6)) __PYX_ERR(16, 184, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(16, 183, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_obj = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "pyarrow/serialization.pxi":182
 *                 raise DeserializationCallbackError(msg, type_id)
 *             type_ = self.whitelisted_types[type_id]
 *             if type_id in self.custom_deserializers:             # <<<<<<<<<<<<<<
 *                 obj = self.custom_deserializers[type_id](
 *                     serialized_obj["data"])
 */
      goto __pyx_L6;
    }

    /* "pyarrow/serialization.pxi":188
 *                 # In this case, serialized_obj should just be
 *                 # the __dict__ field.
 *                 if "_pa_getnewargs_" in serialized_obj:             # <<<<<<<<<<<<<<
 *                     obj = type_.__new__(
 *                         type_, *serialized_obj["_pa_getnewargs_"])
 */
    /*else*/ {
      __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_n_u_pa_getnewargs, __pyx_v_serialized_obj, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(16, 188, __pyx_L1_error)
      __pyx_t_3 = (__pyx_t_2 != 0);
      if (__pyx_t_3) {

        /* "pyarrow/serialization.pxi":189
 *                 # the __dict__ field.
 *                 if "_pa_getnewargs_" in serialized_obj:
 *                     obj = type_.__new__(             # <<<<<<<<<<<<<<
 *                         type_, *serialized_obj["_pa_getnewargs_"])
 *                 else:
 */
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_type_, __pyx_n_s_new); if (unlikely(!__pyx_t_5)) __PYX_ERR(16, 189, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);

        /* "pyarrow/serialization.pxi":190
 *                 if "_pa_getnewargs_" in serialized_obj:
 *                     obj = type_.__new__(
 *                         type_, *serialized_obj["_pa_getnewargs_"])             # <<<<<<<<<<<<<<
 *                 else:
 *                     obj = type_.__new__(type_)
 */
        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 189, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_v_type_);
        __Pyx_GIVEREF(__pyx_v_type_);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_type_);
        __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_serialized_obj, __pyx_n_u_pa_getnewargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(16, 190, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);

        /* "pyarrow/serialization.pxi":189
 *                 # the __dict__ field.
 *                 if "_pa_getnewargs_" in serialized_obj:
 *                     obj = type_.__new__(             # <<<<<<<<<<<<<<
 *                         type_, *serialized_obj["_pa_getnewargs_"])
 *                 else:
 */
        __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(16, 189, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(16, 189, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(16, 189, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_v_obj = __pyx_t_4;
        __pyx_t_4 = 0;

        /* "pyarrow/serialization.pxi":188
 *                 # In this case, serialized_obj should just be
 *                 # the __dict__ field.
 *                 if "_pa_getnewargs_" in serialized_obj:             # <<<<<<<<<<<<<<
 *                     obj = type_.__new__(
 *                         type_, *serialized_obj["_pa_getnewargs_"])
 */
        goto __pyx_L7;
      }

      /* "pyarrow/serialization.pxi":192
 *                         type_, *serialized_obj["_pa_getnewargs_"])
 *                 else:
 *                     obj = type_.__new__(type_)             # <<<<<<<<<<<<<<
 *                     serialized_obj.pop("_pytype_")
 *                     obj.__dict__.update(serialized_obj)
 */
      /*else*/ {
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_type_, __pyx_n_s_new); if (unlikely(!__pyx_t_6)) __PYX_ERR(16, 192, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_5 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_type_) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_type_);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(16, 192, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_v_obj = __pyx_t_4;
        __pyx_t_4 = 0;

        /* "pyarrow/serialization.pxi":193
 *                 else:
 *                     obj = type_.__new__(type_)
 *                     serialized_obj.pop("_pytype_")             # <<<<<<<<<<<<<<
 *                     obj.__dict__.update(serialized_obj)
 *         return obj
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_serialized_obj, __pyx_n_s_pop); if (unlikely(!__pyx_t_6)) __PYX_ERR(16, 193, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_5 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_n_u_pytype) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_n_u_pytype);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(16, 193, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "pyarrow/serialization.pxi":194
 *                     obj = type_.__new__(type_)
 *                     serialized_obj.pop("_pytype_")
 *                     obj.__dict__.update(serialized_obj)             # <<<<<<<<<<<<<<
 *         return obj
 * 
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(16, 194, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_5)) __PYX_ERR(16, 194, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
          }
        }
        __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_serialized_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_serialized_obj);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(16, 194, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __pyx_L7:;
    }
    __pyx_L6:;
  }
  __pyx_L4:;

  /* "pyarrow/serialization.pxi":195
 *                     serialized_obj.pop("_pytype_")
 *                     obj.__dict__.update(serialized_obj)
 *         return obj             # <<<<<<<<<<<<<<
 * 
 *     def serialize(self, obj):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_obj);
  __pyx_r = __pyx_v_obj;
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":166
 *         return dict(serialized_obj, **{"_pytype_": type_id})
 * 
 *     def _deserialize_callback(self, serialized_obj):             # <<<<<<<<<<<<<<
 *         type_id = serialized_obj["_pytype_"]
 *         if isinstance(type_id, bytes):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.SerializationContext._deserialize_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_type_id);
  __Pyx_XDECREF(__pyx_v_obj);
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_XDECREF(__pyx_v_type_);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":197
 *         return obj
 * 
 *     def serialize(self, obj):             # <<<<<<<<<<<<<<
 *         """
 *         Call pyarrow.serialize and pass this SerializationContext
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_13serialize(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20SerializationContext_12serialize[] = "SerializationContext.serialize(self, obj)\n\n        Call pyarrow.serialize and pass this SerializationContext\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_13serialize(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("serialize (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_20SerializationContext_12serialize(((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_12serialize(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("serialize", 0);

  /* "pyarrow/serialization.pxi":201
 *         Call pyarrow.serialize and pass this SerializationContext
 *         """
 *         return serialize(obj, context=self)             # <<<<<<<<<<<<<<
 * 
 *     def serialize_to(self, object value, sink):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_serialize); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_obj);
  __Pyx_GIVEREF(__pyx_v_obj);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(16, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_context, ((PyObject *)__pyx_v_self)) < 0) __PYX_ERR(16, 201, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(16, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":197
 *         return obj
 * 
 *     def serialize(self, obj):             # <<<<<<<<<<<<<<
 *         """
 *         Call pyarrow.serialize and pass this SerializationContext
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.SerializationContext.serialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":203
 *         return serialize(obj, context=self)
 * 
 *     def serialize_to(self, object value, sink):             # <<<<<<<<<<<<<<
 *         """
 *         Call pyarrow.serialize_to and pass this SerializationContext
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_15serialize_to(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20SerializationContext_14serialize_to[] = "SerializationContext.serialize_to(self, value, sink)\n\n        Call pyarrow.serialize_to and pass this SerializationContext\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_15serialize_to(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_sink = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("serialize_to (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,&__pyx_n_s_sink,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sink)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("serialize_to", 1, 2, 2, 1); __PYX_ERR(16, 203, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "serialize_to") < 0)) __PYX_ERR(16, 203, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_value = values[0];
    __pyx_v_sink = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("serialize_to", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(16, 203, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.SerializationContext.serialize_to", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_20SerializationContext_14serialize_to(((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)__pyx_v_self), __pyx_v_value, __pyx_v_sink);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_14serialize_to(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self, PyObject *__pyx_v_value, PyObject *__pyx_v_sink) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("serialize_to", 0);

  /* "pyarrow/serialization.pxi":207
 *         Call pyarrow.serialize_to and pass this SerializationContext
 *         """
 *         return serialize_to(value, sink, context=self)             # <<<<<<<<<<<<<<
 * 
 *     def deserialize(self, what):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_serialize_to); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_value);
  __Pyx_INCREF(__pyx_v_sink);
  __Pyx_GIVEREF(__pyx_v_sink);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_sink);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(16, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_context, ((PyObject *)__pyx_v_self)) < 0) __PYX_ERR(16, 207, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(16, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":203
 *         return serialize(obj, context=self)
 * 
 *     def serialize_to(self, object value, sink):             # <<<<<<<<<<<<<<
 *         """
 *         Call pyarrow.serialize_to and pass this SerializationContext
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.SerializationContext.serialize_to", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":209
 *         return serialize_to(value, sink, context=self)
 * 
 *     def deserialize(self, what):             # <<<<<<<<<<<<<<
 *         """
 *         Call pyarrow.deserialize and pass this SerializationContext
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_17deserialize(PyObject *__pyx_v_self, PyObject *__pyx_v_what); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20SerializationContext_16deserialize[] = "SerializationContext.deserialize(self, what)\n\n        Call pyarrow.deserialize and pass this SerializationContext\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_17deserialize(PyObject *__pyx_v_self, PyObject *__pyx_v_what) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("deserialize (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_20SerializationContext_16deserialize(((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)__pyx_v_self), ((PyObject *)__pyx_v_what));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_16deserialize(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self, PyObject *__pyx_v_what) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("deserialize", 0);

  /* "pyarrow/serialization.pxi":213
 *         Call pyarrow.deserialize and pass this SerializationContext
 *         """
 *         return deserialize(what, context=self)             # <<<<<<<<<<<<<<
 * 
 *     def deserialize_components(self, what):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_deserialize); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_what);
  __Pyx_GIVEREF(__pyx_v_what);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_what);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(16, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_context, ((PyObject *)__pyx_v_self)) < 0) __PYX_ERR(16, 213, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(16, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":209
 *         return serialize_to(value, sink, context=self)
 * 
 *     def deserialize(self, what):             # <<<<<<<<<<<<<<
 *         """
 *         Call pyarrow.deserialize and pass this SerializationContext
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.SerializationContext.deserialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":215
 *         return deserialize(what, context=self)
 * 
 *     def deserialize_components(self, what):             # <<<<<<<<<<<<<<
 *         """
 *         Call pyarrow.deserialize_components and pass this SerializationContext
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_19deserialize_components(PyObject *__pyx_v_self, PyObject *__pyx_v_what); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20SerializationContext_18deserialize_components[] = "SerializationContext.deserialize_components(self, what)\n\n        Call pyarrow.deserialize_components and pass this SerializationContext\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_19deserialize_components(PyObject *__pyx_v_self, PyObject *__pyx_v_what) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("deserialize_components (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_20SerializationContext_18deserialize_components(((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)__pyx_v_self), ((PyObject *)__pyx_v_what));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_18deserialize_components(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self, PyObject *__pyx_v_what) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("deserialize_components", 0);

  /* "pyarrow/serialization.pxi":219
 *         Call pyarrow.deserialize_components and pass this SerializationContext
 *         """
 *         return deserialize_components(what, context=self)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_deserialize_components); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_what);
  __Pyx_GIVEREF(__pyx_v_what);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_what);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(16, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_context, ((PyObject *)__pyx_v_self)) < 0) __PYX_ERR(16, 219, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(16, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":215
 *         return deserialize(what, context=self)
 * 
 *     def deserialize_components(self, what):             # <<<<<<<<<<<<<<
 *         """
 *         Call pyarrow.deserialize_components and pass this SerializationContext
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.SerializationContext.deserialize_components", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_21__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20SerializationContext_20__reduce_cython__[] = "SerializationContext.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_21__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_20SerializationContext_20__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_20__reduce_cython__(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self.custom_deserializers, self.custom_serializers, self.pickle_deserializer, self.pickle_serializer, self.type_to_type_id, self.types_to_pickle, self.whitelisted_types)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->custom_deserializers);
  __Pyx_GIVEREF(__pyx_v_self->custom_deserializers);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->custom_deserializers);
  __Pyx_INCREF(__pyx_v_self->custom_serializers);
  __Pyx_GIVEREF(__pyx_v_self->custom_serializers);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->custom_serializers);
  __Pyx_INCREF(__pyx_v_self->pickle_deserializer);
  __Pyx_GIVEREF(__pyx_v_self->pickle_deserializer);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_self->pickle_deserializer);
  __Pyx_INCREF(__pyx_v_self->pickle_serializer);
  __Pyx_GIVEREF(__pyx_v_self->pickle_serializer);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_self->pickle_serializer);
  __Pyx_INCREF(__pyx_v_self->type_to_type_id);
  __Pyx_GIVEREF(__pyx_v_self->type_to_type_id);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_self->type_to_type_id);
  __Pyx_INCREF(__pyx_v_self->types_to_pickle);
  __Pyx_GIVEREF(__pyx_v_self->types_to_pickle);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_v_self->types_to_pickle);
  __Pyx_INCREF(__pyx_v_self->whitelisted_types);
  __Pyx_GIVEREF(__pyx_v_self->whitelisted_types);
  PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_v_self->whitelisted_types);
  __pyx_v_state = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self.custom_deserializers, self.custom_serializers, self.pickle_deserializer, self.pickle_serializer, self.type_to_type_id, self.types_to_pickle, self.whitelisted_types)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":7
 *     state = (self.custom_deserializers, self.custom_serializers, self.pickle_deserializer, self.pickle_serializer, self.type_to_type_id, self.types_to_pickle, self.whitelisted_types)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_2 = (__pyx_v__dict != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self.custom_deserializers is not None or self.custom_serializers is not None or self.pickle_deserializer is not None or self.pickle_serializer is not None or self.type_to_type_id is not None or self.types_to_pickle is not None or self.whitelisted_types is not None
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self.custom_deserializers, self.custom_serializers, self.pickle_deserializer, self.pickle_serializer, self.type_to_type_id, self.types_to_pickle, self.whitelisted_types)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self.custom_deserializers is not None or self.custom_serializers is not None or self.pickle_deserializer is not None or self.pickle_serializer is not None or self.type_to_type_id is not None or self.types_to_pickle is not None or self.whitelisted_types is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_SerializationContext, (type(self), 0x9aeed6f, None), state
 */
  /*else*/ {
    __pyx_t_2 = (__pyx_v_self->custom_deserializers != Py_None);
    __pyx_t_5 = (__pyx_t_2 != 0);
    if (!__pyx_t_5) {
    } else {
      __pyx_t_3 = __pyx_t_5;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_5 = (__pyx_v_self->custom_serializers != Py_None);
    __pyx_t_2 = (__pyx_t_5 != 0);
    if (!__pyx_t_2) {
    } else {
      __pyx_t_3 = __pyx_t_2;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_2 = (__pyx_v_self->pickle_deserializer != Py_None);
    __pyx_t_5 = (__pyx_t_2 != 0);
    if (!__pyx_t_5) {
    } else {
      __pyx_t_3 = __pyx_t_5;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_5 = (__pyx_v_self->pickle_serializer != Py_None);
    __pyx_t_2 = (__pyx_t_5 != 0);
    if (!__pyx_t_2) {
    } else {
      __pyx_t_3 = __pyx_t_2;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_2 = (__pyx_v_self->type_to_type_id != Py_None);
    __pyx_t_5 = (__pyx_t_2 != 0);
    if (!__pyx_t_5) {
    } else {
      __pyx_t_3 = __pyx_t_5;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_5 = (__pyx_v_self->types_to_pickle != Py_None);
    __pyx_t_2 = (__pyx_t_5 != 0);
    if (!__pyx_t_2) {
    } else {
      __pyx_t_3 = __pyx_t_2;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_2 = (__pyx_v_self->whitelisted_types != Py_None);
    __pyx_t_5 = (__pyx_t_2 != 0);
    __pyx_t_3 = __pyx_t_5;
    __pyx_L4_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_3;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.custom_deserializers is not None or self.custom_serializers is not None or self.pickle_deserializer is not None or self.pickle_serializer is not None or self.type_to_type_id is not None or self.types_to_pickle is not None or self.whitelisted_types is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_SerializationContext, (type(self), 0x9aeed6f, None), state
 *     else:
 */
  __pyx_t_3 = (__pyx_v_use_setstate != 0);
  if (__pyx_t_3) {

    /* "(tree fragment)":13
 *         use_setstate = self.custom_deserializers is not None or self.custom_serializers is not None or self.pickle_deserializer is not None or self.pickle_serializer is not None or self.type_to_type_id is not None or self.types_to_pickle is not None or self.whitelisted_types is not None
 *     if use_setstate:
 *         return __pyx_unpickle_SerializationContext, (type(self), 0x9aeed6f, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_SerializationContext, (type(self), 0x9aeed6f, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_SerializationCont); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_162458991);
    __Pyx_GIVEREF(__pyx_int_162458991);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_162458991);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
    __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_state);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.custom_deserializers is not None or self.custom_serializers is not None or self.pickle_deserializer is not None or self.pickle_serializer is not None or self.type_to_type_id is not None or self.types_to_pickle is not None or self.whitelisted_types is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_SerializationContext, (type(self), 0x9aeed6f, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_SerializationContext, (type(self), 0x9aeed6f, None), state
 *     else:
 *         return __pyx_unpickle_SerializationContext, (type(self), 0x9aeed6f, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_SerializationContext__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pyx_unpickle_SerializationCont); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_162458991);
    __Pyx_GIVEREF(__pyx_int_162458991);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_162458991);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
    __pyx_t_6 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib.SerializationContext.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_SerializationContext, (type(self), 0x9aeed6f, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_SerializationContext__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_23__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20SerializationContext_22__setstate_cython__[] = "SerializationContext.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_20SerializationContext_23__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_20SerializationContext_22__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_20SerializationContext_22__setstate_cython__(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_SerializationContext, (type(self), 0x9aeed6f, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_SerializationContext__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(10, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_7pyarrow_3lib___pyx_unpickle_SerializationContext__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_SerializationContext, (type(self), 0x9aeed6f, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_SerializationContext__set_state(self, __pyx_state)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.SerializationContext.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":226
 * 
 * 
 * def _get_default_context():             # <<<<<<<<<<<<<<
 *     global _default_context_initialized
 *     from pyarrow.serialization import register_default_serialization_handlers
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_203_get_default_context(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_202_get_default_context[] = "_get_default_context()";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_203_get_default_context = {"_get_default_context", (PyCFunction)__pyx_pw_7pyarrow_3lib_203_get_default_context, METH_NOARGS, __pyx_doc_7pyarrow_3lib_202_get_default_context};
static PyObject *__pyx_pw_7pyarrow_3lib_203_get_default_context(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_default_context (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_202_get_default_context(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_202_get_default_context(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_register_default_serialization_handlers = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("_get_default_context", 0);

  /* "pyarrow/serialization.pxi":228
 * def _get_default_context():
 *     global _default_context_initialized
 *     from pyarrow.serialization import register_default_serialization_handlers             # <<<<<<<<<<<<<<
 *     if not _default_context_initialized:
 *         register_default_serialization_handlers(_default_serialization_context)
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_register_default_serialization_h);
  __Pyx_GIVEREF(__pyx_n_s_register_default_serialization_h);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_register_default_serialization_h);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_pyarrow_serialization, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_register_default_serialization_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_register_default_serialization_handlers = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/serialization.pxi":229
 *     global _default_context_initialized
 *     from pyarrow.serialization import register_default_serialization_handlers
 *     if not _default_context_initialized:             # <<<<<<<<<<<<<<
 *         register_default_serialization_handlers(_default_serialization_context)
 *         _default_context_initialized = True
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_default_context_initialized); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(16, 229, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = ((!__pyx_t_3) != 0);
  if (__pyx_t_4) {

    /* "pyarrow/serialization.pxi":230
 *     from pyarrow.serialization import register_default_serialization_handlers
 *     if not _default_context_initialized:
 *         register_default_serialization_handlers(_default_serialization_context)             # <<<<<<<<<<<<<<
 *         _default_context_initialized = True
 *     return _default_serialization_context
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_default_serialization_context); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 230, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_register_default_serialization_handlers);
    __pyx_t_5 = __pyx_v_register_default_serialization_handlers; __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 230, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pyarrow/serialization.pxi":231
 *     if not _default_context_initialized:
 *         register_default_serialization_handlers(_default_serialization_context)
 *         _default_context_initialized = True             # <<<<<<<<<<<<<<
 *     return _default_serialization_context
 * 
 */
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_context_initialized, Py_True) < 0) __PYX_ERR(16, 231, __pyx_L1_error)

    /* "pyarrow/serialization.pxi":229
 *     global _default_context_initialized
 *     from pyarrow.serialization import register_default_serialization_handlers
 *     if not _default_context_initialized:             # <<<<<<<<<<<<<<
 *         register_default_serialization_handlers(_default_serialization_context)
 *         _default_context_initialized = True
 */
  }

  /* "pyarrow/serialization.pxi":232
 *         register_default_serialization_handlers(_default_serialization_context)
 *         _default_context_initialized = True
 *     return _default_serialization_context             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_default_serialization_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":226
 * 
 * 
 * def _get_default_context():             # <<<<<<<<<<<<<<
 *     global _default_context_initialized
 *     from pyarrow.serialization import register_default_serialization_handlers
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow.lib._get_default_context", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_register_default_serialization_handlers);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":246
 * 
 *     @property
 *     def total_bytes(self):             # <<<<<<<<<<<<<<
 *         cdef CMockOutputStream mock_stream
 *         with nogil:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18SerializedPyObject_11total_bytes_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_18SerializedPyObject_11total_bytes_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_18SerializedPyObject_11total_bytes___get__(((struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_11total_bytes___get__(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self) {
   arrow::io::MockOutputStream __pyx_v_mock_stream;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/serialization.pxi":248
 *     def total_bytes(self):
 *         cdef CMockOutputStream mock_stream
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.data.WriteTo(&mock_stream))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/serialization.pxi":249
 *         cdef CMockOutputStream mock_stream
 *         with nogil:
 *             check_status(self.data.WriteTo(&mock_stream))             # <<<<<<<<<<<<<<
 * 
 *         return mock_stream.GetExtentBytesWritten()
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->data.WriteTo((&__pyx_v_mock_stream))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(16, 249, __pyx_L4_error)
      }

      /* "pyarrow/serialization.pxi":248
 *     def total_bytes(self):
 *         cdef CMockOutputStream mock_stream
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.data.WriteTo(&mock_stream))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/serialization.pxi":251
 *             check_status(self.data.WriteTo(&mock_stream))
 * 
 *         return mock_stream.GetExtentBytesWritten()             # <<<<<<<<<<<<<<
 * 
 *     def write_to(self, sink):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_mock_stream.GetExtentBytesWritten()); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":246
 * 
 *     @property
 *     def total_bytes(self):             # <<<<<<<<<<<<<<
 *         cdef CMockOutputStream mock_stream
 *         with nogil:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.SerializedPyObject.total_bytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":253
 *         return mock_stream.GetExtentBytesWritten()
 * 
 *     def write_to(self, sink):             # <<<<<<<<<<<<<<
 *         """
 *         Write serialized object to a sink
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18SerializedPyObject_1write_to(PyObject *__pyx_v_self, PyObject *__pyx_v_sink); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18SerializedPyObject_write_to[] = "SerializedPyObject.write_to(self, sink)\n\n        Write serialized object to a sink\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_18SerializedPyObject_1write_to(PyObject *__pyx_v_self, PyObject *__pyx_v_sink) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write_to (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_18SerializedPyObject_write_to(((struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *)__pyx_v_self), ((PyObject *)__pyx_v_sink));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_write_to(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self, PyObject *__pyx_v_sink) {
  std::shared_ptr< arrow::io::OutputStream>  __pyx_v_stream;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("write_to", 0);

  /* "pyarrow/serialization.pxi":258
 *         """
 *         cdef shared_ptr[COutputStream] stream
 *         get_writer(sink, &stream)             # <<<<<<<<<<<<<<
 *         self._write_to(stream.get())
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_get_writer(__pyx_v_sink, (&__pyx_v_stream)); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":259
 *         cdef shared_ptr[COutputStream] stream
 *         get_writer(sink, &stream)
 *         self._write_to(stream.get())             # <<<<<<<<<<<<<<
 * 
 *     cdef _write_to(self, COutputStream* stream):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_SerializedPyObject *)__pyx_v_self->__pyx_vtab)->_write_to(__pyx_v_self, __pyx_v_stream.get()); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":253
 *         return mock_stream.GetExtentBytesWritten()
 * 
 *     def write_to(self, sink):             # <<<<<<<<<<<<<<
 *         """
 *         Write serialized object to a sink
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.SerializedPyObject.write_to", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":261
 *         self._write_to(stream.get())
 * 
 *     cdef _write_to(self, COutputStream* stream):             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(self.data.WriteTo(stream))
 */

static PyObject *__pyx_f_7pyarrow_3lib_18SerializedPyObject__write_to(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self,  arrow::io::OutputStream *__pyx_v_stream) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("_write_to", 0);

  /* "pyarrow/serialization.pxi":262
 * 
 *     cdef _write_to(self, COutputStream* stream):
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.data.WriteTo(stream))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/serialization.pxi":263
 *     cdef _write_to(self, COutputStream* stream):
 *         with nogil:
 *             check_status(self.data.WriteTo(stream))             # <<<<<<<<<<<<<<
 * 
 *     def deserialize(self, SerializationContext context=None):
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->data.WriteTo(__pyx_v_stream)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(16, 263, __pyx_L4_error)
      }

      /* "pyarrow/serialization.pxi":262
 * 
 *     cdef _write_to(self, COutputStream* stream):
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.data.WriteTo(stream))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/serialization.pxi":261
 *         self._write_to(stream.get())
 * 
 *     cdef _write_to(self, COutputStream* stream):             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(self.data.WriteTo(stream))
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.SerializedPyObject._write_to", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":265
 *             check_status(self.data.WriteTo(stream))
 * 
 *     def deserialize(self, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *         """
 *         Convert back to Python object
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18SerializedPyObject_3deserialize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18SerializedPyObject_2deserialize[] = "SerializedPyObject.deserialize(self, SerializationContext context=None)\n\n        Convert back to Python object\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_18SerializedPyObject_3deserialize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_context = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("deserialize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,0};
    PyObject* values[1] = {0};
    values[0] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "deserialize") < 0)) __PYX_ERR(16, 265, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_context = ((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("deserialize", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(16, 265, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.SerializedPyObject.deserialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_context), __pyx_ptype_7pyarrow_3lib_SerializationContext, 1, "context", 0))) __PYX_ERR(16, 265, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_18SerializedPyObject_2deserialize(((struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *)__pyx_v_self), __pyx_v_context);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_2deserialize(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_context) {
  PyObject *__pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("deserialize", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_context);

  /* "pyarrow/serialization.pxi":271
 *         cdef PyObject* result
 * 
 *         if context is None:             # <<<<<<<<<<<<<<
 *             context = _get_default_context()
 * 
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_context) == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/serialization.pxi":272
 * 
 *         if context is None:
 *             context = _get_default_context()             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_get_default_context); if (unlikely(!__pyx_t_4)) __PYX_ERR(16, 272, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(16, 272, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_SerializationContext))))) __PYX_ERR(16, 272, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_context, ((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "pyarrow/serialization.pxi":271
 *         cdef PyObject* result
 * 
 *         if context is None:             # <<<<<<<<<<<<<<
 *             context = _get_default_context()
 * 
 */
  }

  /* "pyarrow/serialization.pxi":274
 *             context = _get_default_context()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(DeserializeObject(context, self.data,
 *                                            <PyObject*> self.base, &result))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/serialization.pxi":275
 * 
 *         with nogil:
 *             check_status(DeserializeObject(context, self.data,             # <<<<<<<<<<<<<<
 *                                            <PyObject*> self.base, &result))
 * 
 */
        __pyx_t_6 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::DeserializeObject(((PyObject *)__pyx_v_context), __pyx_v_self->data, ((PyObject *)__pyx_v_self->base), (&__pyx_v_result))); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(16, 275, __pyx_L5_error)
      }

      /* "pyarrow/serialization.pxi":274
 *             context = _get_default_context()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(DeserializeObject(context, self.data,
 *                                            <PyObject*> self.base, &result))
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L6;
        }
        __pyx_L5_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L6:;
      }
  }

  /* "pyarrow/serialization.pxi":280
 *         # PyObject_to_object is necessary to avoid a memory leak;
 *         # also unpack the list the object was wrapped in in serialize
 *         return PyObject_to_object(result)[0]             # <<<<<<<<<<<<<<
 * 
 *     def to_buffer(self, nthreads=1):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_8includes_6common_PyObject_to_object(__pyx_v_result); if (unlikely(!__pyx_t_3)) __PYX_ERR(16, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(16, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":265
 *             check_status(self.data.WriteTo(stream))
 * 
 *     def deserialize(self, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *         """
 *         Convert back to Python object
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.SerializedPyObject.deserialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_context);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":282
 *         return PyObject_to_object(result)[0]
 * 
 *     def to_buffer(self, nthreads=1):             # <<<<<<<<<<<<<<
 *         """
 *         Write serialized data as Buffer
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18SerializedPyObject_5to_buffer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18SerializedPyObject_4to_buffer[] = "SerializedPyObject.to_buffer(self, nthreads=1)\n\n        Write serialized data as Buffer\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_18SerializedPyObject_5to_buffer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_nthreads = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_buffer (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nthreads,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_int_1);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nthreads);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "to_buffer") < 0)) __PYX_ERR(16, 282, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_nthreads = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_buffer", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(16, 282, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.SerializedPyObject.to_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_18SerializedPyObject_4to_buffer(((struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *)__pyx_v_self), __pyx_v_nthreads);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_4to_buffer(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self, PyObject *__pyx_v_nthreads) {
  struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_output = 0;
  struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *__pyx_v_sink = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("to_buffer", 0);

  /* "pyarrow/serialization.pxi":286
 *         Write serialized data as Buffer
 *         """
 *         cdef Buffer output = allocate_buffer(self.total_bytes)             # <<<<<<<<<<<<<<
 *         sink = FixedSizeBufferWriter(output)
 *         if nthreads > 1:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_allocate_buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_total_bytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(16, 286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_Buffer))))) __PYX_ERR(16, 286, __pyx_L1_error)
  __pyx_v_output = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":287
 *         """
 *         cdef Buffer output = allocate_buffer(self.total_bytes)
 *         sink = FixedSizeBufferWriter(output)             # <<<<<<<<<<<<<<
 *         if nthreads > 1:
 *             sink.set_memcopy_threads(nthreads)
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_FixedSizeBufferWriter), ((PyObject *)__pyx_v_output)); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_sink = ((struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":288
 *         cdef Buffer output = allocate_buffer(self.total_bytes)
 *         sink = FixedSizeBufferWriter(output)
 *         if nthreads > 1:             # <<<<<<<<<<<<<<
 *             sink.set_memcopy_threads(nthreads)
 *         self.write_to(sink)
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_nthreads, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 288, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(16, 288, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_5) {

    /* "pyarrow/serialization.pxi":289
 *         sink = FixedSizeBufferWriter(output)
 *         if nthreads > 1:
 *             sink.set_memcopy_threads(nthreads)             # <<<<<<<<<<<<<<
 *         self.write_to(sink)
 *         return output
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sink), __pyx_n_s_set_memcopy_threads); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 289, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_nthreads) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_nthreads);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 289, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/serialization.pxi":288
 *         cdef Buffer output = allocate_buffer(self.total_bytes)
 *         sink = FixedSizeBufferWriter(output)
 *         if nthreads > 1:             # <<<<<<<<<<<<<<
 *             sink.set_memcopy_threads(nthreads)
 *         self.write_to(sink)
 */
  }

  /* "pyarrow/serialization.pxi":290
 *         if nthreads > 1:
 *             sink.set_memcopy_threads(nthreads)
 *         self.write_to(sink)             # <<<<<<<<<<<<<<
 *         return output
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write_to); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_sink)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_sink));
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":291
 *             sink.set_memcopy_threads(nthreads)
 *         self.write_to(sink)
 *         return output             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_output));
  __pyx_r = ((PyObject *)__pyx_v_output);
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":282
 *         return PyObject_to_object(result)[0]
 * 
 *     def to_buffer(self, nthreads=1):             # <<<<<<<<<<<<<<
 *         """
 *         Write serialized data as Buffer
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.SerializedPyObject.to_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_output);
  __Pyx_XDECREF((PyObject *)__pyx_v_sink);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":294
 * 
 *     @staticmethod
 *     def from_components(components):             # <<<<<<<<<<<<<<
 *         """
 *         Reconstruct SerializedPyObject from output of
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18SerializedPyObject_7from_components(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18SerializedPyObject_6from_components[] = "SerializedPyObject.from_components(components)\n\n        Reconstruct SerializedPyObject from output of\n        SerializedPyObject.to_components\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_18SerializedPyObject_7from_components = {"from_components", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_18SerializedPyObject_7from_components, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_18SerializedPyObject_6from_components};
static PyObject *__pyx_pw_7pyarrow_3lib_18SerializedPyObject_7from_components(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_components = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_components (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_components,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_components)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_components") < 0)) __PYX_ERR(16, 294, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_components = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_components", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(16, 294, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.SerializedPyObject.from_components", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_18SerializedPyObject_6from_components(__pyx_v_components);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_6from_components(PyObject *__pyx_v_components) {
  int __pyx_v_num_tensors;
  int __pyx_v_num_ndarrays;
  int __pyx_v_num_buffers;
  PyObject *__pyx_v_buffers = 0;
  arrow::py::SparseTensorCounts __pyx_v_num_sparse_tensors;
  struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("from_components", 0);

  /* "pyarrow/serialization.pxi":300
 *         """
 *         cdef:
 *             int num_tensors = components['num_tensors']             # <<<<<<<<<<<<<<
 *             int num_ndarrays = components['num_ndarrays']
 *             int num_buffers = components['num_buffers']
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_components, __pyx_n_u_num_tensors); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(16, 300, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_num_tensors = __pyx_t_2;

  /* "pyarrow/serialization.pxi":301
 *         cdef:
 *             int num_tensors = components['num_tensors']
 *             int num_ndarrays = components['num_ndarrays']             # <<<<<<<<<<<<<<
 *             int num_buffers = components['num_buffers']
 *             list buffers = components['data']
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_components, __pyx_n_u_num_ndarrays); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(16, 301, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_num_ndarrays = __pyx_t_2;

  /* "pyarrow/serialization.pxi":302
 *             int num_tensors = components['num_tensors']
 *             int num_ndarrays = components['num_ndarrays']
 *             int num_buffers = components['num_buffers']             # <<<<<<<<<<<<<<
 *             list buffers = components['data']
 *             SparseTensorCounts num_sparse_tensors = SparseTensorCounts()
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_components, __pyx_n_u_num_buffers); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(16, 302, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_num_buffers = __pyx_t_2;

  /* "pyarrow/serialization.pxi":303
 *             int num_ndarrays = components['num_ndarrays']
 *             int num_buffers = components['num_buffers']
 *             list buffers = components['data']             # <<<<<<<<<<<<<<
 *             SparseTensorCounts num_sparse_tensors = SparseTensorCounts()
 *             SerializedPyObject result = SerializedPyObject()
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_components, __pyx_n_u_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(16, 303, __pyx_L1_error)
  __pyx_v_buffers = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":304
 *             int num_buffers = components['num_buffers']
 *             list buffers = components['data']
 *             SparseTensorCounts num_sparse_tensors = SparseTensorCounts()             # <<<<<<<<<<<<<<
 *             SerializedPyObject result = SerializedPyObject()
 * 
 */
  __pyx_v_num_sparse_tensors = arrow::py::SparseTensorCounts();

  /* "pyarrow/serialization.pxi":305
 *             list buffers = components['data']
 *             SparseTensorCounts num_sparse_tensors = SparseTensorCounts()
 *             SerializedPyObject result = SerializedPyObject()             # <<<<<<<<<<<<<<
 * 
 *         num_sparse_tensors.coo = components['num_sparse_tensors']['coo']
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_SerializedPyObject)); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":307
 *             SerializedPyObject result = SerializedPyObject()
 * 
 *         num_sparse_tensors.coo = components['num_sparse_tensors']['coo']             # <<<<<<<<<<<<<<
 *         num_sparse_tensors.csr = components['num_sparse_tensors']['csr']
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_components, __pyx_n_u_num_sparse_tensors); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_coo); if (unlikely(!__pyx_t_3)) __PYX_ERR(16, 307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(16, 307, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_num_sparse_tensors.coo = __pyx_t_2;

  /* "pyarrow/serialization.pxi":308
 * 
 *         num_sparse_tensors.coo = components['num_sparse_tensors']['coo']
 *         num_sparse_tensors.csr = components['num_sparse_tensors']['csr']             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_components, __pyx_n_u_num_sparse_tensors); if (unlikely(!__pyx_t_3)) __PYX_ERR(16, 308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_n_u_csr); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(16, 308, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_num_sparse_tensors.csr = __pyx_t_2;

  /* "pyarrow/serialization.pxi":310
 *         num_sparse_tensors.csr = components['num_sparse_tensors']['csr']
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(GetSerializedFromComponents(num_tensors,
 *                                                      num_sparse_tensors,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/serialization.pxi":311
 * 
 *         with nogil:
 *             check_status(GetSerializedFromComponents(num_tensors,             # <<<<<<<<<<<<<<
 *                                                      num_sparse_tensors,
 *                                                      num_ndarrays,
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::GetSerializedFromComponents(__pyx_v_num_tensors, __pyx_v_num_sparse_tensors, __pyx_v_num_ndarrays, __pyx_v_num_buffers, __pyx_v_buffers, (&__pyx_v_result->data))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(16, 311, __pyx_L4_error)
      }

      /* "pyarrow/serialization.pxi":310
 *         num_sparse_tensors.csr = components['num_sparse_tensors']['csr']
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(GetSerializedFromComponents(num_tensors,
 *                                                      num_sparse_tensors,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/serialization.pxi":317
 *                                                      buffers, &result.data))
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def to_components(self, memory_pool=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":294
 * 
 *     @staticmethod
 *     def from_components(components):             # <<<<<<<<<<<<<<
 *         """
 *         Reconstruct SerializedPyObject from output of
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.SerializedPyObject.from_components", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_buffers);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":319
 *         return result
 * 
 *     def to_components(self, memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Return the decomposed dict representation of the serialized object
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18SerializedPyObject_9to_components(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18SerializedPyObject_8to_components[] = "SerializedPyObject.to_components(self, memory_pool=None)\n\n        Return the decomposed dict representation of the serialized object\n        containing a collection of Buffer objects which maximize opportunities\n        for zero-copy\n\n        Parameters\n        ----------\n        memory_pool : MemoryPool default None\n            Pool to use for necessary allocations\n\n        Returns\n\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_18SerializedPyObject_9to_components(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_memory_pool = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_components (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_memory_pool,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "to_components") < 0)) __PYX_ERR(16, 319, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_memory_pool = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_components", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(16, 319, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.SerializedPyObject.to_components", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_18SerializedPyObject_8to_components(((struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *)__pyx_v_self), __pyx_v_memory_pool);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_8to_components(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self, PyObject *__pyx_v_memory_pool) {
  PyObject *__pyx_v_result;
   arrow::MemoryPool *__pyx_v_c_pool;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("to_components", 0);

  /* "pyarrow/serialization.pxi":334
 *         """
 *         cdef PyObject* result
 *         cdef CMemoryPool* c_pool = maybe_unbox_memory_pool(memory_pool)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  if (!(likely(((__pyx_v_memory_pool) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_memory_pool, __pyx_ptype_7pyarrow_3lib_MemoryPool))))) __PYX_ERR(16, 334, __pyx_L1_error)
  __pyx_v_c_pool = __pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_v_memory_pool));

  /* "pyarrow/serialization.pxi":336
 *         cdef CMemoryPool* c_pool = maybe_unbox_memory_pool(memory_pool)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.data.GetComponents(c_pool, &result))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/serialization.pxi":337
 * 
 *         with nogil:
 *             check_status(self.data.GetComponents(c_pool, &result))             # <<<<<<<<<<<<<<
 * 
 *         return PyObject_to_object(result)
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->data.GetComponents(__pyx_v_c_pool, (&__pyx_v_result))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(16, 337, __pyx_L4_error)
      }

      /* "pyarrow/serialization.pxi":336
 *         cdef CMemoryPool* c_pool = maybe_unbox_memory_pool(memory_pool)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.data.GetComponents(c_pool, &result))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/serialization.pxi":339
 *             check_status(self.data.GetComponents(c_pool, &result))
 * 
 *         return PyObject_to_object(result)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_8includes_6common_PyObject_to_object(__pyx_v_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":319
 *         return result
 * 
 *     def to_components(self, memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Return the decomposed dict representation of the serialized object
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.SerializedPyObject.to_components", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":243
 * 
 *     cdef readonly:
 *         object base             # <<<<<<<<<<<<<<
 * 
 *     @property
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18SerializedPyObject_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_18SerializedPyObject_4base_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_18SerializedPyObject_4base___get__(((struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_4base___get__(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->base);
  __pyx_r = __pyx_v_self->base;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.data cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18SerializedPyObject_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18SerializedPyObject_10__reduce_cython__[] = "SerializedPyObject.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_18SerializedPyObject_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_18SerializedPyObject_10__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.data cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.data cannot be converted to a Python object for pickling")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__271, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.data cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.SerializedPyObject.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.data cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.data cannot be converted to a Python object for pickling")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18SerializedPyObject_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18SerializedPyObject_12__setstate_cython__[] = "SerializedPyObject.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_18SerializedPyObject_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_18SerializedPyObject_12__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_18SerializedPyObject_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("self.data cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.data cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__272, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(10, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("self.data cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("self.data cannot be converted to a Python object for pickling")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.SerializedPyObject.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":342
 * 
 * 
 * def serialize(object value, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Serialize a general Python sequence for transient storage
 *     and transport. This may have better performance and memory efficiency than
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_205serialize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_204serialize[] = "serialize(value, SerializationContext context=None)\nEXPERIMENTAL: Serialize a general Python sequence for transient storage\n    and transport. This may have better performance and memory efficiency than\n    Python pickle.\n\n    Note: this function produces data that is incompatible with the standard\n    Arrow IPC binary protocol, i.e. it cannot be used with ipc.open_stream or\n    ipc.open_file. You can use deserialize, deserialize_from, or\n    deserialize_components to read it.\n\n    Parameters\n    ----------\n    value: object\n        Python object for the sequence that is to be serialized.\n    context : SerializationContext\n        Custom serialization and deserialization context, uses a default\n        context with some standard type handlers if not specified\n\n    Returns\n    -------\n    serialized : SerializedPyObject\n\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_205serialize = {"serialize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_205serialize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_204serialize};
static PyObject *__pyx_pw_7pyarrow_3lib_205serialize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_value = 0;
  struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_context = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("serialize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,&__pyx_n_s_context,0};
    PyObject* values[2] = {0,0};
    values[1] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "serialize") < 0)) __PYX_ERR(16, 342, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_value = values[0];
    __pyx_v_context = ((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("serialize", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(16, 342, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.serialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_context), __pyx_ptype_7pyarrow_3lib_SerializationContext, 1, "context", 0))) __PYX_ERR(16, 342, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_204serialize(__pyx_self, __pyx_v_value, __pyx_v_context);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_204serialize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value, struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_context) {
  struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_serialized = 0;
  PyObject *__pyx_v_wrapped_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("serialize", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_context);

  /* "pyarrow/serialization.pxi":365
 * 
 *     """
 *     cdef SerializedPyObject serialized = SerializedPyObject()             # <<<<<<<<<<<<<<
 *     wrapped_value = [value]
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_SerializedPyObject)); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_serialized = ((struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":366
 *     """
 *     cdef SerializedPyObject serialized = SerializedPyObject()
 *     wrapped_value = [value]             # <<<<<<<<<<<<<<
 * 
 *     if context is None:
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_value);
  __pyx_v_wrapped_value = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":368
 *     wrapped_value = [value]
 * 
 *     if context is None:             # <<<<<<<<<<<<<<
 *         context = _get_default_context()
 * 
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_context) == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/serialization.pxi":369
 * 
 *     if context is None:
 *         context = _get_default_context()             # <<<<<<<<<<<<<<
 * 
 *     with nogil:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_get_default_context); if (unlikely(!__pyx_t_4)) __PYX_ERR(16, 369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_SerializationContext))))) __PYX_ERR(16, 369, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_context, ((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "pyarrow/serialization.pxi":368
 *     wrapped_value = [value]
 * 
 *     if context is None:             # <<<<<<<<<<<<<<
 *         context = _get_default_context()
 * 
 */
  }

  /* "pyarrow/serialization.pxi":371
 *         context = _get_default_context()
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(SerializeObject(context, wrapped_value, &serialized.data))
 *     return serialized
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/serialization.pxi":372
 * 
 *     with nogil:
 *         check_status(SerializeObject(context, wrapped_value, &serialized.data))             # <<<<<<<<<<<<<<
 *     return serialized
 * 
 */
        __pyx_t_6 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::SerializeObject(((PyObject *)__pyx_v_context), __pyx_v_wrapped_value, (&__pyx_v_serialized->data))); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(16, 372, __pyx_L5_error)
      }

      /* "pyarrow/serialization.pxi":371
 *         context = _get_default_context()
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(SerializeObject(context, wrapped_value, &serialized.data))
 *     return serialized
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L6;
        }
        __pyx_L5_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L6:;
      }
  }

  /* "pyarrow/serialization.pxi":373
 *     with nogil:
 *         check_status(SerializeObject(context, wrapped_value, &serialized.data))
 *     return serialized             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_serialized));
  __pyx_r = ((PyObject *)__pyx_v_serialized);
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":342
 * 
 * 
 * def serialize(object value, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Serialize a general Python sequence for transient storage
 *     and transport. This may have better performance and memory efficiency than
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.serialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_serialized);
  __Pyx_XDECREF(__pyx_v_wrapped_value);
  __Pyx_XDECREF((PyObject *)__pyx_v_context);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":376
 * 
 * 
 * def serialize_to(object value, sink, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Serialize a Python sequence to a file.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_207serialize_to(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_206serialize_to[] = "serialize_to(value, sink, SerializationContext context=None)\nEXPERIMENTAL: Serialize a Python sequence to a file.\n\n    Parameters\n    ----------\n    value: object\n        Python object for the sequence that is to be serialized.\n    sink: NativeFile or file-like\n        File the sequence will be written to.\n    context : SerializationContext\n        Custom serialization and deserialization context, uses a default\n        context with some standard type handlers if not specified\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_207serialize_to = {"serialize_to", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_207serialize_to, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_206serialize_to};
static PyObject *__pyx_pw_7pyarrow_3lib_207serialize_to(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_sink = 0;
  struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_context = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("serialize_to (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,&__pyx_n_s_sink,&__pyx_n_s_context,0};
    PyObject* values[3] = {0,0,0};
    values[2] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sink)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("serialize_to", 0, 2, 3, 1); __PYX_ERR(16, 376, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "serialize_to") < 0)) __PYX_ERR(16, 376, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_value = values[0];
    __pyx_v_sink = values[1];
    __pyx_v_context = ((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("serialize_to", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(16, 376, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.serialize_to", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_context), __pyx_ptype_7pyarrow_3lib_SerializationContext, 1, "context", 0))) __PYX_ERR(16, 376, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_206serialize_to(__pyx_self, __pyx_v_value, __pyx_v_sink, __pyx_v_context);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_206serialize_to(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value, PyObject *__pyx_v_sink, struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_context) {
  PyObject *__pyx_v_serialized = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("serialize_to", 0);

  /* "pyarrow/serialization.pxi":389
 *         context with some standard type handlers if not specified
 *     """
 *     serialized = serialize(value, context)             # <<<<<<<<<<<<<<
 *     serialized.write_to(sink)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_serialize); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_value, ((PyObject *)__pyx_v_context)};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 389, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_value, ((PyObject *)__pyx_v_context)};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 389, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(16, 389, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_value);
    __Pyx_GIVEREF(__pyx_v_value);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_value);
    __Pyx_INCREF(((PyObject *)__pyx_v_context));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_context));
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, ((PyObject *)__pyx_v_context));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 389, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_serialized = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":390
 *     """
 *     serialized = serialize(value, context)
 *     serialized.write_to(sink)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_serialized, __pyx_n_s_write_to); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_v_sink) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_sink);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":376
 * 
 * 
 * def serialize_to(object value, sink, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Serialize a Python sequence to a file.
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.serialize_to", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_serialized);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":393
 * 
 * 
 * def read_serialized(source, base=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Read serialized Python sequence from file-like object
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_209read_serialized(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_208read_serialized[] = "read_serialized(source, base=None)\nEXPERIMENTAL: Read serialized Python sequence from file-like object\n\n    Parameters\n    ----------\n    source: NativeFile\n        File to read the sequence from.\n    base: object\n        This object will be the base object of all the numpy arrays\n        contained in the sequence.\n\n    Returns\n    -------\n    serialized : the serialized data\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_209read_serialized = {"read_serialized", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_209read_serialized, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_208read_serialized};
static PyObject *__pyx_pw_7pyarrow_3lib_209read_serialized(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_source = 0;
  PyObject *__pyx_v_base = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_serialized (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,&__pyx_n_s_base,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_base);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_serialized") < 0)) __PYX_ERR(16, 393, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_source = values[0];
    __pyx_v_base = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("read_serialized", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(16, 393, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.read_serialized", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_208read_serialized(__pyx_self, __pyx_v_source, __pyx_v_base);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_208read_serialized(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source, PyObject *__pyx_v_base) {
  std::shared_ptr< arrow::io::RandomAccessFile>  __pyx_v_stream;
  struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *__pyx_v_serialized = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("read_serialized", 0);

  /* "pyarrow/serialization.pxi":409
 *     """
 *     cdef shared_ptr[CRandomAccessFile] stream
 *     get_reader(source, True, &stream)             # <<<<<<<<<<<<<<
 * 
 *     cdef SerializedPyObject serialized = SerializedPyObject()
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_get_reader(__pyx_v_source, 1, (&__pyx_v_stream)); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":411
 *     get_reader(source, True, &stream)
 * 
 *     cdef SerializedPyObject serialized = SerializedPyObject()             # <<<<<<<<<<<<<<
 *     serialized.base = base
 *     with nogil:
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_SerializedPyObject)); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 411, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_serialized = ((struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":412
 * 
 *     cdef SerializedPyObject serialized = SerializedPyObject()
 *     serialized.base = base             # <<<<<<<<<<<<<<
 *     with nogil:
 *         check_status(ReadSerializedObject(stream.get(), &serialized.data))
 */
  __Pyx_INCREF(__pyx_v_base);
  __Pyx_GIVEREF(__pyx_v_base);
  __Pyx_GOTREF(__pyx_v_serialized->base);
  __Pyx_DECREF(__pyx_v_serialized->base);
  __pyx_v_serialized->base = __pyx_v_base;

  /* "pyarrow/serialization.pxi":413
 *     cdef SerializedPyObject serialized = SerializedPyObject()
 *     serialized.base = base
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(ReadSerializedObject(stream.get(), &serialized.data))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/serialization.pxi":414
 *     serialized.base = base
 *     with nogil:
 *         check_status(ReadSerializedObject(stream.get(), &serialized.data))             # <<<<<<<<<<<<<<
 * 
 *     return serialized
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::ReadSerializedObject(__pyx_v_stream.get(), (&__pyx_v_serialized->data))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(16, 414, __pyx_L4_error)
      }

      /* "pyarrow/serialization.pxi":413
 *     cdef SerializedPyObject serialized = SerializedPyObject()
 *     serialized.base = base
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(ReadSerializedObject(stream.get(), &serialized.data))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/serialization.pxi":416
 *         check_status(ReadSerializedObject(stream.get(), &serialized.data))
 * 
 *     return serialized             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_serialized));
  __pyx_r = ((PyObject *)__pyx_v_serialized);
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":393
 * 
 * 
 * def read_serialized(source, base=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Read serialized Python sequence from file-like object
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.read_serialized", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_serialized);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":419
 * 
 * 
 * def deserialize_from(source, object base, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Deserialize a Python sequence from a file. This only can
 *     interact with data produced by pyarrow.serialize or pyarrow.serialize_to
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_211deserialize_from(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_210deserialize_from[] = "deserialize_from(source, base, SerializationContext context=None)\nEXPERIMENTAL: Deserialize a Python sequence from a file. This only can\n    interact with data produced by pyarrow.serialize or pyarrow.serialize_to\n\n    Parameters\n    ----------\n    source: NativeFile\n        File to read the sequence from.\n    base: object\n        This object will be the base object of all the numpy arrays\n        contained in the sequence.\n    context : SerializationContext\n        Custom serialization and deserialization context\n\n    Returns\n    -------\n    object\n        Python object for the deserialized sequence.\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_211deserialize_from = {"deserialize_from", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_211deserialize_from, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_210deserialize_from};
static PyObject *__pyx_pw_7pyarrow_3lib_211deserialize_from(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_source = 0;
  PyObject *__pyx_v_base = 0;
  struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_context = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("deserialize_from (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,&__pyx_n_s_base,&__pyx_n_s_context,0};
    PyObject* values[3] = {0,0,0};
    values[2] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_base)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("deserialize_from", 0, 2, 3, 1); __PYX_ERR(16, 419, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "deserialize_from") < 0)) __PYX_ERR(16, 419, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_source = values[0];
    __pyx_v_base = values[1];
    __pyx_v_context = ((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("deserialize_from", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(16, 419, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.deserialize_from", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_context), __pyx_ptype_7pyarrow_3lib_SerializationContext, 1, "context", 0))) __PYX_ERR(16, 419, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_210deserialize_from(__pyx_self, __pyx_v_source, __pyx_v_base, __pyx_v_context);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_210deserialize_from(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source, PyObject *__pyx_v_base, struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_context) {
  PyObject *__pyx_v_serialized = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("deserialize_from", 0);

  /* "pyarrow/serialization.pxi":438
 *         Python object for the deserialized sequence.
 *     """
 *     serialized = read_serialized(source, base=base)             # <<<<<<<<<<<<<<
 *     return serialized.deserialize(context)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_read_serialized); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_source);
  __Pyx_GIVEREF(__pyx_v_source);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_source);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(16, 438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_base, __pyx_v_base) < 0) __PYX_ERR(16, 438, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(16, 438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_serialized = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pyarrow/serialization.pxi":439
 *     """
 *     serialized = read_serialized(source, base=base)
 *     return serialized.deserialize(context)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_serialized, __pyx_n_s_deserialize); if (unlikely(!__pyx_t_3)) __PYX_ERR(16, 439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_v_context)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_context));
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(16, 439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":419
 * 
 * 
 * def deserialize_from(source, object base, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Deserialize a Python sequence from a file. This only can
 *     interact with data produced by pyarrow.serialize or pyarrow.serialize_to
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.deserialize_from", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_serialized);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":442
 * 
 * 
 * def deserialize_components(components, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """
 *     Reconstruct Python object from output of SerializedPyObject.to_components
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_213deserialize_components(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_212deserialize_components[] = "deserialize_components(components, SerializationContext context=None)\n\n    Reconstruct Python object from output of SerializedPyObject.to_components\n\n    Parameters\n    ----------\n    components : dict\n        Output of SerializedPyObject.to_components\n    context : SerializationContext, default None\n\n    Returns\n    -------\n    object : the Python object that was originally serialized\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_213deserialize_components = {"deserialize_components", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_213deserialize_components, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_212deserialize_components};
static PyObject *__pyx_pw_7pyarrow_3lib_213deserialize_components(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_components = 0;
  struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_context = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("deserialize_components (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_components,&__pyx_n_s_context,0};
    PyObject* values[2] = {0,0};
    values[1] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_components)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "deserialize_components") < 0)) __PYX_ERR(16, 442, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_components = values[0];
    __pyx_v_context = ((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("deserialize_components", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(16, 442, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.deserialize_components", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_context), __pyx_ptype_7pyarrow_3lib_SerializationContext, 1, "context", 0))) __PYX_ERR(16, 442, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_212deserialize_components(__pyx_self, __pyx_v_components, __pyx_v_context);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_212deserialize_components(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_components, struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_context) {
  PyObject *__pyx_v_serialized = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("deserialize_components", 0);

  /* "pyarrow/serialization.pxi":456
 *     object : the Python object that was originally serialized
 *     """
 *     serialized = SerializedPyObject.from_components(components)             # <<<<<<<<<<<<<<
 *     return serialized.deserialize(context)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_SerializedPyObject), __pyx_n_s_from_components); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_components) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_components);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_serialized = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":457
 *     """
 *     serialized = SerializedPyObject.from_components(components)
 *     return serialized.deserialize(context)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_serialized, __pyx_n_s_deserialize); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_context)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_context));
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":442
 * 
 * 
 * def deserialize_components(components, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """
 *     Reconstruct Python object from output of SerializedPyObject.to_components
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.deserialize_components", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_serialized);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/serialization.pxi":460
 * 
 * 
 * def deserialize(obj, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Deserialize Python object from Buffer or other Python
 *     object supporting the buffer protocol. This only can interact with data
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_215deserialize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_214deserialize[] = "deserialize(obj, SerializationContext context=None)\nEXPERIMENTAL: Deserialize Python object from Buffer or other Python\n    object supporting the buffer protocol. This only can interact with data\n    produced by pyarrow.serialize or pyarrow.serialize_to\n\n    Parameters\n    ----------\n    obj : pyarrow.Buffer or Python object supporting buffer protocol\n    context : SerializationContext\n        Custom serialization and deserialization context\n\n    Returns\n    -------\n    deserialized : object\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_215deserialize = {"deserialize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_215deserialize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_214deserialize};
static PyObject *__pyx_pw_7pyarrow_3lib_215deserialize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_obj = 0;
  struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_context = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("deserialize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_context,0};
    PyObject* values[2] = {0,0};
    values[1] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "deserialize") < 0)) __PYX_ERR(16, 460, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_obj = values[0];
    __pyx_v_context = ((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("deserialize", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(16, 460, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.deserialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_context), __pyx_ptype_7pyarrow_3lib_SerializationContext, 1, "context", 0))) __PYX_ERR(16, 460, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_214deserialize(__pyx_self, __pyx_v_obj, __pyx_v_context);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_214deserialize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v_context) {
  struct __pyx_obj_7pyarrow_3lib_BufferReader *__pyx_v_source = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("deserialize", 0);

  /* "pyarrow/serialization.pxi":475
 *     deserialized : object
 *     """
 *     source = BufferReader(obj)             # <<<<<<<<<<<<<<
 *     return deserialize_from(source, obj, context)
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_BufferReader), __pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 475, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_source = ((struct __pyx_obj_7pyarrow_3lib_BufferReader *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":476
 *     """
 *     source = BufferReader(obj)
 *     return deserialize_from(source, obj, context)             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_deserialize_from); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 476, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_source), __pyx_v_obj, ((PyObject *)__pyx_v_context)};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 476, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_source), __pyx_v_obj, ((PyObject *)__pyx_v_context)};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 476, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(16, 476, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_source));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_source));
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_source));
    __Pyx_INCREF(__pyx_v_obj);
    __Pyx_GIVEREF(__pyx_v_obj);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_obj);
    __Pyx_INCREF(((PyObject *)__pyx_v_context));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_context));
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, ((PyObject *)__pyx_v_context));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 476, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":460
 * 
 * 
 * def deserialize(obj, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Deserialize Python object from Buffer or other Python
 *     object supporting the buffer protocol. This only can interact with data
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.deserialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_source);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/benchmark.pxi":19
 * 
 * 
 * def benchmark_PandasObjectIsNull(list obj):             # <<<<<<<<<<<<<<
 *     Benchmark_PandasObjectIsNull(obj)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_217benchmark_PandasObjectIsNull(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_216benchmark_PandasObjectIsNull[] = "benchmark_PandasObjectIsNull(list obj)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_217benchmark_PandasObjectIsNull = {"benchmark_PandasObjectIsNull", (PyCFunction)__pyx_pw_7pyarrow_3lib_217benchmark_PandasObjectIsNull, METH_O, __pyx_doc_7pyarrow_3lib_216benchmark_PandasObjectIsNull};
static PyObject *__pyx_pw_7pyarrow_3lib_217benchmark_PandasObjectIsNull(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("benchmark_PandasObjectIsNull (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_obj), (&PyList_Type), 1, "obj", 1))) __PYX_ERR(17, 19, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_216benchmark_PandasObjectIsNull(__pyx_self, ((PyObject*)__pyx_v_obj));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_216benchmark_PandasObjectIsNull(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("benchmark_PandasObjectIsNull", 0);

  /* "pyarrow/benchmark.pxi":20
 * 
 * def benchmark_PandasObjectIsNull(list obj):
 *     Benchmark_PandasObjectIsNull(obj)             # <<<<<<<<<<<<<<
 */
  arrow::py::benchmark::Benchmark_PandasObjectIsNull(__pyx_v_obj); if (unlikely(PyErr_Occurred())) __PYX_ERR(17, 20, __pyx_L1_error)

  /* "pyarrow/benchmark.pxi":19
 * 
 * 
 * def benchmark_PandasObjectIsNull(list obj):             # <<<<<<<<<<<<<<
 *     Benchmark_PandasObjectIsNull(obj)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib.benchmark_PandasObjectIsNull", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":28
 * 
 * 
 * cdef api bint pyarrow_is_buffer(object buffer):             # <<<<<<<<<<<<<<
 *     return isinstance(buffer, Buffer)
 * 
 */

static int __pyx_f_7pyarrow_3lib_pyarrow_is_buffer(PyObject *__pyx_v_buffer) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("pyarrow_is_buffer", 0);

  /* "pyarrow/public-api.pxi":29
 * 
 * cdef api bint pyarrow_is_buffer(object buffer):
 *     return isinstance(buffer, Buffer)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_buffer, __pyx_ptype_7pyarrow_3lib_Buffer); 
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":28
 * 
 * 
 * cdef api bint pyarrow_is_buffer(object buffer):             # <<<<<<<<<<<<<<
 *     return isinstance(buffer, Buffer)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":32
 * 
 * 
 * cdef api shared_ptr[CBuffer] pyarrow_unwrap_buffer(object buffer):             # <<<<<<<<<<<<<<
 *     cdef Buffer buf
 *     if pyarrow_is_buffer(buffer):
 */

std::shared_ptr< arrow::Buffer>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_buffer(PyObject *__pyx_v_buffer) {
  struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_buf = 0;
  std::shared_ptr< arrow::Buffer>  __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_unwrap_buffer", 0);

  /* "pyarrow/public-api.pxi":34
 * cdef api shared_ptr[CBuffer] pyarrow_unwrap_buffer(object buffer):
 *     cdef Buffer buf
 *     if pyarrow_is_buffer(buffer):             # <<<<<<<<<<<<<<
 *         buf = <Buffer>(buffer)
 *         return buf.buffer
 */
  __pyx_t_1 = (__pyx_f_7pyarrow_3lib_pyarrow_is_buffer(__pyx_v_buffer) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":35
 *     cdef Buffer buf
 *     if pyarrow_is_buffer(buffer):
 *         buf = <Buffer>(buffer)             # <<<<<<<<<<<<<<
 *         return buf.buffer
 * 
 */
    __pyx_t_2 = __pyx_v_buffer;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v_buf = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":36
 *     if pyarrow_is_buffer(buffer):
 *         buf = <Buffer>(buffer)
 *         return buf.buffer             # <<<<<<<<<<<<<<
 * 
 *     return shared_ptr[CBuffer]()
 */
    __pyx_r = __pyx_v_buf->buffer;
    goto __pyx_L0;

    /* "pyarrow/public-api.pxi":34
 * cdef api shared_ptr[CBuffer] pyarrow_unwrap_buffer(object buffer):
 *     cdef Buffer buf
 *     if pyarrow_is_buffer(buffer):             # <<<<<<<<<<<<<<
 *         buf = <Buffer>(buffer)
 *         return buf.buffer
 */
  }

  /* "pyarrow/public-api.pxi":38
 *         return buf.buffer
 * 
 *     return shared_ptr[CBuffer]()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = std::shared_ptr< arrow::Buffer> ();
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":32
 * 
 * 
 * cdef api shared_ptr[CBuffer] pyarrow_unwrap_buffer(object buffer):             # <<<<<<<<<<<<<<
 *     cdef Buffer buf
 *     if pyarrow_is_buffer(buffer):
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":41
 * 
 * 
 * cdef api object pyarrow_wrap_buffer(const shared_ptr[CBuffer]& buf):             # <<<<<<<<<<<<<<
 *     cdef Buffer result = Buffer.__new__(Buffer)
 *     result.init(buf)
 */

PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(std::shared_ptr< arrow::Buffer>  const &__pyx_v_buf) {
  struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_wrap_buffer", 0);

  /* "pyarrow/public-api.pxi":42
 * 
 * cdef api object pyarrow_wrap_buffer(const shared_ptr[CBuffer]& buf):
 *     cdef Buffer result = Buffer.__new__(Buffer)             # <<<<<<<<<<<<<<
 *     result.init(buf)
 *     return result
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_Buffer(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_Buffer), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 42, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/public-api.pxi":43
 * cdef api object pyarrow_wrap_buffer(const shared_ptr[CBuffer]& buf):
 *     cdef Buffer result = Buffer.__new__(Buffer)
 *     result.init(buf)             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_Buffer *)__pyx_v_result->__pyx_vtab)->init(__pyx_v_result, __pyx_v_buf);

  /* "pyarrow/public-api.pxi":44
 *     cdef Buffer result = Buffer.__new__(Buffer)
 *     result.init(buf)
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":41
 * 
 * 
 * cdef api object pyarrow_wrap_buffer(const shared_ptr[CBuffer]& buf):             # <<<<<<<<<<<<<<
 *     cdef Buffer result = Buffer.__new__(Buffer)
 *     result.init(buf)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.pyarrow_wrap_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":47
 * 
 * 
 * cdef api object pyarrow_wrap_resizable_buffer(             # <<<<<<<<<<<<<<
 *         const shared_ptr[CResizableBuffer]& buf):
 *     cdef ResizableBuffer result = ResizableBuffer.__new__(ResizableBuffer)
 */

PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_resizable_buffer(std::shared_ptr< arrow::ResizableBuffer>  const &__pyx_v_buf) {
  struct __pyx_obj_7pyarrow_3lib_ResizableBuffer *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_wrap_resizable_buffer", 0);

  /* "pyarrow/public-api.pxi":49
 * cdef api object pyarrow_wrap_resizable_buffer(
 *         const shared_ptr[CResizableBuffer]& buf):
 *     cdef ResizableBuffer result = ResizableBuffer.__new__(ResizableBuffer)             # <<<<<<<<<<<<<<
 *     result.init_rz(buf)
 *     return result
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_ResizableBuffer(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_ResizableBuffer), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 49, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_3lib_ResizableBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/public-api.pxi":50
 *         const shared_ptr[CResizableBuffer]& buf):
 *     cdef ResizableBuffer result = ResizableBuffer.__new__(ResizableBuffer)
 *     result.init_rz(buf)             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_ResizableBuffer *)__pyx_v_result->__pyx_base.__pyx_vtab)->init_rz(__pyx_v_result, __pyx_v_buf);

  /* "pyarrow/public-api.pxi":51
 *     cdef ResizableBuffer result = ResizableBuffer.__new__(ResizableBuffer)
 *     result.init_rz(buf)
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":47
 * 
 * 
 * cdef api object pyarrow_wrap_resizable_buffer(             # <<<<<<<<<<<<<<
 *         const shared_ptr[CResizableBuffer]& buf):
 *     cdef ResizableBuffer result = ResizableBuffer.__new__(ResizableBuffer)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.pyarrow_wrap_resizable_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":54
 * 
 * 
 * cdef api bint pyarrow_is_data_type(object type_):             # <<<<<<<<<<<<<<
 *     return isinstance(type_, DataType)
 * 
 */

static int __pyx_f_7pyarrow_3lib_pyarrow_is_data_type(PyObject *__pyx_v_type_) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("pyarrow_is_data_type", 0);

  /* "pyarrow/public-api.pxi":55
 * 
 * cdef api bint pyarrow_is_data_type(object type_):
 *     return isinstance(type_, DataType)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_type_, __pyx_ptype_7pyarrow_3lib_DataType); 
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":54
 * 
 * 
 * cdef api bint pyarrow_is_data_type(object type_):             # <<<<<<<<<<<<<<
 *     return isinstance(type_, DataType)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":58
 * 
 * 
 * cdef api shared_ptr[CDataType] pyarrow_unwrap_data_type(             # <<<<<<<<<<<<<<
 *         object data_type):
 *     cdef DataType type_
 */

std::shared_ptr< arrow::DataType>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_data_type(PyObject *__pyx_v_data_type) {
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_type_ = 0;
  std::shared_ptr< arrow::DataType>  __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_unwrap_data_type", 0);

  /* "pyarrow/public-api.pxi":61
 *         object data_type):
 *     cdef DataType type_
 *     if pyarrow_is_data_type(data_type):             # <<<<<<<<<<<<<<
 *         type_ = <DataType>(data_type)
 *         return type_.sp_type
 */
  __pyx_t_1 = (__pyx_f_7pyarrow_3lib_pyarrow_is_data_type(__pyx_v_data_type) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":62
 *     cdef DataType type_
 *     if pyarrow_is_data_type(data_type):
 *         type_ = <DataType>(data_type)             # <<<<<<<<<<<<<<
 *         return type_.sp_type
 * 
 */
    __pyx_t_2 = __pyx_v_data_type;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v_type_ = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":63
 *     if pyarrow_is_data_type(data_type):
 *         type_ = <DataType>(data_type)
 *         return type_.sp_type             # <<<<<<<<<<<<<<
 * 
 *     return shared_ptr[CDataType]()
 */
    __pyx_r = __pyx_v_type_->sp_type;
    goto __pyx_L0;

    /* "pyarrow/public-api.pxi":61
 *         object data_type):
 *     cdef DataType type_
 *     if pyarrow_is_data_type(data_type):             # <<<<<<<<<<<<<<
 *         type_ = <DataType>(data_type)
 *         return type_.sp_type
 */
  }

  /* "pyarrow/public-api.pxi":65
 *         return type_.sp_type
 * 
 *     return shared_ptr[CDataType]()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = std::shared_ptr< arrow::DataType> ();
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":58
 * 
 * 
 * cdef api shared_ptr[CDataType] pyarrow_unwrap_data_type(             # <<<<<<<<<<<<<<
 *         object data_type):
 *     cdef DataType type_
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_type_);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":73
 * 
 * 
 * cdef api object pyarrow_wrap_data_type(             # <<<<<<<<<<<<<<
 *         const shared_ptr[CDataType]& type):
 *     cdef:
 */

PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(std::shared_ptr< arrow::DataType>  const &__pyx_v_type) {
   arrow::ExtensionType const *__pyx_v_ext_type;
   arrow::py::PyExtensionType const *__pyx_v_cpy_ext_type;
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __pyx_t_7pyarrow_3lib__CPyExtensionTypePtr __pyx_t_3;
  __Pyx_RefNannySetupContext("pyarrow_wrap_data_type", 0);

  /* "pyarrow/public-api.pxi":80
 *         DataType out
 * 
 *     if type.get() == NULL:             # <<<<<<<<<<<<<<
 *         return None
 * 
 */
  __pyx_t_1 = ((__pyx_v_type.get() == NULL) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":81
 * 
 *     if type.get() == NULL:
 *         return None             # <<<<<<<<<<<<<<
 * 
 *     if type.get().id() == _Type_DICTIONARY:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/public-api.pxi":80
 *         DataType out
 * 
 *     if type.get() == NULL:             # <<<<<<<<<<<<<<
 *         return None
 * 
 */
  }

  /* "pyarrow/public-api.pxi":83
 *         return None
 * 
 *     if type.get().id() == _Type_DICTIONARY:             # <<<<<<<<<<<<<<
 *         out = DictionaryType.__new__(DictionaryType)
 *     elif type.get().id() == _Type_LIST:
 */
  __pyx_t_1 = ((__pyx_v_type.get()->id() ==  arrow::Type::DICTIONARY) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":84
 * 
 *     if type.get().id() == _Type_DICTIONARY:
 *         out = DictionaryType.__new__(DictionaryType)             # <<<<<<<<<<<<<<
 *     elif type.get().id() == _Type_LIST:
 *         out = ListType.__new__(ListType)
 */
    __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_DictionaryType(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_DictionaryType), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 84, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_2), __pyx_ptype_7pyarrow_3lib_DataType)))) __PYX_ERR(18, 84, __pyx_L1_error)
    __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":83
 *         return None
 * 
 *     if type.get().id() == _Type_DICTIONARY:             # <<<<<<<<<<<<<<
 *         out = DictionaryType.__new__(DictionaryType)
 *     elif type.get().id() == _Type_LIST:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/public-api.pxi":85
 *     if type.get().id() == _Type_DICTIONARY:
 *         out = DictionaryType.__new__(DictionaryType)
 *     elif type.get().id() == _Type_LIST:             # <<<<<<<<<<<<<<
 *         out = ListType.__new__(ListType)
 *     elif type.get().id() == _Type_LARGE_LIST:
 */
  __pyx_t_1 = ((__pyx_v_type.get()->id() ==  arrow::Type::LIST) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":86
 *         out = DictionaryType.__new__(DictionaryType)
 *     elif type.get().id() == _Type_LIST:
 *         out = ListType.__new__(ListType)             # <<<<<<<<<<<<<<
 *     elif type.get().id() == _Type_LARGE_LIST:
 *         out = LargeListType.__new__(LargeListType)
 */
    __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_ListType(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_ListType), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 86, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_2), __pyx_ptype_7pyarrow_3lib_DataType)))) __PYX_ERR(18, 86, __pyx_L1_error)
    __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":85
 *     if type.get().id() == _Type_DICTIONARY:
 *         out = DictionaryType.__new__(DictionaryType)
 *     elif type.get().id() == _Type_LIST:             # <<<<<<<<<<<<<<
 *         out = ListType.__new__(ListType)
 *     elif type.get().id() == _Type_LARGE_LIST:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/public-api.pxi":87
 *     elif type.get().id() == _Type_LIST:
 *         out = ListType.__new__(ListType)
 *     elif type.get().id() == _Type_LARGE_LIST:             # <<<<<<<<<<<<<<
 *         out = LargeListType.__new__(LargeListType)
 *     elif type.get().id() == _Type_MAP:
 */
  __pyx_t_1 = ((__pyx_v_type.get()->id() ==  arrow::Type::LARGE_LIST) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":88
 *         out = ListType.__new__(ListType)
 *     elif type.get().id() == _Type_LARGE_LIST:
 *         out = LargeListType.__new__(LargeListType)             # <<<<<<<<<<<<<<
 *     elif type.get().id() == _Type_MAP:
 *         out = MapType.__new__(MapType)
 */
    __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_LargeListType(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_LargeListType), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 88, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_2), __pyx_ptype_7pyarrow_3lib_DataType)))) __PYX_ERR(18, 88, __pyx_L1_error)
    __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":87
 *     elif type.get().id() == _Type_LIST:
 *         out = ListType.__new__(ListType)
 *     elif type.get().id() == _Type_LARGE_LIST:             # <<<<<<<<<<<<<<
 *         out = LargeListType.__new__(LargeListType)
 *     elif type.get().id() == _Type_MAP:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/public-api.pxi":89
 *     elif type.get().id() == _Type_LARGE_LIST:
 *         out = LargeListType.__new__(LargeListType)
 *     elif type.get().id() == _Type_MAP:             # <<<<<<<<<<<<<<
 *         out = MapType.__new__(MapType)
 *     elif type.get().id() == _Type_FIXED_SIZE_LIST:
 */
  __pyx_t_1 = ((__pyx_v_type.get()->id() ==  arrow::Type::MAP) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":90
 *         out = LargeListType.__new__(LargeListType)
 *     elif type.get().id() == _Type_MAP:
 *         out = MapType.__new__(MapType)             # <<<<<<<<<<<<<<
 *     elif type.get().id() == _Type_FIXED_SIZE_LIST:
 *         out = FixedSizeListType.__new__(FixedSizeListType)
 */
    __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_MapType(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_MapType), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 90, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_2), __pyx_ptype_7pyarrow_3lib_DataType)))) __PYX_ERR(18, 90, __pyx_L1_error)
    __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":89
 *     elif type.get().id() == _Type_LARGE_LIST:
 *         out = LargeListType.__new__(LargeListType)
 *     elif type.get().id() == _Type_MAP:             # <<<<<<<<<<<<<<
 *         out = MapType.__new__(MapType)
 *     elif type.get().id() == _Type_FIXED_SIZE_LIST:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/public-api.pxi":91
 *     elif type.get().id() == _Type_MAP:
 *         out = MapType.__new__(MapType)
 *     elif type.get().id() == _Type_FIXED_SIZE_LIST:             # <<<<<<<<<<<<<<
 *         out = FixedSizeListType.__new__(FixedSizeListType)
 *     elif type.get().id() == _Type_STRUCT:
 */
  __pyx_t_1 = ((__pyx_v_type.get()->id() ==  arrow::Type::FIXED_SIZE_LIST) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":92
 *         out = MapType.__new__(MapType)
 *     elif type.get().id() == _Type_FIXED_SIZE_LIST:
 *         out = FixedSizeListType.__new__(FixedSizeListType)             # <<<<<<<<<<<<<<
 *     elif type.get().id() == _Type_STRUCT:
 *         out = StructType.__new__(StructType)
 */
    __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_FixedSizeListType(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_FixedSizeListType), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 92, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_2), __pyx_ptype_7pyarrow_3lib_DataType)))) __PYX_ERR(18, 92, __pyx_L1_error)
    __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":91
 *     elif type.get().id() == _Type_MAP:
 *         out = MapType.__new__(MapType)
 *     elif type.get().id() == _Type_FIXED_SIZE_LIST:             # <<<<<<<<<<<<<<
 *         out = FixedSizeListType.__new__(FixedSizeListType)
 *     elif type.get().id() == _Type_STRUCT:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/public-api.pxi":93
 *     elif type.get().id() == _Type_FIXED_SIZE_LIST:
 *         out = FixedSizeListType.__new__(FixedSizeListType)
 *     elif type.get().id() == _Type_STRUCT:             # <<<<<<<<<<<<<<
 *         out = StructType.__new__(StructType)
 *     elif type.get().id() == _Type_UNION:
 */
  __pyx_t_1 = ((__pyx_v_type.get()->id() ==  arrow::Type::STRUCT) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":94
 *         out = FixedSizeListType.__new__(FixedSizeListType)
 *     elif type.get().id() == _Type_STRUCT:
 *         out = StructType.__new__(StructType)             # <<<<<<<<<<<<<<
 *     elif type.get().id() == _Type_UNION:
 *         out = UnionType.__new__(UnionType)
 */
    __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_StructType(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_StructType), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 94, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_2), __pyx_ptype_7pyarrow_3lib_DataType)))) __PYX_ERR(18, 94, __pyx_L1_error)
    __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":93
 *     elif type.get().id() == _Type_FIXED_SIZE_LIST:
 *         out = FixedSizeListType.__new__(FixedSizeListType)
 *     elif type.get().id() == _Type_STRUCT:             # <<<<<<<<<<<<<<
 *         out = StructType.__new__(StructType)
 *     elif type.get().id() == _Type_UNION:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/public-api.pxi":95
 *     elif type.get().id() == _Type_STRUCT:
 *         out = StructType.__new__(StructType)
 *     elif type.get().id() == _Type_UNION:             # <<<<<<<<<<<<<<
 *         out = UnionType.__new__(UnionType)
 *     elif type.get().id() == _Type_TIMESTAMP:
 */
  __pyx_t_1 = ((__pyx_v_type.get()->id() ==  arrow::Type::UNION) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":96
 *         out = StructType.__new__(StructType)
 *     elif type.get().id() == _Type_UNION:
 *         out = UnionType.__new__(UnionType)             # <<<<<<<<<<<<<<
 *     elif type.get().id() == _Type_TIMESTAMP:
 *         out = TimestampType.__new__(TimestampType)
 */
    __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_UnionType(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_UnionType), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 96, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_2), __pyx_ptype_7pyarrow_3lib_DataType)))) __PYX_ERR(18, 96, __pyx_L1_error)
    __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":95
 *     elif type.get().id() == _Type_STRUCT:
 *         out = StructType.__new__(StructType)
 *     elif type.get().id() == _Type_UNION:             # <<<<<<<<<<<<<<
 *         out = UnionType.__new__(UnionType)
 *     elif type.get().id() == _Type_TIMESTAMP:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/public-api.pxi":97
 *     elif type.get().id() == _Type_UNION:
 *         out = UnionType.__new__(UnionType)
 *     elif type.get().id() == _Type_TIMESTAMP:             # <<<<<<<<<<<<<<
 *         out = TimestampType.__new__(TimestampType)
 *     elif type.get().id() == _Type_DURATION:
 */
  __pyx_t_1 = ((__pyx_v_type.get()->id() ==  arrow::Type::TIMESTAMP) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":98
 *         out = UnionType.__new__(UnionType)
 *     elif type.get().id() == _Type_TIMESTAMP:
 *         out = TimestampType.__new__(TimestampType)             # <<<<<<<<<<<<<<
 *     elif type.get().id() == _Type_DURATION:
 *         out = DurationType.__new__(DurationType)
 */
    __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_TimestampType(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_TimestampType), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 98, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_2), __pyx_ptype_7pyarrow_3lib_DataType)))) __PYX_ERR(18, 98, __pyx_L1_error)
    __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":97
 *     elif type.get().id() == _Type_UNION:
 *         out = UnionType.__new__(UnionType)
 *     elif type.get().id() == _Type_TIMESTAMP:             # <<<<<<<<<<<<<<
 *         out = TimestampType.__new__(TimestampType)
 *     elif type.get().id() == _Type_DURATION:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/public-api.pxi":99
 *     elif type.get().id() == _Type_TIMESTAMP:
 *         out = TimestampType.__new__(TimestampType)
 *     elif type.get().id() == _Type_DURATION:             # <<<<<<<<<<<<<<
 *         out = DurationType.__new__(DurationType)
 *     elif type.get().id() == _Type_FIXED_SIZE_BINARY:
 */
  __pyx_t_1 = ((__pyx_v_type.get()->id() ==  arrow::Type::DURATION) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":100
 *         out = TimestampType.__new__(TimestampType)
 *     elif type.get().id() == _Type_DURATION:
 *         out = DurationType.__new__(DurationType)             # <<<<<<<<<<<<<<
 *     elif type.get().id() == _Type_FIXED_SIZE_BINARY:
 *         out = FixedSizeBinaryType.__new__(FixedSizeBinaryType)
 */
    __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_DurationType(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_DurationType), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 100, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_2), __pyx_ptype_7pyarrow_3lib_DataType)))) __PYX_ERR(18, 100, __pyx_L1_error)
    __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":99
 *     elif type.get().id() == _Type_TIMESTAMP:
 *         out = TimestampType.__new__(TimestampType)
 *     elif type.get().id() == _Type_DURATION:             # <<<<<<<<<<<<<<
 *         out = DurationType.__new__(DurationType)
 *     elif type.get().id() == _Type_FIXED_SIZE_BINARY:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/public-api.pxi":101
 *     elif type.get().id() == _Type_DURATION:
 *         out = DurationType.__new__(DurationType)
 *     elif type.get().id() == _Type_FIXED_SIZE_BINARY:             # <<<<<<<<<<<<<<
 *         out = FixedSizeBinaryType.__new__(FixedSizeBinaryType)
 *     elif type.get().id() == _Type_DECIMAL:
 */
  __pyx_t_1 = ((__pyx_v_type.get()->id() ==  arrow::Type::FIXED_SIZE_BINARY) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":102
 *         out = DurationType.__new__(DurationType)
 *     elif type.get().id() == _Type_FIXED_SIZE_BINARY:
 *         out = FixedSizeBinaryType.__new__(FixedSizeBinaryType)             # <<<<<<<<<<<<<<
 *     elif type.get().id() == _Type_DECIMAL:
 *         out = Decimal128Type.__new__(Decimal128Type)
 */
    __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_FixedSizeBinaryType(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_FixedSizeBinaryType), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 102, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_2), __pyx_ptype_7pyarrow_3lib_DataType)))) __PYX_ERR(18, 102, __pyx_L1_error)
    __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":101
 *     elif type.get().id() == _Type_DURATION:
 *         out = DurationType.__new__(DurationType)
 *     elif type.get().id() == _Type_FIXED_SIZE_BINARY:             # <<<<<<<<<<<<<<
 *         out = FixedSizeBinaryType.__new__(FixedSizeBinaryType)
 *     elif type.get().id() == _Type_DECIMAL:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/public-api.pxi":103
 *     elif type.get().id() == _Type_FIXED_SIZE_BINARY:
 *         out = FixedSizeBinaryType.__new__(FixedSizeBinaryType)
 *     elif type.get().id() == _Type_DECIMAL:             # <<<<<<<<<<<<<<
 *         out = Decimal128Type.__new__(Decimal128Type)
 *     elif type.get().id() == _Type_EXTENSION:
 */
  __pyx_t_1 = ((__pyx_v_type.get()->id() ==  arrow::Type::DECIMAL) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":104
 *         out = FixedSizeBinaryType.__new__(FixedSizeBinaryType)
 *     elif type.get().id() == _Type_DECIMAL:
 *         out = Decimal128Type.__new__(Decimal128Type)             # <<<<<<<<<<<<<<
 *     elif type.get().id() == _Type_EXTENSION:
 *         ext_type = <const CExtensionType*> type.get()
 */
    __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_Decimal128Type(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_Decimal128Type), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 104, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_2), __pyx_ptype_7pyarrow_3lib_DataType)))) __PYX_ERR(18, 104, __pyx_L1_error)
    __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":103
 *     elif type.get().id() == _Type_FIXED_SIZE_BINARY:
 *         out = FixedSizeBinaryType.__new__(FixedSizeBinaryType)
 *     elif type.get().id() == _Type_DECIMAL:             # <<<<<<<<<<<<<<
 *         out = Decimal128Type.__new__(Decimal128Type)
 *     elif type.get().id() == _Type_EXTENSION:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/public-api.pxi":105
 *     elif type.get().id() == _Type_DECIMAL:
 *         out = Decimal128Type.__new__(Decimal128Type)
 *     elif type.get().id() == _Type_EXTENSION:             # <<<<<<<<<<<<<<
 *         ext_type = <const CExtensionType*> type.get()
 *         cpy_ext_type = dynamic_cast[_CPyExtensionTypePtr](ext_type)
 */
  __pyx_t_1 = ((__pyx_v_type.get()->id() ==  arrow::Type::EXTENSION) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":106
 *         out = Decimal128Type.__new__(Decimal128Type)
 *     elif type.get().id() == _Type_EXTENSION:
 *         ext_type = <const CExtensionType*> type.get()             # <<<<<<<<<<<<<<
 *         cpy_ext_type = dynamic_cast[_CPyExtensionTypePtr](ext_type)
 *         if cpy_ext_type != nullptr:
 */
    __pyx_v_ext_type = (( arrow::ExtensionType const *)__pyx_v_type.get());

    /* "pyarrow/public-api.pxi":107
 *     elif type.get().id() == _Type_EXTENSION:
 *         ext_type = <const CExtensionType*> type.get()
 *         cpy_ext_type = dynamic_cast[_CPyExtensionTypePtr](ext_type)             # <<<<<<<<<<<<<<
 *         if cpy_ext_type != nullptr:
 *             return cpy_ext_type.GetInstance()
 */
    try {
      __pyx_t_3 = dynamic_cast<__pyx_t_7pyarrow_3lib__CPyExtensionTypePtr>(__pyx_v_ext_type);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(18, 107, __pyx_L1_error)
    }
    __pyx_v_cpy_ext_type = __pyx_t_3;

    /* "pyarrow/public-api.pxi":108
 *         ext_type = <const CExtensionType*> type.get()
 *         cpy_ext_type = dynamic_cast[_CPyExtensionTypePtr](ext_type)
 *         if cpy_ext_type != nullptr:             # <<<<<<<<<<<<<<
 *             return cpy_ext_type.GetInstance()
 *         else:
 */
    __pyx_t_1 = ((__pyx_v_cpy_ext_type != nullptr) != 0);
    if (__pyx_t_1) {

      /* "pyarrow/public-api.pxi":109
 *         cpy_ext_type = dynamic_cast[_CPyExtensionTypePtr](ext_type)
 *         if cpy_ext_type != nullptr:
 *             return cpy_ext_type.GetInstance()             # <<<<<<<<<<<<<<
 *         else:
 *             out = BaseExtensionType.__new__(BaseExtensionType)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __pyx_v_cpy_ext_type->GetInstance(); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 109, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

      /* "pyarrow/public-api.pxi":108
 *         ext_type = <const CExtensionType*> type.get()
 *         cpy_ext_type = dynamic_cast[_CPyExtensionTypePtr](ext_type)
 *         if cpy_ext_type != nullptr:             # <<<<<<<<<<<<<<
 *             return cpy_ext_type.GetInstance()
 *         else:
 */
    }

    /* "pyarrow/public-api.pxi":111
 *             return cpy_ext_type.GetInstance()
 *         else:
 *             out = BaseExtensionType.__new__(BaseExtensionType)             # <<<<<<<<<<<<<<
 *     else:
 *         out = DataType.__new__(DataType)
 */
    /*else*/ {
      __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_BaseExtensionType(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_BaseExtensionType), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 111, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_2), __pyx_ptype_7pyarrow_3lib_DataType)))) __PYX_ERR(18, 111, __pyx_L1_error)
      __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_2);
      __pyx_t_2 = 0;
    }

    /* "pyarrow/public-api.pxi":105
 *     elif type.get().id() == _Type_DECIMAL:
 *         out = Decimal128Type.__new__(Decimal128Type)
 *     elif type.get().id() == _Type_EXTENSION:             # <<<<<<<<<<<<<<
 *         ext_type = <const CExtensionType*> type.get()
 *         cpy_ext_type = dynamic_cast[_CPyExtensionTypePtr](ext_type)
 */
    goto __pyx_L4;
  }

  /* "pyarrow/public-api.pxi":113
 *             out = BaseExtensionType.__new__(BaseExtensionType)
 *     else:
 *         out = DataType.__new__(DataType)             # <<<<<<<<<<<<<<
 * 
 *     out.init(type)
 */
  /*else*/ {
    __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_DataType(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_DataType), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 113, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_2);
    __pyx_t_2 = 0;
  }
  __pyx_L4:;

  /* "pyarrow/public-api.pxi":115
 *         out = DataType.__new__(DataType)
 * 
 *     out.init(type)             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_DataType *)__pyx_v_out->__pyx_vtab)->init(__pyx_v_out, __pyx_v_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(18, 115, __pyx_L1_error)

  /* "pyarrow/public-api.pxi":116
 * 
 *     out.init(type)
 *     return out             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = ((PyObject *)__pyx_v_out);
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":73
 * 
 * 
 * cdef api object pyarrow_wrap_data_type(             # <<<<<<<<<<<<<<
 *         const shared_ptr[CDataType]& type):
 *     cdef:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.pyarrow_wrap_data_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":119
 * 
 * 
 * cdef object pyarrow_wrap_metadata(             # <<<<<<<<<<<<<<
 *         const shared_ptr[const CKeyValueMetadata]& meta):
 *     cdef const CKeyValueMetadata* cmeta = meta.get()
 */

static PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_metadata(std::shared_ptr< arrow::KeyValueMetadata const >  const &__pyx_v_meta) {
   arrow::KeyValueMetadata const *__pyx_v_cmeta;
  PyObject *__pyx_v_result = NULL;
  int64_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int64_t __pyx_t_5;
  int64_t __pyx_t_6;
  int64_t __pyx_t_7;
  __Pyx_RefNannySetupContext("pyarrow_wrap_metadata", 0);

  /* "pyarrow/public-api.pxi":121
 * cdef object pyarrow_wrap_metadata(
 *         const shared_ptr[const CKeyValueMetadata]& meta):
 *     cdef const CKeyValueMetadata* cmeta = meta.get()             # <<<<<<<<<<<<<<
 * 
 *     if cmeta == nullptr:
 */
  __pyx_v_cmeta = __pyx_v_meta.get();

  /* "pyarrow/public-api.pxi":123
 *     cdef const CKeyValueMetadata* cmeta = meta.get()
 * 
 *     if cmeta == nullptr:             # <<<<<<<<<<<<<<
 *         return None
 * 
 */
  __pyx_t_1 = ((__pyx_v_cmeta == nullptr) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":124
 * 
 *     if cmeta == nullptr:
 *         return None             # <<<<<<<<<<<<<<
 * 
 *     result = ordered_dict()
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/public-api.pxi":123
 *     cdef const CKeyValueMetadata* cmeta = meta.get()
 * 
 *     if cmeta == nullptr:             # <<<<<<<<<<<<<<
 *         return None
 * 
 */
  }

  /* "pyarrow/public-api.pxi":126
 *         return None
 * 
 *     result = ordered_dict()             # <<<<<<<<<<<<<<
 *     for i in range(cmeta.size()):
 *         result[cmeta.key(i)] = cmeta.value(i)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ordered_dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/public-api.pxi":127
 * 
 *     result = ordered_dict()
 *     for i in range(cmeta.size()):             # <<<<<<<<<<<<<<
 *         result[cmeta.key(i)] = cmeta.value(i)
 * 
 */
  __pyx_t_5 = __pyx_v_cmeta->size();
  __pyx_t_6 = __pyx_t_5;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "pyarrow/public-api.pxi":128
 *     result = ordered_dict()
 *     for i in range(cmeta.size()):
 *         result[cmeta.key(i)] = cmeta.value(i)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
    __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_cmeta->value(__pyx_v_i)); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 128, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_cmeta->key(__pyx_v_i)); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 128, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely(PyObject_SetItem(__pyx_v_result, __pyx_t_3, __pyx_t_2) < 0)) __PYX_ERR(18, 128, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "pyarrow/public-api.pxi":130
 *         result[cmeta.key(i)] = cmeta.value(i)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":119
 * 
 * 
 * cdef object pyarrow_wrap_metadata(             # <<<<<<<<<<<<<<
 *         const shared_ptr[const CKeyValueMetadata]& meta):
 *     cdef const CKeyValueMetadata* cmeta = meta.get()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.pyarrow_wrap_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":133
 * 
 * 
 * cdef shared_ptr[CKeyValueMetadata] pyarrow_unwrap_metadata(object meta):             # <<<<<<<<<<<<<<
 *     cdef vector[c_string] keys, values
 * 
 */

static std::shared_ptr< arrow::KeyValueMetadata>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_metadata(PyObject *__pyx_v_meta) {
  std::vector<std::string>  __pyx_v_keys;
  std::vector<std::string>  __pyx_v_values;
  std::shared_ptr< arrow::KeyValueMetadata>  __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  std::vector<std::string>  __pyx_t_7;
  std::shared_ptr< arrow::KeyValueMetadata>  __pyx_t_8;
  __Pyx_RefNannySetupContext("pyarrow_unwrap_metadata", 0);

  /* "pyarrow/public-api.pxi":136
 *     cdef vector[c_string] keys, values
 * 
 *     if isinstance(meta, dict):             # <<<<<<<<<<<<<<
 *         keys = map(tobytes, meta.keys())
 *         values = map(tobytes, meta.values())
 */
  __pyx_t_1 = PyDict_Check(__pyx_v_meta); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/public-api.pxi":137
 * 
 *     if isinstance(meta, dict):
 *         keys = map(tobytes, meta.keys())             # <<<<<<<<<<<<<<
 *         values = map(tobytes, meta.values())
 *         return make_shared[CKeyValueMetadata](keys, values)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 137, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_meta, __pyx_n_s_keys); if (unlikely(!__pyx_t_5)) __PYX_ERR(18, 137, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 137, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(18, 137, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 137, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(18, 137, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_keys = __pyx_t_7;

    /* "pyarrow/public-api.pxi":138
 *     if isinstance(meta, dict):
 *         keys = map(tobytes, meta.keys())
 *         values = map(tobytes, meta.values())             # <<<<<<<<<<<<<<
 *         return make_shared[CKeyValueMetadata](keys, values)
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 138, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_meta, __pyx_n_s_values); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 138, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(18, 138, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 138, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(18, 138, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_t_5); if (unlikely(PyErr_Occurred())) __PYX_ERR(18, 138, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_values = __pyx_t_7;

    /* "pyarrow/public-api.pxi":139
 *         keys = map(tobytes, meta.keys())
 *         values = map(tobytes, meta.values())
 *         return make_shared[CKeyValueMetadata](keys, values)             # <<<<<<<<<<<<<<
 * 
 *     return shared_ptr[CKeyValueMetadata]()
 */
    try {
      __pyx_t_8 = std::make_shared< arrow::KeyValueMetadata>(__pyx_v_keys, __pyx_v_values);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(18, 139, __pyx_L1_error)
    }
    __pyx_r = __pyx_t_8;
    goto __pyx_L0;

    /* "pyarrow/public-api.pxi":136
 *     cdef vector[c_string] keys, values
 * 
 *     if isinstance(meta, dict):             # <<<<<<<<<<<<<<
 *         keys = map(tobytes, meta.keys())
 *         values = map(tobytes, meta.values())
 */
  }

  /* "pyarrow/public-api.pxi":141
 *         return make_shared[CKeyValueMetadata](keys, values)
 * 
 *     return shared_ptr[CKeyValueMetadata]()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = std::shared_ptr< arrow::KeyValueMetadata> ();
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":133
 * 
 * 
 * cdef shared_ptr[CKeyValueMetadata] pyarrow_unwrap_metadata(object meta):             # <<<<<<<<<<<<<<
 *     cdef vector[c_string] keys, values
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("pyarrow.lib.pyarrow_unwrap_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":144
 * 
 * 
 * cdef api bint pyarrow_is_field(object field):             # <<<<<<<<<<<<<<
 *     return isinstance(field, Field)
 * 
 */

static int __pyx_f_7pyarrow_3lib_pyarrow_is_field(PyObject *__pyx_v_field) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("pyarrow_is_field", 0);

  /* "pyarrow/public-api.pxi":145
 * 
 * cdef api bint pyarrow_is_field(object field):
 *     return isinstance(field, Field)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_field, __pyx_ptype_7pyarrow_3lib_Field); 
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":144
 * 
 * 
 * cdef api bint pyarrow_is_field(object field):             # <<<<<<<<<<<<<<
 *     return isinstance(field, Field)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":148
 * 
 * 
 * cdef api shared_ptr[CField] pyarrow_unwrap_field(object field):             # <<<<<<<<<<<<<<
 *     cdef Field field_
 *     if pyarrow_is_field(field):
 */

std::shared_ptr< arrow::Field>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_field(PyObject *__pyx_v_field) {
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_field_ = 0;
  std::shared_ptr< arrow::Field>  __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_unwrap_field", 0);

  /* "pyarrow/public-api.pxi":150
 * cdef api shared_ptr[CField] pyarrow_unwrap_field(object field):
 *     cdef Field field_
 *     if pyarrow_is_field(field):             # <<<<<<<<<<<<<<
 *         field_ = <Field>(field)
 *         return field_.sp_field
 */
  __pyx_t_1 = (__pyx_f_7pyarrow_3lib_pyarrow_is_field(__pyx_v_field) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":151
 *     cdef Field field_
 *     if pyarrow_is_field(field):
 *         field_ = <Field>(field)             # <<<<<<<<<<<<<<
 *         return field_.sp_field
 * 
 */
    __pyx_t_2 = __pyx_v_field;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v_field_ = ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":152
 *     if pyarrow_is_field(field):
 *         field_ = <Field>(field)
 *         return field_.sp_field             # <<<<<<<<<<<<<<
 * 
 *     return shared_ptr[CField]()
 */
    __pyx_r = __pyx_v_field_->sp_field;
    goto __pyx_L0;

    /* "pyarrow/public-api.pxi":150
 * cdef api shared_ptr[CField] pyarrow_unwrap_field(object field):
 *     cdef Field field_
 *     if pyarrow_is_field(field):             # <<<<<<<<<<<<<<
 *         field_ = <Field>(field)
 *         return field_.sp_field
 */
  }

  /* "pyarrow/public-api.pxi":154
 *         return field_.sp_field
 * 
 *     return shared_ptr[CField]()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = std::shared_ptr< arrow::Field> ();
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":148
 * 
 * 
 * cdef api shared_ptr[CField] pyarrow_unwrap_field(object field):             # <<<<<<<<<<<<<<
 *     cdef Field field_
 *     if pyarrow_is_field(field):
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_field_);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":157
 * 
 * 
 * cdef api object pyarrow_wrap_field(const shared_ptr[CField]& field):             # <<<<<<<<<<<<<<
 *     if field.get() == NULL:
 *         return None
 */

PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_field(std::shared_ptr< arrow::Field>  const &__pyx_v_field) {
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_wrap_field", 0);

  /* "pyarrow/public-api.pxi":158
 * 
 * cdef api object pyarrow_wrap_field(const shared_ptr[CField]& field):
 *     if field.get() == NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     cdef Field out = Field.__new__(Field)
 */
  __pyx_t_1 = ((__pyx_v_field.get() == NULL) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":159
 * cdef api object pyarrow_wrap_field(const shared_ptr[CField]& field):
 *     if field.get() == NULL:
 *         return None             # <<<<<<<<<<<<<<
 *     cdef Field out = Field.__new__(Field)
 *     out.init(field)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/public-api.pxi":158
 * 
 * cdef api object pyarrow_wrap_field(const shared_ptr[CField]& field):
 *     if field.get() == NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     cdef Field out = Field.__new__(Field)
 */
  }

  /* "pyarrow/public-api.pxi":160
 *     if field.get() == NULL:
 *         return None
 *     cdef Field out = Field.__new__(Field)             # <<<<<<<<<<<<<<
 *     out.init(field)
 *     return out
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_Field(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_Field), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 160, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/public-api.pxi":161
 *         return None
 *     cdef Field out = Field.__new__(Field)
 *     out.init(field)             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_Field *)__pyx_v_out->__pyx_vtab)->init(__pyx_v_out, __pyx_v_field);

  /* "pyarrow/public-api.pxi":162
 *     cdef Field out = Field.__new__(Field)
 *     out.init(field)
 *     return out             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = ((PyObject *)__pyx_v_out);
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":157
 * 
 * 
 * cdef api object pyarrow_wrap_field(const shared_ptr[CField]& field):             # <<<<<<<<<<<<<<
 *     if field.get() == NULL:
 *         return None
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.pyarrow_wrap_field", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":165
 * 
 * 
 * cdef api bint pyarrow_is_schema(object schema):             # <<<<<<<<<<<<<<
 *     return isinstance(schema, Schema)
 * 
 */

static int __pyx_f_7pyarrow_3lib_pyarrow_is_schema(PyObject *__pyx_v_schema) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("pyarrow_is_schema", 0);

  /* "pyarrow/public-api.pxi":166
 * 
 * cdef api bint pyarrow_is_schema(object schema):
 *     return isinstance(schema, Schema)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_schema, __pyx_ptype_7pyarrow_3lib_Schema); 
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":165
 * 
 * 
 * cdef api bint pyarrow_is_schema(object schema):             # <<<<<<<<<<<<<<
 *     return isinstance(schema, Schema)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":169
 * 
 * 
 * cdef api shared_ptr[CSchema] pyarrow_unwrap_schema(object schema):             # <<<<<<<<<<<<<<
 *     cdef Schema sch
 *     if pyarrow_is_schema(schema):
 */

std::shared_ptr< arrow::Schema>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_schema(PyObject *__pyx_v_schema) {
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_sch = 0;
  std::shared_ptr< arrow::Schema>  __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_unwrap_schema", 0);

  /* "pyarrow/public-api.pxi":171
 * cdef api shared_ptr[CSchema] pyarrow_unwrap_schema(object schema):
 *     cdef Schema sch
 *     if pyarrow_is_schema(schema):             # <<<<<<<<<<<<<<
 *         sch = <Schema>(schema)
 *         return sch.sp_schema
 */
  __pyx_t_1 = (__pyx_f_7pyarrow_3lib_pyarrow_is_schema(__pyx_v_schema) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":172
 *     cdef Schema sch
 *     if pyarrow_is_schema(schema):
 *         sch = <Schema>(schema)             # <<<<<<<<<<<<<<
 *         return sch.sp_schema
 * 
 */
    __pyx_t_2 = __pyx_v_schema;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v_sch = ((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":173
 *     if pyarrow_is_schema(schema):
 *         sch = <Schema>(schema)
 *         return sch.sp_schema             # <<<<<<<<<<<<<<
 * 
 *     return shared_ptr[CSchema]()
 */
    __pyx_r = __pyx_v_sch->sp_schema;
    goto __pyx_L0;

    /* "pyarrow/public-api.pxi":171
 * cdef api shared_ptr[CSchema] pyarrow_unwrap_schema(object schema):
 *     cdef Schema sch
 *     if pyarrow_is_schema(schema):             # <<<<<<<<<<<<<<
 *         sch = <Schema>(schema)
 *         return sch.sp_schema
 */
  }

  /* "pyarrow/public-api.pxi":175
 *         return sch.sp_schema
 * 
 *     return shared_ptr[CSchema]()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = std::shared_ptr< arrow::Schema> ();
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":169
 * 
 * 
 * cdef api shared_ptr[CSchema] pyarrow_unwrap_schema(object schema):             # <<<<<<<<<<<<<<
 *     cdef Schema sch
 *     if pyarrow_is_schema(schema):
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_sch);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":178
 * 
 * 
 * cdef api object pyarrow_wrap_schema(const shared_ptr[CSchema]& schema):             # <<<<<<<<<<<<<<
 *     cdef Schema out = Schema.__new__(Schema)
 *     out.init_schema(schema)
 */

PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(std::shared_ptr< arrow::Schema>  const &__pyx_v_schema) {
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_wrap_schema", 0);

  /* "pyarrow/public-api.pxi":179
 * 
 * cdef api object pyarrow_wrap_schema(const shared_ptr[CSchema]& schema):
 *     cdef Schema out = Schema.__new__(Schema)             # <<<<<<<<<<<<<<
 *     out.init_schema(schema)
 *     return out
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_Schema(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_Schema), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 179, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/public-api.pxi":180
 * cdef api object pyarrow_wrap_schema(const shared_ptr[CSchema]& schema):
 *     cdef Schema out = Schema.__new__(Schema)
 *     out.init_schema(schema)             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_Schema *)__pyx_v_out->__pyx_vtab)->init_schema(__pyx_v_out, __pyx_v_schema);

  /* "pyarrow/public-api.pxi":181
 *     cdef Schema out = Schema.__new__(Schema)
 *     out.init_schema(schema)
 *     return out             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = ((PyObject *)__pyx_v_out);
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":178
 * 
 * 
 * cdef api object pyarrow_wrap_schema(const shared_ptr[CSchema]& schema):             # <<<<<<<<<<<<<<
 *     cdef Schema out = Schema.__new__(Schema)
 *     out.init_schema(schema)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.pyarrow_wrap_schema", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":184
 * 
 * 
 * cdef api bint pyarrow_is_array(object array):             # <<<<<<<<<<<<<<
 *     return isinstance(array, Array)
 * 
 */

static int __pyx_f_7pyarrow_3lib_pyarrow_is_array(PyObject *__pyx_v_array) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("pyarrow_is_array", 0);

  /* "pyarrow/public-api.pxi":185
 * 
 * cdef api bint pyarrow_is_array(object array):
 *     return isinstance(array, Array)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_array, __pyx_ptype_7pyarrow_3lib_Array); 
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":184
 * 
 * 
 * cdef api bint pyarrow_is_array(object array):             # <<<<<<<<<<<<<<
 *     return isinstance(array, Array)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":188
 * 
 * 
 * cdef api shared_ptr[CArray] pyarrow_unwrap_array(object array):             # <<<<<<<<<<<<<<
 *     cdef Array arr
 *     if pyarrow_is_array(array):
 */

std::shared_ptr< arrow::Array>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_array(PyObject *__pyx_v_array) {
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_arr = 0;
  std::shared_ptr< arrow::Array>  __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_unwrap_array", 0);

  /* "pyarrow/public-api.pxi":190
 * cdef api shared_ptr[CArray] pyarrow_unwrap_array(object array):
 *     cdef Array arr
 *     if pyarrow_is_array(array):             # <<<<<<<<<<<<<<
 *         arr = <Array>(array)
 *         return arr.sp_array
 */
  __pyx_t_1 = (__pyx_f_7pyarrow_3lib_pyarrow_is_array(__pyx_v_array) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":191
 *     cdef Array arr
 *     if pyarrow_is_array(array):
 *         arr = <Array>(array)             # <<<<<<<<<<<<<<
 *         return arr.sp_array
 * 
 */
    __pyx_t_2 = __pyx_v_array;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v_arr = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":192
 *     if pyarrow_is_array(array):
 *         arr = <Array>(array)
 *         return arr.sp_array             # <<<<<<<<<<<<<<
 * 
 *     return shared_ptr[CArray]()
 */
    __pyx_r = __pyx_v_arr->sp_array;
    goto __pyx_L0;

    /* "pyarrow/public-api.pxi":190
 * cdef api shared_ptr[CArray] pyarrow_unwrap_array(object array):
 *     cdef Array arr
 *     if pyarrow_is_array(array):             # <<<<<<<<<<<<<<
 *         arr = <Array>(array)
 *         return arr.sp_array
 */
  }

  /* "pyarrow/public-api.pxi":194
 *         return arr.sp_array
 * 
 *     return shared_ptr[CArray]()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = std::shared_ptr< arrow::Array> ();
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":188
 * 
 * 
 * cdef api shared_ptr[CArray] pyarrow_unwrap_array(object array):             # <<<<<<<<<<<<<<
 *     cdef Array arr
 *     if pyarrow_is_array(array):
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":197
 * 
 * 
 * cdef api object pyarrow_wrap_array(const shared_ptr[CArray]& sp_array):             # <<<<<<<<<<<<<<
 *     if sp_array.get() == NULL:
 *         raise ValueError('Array was NULL')
 */

PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_array(std::shared_ptr< arrow::Array>  const &__pyx_v_sp_array) {
   arrow::DataType *__pyx_v_data_type;
  PyObject *__pyx_v_klass = NULL;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_arr = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_wrap_array", 0);

  /* "pyarrow/public-api.pxi":198
 * 
 * cdef api object pyarrow_wrap_array(const shared_ptr[CArray]& sp_array):
 *     if sp_array.get() == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('Array was NULL')
 * 
 */
  __pyx_t_1 = ((__pyx_v_sp_array.get() == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/public-api.pxi":199
 * cdef api object pyarrow_wrap_array(const shared_ptr[CArray]& sp_array):
 *     if sp_array.get() == NULL:
 *         raise ValueError('Array was NULL')             # <<<<<<<<<<<<<<
 * 
 *     cdef CDataType* data_type = sp_array.get().type().get()
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__273, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 199, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(18, 199, __pyx_L1_error)

    /* "pyarrow/public-api.pxi":198
 * 
 * cdef api object pyarrow_wrap_array(const shared_ptr[CArray]& sp_array):
 *     if sp_array.get() == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('Array was NULL')
 * 
 */
  }

  /* "pyarrow/public-api.pxi":201
 *         raise ValueError('Array was NULL')
 * 
 *     cdef CDataType* data_type = sp_array.get().type().get()             # <<<<<<<<<<<<<<
 * 
 *     if data_type == NULL:
 */
  __pyx_v_data_type = __pyx_v_sp_array.get()->type().get();

  /* "pyarrow/public-api.pxi":203
 *     cdef CDataType* data_type = sp_array.get().type().get()
 * 
 *     if data_type == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('Array data type was NULL')
 * 
 */
  __pyx_t_1 = ((__pyx_v_data_type == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/public-api.pxi":204
 * 
 *     if data_type == NULL:
 *         raise ValueError('Array data type was NULL')             # <<<<<<<<<<<<<<
 * 
 *     klass = _array_classes[data_type.id()]
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__274, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 204, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(18, 204, __pyx_L1_error)

    /* "pyarrow/public-api.pxi":203
 *     cdef CDataType* data_type = sp_array.get().type().get()
 * 
 *     if data_type == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('Array data type was NULL')
 * 
 */
  }

  /* "pyarrow/public-api.pxi":206
 *         raise ValueError('Array data type was NULL')
 * 
 *     klass = _array_classes[data_type.id()]             # <<<<<<<<<<<<<<
 * 
 *     cdef Array arr = klass.__new__(klass)
 */
  if (unlikely(__pyx_v_7pyarrow_3lib__array_classes == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(18, 206, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type(__pyx_v_data_type->id()); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_7pyarrow_3lib__array_classes, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_klass = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyarrow/public-api.pxi":208
 *     klass = _array_classes[data_type.id()]
 * 
 *     cdef Array arr = klass.__new__(klass)             # <<<<<<<<<<<<<<
 *     arr.init(sp_array)
 *     return arr
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_klass, __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v_klass) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_klass);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(18, 208, __pyx_L1_error)
  __pyx_v_arr = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyarrow/public-api.pxi":209
 * 
 *     cdef Array arr = klass.__new__(klass)
 *     arr.init(sp_array)             # <<<<<<<<<<<<<<
 *     return arr
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_Array *)__pyx_v_arr->__pyx_vtab)->init(__pyx_v_arr, __pyx_v_sp_array); if (unlikely(PyErr_Occurred())) __PYX_ERR(18, 209, __pyx_L1_error)

  /* "pyarrow/public-api.pxi":210
 *     cdef Array arr = klass.__new__(klass)
 *     arr.init(sp_array)
 *     return arr             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_arr));
  __pyx_r = ((PyObject *)__pyx_v_arr);
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":197
 * 
 * 
 * cdef api object pyarrow_wrap_array(const shared_ptr[CArray]& sp_array):             # <<<<<<<<<<<<<<
 *     if sp_array.get() == NULL:
 *         raise ValueError('Array was NULL')
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.pyarrow_wrap_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_klass);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":213
 * 
 * 
 * cdef api object pyarrow_wrap_chunked_array(             # <<<<<<<<<<<<<<
 *         const shared_ptr[CChunkedArray]& sp_array):
 *     if sp_array.get() == NULL:
 */

PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_chunked_array(std::shared_ptr< arrow::ChunkedArray>  const &__pyx_v_sp_array) {
   arrow::DataType *__pyx_v_data_type;
  struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_arr = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_wrap_chunked_array", 0);

  /* "pyarrow/public-api.pxi":215
 * cdef api object pyarrow_wrap_chunked_array(
 *         const shared_ptr[CChunkedArray]& sp_array):
 *     if sp_array.get() == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('ChunkedArray was NULL')
 * 
 */
  __pyx_t_1 = ((__pyx_v_sp_array.get() == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/public-api.pxi":216
 *         const shared_ptr[CChunkedArray]& sp_array):
 *     if sp_array.get() == NULL:
 *         raise ValueError('ChunkedArray was NULL')             # <<<<<<<<<<<<<<
 * 
 *     cdef CDataType* data_type = sp_array.get().type().get()
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__275, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 216, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(18, 216, __pyx_L1_error)

    /* "pyarrow/public-api.pxi":215
 * cdef api object pyarrow_wrap_chunked_array(
 *         const shared_ptr[CChunkedArray]& sp_array):
 *     if sp_array.get() == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('ChunkedArray was NULL')
 * 
 */
  }

  /* "pyarrow/public-api.pxi":218
 *         raise ValueError('ChunkedArray was NULL')
 * 
 *     cdef CDataType* data_type = sp_array.get().type().get()             # <<<<<<<<<<<<<<
 * 
 *     if data_type == NULL:
 */
  __pyx_v_data_type = __pyx_v_sp_array.get()->type().get();

  /* "pyarrow/public-api.pxi":220
 *     cdef CDataType* data_type = sp_array.get().type().get()
 * 
 *     if data_type == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('ChunkedArray data type was NULL')
 * 
 */
  __pyx_t_1 = ((__pyx_v_data_type == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/public-api.pxi":221
 * 
 *     if data_type == NULL:
 *         raise ValueError('ChunkedArray data type was NULL')             # <<<<<<<<<<<<<<
 * 
 *     cdef ChunkedArray arr = ChunkedArray.__new__(ChunkedArray)
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__276, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 221, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(18, 221, __pyx_L1_error)

    /* "pyarrow/public-api.pxi":220
 *     cdef CDataType* data_type = sp_array.get().type().get()
 * 
 *     if data_type == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('ChunkedArray data type was NULL')
 * 
 */
  }

  /* "pyarrow/public-api.pxi":223
 *         raise ValueError('ChunkedArray data type was NULL')
 * 
 *     cdef ChunkedArray arr = ChunkedArray.__new__(ChunkedArray)             # <<<<<<<<<<<<<<
 *     arr.init(sp_array)
 *     return arr
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_ChunkedArray(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_ChunkedArray), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 223, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v_arr = ((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/public-api.pxi":224
 * 
 *     cdef ChunkedArray arr = ChunkedArray.__new__(ChunkedArray)
 *     arr.init(sp_array)             # <<<<<<<<<<<<<<
 *     return arr
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_ChunkedArray *)__pyx_v_arr->__pyx_vtab)->init(__pyx_v_arr, __pyx_v_sp_array);

  /* "pyarrow/public-api.pxi":225
 *     cdef ChunkedArray arr = ChunkedArray.__new__(ChunkedArray)
 *     arr.init(sp_array)
 *     return arr             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_arr));
  __pyx_r = ((PyObject *)__pyx_v_arr);
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":213
 * 
 * 
 * cdef api object pyarrow_wrap_chunked_array(             # <<<<<<<<<<<<<<
 *         const shared_ptr[CChunkedArray]& sp_array):
 *     if sp_array.get() == NULL:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.pyarrow_wrap_chunked_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":228
 * 
 * 
 * cdef api bint pyarrow_is_scalar(object value):             # <<<<<<<<<<<<<<
 *     return isinstance(value, ScalarValue)
 * 
 */

static int __pyx_f_7pyarrow_3lib_pyarrow_is_scalar(PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("pyarrow_is_scalar", 0);

  /* "pyarrow/public-api.pxi":229
 * 
 * cdef api bint pyarrow_is_scalar(object value):
 *     return isinstance(value, ScalarValue)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_value, __pyx_ptype_7pyarrow_3lib_ScalarValue); 
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":228
 * 
 * 
 * cdef api bint pyarrow_is_scalar(object value):             # <<<<<<<<<<<<<<
 *     return isinstance(value, ScalarValue)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":232
 * 
 * 
 * cdef api shared_ptr[CScalar] pyarrow_unwrap_scalar(object scalar):             # <<<<<<<<<<<<<<
 *     cdef ScalarValue value
 *     if pyarrow_is_scalar(scalar):
 */

std::shared_ptr< arrow::Scalar>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_scalar(PyObject *__pyx_v_scalar) {
  struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_value = 0;
  std::shared_ptr< arrow::Scalar>  __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_unwrap_scalar", 0);

  /* "pyarrow/public-api.pxi":234
 * cdef api shared_ptr[CScalar] pyarrow_unwrap_scalar(object scalar):
 *     cdef ScalarValue value
 *     if pyarrow_is_scalar(scalar):             # <<<<<<<<<<<<<<
 *         value = <ScalarValue>(scalar)
 *         return value.sp_scalar
 */
  __pyx_t_1 = (__pyx_f_7pyarrow_3lib_pyarrow_is_scalar(__pyx_v_scalar) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":235
 *     cdef ScalarValue value
 *     if pyarrow_is_scalar(scalar):
 *         value = <ScalarValue>(scalar)             # <<<<<<<<<<<<<<
 *         return value.sp_scalar
 * 
 */
    __pyx_t_2 = __pyx_v_scalar;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v_value = ((struct __pyx_obj_7pyarrow_3lib_ScalarValue *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":236
 *     if pyarrow_is_scalar(scalar):
 *         value = <ScalarValue>(scalar)
 *         return value.sp_scalar             # <<<<<<<<<<<<<<
 * 
 *     return shared_ptr[CScalar]()
 */
    __pyx_r = __pyx_v_value->sp_scalar;
    goto __pyx_L0;

    /* "pyarrow/public-api.pxi":234
 * cdef api shared_ptr[CScalar] pyarrow_unwrap_scalar(object scalar):
 *     cdef ScalarValue value
 *     if pyarrow_is_scalar(scalar):             # <<<<<<<<<<<<<<
 *         value = <ScalarValue>(scalar)
 *         return value.sp_scalar
 */
  }

  /* "pyarrow/public-api.pxi":238
 *         return value.sp_scalar
 * 
 *     return shared_ptr[CScalar]()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = std::shared_ptr< arrow::Scalar> ();
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":232
 * 
 * 
 * cdef api shared_ptr[CScalar] pyarrow_unwrap_scalar(object scalar):             # <<<<<<<<<<<<<<
 *     cdef ScalarValue value
 *     if pyarrow_is_scalar(scalar):
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_value);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":241
 * 
 * 
 * cdef api object pyarrow_wrap_scalar(const shared_ptr[CScalar]& sp_scalar):             # <<<<<<<<<<<<<<
 *     if sp_scalar.get() == NULL:
 *         raise ValueError('Scalar was NULL')
 */

PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_scalar(std::shared_ptr< arrow::Scalar>  const &__pyx_v_sp_scalar) {
   arrow::DataType *__pyx_v_data_type;
  PyObject *__pyx_v_klass = NULL;
  struct __pyx_obj_7pyarrow_3lib_ScalarValue *__pyx_v_scalar = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_wrap_scalar", 0);

  /* "pyarrow/public-api.pxi":242
 * 
 * cdef api object pyarrow_wrap_scalar(const shared_ptr[CScalar]& sp_scalar):
 *     if sp_scalar.get() == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('Scalar was NULL')
 * 
 */
  __pyx_t_1 = ((__pyx_v_sp_scalar.get() == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/public-api.pxi":243
 * cdef api object pyarrow_wrap_scalar(const shared_ptr[CScalar]& sp_scalar):
 *     if sp_scalar.get() == NULL:
 *         raise ValueError('Scalar was NULL')             # <<<<<<<<<<<<<<
 * 
 *     cdef CDataType* data_type = sp_scalar.get().type.get()
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__277, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 243, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(18, 243, __pyx_L1_error)

    /* "pyarrow/public-api.pxi":242
 * 
 * cdef api object pyarrow_wrap_scalar(const shared_ptr[CScalar]& sp_scalar):
 *     if sp_scalar.get() == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('Scalar was NULL')
 * 
 */
  }

  /* "pyarrow/public-api.pxi":245
 *         raise ValueError('Scalar was NULL')
 * 
 *     cdef CDataType* data_type = sp_scalar.get().type.get()             # <<<<<<<<<<<<<<
 * 
 *     if data_type == NULL:
 */
  __pyx_v_data_type = __pyx_v_sp_scalar.get()->type.get();

  /* "pyarrow/public-api.pxi":247
 *     cdef CDataType* data_type = sp_scalar.get().type.get()
 * 
 *     if data_type == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('Scalar data type was NULL')
 * 
 */
  __pyx_t_1 = ((__pyx_v_data_type == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/public-api.pxi":248
 * 
 *     if data_type == NULL:
 *         raise ValueError('Scalar data type was NULL')             # <<<<<<<<<<<<<<
 * 
 *     klass = _scalar_classes[data_type.id()]
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__278, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 248, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(18, 248, __pyx_L1_error)

    /* "pyarrow/public-api.pxi":247
 *     cdef CDataType* data_type = sp_scalar.get().type.get()
 * 
 *     if data_type == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('Scalar data type was NULL')
 * 
 */
  }

  /* "pyarrow/public-api.pxi":250
 *         raise ValueError('Scalar data type was NULL')
 * 
 *     klass = _scalar_classes[data_type.id()]             # <<<<<<<<<<<<<<
 * 
 *     cdef ScalarValue scalar = klass.__new__(klass)
 */
  if (unlikely(__pyx_v_7pyarrow_3lib__scalar_classes == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(18, 250, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type(__pyx_v_data_type->id()); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_7pyarrow_3lib__scalar_classes, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_klass = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyarrow/public-api.pxi":252
 *     klass = _scalar_classes[data_type.id()]
 * 
 *     cdef ScalarValue scalar = klass.__new__(klass)             # <<<<<<<<<<<<<<
 *     scalar.init(sp_scalar)
 *     return scalar
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_klass, __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v_klass) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_klass);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_ScalarValue))))) __PYX_ERR(18, 252, __pyx_L1_error)
  __pyx_v_scalar = ((struct __pyx_obj_7pyarrow_3lib_ScalarValue *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyarrow/public-api.pxi":253
 * 
 *     cdef ScalarValue scalar = klass.__new__(klass)
 *     scalar.init(sp_scalar)             # <<<<<<<<<<<<<<
 *     return scalar
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue *)__pyx_v_scalar->__pyx_vtab)->init(__pyx_v_scalar, __pyx_v_sp_scalar);

  /* "pyarrow/public-api.pxi":254
 *     cdef ScalarValue scalar = klass.__new__(klass)
 *     scalar.init(sp_scalar)
 *     return scalar             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_scalar));
  __pyx_r = ((PyObject *)__pyx_v_scalar);
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":241
 * 
 * 
 * cdef api object pyarrow_wrap_scalar(const shared_ptr[CScalar]& sp_scalar):             # <<<<<<<<<<<<<<
 *     if sp_scalar.get() == NULL:
 *         raise ValueError('Scalar was NULL')
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow.lib.pyarrow_wrap_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_klass);
  __Pyx_XDECREF((PyObject *)__pyx_v_scalar);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":257
 * 
 * 
 * cdef api bint pyarrow_is_tensor(object tensor):             # <<<<<<<<<<<<<<
 *     return isinstance(tensor, Tensor)
 * 
 */

static int __pyx_f_7pyarrow_3lib_pyarrow_is_tensor(PyObject *__pyx_v_tensor) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("pyarrow_is_tensor", 0);

  /* "pyarrow/public-api.pxi":258
 * 
 * cdef api bint pyarrow_is_tensor(object tensor):
 *     return isinstance(tensor, Tensor)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_tensor, __pyx_ptype_7pyarrow_3lib_Tensor); 
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":257
 * 
 * 
 * cdef api bint pyarrow_is_tensor(object tensor):             # <<<<<<<<<<<<<<
 *     return isinstance(tensor, Tensor)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":261
 * 
 * 
 * cdef api shared_ptr[CTensor] pyarrow_unwrap_tensor(object tensor):             # <<<<<<<<<<<<<<
 *     cdef Tensor ten
 *     if pyarrow_is_tensor(tensor):
 */

std::shared_ptr< arrow::Tensor>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_tensor(PyObject *__pyx_v_tensor) {
  struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_ten = 0;
  std::shared_ptr< arrow::Tensor>  __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_unwrap_tensor", 0);

  /* "pyarrow/public-api.pxi":263
 * cdef api shared_ptr[CTensor] pyarrow_unwrap_tensor(object tensor):
 *     cdef Tensor ten
 *     if pyarrow_is_tensor(tensor):             # <<<<<<<<<<<<<<
 *         ten = <Tensor>(tensor)
 *         return ten.sp_tensor
 */
  __pyx_t_1 = (__pyx_f_7pyarrow_3lib_pyarrow_is_tensor(__pyx_v_tensor) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":264
 *     cdef Tensor ten
 *     if pyarrow_is_tensor(tensor):
 *         ten = <Tensor>(tensor)             # <<<<<<<<<<<<<<
 *         return ten.sp_tensor
 * 
 */
    __pyx_t_2 = __pyx_v_tensor;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v_ten = ((struct __pyx_obj_7pyarrow_3lib_Tensor *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":265
 *     if pyarrow_is_tensor(tensor):
 *         ten = <Tensor>(tensor)
 *         return ten.sp_tensor             # <<<<<<<<<<<<<<
 * 
 *     return shared_ptr[CTensor]()
 */
    __pyx_r = __pyx_v_ten->sp_tensor;
    goto __pyx_L0;

    /* "pyarrow/public-api.pxi":263
 * cdef api shared_ptr[CTensor] pyarrow_unwrap_tensor(object tensor):
 *     cdef Tensor ten
 *     if pyarrow_is_tensor(tensor):             # <<<<<<<<<<<<<<
 *         ten = <Tensor>(tensor)
 *         return ten.sp_tensor
 */
  }

  /* "pyarrow/public-api.pxi":267
 *         return ten.sp_tensor
 * 
 *     return shared_ptr[CTensor]()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = std::shared_ptr< arrow::Tensor> ();
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":261
 * 
 * 
 * cdef api shared_ptr[CTensor] pyarrow_unwrap_tensor(object tensor):             # <<<<<<<<<<<<<<
 *     cdef Tensor ten
 *     if pyarrow_is_tensor(tensor):
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_ten);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":270
 * 
 * 
 * cdef api object pyarrow_wrap_tensor(             # <<<<<<<<<<<<<<
 *         const shared_ptr[CTensor]& sp_tensor):
 *     if sp_tensor.get() == NULL:
 */

PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_tensor(std::shared_ptr< arrow::Tensor>  const &__pyx_v_sp_tensor) {
  struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_tensor = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_wrap_tensor", 0);

  /* "pyarrow/public-api.pxi":272
 * cdef api object pyarrow_wrap_tensor(
 *         const shared_ptr[CTensor]& sp_tensor):
 *     if sp_tensor.get() == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('Tensor was NULL')
 * 
 */
  __pyx_t_1 = ((__pyx_v_sp_tensor.get() == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/public-api.pxi":273
 *         const shared_ptr[CTensor]& sp_tensor):
 *     if sp_tensor.get() == NULL:
 *         raise ValueError('Tensor was NULL')             # <<<<<<<<<<<<<<
 * 
 *     cdef Tensor tensor = Tensor.__new__(Tensor)
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__279, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 273, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(18, 273, __pyx_L1_error)

    /* "pyarrow/public-api.pxi":272
 * cdef api object pyarrow_wrap_tensor(
 *         const shared_ptr[CTensor]& sp_tensor):
 *     if sp_tensor.get() == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('Tensor was NULL')
 * 
 */
  }

  /* "pyarrow/public-api.pxi":275
 *         raise ValueError('Tensor was NULL')
 * 
 *     cdef Tensor tensor = Tensor.__new__(Tensor)             # <<<<<<<<<<<<<<
 *     tensor.init(sp_tensor)
 *     return tensor
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_Tensor(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_Tensor), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 275, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v_tensor = ((struct __pyx_obj_7pyarrow_3lib_Tensor *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/public-api.pxi":276
 * 
 *     cdef Tensor tensor = Tensor.__new__(Tensor)
 *     tensor.init(sp_tensor)             # <<<<<<<<<<<<<<
 *     return tensor
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_Tensor *)__pyx_v_tensor->__pyx_vtab)->init(__pyx_v_tensor, __pyx_v_sp_tensor);

  /* "pyarrow/public-api.pxi":277
 *     cdef Tensor tensor = Tensor.__new__(Tensor)
 *     tensor.init(sp_tensor)
 *     return tensor             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_tensor));
  __pyx_r = ((PyObject *)__pyx_v_tensor);
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":270
 * 
 * 
 * cdef api object pyarrow_wrap_tensor(             # <<<<<<<<<<<<<<
 *         const shared_ptr[CTensor]& sp_tensor):
 *     if sp_tensor.get() == NULL:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.pyarrow_wrap_tensor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_tensor);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":280
 * 
 * 
 * cdef api bint pyarrow_is_sparse_coo_tensor(object sparse_tensor):             # <<<<<<<<<<<<<<
 *     return isinstance(sparse_tensor, SparseCOOTensor)
 * 
 */

static int __pyx_f_7pyarrow_3lib_pyarrow_is_sparse_coo_tensor(PyObject *__pyx_v_sparse_tensor) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("pyarrow_is_sparse_coo_tensor", 0);

  /* "pyarrow/public-api.pxi":281
 * 
 * cdef api bint pyarrow_is_sparse_coo_tensor(object sparse_tensor):
 *     return isinstance(sparse_tensor, SparseCOOTensor)             # <<<<<<<<<<<<<<
 * 
 * cdef api shared_ptr[CSparseCOOTensor] pyarrow_unwrap_sparse_coo_tensor(
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_sparse_tensor, __pyx_ptype_7pyarrow_3lib_SparseCOOTensor); 
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":280
 * 
 * 
 * cdef api bint pyarrow_is_sparse_coo_tensor(object sparse_tensor):             # <<<<<<<<<<<<<<
 *     return isinstance(sparse_tensor, SparseCOOTensor)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":283
 *     return isinstance(sparse_tensor, SparseCOOTensor)
 * 
 * cdef api shared_ptr[CSparseCOOTensor] pyarrow_unwrap_sparse_coo_tensor(             # <<<<<<<<<<<<<<
 *         object sparse_tensor):
 *     cdef SparseCOOTensor sten
 */

std::shared_ptr< arrow::SparseCOOTensor>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_sparse_coo_tensor(PyObject *__pyx_v_sparse_tensor) {
  struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *__pyx_v_sten = 0;
  std::shared_ptr< arrow::SparseCOOTensor>  __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_unwrap_sparse_coo_tensor", 0);

  /* "pyarrow/public-api.pxi":286
 *         object sparse_tensor):
 *     cdef SparseCOOTensor sten
 *     if pyarrow_is_sparse_coo_tensor(sparse_tensor):             # <<<<<<<<<<<<<<
 *         sten = <SparseCOOTensor>(sparse_tensor)
 *         return sten.sp_sparse_tensor
 */
  __pyx_t_1 = (__pyx_f_7pyarrow_3lib_pyarrow_is_sparse_coo_tensor(__pyx_v_sparse_tensor) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":287
 *     cdef SparseCOOTensor sten
 *     if pyarrow_is_sparse_coo_tensor(sparse_tensor):
 *         sten = <SparseCOOTensor>(sparse_tensor)             # <<<<<<<<<<<<<<
 *         return sten.sp_sparse_tensor
 * 
 */
    __pyx_t_2 = __pyx_v_sparse_tensor;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v_sten = ((struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":288
 *     if pyarrow_is_sparse_coo_tensor(sparse_tensor):
 *         sten = <SparseCOOTensor>(sparse_tensor)
 *         return sten.sp_sparse_tensor             # <<<<<<<<<<<<<<
 * 
 *     return shared_ptr[CSparseCOOTensor]()
 */
    __pyx_r = __pyx_v_sten->sp_sparse_tensor;
    goto __pyx_L0;

    /* "pyarrow/public-api.pxi":286
 *         object sparse_tensor):
 *     cdef SparseCOOTensor sten
 *     if pyarrow_is_sparse_coo_tensor(sparse_tensor):             # <<<<<<<<<<<<<<
 *         sten = <SparseCOOTensor>(sparse_tensor)
 *         return sten.sp_sparse_tensor
 */
  }

  /* "pyarrow/public-api.pxi":290
 *         return sten.sp_sparse_tensor
 * 
 *     return shared_ptr[CSparseCOOTensor]()             # <<<<<<<<<<<<<<
 * 
 * cdef api object pyarrow_wrap_sparse_coo_tensor(
 */
  __pyx_r = std::shared_ptr< arrow::SparseCOOTensor> ();
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":283
 *     return isinstance(sparse_tensor, SparseCOOTensor)
 * 
 * cdef api shared_ptr[CSparseCOOTensor] pyarrow_unwrap_sparse_coo_tensor(             # <<<<<<<<<<<<<<
 *         object sparse_tensor):
 *     cdef SparseCOOTensor sten
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_sten);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":292
 *     return shared_ptr[CSparseCOOTensor]()
 * 
 * cdef api object pyarrow_wrap_sparse_coo_tensor(             # <<<<<<<<<<<<<<
 *         const shared_ptr[CSparseCOOTensor]& sp_sparse_tensor):
 *     if sp_sparse_tensor.get() == NULL:
 */

PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_sparse_coo_tensor(std::shared_ptr< arrow::SparseCOOTensor>  const &__pyx_v_sp_sparse_tensor) {
  struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *__pyx_v_sparse_tensor = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_wrap_sparse_coo_tensor", 0);

  /* "pyarrow/public-api.pxi":294
 * cdef api object pyarrow_wrap_sparse_coo_tensor(
 *         const shared_ptr[CSparseCOOTensor]& sp_sparse_tensor):
 *     if sp_sparse_tensor.get() == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('SparseCOOTensor was NULL')
 * 
 */
  __pyx_t_1 = ((__pyx_v_sp_sparse_tensor.get() == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/public-api.pxi":295
 *         const shared_ptr[CSparseCOOTensor]& sp_sparse_tensor):
 *     if sp_sparse_tensor.get() == NULL:
 *         raise ValueError('SparseCOOTensor was NULL')             # <<<<<<<<<<<<<<
 * 
 *     cdef SparseCOOTensor sparse_tensor = SparseCOOTensor.__new__(
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__280, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 295, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(18, 295, __pyx_L1_error)

    /* "pyarrow/public-api.pxi":294
 * cdef api object pyarrow_wrap_sparse_coo_tensor(
 *         const shared_ptr[CSparseCOOTensor]& sp_sparse_tensor):
 *     if sp_sparse_tensor.get() == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('SparseCOOTensor was NULL')
 * 
 */
  }

  /* "pyarrow/public-api.pxi":297
 *         raise ValueError('SparseCOOTensor was NULL')
 * 
 *     cdef SparseCOOTensor sparse_tensor = SparseCOOTensor.__new__(             # <<<<<<<<<<<<<<
 *         SparseCOOTensor)
 *     sparse_tensor.init(sp_sparse_tensor)
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_SparseCOOTensor(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_SparseCOOTensor), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 297, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v_sparse_tensor = ((struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/public-api.pxi":299
 *     cdef SparseCOOTensor sparse_tensor = SparseCOOTensor.__new__(
 *         SparseCOOTensor)
 *     sparse_tensor.init(sp_sparse_tensor)             # <<<<<<<<<<<<<<
 *     return sparse_tensor
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_SparseCOOTensor *)__pyx_v_sparse_tensor->__pyx_vtab)->init(__pyx_v_sparse_tensor, __pyx_v_sp_sparse_tensor);

  /* "pyarrow/public-api.pxi":300
 *         SparseCOOTensor)
 *     sparse_tensor.init(sp_sparse_tensor)
 *     return sparse_tensor             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_sparse_tensor));
  __pyx_r = ((PyObject *)__pyx_v_sparse_tensor);
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":292
 *     return shared_ptr[CSparseCOOTensor]()
 * 
 * cdef api object pyarrow_wrap_sparse_coo_tensor(             # <<<<<<<<<<<<<<
 *         const shared_ptr[CSparseCOOTensor]& sp_sparse_tensor):
 *     if sp_sparse_tensor.get() == NULL:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.pyarrow_wrap_sparse_coo_tensor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_sparse_tensor);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":303
 * 
 * 
 * cdef api bint pyarrow_is_sparse_csr_matrix(object sparse_tensor):             # <<<<<<<<<<<<<<
 *     return isinstance(sparse_tensor, SparseCSRMatrix)
 * 
 */

static int __pyx_f_7pyarrow_3lib_pyarrow_is_sparse_csr_matrix(PyObject *__pyx_v_sparse_tensor) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("pyarrow_is_sparse_csr_matrix", 0);

  /* "pyarrow/public-api.pxi":304
 * 
 * cdef api bint pyarrow_is_sparse_csr_matrix(object sparse_tensor):
 *     return isinstance(sparse_tensor, SparseCSRMatrix)             # <<<<<<<<<<<<<<
 * 
 * cdef api shared_ptr[CSparseCSRMatrix] pyarrow_unwrap_sparse_csr_matrix(
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_sparse_tensor, __pyx_ptype_7pyarrow_3lib_SparseCSRMatrix); 
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":303
 * 
 * 
 * cdef api bint pyarrow_is_sparse_csr_matrix(object sparse_tensor):             # <<<<<<<<<<<<<<
 *     return isinstance(sparse_tensor, SparseCSRMatrix)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":306
 *     return isinstance(sparse_tensor, SparseCSRMatrix)
 * 
 * cdef api shared_ptr[CSparseCSRMatrix] pyarrow_unwrap_sparse_csr_matrix(             # <<<<<<<<<<<<<<
 *         object sparse_tensor):
 *     cdef SparseCSRMatrix sten
 */

std::shared_ptr< arrow::SparseCSRMatrix>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_sparse_csr_matrix(PyObject *__pyx_v_sparse_tensor) {
  struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *__pyx_v_sten = 0;
  std::shared_ptr< arrow::SparseCSRMatrix>  __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_unwrap_sparse_csr_matrix", 0);

  /* "pyarrow/public-api.pxi":309
 *         object sparse_tensor):
 *     cdef SparseCSRMatrix sten
 *     if pyarrow_is_sparse_csr_matrix(sparse_tensor):             # <<<<<<<<<<<<<<
 *         sten = <SparseCSRMatrix>(sparse_tensor)
 *         return sten.sp_sparse_tensor
 */
  __pyx_t_1 = (__pyx_f_7pyarrow_3lib_pyarrow_is_sparse_csr_matrix(__pyx_v_sparse_tensor) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":310
 *     cdef SparseCSRMatrix sten
 *     if pyarrow_is_sparse_csr_matrix(sparse_tensor):
 *         sten = <SparseCSRMatrix>(sparse_tensor)             # <<<<<<<<<<<<<<
 *         return sten.sp_sparse_tensor
 * 
 */
    __pyx_t_2 = __pyx_v_sparse_tensor;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v_sten = ((struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":311
 *     if pyarrow_is_sparse_csr_matrix(sparse_tensor):
 *         sten = <SparseCSRMatrix>(sparse_tensor)
 *         return sten.sp_sparse_tensor             # <<<<<<<<<<<<<<
 * 
 *     return shared_ptr[CSparseCSRMatrix]()
 */
    __pyx_r = __pyx_v_sten->sp_sparse_tensor;
    goto __pyx_L0;

    /* "pyarrow/public-api.pxi":309
 *         object sparse_tensor):
 *     cdef SparseCSRMatrix sten
 *     if pyarrow_is_sparse_csr_matrix(sparse_tensor):             # <<<<<<<<<<<<<<
 *         sten = <SparseCSRMatrix>(sparse_tensor)
 *         return sten.sp_sparse_tensor
 */
  }

  /* "pyarrow/public-api.pxi":313
 *         return sten.sp_sparse_tensor
 * 
 *     return shared_ptr[CSparseCSRMatrix]()             # <<<<<<<<<<<<<<
 * 
 * cdef api object pyarrow_wrap_sparse_csr_matrix(
 */
  __pyx_r = std::shared_ptr< arrow::SparseCSRMatrix> ();
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":306
 *     return isinstance(sparse_tensor, SparseCSRMatrix)
 * 
 * cdef api shared_ptr[CSparseCSRMatrix] pyarrow_unwrap_sparse_csr_matrix(             # <<<<<<<<<<<<<<
 *         object sparse_tensor):
 *     cdef SparseCSRMatrix sten
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_sten);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":315
 *     return shared_ptr[CSparseCSRMatrix]()
 * 
 * cdef api object pyarrow_wrap_sparse_csr_matrix(             # <<<<<<<<<<<<<<
 *         const shared_ptr[CSparseCSRMatrix]& sp_sparse_tensor):
 *     if sp_sparse_tensor.get() == NULL:
 */

PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_sparse_csr_matrix(std::shared_ptr< arrow::SparseCSRMatrix>  const &__pyx_v_sp_sparse_tensor) {
  struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *__pyx_v_sparse_tensor = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_wrap_sparse_csr_matrix", 0);

  /* "pyarrow/public-api.pxi":317
 * cdef api object pyarrow_wrap_sparse_csr_matrix(
 *         const shared_ptr[CSparseCSRMatrix]& sp_sparse_tensor):
 *     if sp_sparse_tensor.get() == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('SparseCSRMatrix was NULL')
 * 
 */
  __pyx_t_1 = ((__pyx_v_sp_sparse_tensor.get() == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/public-api.pxi":318
 *         const shared_ptr[CSparseCSRMatrix]& sp_sparse_tensor):
 *     if sp_sparse_tensor.get() == NULL:
 *         raise ValueError('SparseCSRMatrix was NULL')             # <<<<<<<<<<<<<<
 * 
 *     cdef SparseCSRMatrix sparse_tensor = SparseCSRMatrix.__new__(
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__281, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(18, 318, __pyx_L1_error)

    /* "pyarrow/public-api.pxi":317
 * cdef api object pyarrow_wrap_sparse_csr_matrix(
 *         const shared_ptr[CSparseCSRMatrix]& sp_sparse_tensor):
 *     if sp_sparse_tensor.get() == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('SparseCSRMatrix was NULL')
 * 
 */
  }

  /* "pyarrow/public-api.pxi":320
 *         raise ValueError('SparseCSRMatrix was NULL')
 * 
 *     cdef SparseCSRMatrix sparse_tensor = SparseCSRMatrix.__new__(             # <<<<<<<<<<<<<<
 *         SparseCSRMatrix)
 *     sparse_tensor.init(sp_sparse_tensor)
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_SparseCSRMatrix(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_SparseCSRMatrix), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 320, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v_sparse_tensor = ((struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/public-api.pxi":322
 *     cdef SparseCSRMatrix sparse_tensor = SparseCSRMatrix.__new__(
 *         SparseCSRMatrix)
 *     sparse_tensor.init(sp_sparse_tensor)             # <<<<<<<<<<<<<<
 *     return sparse_tensor
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_SparseCSRMatrix *)__pyx_v_sparse_tensor->__pyx_vtab)->init(__pyx_v_sparse_tensor, __pyx_v_sp_sparse_tensor);

  /* "pyarrow/public-api.pxi":323
 *         SparseCSRMatrix)
 *     sparse_tensor.init(sp_sparse_tensor)
 *     return sparse_tensor             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_sparse_tensor));
  __pyx_r = ((PyObject *)__pyx_v_sparse_tensor);
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":315
 *     return shared_ptr[CSparseCSRMatrix]()
 * 
 * cdef api object pyarrow_wrap_sparse_csr_matrix(             # <<<<<<<<<<<<<<
 *         const shared_ptr[CSparseCSRMatrix]& sp_sparse_tensor):
 *     if sp_sparse_tensor.get() == NULL:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.pyarrow_wrap_sparse_csr_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_sparse_tensor);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":326
 * 
 * 
 * cdef api bint pyarrow_is_table(object table):             # <<<<<<<<<<<<<<
 *     return isinstance(table, Table)
 * 
 */

static int __pyx_f_7pyarrow_3lib_pyarrow_is_table(PyObject *__pyx_v_table) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("pyarrow_is_table", 0);

  /* "pyarrow/public-api.pxi":327
 * 
 * cdef api bint pyarrow_is_table(object table):
 *     return isinstance(table, Table)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_table, __pyx_ptype_7pyarrow_3lib_Table); 
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":326
 * 
 * 
 * cdef api bint pyarrow_is_table(object table):             # <<<<<<<<<<<<<<
 *     return isinstance(table, Table)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":330
 * 
 * 
 * cdef api shared_ptr[CTable] pyarrow_unwrap_table(object table):             # <<<<<<<<<<<<<<
 *     cdef Table tab
 *     if pyarrow_is_table(table):
 */

std::shared_ptr< arrow::Table>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_table(PyObject *__pyx_v_table) {
  struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_tab = 0;
  std::shared_ptr< arrow::Table>  __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_unwrap_table", 0);

  /* "pyarrow/public-api.pxi":332
 * cdef api shared_ptr[CTable] pyarrow_unwrap_table(object table):
 *     cdef Table tab
 *     if pyarrow_is_table(table):             # <<<<<<<<<<<<<<
 *         tab = <Table>(table)
 *         return tab.sp_table
 */
  __pyx_t_1 = (__pyx_f_7pyarrow_3lib_pyarrow_is_table(__pyx_v_table) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":333
 *     cdef Table tab
 *     if pyarrow_is_table(table):
 *         tab = <Table>(table)             # <<<<<<<<<<<<<<
 *         return tab.sp_table
 * 
 */
    __pyx_t_2 = __pyx_v_table;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v_tab = ((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":334
 *     if pyarrow_is_table(table):
 *         tab = <Table>(table)
 *         return tab.sp_table             # <<<<<<<<<<<<<<
 * 
 *     return shared_ptr[CTable]()
 */
    __pyx_r = __pyx_v_tab->sp_table;
    goto __pyx_L0;

    /* "pyarrow/public-api.pxi":332
 * cdef api shared_ptr[CTable] pyarrow_unwrap_table(object table):
 *     cdef Table tab
 *     if pyarrow_is_table(table):             # <<<<<<<<<<<<<<
 *         tab = <Table>(table)
 *         return tab.sp_table
 */
  }

  /* "pyarrow/public-api.pxi":336
 *         return tab.sp_table
 * 
 *     return shared_ptr[CTable]()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = std::shared_ptr< arrow::Table> ();
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":330
 * 
 * 
 * cdef api shared_ptr[CTable] pyarrow_unwrap_table(object table):             # <<<<<<<<<<<<<<
 *     cdef Table tab
 *     if pyarrow_is_table(table):
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_tab);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":339
 * 
 * 
 * cdef api object pyarrow_wrap_table(const shared_ptr[CTable]& ctable):             # <<<<<<<<<<<<<<
 *     # Ensure that wrapped table is Valid
 *     check_status(ctable.get().Validate())
 */

PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_table(std::shared_ptr< arrow::Table>  const &__pyx_v_ctable) {
  struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_table = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_wrap_table", 0);

  /* "pyarrow/public-api.pxi":341
 * cdef api object pyarrow_wrap_table(const shared_ptr[CTable]& ctable):
 *     # Ensure that wrapped table is Valid
 *     check_status(ctable.get().Validate())             # <<<<<<<<<<<<<<
 *     cdef Table table = Table.__new__(Table)
 *     table.init(ctable)
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_ctable.get()->Validate()); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(18, 341, __pyx_L1_error)

  /* "pyarrow/public-api.pxi":342
 *     # Ensure that wrapped table is Valid
 *     check_status(ctable.get().Validate())
 *     cdef Table table = Table.__new__(Table)             # <<<<<<<<<<<<<<
 *     table.init(ctable)
 *     return table
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_Table(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_Table), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 342, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v_table = ((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/public-api.pxi":343
 *     check_status(ctable.get().Validate())
 *     cdef Table table = Table.__new__(Table)
 *     table.init(ctable)             # <<<<<<<<<<<<<<
 *     return table
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_Table *)__pyx_v_table->__pyx_vtab)->init(__pyx_v_table, __pyx_v_ctable);

  /* "pyarrow/public-api.pxi":344
 *     cdef Table table = Table.__new__(Table)
 *     table.init(ctable)
 *     return table             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_table));
  __pyx_r = ((PyObject *)__pyx_v_table);
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":339
 * 
 * 
 * cdef api object pyarrow_wrap_table(const shared_ptr[CTable]& ctable):             # <<<<<<<<<<<<<<
 *     # Ensure that wrapped table is Valid
 *     check_status(ctable.get().Validate())
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow.lib.pyarrow_wrap_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_table);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":347
 * 
 * 
 * cdef api bint pyarrow_is_batch(object batch):             # <<<<<<<<<<<<<<
 *     return isinstance(batch, RecordBatch)
 * 
 */

static int __pyx_f_7pyarrow_3lib_pyarrow_is_batch(PyObject *__pyx_v_batch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("pyarrow_is_batch", 0);

  /* "pyarrow/public-api.pxi":348
 * 
 * cdef api bint pyarrow_is_batch(object batch):
 *     return isinstance(batch, RecordBatch)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_batch, __pyx_ptype_7pyarrow_3lib_RecordBatch); 
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":347
 * 
 * 
 * cdef api bint pyarrow_is_batch(object batch):             # <<<<<<<<<<<<<<
 *     return isinstance(batch, RecordBatch)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":351
 * 
 * 
 * cdef api shared_ptr[CRecordBatch] pyarrow_unwrap_batch(object batch):             # <<<<<<<<<<<<<<
 *     cdef RecordBatch bat
 *     if pyarrow_is_batch(batch):
 */

std::shared_ptr< arrow::RecordBatch>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_batch(PyObject *__pyx_v_batch) {
  struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_bat = 0;
  std::shared_ptr< arrow::RecordBatch>  __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_unwrap_batch", 0);

  /* "pyarrow/public-api.pxi":353
 * cdef api shared_ptr[CRecordBatch] pyarrow_unwrap_batch(object batch):
 *     cdef RecordBatch bat
 *     if pyarrow_is_batch(batch):             # <<<<<<<<<<<<<<
 *         bat = <RecordBatch>(batch)
 *         return bat.sp_batch
 */
  __pyx_t_1 = (__pyx_f_7pyarrow_3lib_pyarrow_is_batch(__pyx_v_batch) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":354
 *     cdef RecordBatch bat
 *     if pyarrow_is_batch(batch):
 *         bat = <RecordBatch>(batch)             # <<<<<<<<<<<<<<
 *         return bat.sp_batch
 * 
 */
    __pyx_t_2 = __pyx_v_batch;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v_bat = ((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":355
 *     if pyarrow_is_batch(batch):
 *         bat = <RecordBatch>(batch)
 *         return bat.sp_batch             # <<<<<<<<<<<<<<
 * 
 *     return shared_ptr[CRecordBatch]()
 */
    __pyx_r = __pyx_v_bat->sp_batch;
    goto __pyx_L0;

    /* "pyarrow/public-api.pxi":353
 * cdef api shared_ptr[CRecordBatch] pyarrow_unwrap_batch(object batch):
 *     cdef RecordBatch bat
 *     if pyarrow_is_batch(batch):             # <<<<<<<<<<<<<<
 *         bat = <RecordBatch>(batch)
 *         return bat.sp_batch
 */
  }

  /* "pyarrow/public-api.pxi":357
 *         return bat.sp_batch
 * 
 *     return shared_ptr[CRecordBatch]()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = std::shared_ptr< arrow::RecordBatch> ();
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":351
 * 
 * 
 * cdef api shared_ptr[CRecordBatch] pyarrow_unwrap_batch(object batch):             # <<<<<<<<<<<<<<
 *     cdef RecordBatch bat
 *     if pyarrow_is_batch(batch):
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_bat);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":360
 * 
 * 
 * cdef api object pyarrow_wrap_batch(             # <<<<<<<<<<<<<<
 *         const shared_ptr[CRecordBatch]& cbatch):
 *     cdef RecordBatch batch = RecordBatch.__new__(RecordBatch)
 */

PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_batch(std::shared_ptr< arrow::RecordBatch>  const &__pyx_v_cbatch) {
  struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_batch = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_wrap_batch", 0);

  /* "pyarrow/public-api.pxi":362
 * cdef api object pyarrow_wrap_batch(
 *         const shared_ptr[CRecordBatch]& cbatch):
 *     cdef RecordBatch batch = RecordBatch.__new__(RecordBatch)             # <<<<<<<<<<<<<<
 *     batch.init(cbatch)
 *     return batch
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_RecordBatch(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_RecordBatch), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 362, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_batch = ((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/public-api.pxi":363
 *         const shared_ptr[CRecordBatch]& cbatch):
 *     cdef RecordBatch batch = RecordBatch.__new__(RecordBatch)
 *     batch.init(cbatch)             # <<<<<<<<<<<<<<
 *     return batch
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_RecordBatch *)__pyx_v_batch->__pyx_vtab)->init(__pyx_v_batch, __pyx_v_cbatch);

  /* "pyarrow/public-api.pxi":364
 *     cdef RecordBatch batch = RecordBatch.__new__(RecordBatch)
 *     batch.init(cbatch)
 *     return batch             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_batch));
  __pyx_r = ((PyObject *)__pyx_v_batch);
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":360
 * 
 * 
 * cdef api object pyarrow_wrap_batch(             # <<<<<<<<<<<<<<
 *         const shared_ptr[CRecordBatch]& cbatch):
 *     cdef RecordBatch batch = RecordBatch.__new__(RecordBatch)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.pyarrow_wrap_batch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_batch);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle__PandasAPIShim(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_219__pyx_unpickle__PandasAPIShim(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_218__pyx_unpickle__PandasAPIShim[] = "__pyx_unpickle__PandasAPIShim(__pyx_type, long __pyx_checksum, __pyx_state)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_219__pyx_unpickle__PandasAPIShim = {"__pyx_unpickle__PandasAPIShim", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_219__pyx_unpickle__PandasAPIShim, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_218__pyx_unpickle__PandasAPIShim};
static PyObject *__pyx_pw_7pyarrow_3lib_219__pyx_unpickle__PandasAPIShim(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle__PandasAPIShim (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle__PandasAPIShim", 1, 3, 3, 1); __PYX_ERR(10, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle__PandasAPIShim", 1, 3, 3, 2); __PYX_ERR(10, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle__PandasAPIShim") < 0)) __PYX_ERR(10, 1, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(10, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle__PandasAPIShim", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(10, 1, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.__pyx_unpickle__PandasAPIShim", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_218__pyx_unpickle__PandasAPIShim(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_218__pyx_unpickle__PandasAPIShim(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("__pyx_unpickle__PandasAPIShim", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x3f5738b:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x3f5738b = (_array_like_types, _categorical_type, _compat_module, _data_frame, _datetimetz_type, _extension_array, _extension_dtype, _have_pandas, _index, _loose_version, _pd, _pd024, _series, _tried_importing_pandas, _types_api, _version, has_sparse))" % __pyx_checksum)
 */
  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x3f5738b) != 0);
  if (__pyx_t_1) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x3f5738b:
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x3f5738b = (_array_like_types, _categorical_type, _compat_module, _data_frame, _datetimetz_type, _extension_array, _extension_dtype, _have_pandas, _index, _loose_version, _pd, _pd024, _series, _tried_importing_pandas, _types_api, _version, has_sparse))" % __pyx_checksum)
 *     __pyx_result = _PandasAPIShim.__new__(__pyx_type)
 */
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v___pyx_PickleError = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum != 0x3f5738b:
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x3f5738b = (_array_like_types, _categorical_type, _compat_module, _data_frame, _datetimetz_type, _extension_array, _extension_dtype, _have_pandas, _index, _loose_version, _pd, _pd024, _series, _tried_importing_pandas, _types_api, _version, has_sparse))" % __pyx_checksum)             # <<<<<<<<<<<<<<
 *     __pyx_result = _PandasAPIShim.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x3f, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_v___pyx_PickleError);
    __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(10, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x3f5738b:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x3f5738b = (_array_like_types, _categorical_type, _compat_module, _data_frame, _datetimetz_type, _extension_array, _extension_dtype, _have_pandas, _index, _loose_version, _pd, _pd024, _series, _tried_importing_pandas, _types_api, _version, has_sparse))" % __pyx_checksum)
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x3f5738b = (_array_like_types, _categorical_type, _compat_module, _data_frame, _datetimetz_type, _extension_array, _extension_dtype, _have_pandas, _index, _loose_version, _pd, _pd024, _series, _tried_importing_pandas, _types_api, _version, has_sparse))" % __pyx_checksum)
 *     __pyx_result = _PandasAPIShim.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle__PandasAPIShim__set_state(<_PandasAPIShim> __pyx_result, __pyx_state)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib__PandasAPIShim), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v___pyx_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x3f5738b = (_array_like_types, _categorical_type, _compat_module, _data_frame, _datetimetz_type, _extension_array, _extension_dtype, _have_pandas, _index, _loose_version, _pd, _pd024, _series, _tried_importing_pandas, _types_api, _version, has_sparse))" % __pyx_checksum)
 *     __pyx_result = _PandasAPIShim.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle__PandasAPIShim__set_state(<_PandasAPIShim> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (__pyx_t_6) {

    /* "(tree fragment)":9
 *     __pyx_result = _PandasAPIShim.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle__PandasAPIShim__set_state(<_PandasAPIShim> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle__PandasAPIShim__set_state(_PandasAPIShim __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(10, 9, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_7pyarrow_3lib___pyx_unpickle__PandasAPIShim__set_state(((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x3f5738b = (_array_like_types, _categorical_type, _compat_module, _data_frame, _datetimetz_type, _extension_array, _extension_dtype, _have_pandas, _index, _loose_version, _pd, _pd024, _series, _tried_importing_pandas, _types_api, _version, has_sparse))" % __pyx_checksum)
 *     __pyx_result = _PandasAPIShim.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle__PandasAPIShim__set_state(<_PandasAPIShim> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle__PandasAPIShim__set_state(<_PandasAPIShim> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle__PandasAPIShim__set_state(_PandasAPIShim __pyx_result, tuple __pyx_state):
 *     __pyx_result._array_like_types = __pyx_state[0]; __pyx_result._categorical_type = __pyx_state[1]; __pyx_result._compat_module = __pyx_state[2]; __pyx_result._data_frame = __pyx_state[3]; __pyx_result._datetimetz_type = __pyx_state[4]; __pyx_result._extension_array = __pyx_state[5]; __pyx_result._extension_dtype = __pyx_state[6]; __pyx_result._have_pandas = __pyx_state[7]; __pyx_result._index = __pyx_state[8]; __pyx_result._loose_version = __pyx_state[9]; __pyx_result._pd = __pyx_state[10]; __pyx_result._pd024 = __pyx_state[11]; __pyx_result._series = __pyx_state[12]; __pyx_result._tried_importing_pandas = __pyx_state[13]; __pyx_result._types_api = __pyx_state[14]; __pyx_result._version = __pyx_state[15]; __pyx_result.has_sparse = __pyx_state[16]
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle__PandasAPIShim(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.__pyx_unpickle__PandasAPIShim", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle__PandasAPIShim__set_state(<_PandasAPIShim> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle__PandasAPIShim__set_state(_PandasAPIShim __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result._array_like_types = __pyx_state[0]; __pyx_result._categorical_type = __pyx_state[1]; __pyx_result._compat_module = __pyx_state[2]; __pyx_result._data_frame = __pyx_state[3]; __pyx_result._datetimetz_type = __pyx_state[4]; __pyx_result._extension_array = __pyx_state[5]; __pyx_result._extension_dtype = __pyx_state[6]; __pyx_result._have_pandas = __pyx_state[7]; __pyx_result._index = __pyx_state[8]; __pyx_result._loose_version = __pyx_state[9]; __pyx_result._pd = __pyx_state[10]; __pyx_result._pd024 = __pyx_state[11]; __pyx_result._series = __pyx_state[12]; __pyx_result._tried_importing_pandas = __pyx_state[13]; __pyx_result._types_api = __pyx_state[14]; __pyx_result._version = __pyx_state[15]; __pyx_result.has_sparse = __pyx_state[16]
 *     if len(__pyx_state) > 17 and hasattr(__pyx_result, '__dict__'):
 */

static PyObject *__pyx_f_7pyarrow_3lib___pyx_unpickle__PandasAPIShim__set_state(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("__pyx_unpickle__PandasAPIShim__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle__PandasAPIShim__set_state(_PandasAPIShim __pyx_result, tuple __pyx_state):
 *     __pyx_result._array_like_types = __pyx_state[0]; __pyx_result._categorical_type = __pyx_state[1]; __pyx_result._compat_module = __pyx_state[2]; __pyx_result._data_frame = __pyx_state[3]; __pyx_result._datetimetz_type = __pyx_state[4]; __pyx_result._extension_array = __pyx_state[5]; __pyx_result._extension_dtype = __pyx_state[6]; __pyx_result._have_pandas = __pyx_state[7]; __pyx_result._index = __pyx_state[8]; __pyx_result._loose_version = __pyx_state[9]; __pyx_result._pd = __pyx_state[10]; __pyx_result._pd024 = __pyx_state[11]; __pyx_result._series = __pyx_state[12]; __pyx_result._tried_importing_pandas = __pyx_state[13]; __pyx_result._types_api = __pyx_state[14]; __pyx_result._version = __pyx_state[15]; __pyx_result.has_sparse = __pyx_state[16]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 17 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[17])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(10, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_array_like_types);
  __Pyx_DECREF(__pyx_v___pyx_result->_array_like_types);
  __pyx_v___pyx_result->_array_like_types = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(10, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_categorical_type);
  __Pyx_DECREF(__pyx_v___pyx_result->_categorical_type);
  __pyx_v___pyx_result->_categorical_type = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(10, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_compat_module);
  __Pyx_DECREF(__pyx_v___pyx_result->_compat_module);
  __pyx_v___pyx_result->_compat_module = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(10, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_data_frame);
  __Pyx_DECREF(__pyx_v___pyx_result->_data_frame);
  __pyx_v___pyx_result->_data_frame = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(10, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_datetimetz_type);
  __Pyx_DECREF(__pyx_v___pyx_result->_datetimetz_type);
  __pyx_v___pyx_result->_datetimetz_type = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(10, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_extension_array);
  __Pyx_DECREF(__pyx_v___pyx_result->_extension_array);
  __pyx_v___pyx_result->_extension_array = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(10, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_extension_dtype);
  __Pyx_DECREF(__pyx_v___pyx_result->_extension_dtype);
  __pyx_v___pyx_result->_extension_dtype = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(10, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(10, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->_have_pandas = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(10, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_index);
  __Pyx_DECREF(__pyx_v___pyx_result->_index);
  __pyx_v___pyx_result->_index = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(10, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_loose_version);
  __Pyx_DECREF(__pyx_v___pyx_result->_loose_version);
  __pyx_v___pyx_result->_loose_version = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(10, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_pd);
  __Pyx_DECREF(__pyx_v___pyx_result->_pd);
  __pyx_v___pyx_result->_pd = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(10, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(10, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->_pd024 = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(10, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 12, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_series);
  __Pyx_DECREF(__pyx_v___pyx_result->_series);
  __pyx_v___pyx_result->_series = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(10, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 13, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(10, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->_tried_importing_pandas = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(10, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 14, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_types_api);
  __Pyx_DECREF(__pyx_v___pyx_result->_types_api);
  __pyx_v___pyx_result->_types_api = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(10, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 15, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_version);
  __Pyx_DECREF(__pyx_v___pyx_result->_version);
  __pyx_v___pyx_result->_version = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(10, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 16, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(10, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->has_sparse = __pyx_t_2;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle__PandasAPIShim__set_state(_PandasAPIShim __pyx_result, tuple __pyx_state):
 *     __pyx_result._array_like_types = __pyx_state[0]; __pyx_result._categorical_type = __pyx_state[1]; __pyx_result._compat_module = __pyx_state[2]; __pyx_result._data_frame = __pyx_state[3]; __pyx_result._datetimetz_type = __pyx_state[4]; __pyx_result._extension_array = __pyx_state[5]; __pyx_result._extension_dtype = __pyx_state[6]; __pyx_result._have_pandas = __pyx_state[7]; __pyx_result._index = __pyx_state[8]; __pyx_result._loose_version = __pyx_state[9]; __pyx_result._pd = __pyx_state[10]; __pyx_result._pd024 = __pyx_state[11]; __pyx_result._series = __pyx_state[12]; __pyx_result._tried_importing_pandas = __pyx_state[13]; __pyx_result._types_api = __pyx_state[14]; __pyx_result._version = __pyx_state[15]; __pyx_result.has_sparse = __pyx_state[16]
 *     if len(__pyx_state) > 17 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[17])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(10, 13, __pyx_L1_error)
  }
  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(10, 13, __pyx_L1_error)
  __pyx_t_4 = ((__pyx_t_3 > 17) != 0);
  if (__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(10, 13, __pyx_L1_error)
  __pyx_t_5 = (__pyx_t_4 != 0);
  __pyx_t_2 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":14
 *     __pyx_result._array_like_types = __pyx_state[0]; __pyx_result._categorical_type = __pyx_state[1]; __pyx_result._compat_module = __pyx_state[2]; __pyx_result._data_frame = __pyx_state[3]; __pyx_result._datetimetz_type = __pyx_state[4]; __pyx_result._extension_array = __pyx_state[5]; __pyx_result._extension_dtype = __pyx_state[6]; __pyx_result._have_pandas = __pyx_state[7]; __pyx_result._index = __pyx_state[8]; __pyx_result._loose_version = __pyx_state[9]; __pyx_result._pd = __pyx_state[10]; __pyx_result._pd024 = __pyx_state[11]; __pyx_result._series = __pyx_state[12]; __pyx_result._tried_importing_pandas = __pyx_state[13]; __pyx_result._types_api = __pyx_state[14]; __pyx_result._version = __pyx_state[15]; __pyx_result.has_sparse = __pyx_state[16]
 *     if len(__pyx_state) > 17 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[17])             # <<<<<<<<<<<<<<
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(10, 14, __pyx_L1_error)
    }
    __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 17, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle__PandasAPIShim__set_state(_PandasAPIShim __pyx_result, tuple __pyx_state):
 *     __pyx_result._array_like_types = __pyx_state[0]; __pyx_result._categorical_type = __pyx_state[1]; __pyx_result._compat_module = __pyx_state[2]; __pyx_result._data_frame = __pyx_state[3]; __pyx_result._datetimetz_type = __pyx_state[4]; __pyx_result._extension_array = __pyx_state[5]; __pyx_result._extension_dtype = __pyx_state[6]; __pyx_result._have_pandas = __pyx_state[7]; __pyx_result._index = __pyx_state[8]; __pyx_result._loose_version = __pyx_state[9]; __pyx_result._pd = __pyx_state[10]; __pyx_result._pd024 = __pyx_state[11]; __pyx_result._series = __pyx_state[12]; __pyx_result._tried_importing_pandas = __pyx_state[13]; __pyx_result._types_api = __pyx_state[14]; __pyx_result._version = __pyx_state[15]; __pyx_result.has_sparse = __pyx_state[16]
 *     if len(__pyx_state) > 17 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[17])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle__PandasAPIShim__set_state(<_PandasAPIShim> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle__PandasAPIShim__set_state(_PandasAPIShim __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result._array_like_types = __pyx_state[0]; __pyx_result._categorical_type = __pyx_state[1]; __pyx_result._compat_module = __pyx_state[2]; __pyx_result._data_frame = __pyx_state[3]; __pyx_result._datetimetz_type = __pyx_state[4]; __pyx_result._extension_array = __pyx_state[5]; __pyx_result._extension_dtype = __pyx_state[6]; __pyx_result._have_pandas = __pyx_state[7]; __pyx_result._index = __pyx_state[8]; __pyx_result._loose_version = __pyx_state[9]; __pyx_result._pd = __pyx_state[10]; __pyx_result._pd024 = __pyx_state[11]; __pyx_result._series = __pyx_state[12]; __pyx_result._tried_importing_pandas = __pyx_state[13]; __pyx_result._types_api = __pyx_state[14]; __pyx_result._version = __pyx_state[15]; __pyx_result.has_sparse = __pyx_state[16]
 *     if len(__pyx_state) > 17 and hasattr(__pyx_result, '__dict__'):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow.lib.__pyx_unpickle__PandasAPIShim__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle_Scalar(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_221__pyx_unpickle_Scalar(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_220__pyx_unpickle_Scalar[] = "__pyx_unpickle_Scalar(__pyx_type, long __pyx_checksum, __pyx_state)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_221__pyx_unpickle_Scalar = {"__pyx_unpickle_Scalar", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_221__pyx_unpickle_Scalar, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_220__pyx_unpickle_Scalar};
static PyObject *__pyx_pw_7pyarrow_3lib_221__pyx_unpickle_Scalar(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_Scalar (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Scalar", 1, 3, 3, 1); __PYX_ERR(10, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Scalar", 1, 3, 3, 2); __PYX_ERR(10, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Scalar") < 0)) __PYX_ERR(10, 1, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(10, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Scalar", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(10, 1, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.__pyx_unpickle_Scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_220__pyx_unpickle_Scalar(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_220__pyx_unpickle_Scalar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("__pyx_unpickle_Scalar", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x599dcce:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x599dcce = (type))" % __pyx_checksum)
 */
  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x599dcce) != 0);
  if (__pyx_t_1) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x599dcce:
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x599dcce = (type))" % __pyx_checksum)
 *     __pyx_result = Scalar.__new__(__pyx_type)
 */
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v___pyx_PickleError = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum != 0x599dcce:
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x599dcce = (type))" % __pyx_checksum)             # <<<<<<<<<<<<<<
 *     __pyx_result = Scalar.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x59, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_v___pyx_PickleError);
    __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(10, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x599dcce:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x599dcce = (type))" % __pyx_checksum)
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x599dcce = (type))" % __pyx_checksum)
 *     __pyx_result = Scalar.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Scalar__set_state(<Scalar> __pyx_result, __pyx_state)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_Scalar), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v___pyx_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x599dcce = (type))" % __pyx_checksum)
 *     __pyx_result = Scalar.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_Scalar__set_state(<Scalar> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (__pyx_t_6) {

    /* "(tree fragment)":9
 *     __pyx_result = Scalar.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Scalar__set_state(<Scalar> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_Scalar__set_state(Scalar __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(10, 9, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_7pyarrow_3lib___pyx_unpickle_Scalar__set_state(((struct __pyx_obj_7pyarrow_3lib_Scalar *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x599dcce = (type))" % __pyx_checksum)
 *     __pyx_result = Scalar.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_Scalar__set_state(<Scalar> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Scalar__set_state(<Scalar> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_Scalar__set_state(Scalar __pyx_result, tuple __pyx_state):
 *     __pyx_result.type = __pyx_state[0]
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_Scalar(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.__pyx_unpickle_Scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_Scalar__set_state(<Scalar> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_Scalar__set_state(Scalar __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.type = __pyx_state[0]
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
 */

static PyObject *__pyx_f_7pyarrow_3lib___pyx_unpickle_Scalar__set_state(struct __pyx_obj_7pyarrow_3lib_Scalar *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("__pyx_unpickle_Scalar__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_Scalar__set_state(Scalar __pyx_result, tuple __pyx_state):
 *     __pyx_result.type = __pyx_state[0]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[1])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(10, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(10, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->type);
  __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->type));
  __pyx_v___pyx_result->type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_Scalar__set_state(Scalar __pyx_result, tuple __pyx_state):
 *     __pyx_result.type = __pyx_state[0]
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[1])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(10, 13, __pyx_L1_error)
  }
  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(10, 13, __pyx_L1_error)
  __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
  if (__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(10, 13, __pyx_L1_error)
  __pyx_t_5 = (__pyx_t_4 != 0);
  __pyx_t_2 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":14
 *     __pyx_result.type = __pyx_state[0]
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[1])             # <<<<<<<<<<<<<<
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(10, 14, __pyx_L1_error)
    }
    __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_Scalar__set_state(Scalar __pyx_result, tuple __pyx_state):
 *     __pyx_result.type = __pyx_state[0]
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[1])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_Scalar__set_state(<Scalar> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_Scalar__set_state(Scalar __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.type = __pyx_state[0]
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow.lib.__pyx_unpickle_Scalar__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle__PandasConvertible(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_223__pyx_unpickle__PandasConvertible(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_222__pyx_unpickle__PandasConvertible[] = "__pyx_unpickle__PandasConvertible(__pyx_type, long __pyx_checksum, __pyx_state)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_223__pyx_unpickle__PandasConvertible = {"__pyx_unpickle__PandasConvertible", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_223__pyx_unpickle__PandasConvertible, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_222__pyx_unpickle__PandasConvertible};
static PyObject *__pyx_pw_7pyarrow_3lib_223__pyx_unpickle__PandasConvertible(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle__PandasConvertible (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle__PandasConvertible", 1, 3, 3, 1); __PYX_ERR(10, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle__PandasConvertible", 1, 3, 3, 2); __PYX_ERR(10, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle__PandasConvertible") < 0)) __PYX_ERR(10, 1, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(10, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle__PandasConvertible", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(10, 1, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.__pyx_unpickle__PandasConvertible", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_222__pyx_unpickle__PandasConvertible(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_222__pyx_unpickle__PandasConvertible(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("__pyx_unpickle__PandasConvertible", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0xd41d8cd:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum)
 */
  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xd41d8cd) != 0);
  if (__pyx_t_1) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0xd41d8cd:
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum)
 *     __pyx_result = _PandasConvertible.__new__(__pyx_type)
 */
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v___pyx_PickleError = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum != 0xd41d8cd:
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum)             # <<<<<<<<<<<<<<
 *     __pyx_result = _PandasConvertible.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xd4, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_v___pyx_PickleError);
    __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(10, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0xd41d8cd:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum)
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum)
 *     __pyx_result = _PandasConvertible.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle__PandasConvertible__set_state(<_PandasConvertible> __pyx_result, __pyx_state)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib__PandasConvertible), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v___pyx_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum)
 *     __pyx_result = _PandasConvertible.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle__PandasConvertible__set_state(<_PandasConvertible> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (__pyx_t_6) {

    /* "(tree fragment)":9
 *     __pyx_result = _PandasConvertible.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle__PandasConvertible__set_state(<_PandasConvertible> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle__PandasConvertible__set_state(_PandasConvertible __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(10, 9, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_7pyarrow_3lib___pyx_unpickle__PandasConvertible__set_state(((struct __pyx_obj_7pyarrow_3lib__PandasConvertible *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum)
 *     __pyx_result = _PandasConvertible.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle__PandasConvertible__set_state(<_PandasConvertible> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle__PandasConvertible__set_state(<_PandasConvertible> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle__PandasConvertible__set_state(_PandasConvertible __pyx_result, tuple __pyx_state):
 *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle__PandasConvertible(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.__pyx_unpickle__PandasConvertible", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle__PandasConvertible__set_state(<_PandasConvertible> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle__PandasConvertible__set_state(_PandasConvertible __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[0])
 */

static PyObject *__pyx_f_7pyarrow_3lib___pyx_unpickle__PandasConvertible__set_state(struct __pyx_obj_7pyarrow_3lib__PandasConvertible *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("__pyx_unpickle__PandasConvertible__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle__PandasConvertible__set_state(_PandasConvertible __pyx_result, tuple __pyx_state):
 *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[0])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(10, 12, __pyx_L1_error)
  }
  __pyx_t_2 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(10, 12, __pyx_L1_error)
  __pyx_t_3 = ((__pyx_t_2 > 0) != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(10, 12, __pyx_L1_error)
  __pyx_t_4 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "(tree fragment)":13
 * cdef __pyx_unpickle__PandasConvertible__set_state(_PandasConvertible __pyx_result, tuple __pyx_state):
 *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[0])             # <<<<<<<<<<<<<<
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(10, 13, __pyx_L1_error)
    }
    __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle__PandasConvertible__set_state(_PandasConvertible __pyx_result, tuple __pyx_state):
 *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[0])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle__PandasConvertible__set_state(<_PandasConvertible> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle__PandasConvertible__set_state(_PandasConvertible __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[0])
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow.lib.__pyx_unpickle__PandasConvertible__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle_SerializationContext(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_225__pyx_unpickle_SerializationContext(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_224__pyx_unpickle_SerializationContext[] = "__pyx_unpickle_SerializationContext(__pyx_type, long __pyx_checksum, __pyx_state)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_225__pyx_unpickle_SerializationContext = {"__pyx_unpickle_SerializationContext", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_225__pyx_unpickle_SerializationContext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_224__pyx_unpickle_SerializationContext};
static PyObject *__pyx_pw_7pyarrow_3lib_225__pyx_unpickle_SerializationContext(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_SerializationContext (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SerializationContext", 1, 3, 3, 1); __PYX_ERR(10, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SerializationContext", 1, 3, 3, 2); __PYX_ERR(10, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_SerializationContext") < 0)) __PYX_ERR(10, 1, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(10, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SerializationContext", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(10, 1, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.__pyx_unpickle_SerializationContext", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_224__pyx_unpickle_SerializationContext(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_3lib_224__pyx_unpickle_SerializationContext(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("__pyx_unpickle_SerializationContext", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x9aeed6f:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x9aeed6f = (custom_deserializers, custom_serializers, pickle_deserializer, pickle_serializer, type_to_type_id, types_to_pickle, whitelisted_types))" % __pyx_checksum)
 */
  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x9aeed6f) != 0);
  if (__pyx_t_1) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x9aeed6f:
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x9aeed6f = (custom_deserializers, custom_serializers, pickle_deserializer, pickle_serializer, type_to_type_id, types_to_pickle, whitelisted_types))" % __pyx_checksum)
 *     __pyx_result = SerializationContext.__new__(__pyx_type)
 */
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v___pyx_PickleError = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum != 0x9aeed6f:
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x9aeed6f = (custom_deserializers, custom_serializers, pickle_deserializer, pickle_serializer, type_to_type_id, types_to_pickle, whitelisted_types))" % __pyx_checksum)             # <<<<<<<<<<<<<<
 *     __pyx_result = SerializationContext.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x9a, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_v___pyx_PickleError);
    __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(10, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x9aeed6f:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x9aeed6f = (custom_deserializers, custom_serializers, pickle_deserializer, pickle_serializer, type_to_type_id, types_to_pickle, whitelisted_types))" % __pyx_checksum)
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x9aeed6f = (custom_deserializers, custom_serializers, pickle_deserializer, pickle_serializer, type_to_type_id, types_to_pickle, whitelisted_types))" % __pyx_checksum)
 *     __pyx_result = SerializationContext.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_SerializationContext__set_state(<SerializationContext> __pyx_result, __pyx_state)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_SerializationContext), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v___pyx_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x9aeed6f = (custom_deserializers, custom_serializers, pickle_deserializer, pickle_serializer, type_to_type_id, types_to_pickle, whitelisted_types))" % __pyx_checksum)
 *     __pyx_result = SerializationContext.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_SerializationContext__set_state(<SerializationContext> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (__pyx_t_6) {

    /* "(tree fragment)":9
 *     __pyx_result = SerializationContext.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_SerializationContext__set_state(<SerializationContext> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_SerializationContext__set_state(SerializationContext __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(10, 9, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_7pyarrow_3lib___pyx_unpickle_SerializationContext__set_state(((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x9aeed6f = (custom_deserializers, custom_serializers, pickle_deserializer, pickle_serializer, type_to_type_id, types_to_pickle, whitelisted_types))" % __pyx_checksum)
 *     __pyx_result = SerializationContext.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_SerializationContext__set_state(<SerializationContext> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_SerializationContext__set_state(<SerializationContext> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_SerializationContext__set_state(SerializationContext __pyx_result, tuple __pyx_state):
 *     __pyx_result.custom_deserializers = __pyx_state[0]; __pyx_result.custom_serializers = __pyx_state[1]; __pyx_result.pickle_deserializer = __pyx_state[2]; __pyx_result.pickle_serializer = __pyx_state[3]; __pyx_result.type_to_type_id = __pyx_state[4]; __pyx_result.types_to_pickle = __pyx_state[5]; __pyx_result.whitelisted_types = __pyx_state[6]
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_SerializationContext(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.__pyx_unpickle_SerializationContext", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_SerializationContext__set_state(<SerializationContext> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_SerializationContext__set_state(SerializationContext __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.custom_deserializers = __pyx_state[0]; __pyx_result.custom_serializers = __pyx_state[1]; __pyx_result.pickle_deserializer = __pyx_state[2]; __pyx_result.pickle_serializer = __pyx_state[3]; __pyx_result.type_to_type_id = __pyx_state[4]; __pyx_result.types_to_pickle = __pyx_state[5]; __pyx_result.whitelisted_types = __pyx_state[6]
 *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):
 */

static PyObject *__pyx_f_7pyarrow_3lib___pyx_unpickle_SerializationContext__set_state(struct __pyx_obj_7pyarrow_3lib_SerializationContext *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("__pyx_unpickle_SerializationContext__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_SerializationContext__set_state(SerializationContext __pyx_result, tuple __pyx_state):
 *     __pyx_result.custom_deserializers = __pyx_state[0]; __pyx_result.custom_serializers = __pyx_state[1]; __pyx_result.pickle_deserializer = __pyx_state[2]; __pyx_result.pickle_serializer = __pyx_state[3]; __pyx_result.type_to_type_id = __pyx_state[4]; __pyx_result.types_to_pickle = __pyx_state[5]; __pyx_result.whitelisted_types = __pyx_state[6]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[7])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(10, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->custom_deserializers);
  __Pyx_DECREF(__pyx_v___pyx_result->custom_deserializers);
  __pyx_v___pyx_result->custom_deserializers = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(10, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->custom_serializers);
  __Pyx_DECREF(__pyx_v___pyx_result->custom_serializers);
  __pyx_v___pyx_result->custom_serializers = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(10, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->pickle_deserializer);
  __Pyx_DECREF(__pyx_v___pyx_result->pickle_deserializer);
  __pyx_v___pyx_result->pickle_deserializer = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(10, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->pickle_serializer);
  __Pyx_DECREF(__pyx_v___pyx_result->pickle_serializer);
  __pyx_v___pyx_result->pickle_serializer = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(10, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->type_to_type_id);
  __Pyx_DECREF(__pyx_v___pyx_result->type_to_type_id);
  __pyx_v___pyx_result->type_to_type_id = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(10, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->types_to_pickle);
  __Pyx_DECREF(__pyx_v___pyx_result->types_to_pickle);
  __pyx_v___pyx_result->types_to_pickle = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(10, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->whitelisted_types);
  __Pyx_DECREF(__pyx_v___pyx_result->whitelisted_types);
  __pyx_v___pyx_result->whitelisted_types = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_SerializationContext__set_state(SerializationContext __pyx_result, tuple __pyx_state):
 *     __pyx_result.custom_deserializers = __pyx_state[0]; __pyx_result.custom_serializers = __pyx_state[1]; __pyx_result.pickle_deserializer = __pyx_state[2]; __pyx_result.pickle_serializer = __pyx_state[3]; __pyx_result.type_to_type_id = __pyx_state[4]; __pyx_result.types_to_pickle = __pyx_state[5]; __pyx_result.whitelisted_types = __pyx_state[6]
 *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[7])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(10, 13, __pyx_L1_error)
  }
  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(10, 13, __pyx_L1_error)
  __pyx_t_4 = ((__pyx_t_3 > 7) != 0);
  if (__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(10, 13, __pyx_L1_error)
  __pyx_t_5 = (__pyx_t_4 != 0);
  __pyx_t_2 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":14
 *     __pyx_result.custom_deserializers = __pyx_state[0]; __pyx_result.custom_serializers = __pyx_state[1]; __pyx_result.pickle_deserializer = __pyx_state[2]; __pyx_result.pickle_serializer = __pyx_state[3]; __pyx_result.type_to_type_id = __pyx_state[4]; __pyx_result.types_to_pickle = __pyx_state[5]; __pyx_result.whitelisted_types = __pyx_state[6]
 *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[7])             # <<<<<<<<<<<<<<
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(10, 14, __pyx_L1_error)
    }
    __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_SerializationContext__set_state(SerializationContext __pyx_result, tuple __pyx_state):
 *     __pyx_result.custom_deserializers = __pyx_state[0]; __pyx_result.custom_serializers = __pyx_state[1]; __pyx_result.pickle_deserializer = __pyx_state[2]; __pyx_result.pickle_serializer = __pyx_state[3]; __pyx_result.type_to_type_id = __pyx_state[4]; __pyx_result.types_to_pickle = __pyx_state[5]; __pyx_result.whitelisted_types = __pyx_state[6]
 *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[7])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_SerializationContext__set_state(<SerializationContext> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_SerializationContext__set_state(SerializationContext __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.custom_deserializers = __pyx_state[0]; __pyx_result.custom_serializers = __pyx_state[1]; __pyx_result.pickle_deserializer = __pyx_state[2]; __pyx_result.pickle_serializer = __pyx_state[3]; __pyx_result.type_to_type_id = __pyx_state[4]; __pyx_result.types_to_pickle = __pyx_state[5]; __pyx_result.whitelisted_types = __pyx_state[6]
 *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow.lib.__pyx_unpickle_SerializationContext__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/datetime.pxd":104
 * # Datetime C API initialization function.
 * # You have to call it before any usage of DateTime CAPI functions.
 * cdef inline void import_datetime():             # <<<<<<<<<<<<<<
 *     PyDateTime_IMPORT
 * 
 */

static CYTHON_INLINE void __pyx_f_7cpython_8datetime_import_datetime(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("import_datetime", 0);

  /* "cpython/datetime.pxd":105
 * # You have to call it before any usage of DateTime CAPI functions.
 * cdef inline void import_datetime():
 *     PyDateTime_IMPORT             # <<<<<<<<<<<<<<
 * 
 * # Create date object using DateTime CAPI factory function.
 */
  (void)(PyDateTime_IMPORT);

  /* "cpython/datetime.pxd":104
 * # Datetime C API initialization function.
 * # You have to call it before any usage of DateTime CAPI functions.
 * cdef inline void import_datetime():             # <<<<<<<<<<<<<<
 *     PyDateTime_IMPORT
 * 
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "cpython/datetime.pxd":109
 * # Create date object using DateTime CAPI factory function.
 * # Note, there are no range checks for any of the arguments.
 * cdef inline object date_new(int year, int month, int day):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.Date_FromDate(year, month, day, PyDateTimeAPI.DateType)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_date_new(int __pyx_v_year, int __pyx_v_month, int __pyx_v_day) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("date_new", 0);

  /* "cpython/datetime.pxd":110
 * # Note, there are no range checks for any of the arguments.
 * cdef inline object date_new(int year, int month, int day):
 *     return PyDateTimeAPI.Date_FromDate(year, month, day, PyDateTimeAPI.DateType)             # <<<<<<<<<<<<<<
 * 
 * # Create time object using DateTime CAPI factory function
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyDateTimeAPI->Date_FromDate(__pyx_v_year, __pyx_v_month, __pyx_v_day, PyDateTimeAPI->DateType); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cpython/datetime.pxd":109
 * # Create date object using DateTime CAPI factory function.
 * # Note, there are no range checks for any of the arguments.
 * cdef inline object date_new(int year, int month, int day):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.Date_FromDate(year, month, day, PyDateTimeAPI.DateType)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cpython.datetime.date_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/datetime.pxd":114
 * # Create time object using DateTime CAPI factory function
 * # Note, there are no range checks for any of the arguments.
 * cdef inline object time_new(int hour, int minute, int second, int microsecond, object tz):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.Time_FromTime(hour, minute, second, microsecond, tz, PyDateTimeAPI.TimeType)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_time_new(int __pyx_v_hour, int __pyx_v_minute, int __pyx_v_second, int __pyx_v_microsecond, PyObject *__pyx_v_tz) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("time_new", 0);

  /* "cpython/datetime.pxd":115
 * # Note, there are no range checks for any of the arguments.
 * cdef inline object time_new(int hour, int minute, int second, int microsecond, object tz):
 *     return PyDateTimeAPI.Time_FromTime(hour, minute, second, microsecond, tz, PyDateTimeAPI.TimeType)             # <<<<<<<<<<<<<<
 * 
 * # Create datetime object using DateTime CAPI factory function.
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyDateTimeAPI->Time_FromTime(__pyx_v_hour, __pyx_v_minute, __pyx_v_second, __pyx_v_microsecond, __pyx_v_tz, PyDateTimeAPI->TimeType); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cpython/datetime.pxd":114
 * # Create time object using DateTime CAPI factory function
 * # Note, there are no range checks for any of the arguments.
 * cdef inline object time_new(int hour, int minute, int second, int microsecond, object tz):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.Time_FromTime(hour, minute, second, microsecond, tz, PyDateTimeAPI.TimeType)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cpython.datetime.time_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/datetime.pxd":119
 * # Create datetime object using DateTime CAPI factory function.
 * # Note, there are no range checks for any of the arguments.
 * cdef inline object datetime_new(int year, int month, int day, int hour, int minute, int second, int microsecond, object tz):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.DateTime_FromDateAndTime(year, month, day, hour, minute, second, microsecond, tz, PyDateTimeAPI.DateTimeType)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_datetime_new(int __pyx_v_year, int __pyx_v_month, int __pyx_v_day, int __pyx_v_hour, int __pyx_v_minute, int __pyx_v_second, int __pyx_v_microsecond, PyObject *__pyx_v_tz) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("datetime_new", 0);

  /* "cpython/datetime.pxd":120
 * # Note, there are no range checks for any of the arguments.
 * cdef inline object datetime_new(int year, int month, int day, int hour, int minute, int second, int microsecond, object tz):
 *     return PyDateTimeAPI.DateTime_FromDateAndTime(year, month, day, hour, minute, second, microsecond, tz, PyDateTimeAPI.DateTimeType)             # <<<<<<<<<<<<<<
 * 
 * # Create timedelta object using DateTime CAPI factory function.
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyDateTimeAPI->DateTime_FromDateAndTime(__pyx_v_year, __pyx_v_month, __pyx_v_day, __pyx_v_hour, __pyx_v_minute, __pyx_v_second, __pyx_v_microsecond, __pyx_v_tz, PyDateTimeAPI->DateTimeType); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cpython/datetime.pxd":119
 * # Create datetime object using DateTime CAPI factory function.
 * # Note, there are no range checks for any of the arguments.
 * cdef inline object datetime_new(int year, int month, int day, int hour, int minute, int second, int microsecond, object tz):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.DateTime_FromDateAndTime(year, month, day, hour, minute, second, microsecond, tz, PyDateTimeAPI.DateTimeType)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cpython.datetime.datetime_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/datetime.pxd":124
 * # Create timedelta object using DateTime CAPI factory function.
 * # Note, there are no range checks for any of the arguments.
 * cdef inline object timedelta_new(int days, int seconds, int useconds):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.Delta_FromDelta(days, seconds, useconds, 1, PyDateTimeAPI.DeltaType)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_timedelta_new(int __pyx_v_days, int __pyx_v_seconds, int __pyx_v_useconds) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("timedelta_new", 0);

  /* "cpython/datetime.pxd":125
 * # Note, there are no range checks for any of the arguments.
 * cdef inline object timedelta_new(int days, int seconds, int useconds):
 *     return PyDateTimeAPI.Delta_FromDelta(days, seconds, useconds, 1, PyDateTimeAPI.DeltaType)             # <<<<<<<<<<<<<<
 * 
 * # More recognizable getters for date/time/datetime/timedelta.
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyDateTimeAPI->Delta_FromDelta(__pyx_v_days, __pyx_v_seconds, __pyx_v_useconds, 1, PyDateTimeAPI->DeltaType); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cpython/datetime.pxd":124
 * # Create timedelta object using DateTime CAPI factory function.
 * # Note, there are no range checks for any of the arguments.
 * cdef inline object timedelta_new(int days, int seconds, int useconds):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.Delta_FromDelta(days, seconds, useconds, 1, PyDateTimeAPI.DeltaType)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cpython.datetime.timedelta_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/datetime.pxd":133
 * 
 * # Get tzinfo of time
 * cdef inline object time_tzinfo(object o):             # <<<<<<<<<<<<<<
 *     if (<PyDateTime_Time*>o).hastzinfo:
 *         return <object>(<PyDateTime_Time*>o).tzinfo
 */

static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_time_tzinfo(PyObject *__pyx_v_o) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("time_tzinfo", 0);

  /* "cpython/datetime.pxd":134
 * # Get tzinfo of time
 * cdef inline object time_tzinfo(object o):
 *     if (<PyDateTime_Time*>o).hastzinfo:             # <<<<<<<<<<<<<<
 *         return <object>(<PyDateTime_Time*>o).tzinfo
 *     else:
 */
  __pyx_t_1 = (((PyDateTime_Time *)__pyx_v_o)->hastzinfo != 0);
  if (__pyx_t_1) {

    /* "cpython/datetime.pxd":135
 * cdef inline object time_tzinfo(object o):
 *     if (<PyDateTime_Time*>o).hastzinfo:
 *         return <object>(<PyDateTime_Time*>o).tzinfo             # <<<<<<<<<<<<<<
 *     else:
 *         return None
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)((PyDateTime_Time *)__pyx_v_o)->tzinfo));
    __pyx_r = ((PyObject *)((PyDateTime_Time *)__pyx_v_o)->tzinfo);
    goto __pyx_L0;

    /* "cpython/datetime.pxd":134
 * # Get tzinfo of time
 * cdef inline object time_tzinfo(object o):
 *     if (<PyDateTime_Time*>o).hastzinfo:             # <<<<<<<<<<<<<<
 *         return <object>(<PyDateTime_Time*>o).tzinfo
 *     else:
 */
  }

  /* "cpython/datetime.pxd":137
 *         return <object>(<PyDateTime_Time*>o).tzinfo
 *     else:
 *         return None             # <<<<<<<<<<<<<<
 * 
 * # Get tzinfo of datetime
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "cpython/datetime.pxd":133
 * 
 * # Get tzinfo of time
 * cdef inline object time_tzinfo(object o):             # <<<<<<<<<<<<<<
 *     if (<PyDateTime_Time*>o).hastzinfo:
 *         return <object>(<PyDateTime_Time*>o).tzinfo
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/datetime.pxd":140
 * 
 * # Get tzinfo of datetime
 * cdef inline object datetime_tzinfo(object o):             # <<<<<<<<<<<<<<
 *     if (<PyDateTime_DateTime*>o).hastzinfo:
 *         return <object>(<PyDateTime_DateTime*>o).tzinfo
 */

static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_datetime_tzinfo(PyObject *__pyx_v_o) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("datetime_tzinfo", 0);

  /* "cpython/datetime.pxd":141
 * # Get tzinfo of datetime
 * cdef inline object datetime_tzinfo(object o):
 *     if (<PyDateTime_DateTime*>o).hastzinfo:             # <<<<<<<<<<<<<<
 *         return <object>(<PyDateTime_DateTime*>o).tzinfo
 *     else:
 */
  __pyx_t_1 = (((PyDateTime_DateTime *)__pyx_v_o)->hastzinfo != 0);
  if (__pyx_t_1) {

    /* "cpython/datetime.pxd":142
 * cdef inline object datetime_tzinfo(object o):
 *     if (<PyDateTime_DateTime*>o).hastzinfo:
 *         return <object>(<PyDateTime_DateTime*>o).tzinfo             # <<<<<<<<<<<<<<
 *     else:
 *         return None
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)((PyDateTime_DateTime *)__pyx_v_o)->tzinfo));
    __pyx_r = ((PyObject *)((PyDateTime_DateTime *)__pyx_v_o)->tzinfo);
    goto __pyx_L0;

    /* "cpython/datetime.pxd":141
 * # Get tzinfo of datetime
 * cdef inline object datetime_tzinfo(object o):
 *     if (<PyDateTime_DateTime*>o).hastzinfo:             # <<<<<<<<<<<<<<
 *         return <object>(<PyDateTime_DateTime*>o).tzinfo
 *     else:
 */
  }

  /* "cpython/datetime.pxd":144
 *         return <object>(<PyDateTime_DateTime*>o).tzinfo
 *     else:
 *         return None             # <<<<<<<<<<<<<<
 * 
 * # Get year of date
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "cpython/datetime.pxd":140
 * 
 * # Get tzinfo of datetime
 * cdef inline object datetime_tzinfo(object o):             # <<<<<<<<<<<<<<
 *     if (<PyDateTime_DateTime*>o).hastzinfo:
 *         return <object>(<PyDateTime_DateTime*>o).tzinfo
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/datetime.pxd":147
 * 
 * # Get year of date
 * cdef inline int date_year(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_YEAR(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_date_year(PyObject *__pyx_v_o) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("date_year", 0);

  /* "cpython/datetime.pxd":148
 * # Get year of date
 * cdef inline int date_year(object o):
 *     return PyDateTime_GET_YEAR(o)             # <<<<<<<<<<<<<<
 * 
 * # Get month of date
 */
  __pyx_r = PyDateTime_GET_YEAR(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":147
 * 
 * # Get year of date
 * cdef inline int date_year(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_YEAR(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/datetime.pxd":151
 * 
 * # Get month of date
 * cdef inline int date_month(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_MONTH(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_date_month(PyObject *__pyx_v_o) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("date_month", 0);

  /* "cpython/datetime.pxd":152
 * # Get month of date
 * cdef inline int date_month(object o):
 *     return PyDateTime_GET_MONTH(o)             # <<<<<<<<<<<<<<
 * 
 * # Get day of date
 */
  __pyx_r = PyDateTime_GET_MONTH(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":151
 * 
 * # Get month of date
 * cdef inline int date_month(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_MONTH(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/datetime.pxd":155
 * 
 * # Get day of date
 * cdef inline int date_day(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_DAY(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_date_day(PyObject *__pyx_v_o) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("date_day", 0);

  /* "cpython/datetime.pxd":156
 * # Get day of date
 * cdef inline int date_day(object o):
 *     return PyDateTime_GET_DAY(o)             # <<<<<<<<<<<<<<
 * 
 * # Get year of datetime
 */
  __pyx_r = PyDateTime_GET_DAY(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":155
 * 
 * # Get day of date
 * cdef inline int date_day(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_DAY(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/datetime.pxd":159
 * 
 * # Get year of datetime
 * cdef inline int datetime_year(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_YEAR(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_year(PyObject *__pyx_v_o) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("datetime_year", 0);

  /* "cpython/datetime.pxd":160
 * # Get year of datetime
 * cdef inline int datetime_year(object o):
 *     return PyDateTime_GET_YEAR(o)             # <<<<<<<<<<<<<<
 * 
 * # Get month of datetime
 */
  __pyx_r = PyDateTime_GET_YEAR(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":159
 * 
 * # Get year of datetime
 * cdef inline int datetime_year(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_YEAR(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/datetime.pxd":163
 * 
 * # Get month of datetime
 * cdef inline int datetime_month(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_MONTH(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_month(PyObject *__pyx_v_o) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("datetime_month", 0);

  /* "cpython/datetime.pxd":164
 * # Get month of datetime
 * cdef inline int datetime_month(object o):
 *     return PyDateTime_GET_MONTH(o)             # <<<<<<<<<<<<<<
 * 
 * # Get day of datetime
 */
  __pyx_r = PyDateTime_GET_MONTH(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":163
 * 
 * # Get month of datetime
 * cdef inline int datetime_month(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_MONTH(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/datetime.pxd":167
 * 
 * # Get day of datetime
 * cdef inline int datetime_day(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_DAY(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_day(PyObject *__pyx_v_o) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("datetime_day", 0);

  /* "cpython/datetime.pxd":168
 * # Get day of datetime
 * cdef inline int datetime_day(object o):
 *     return PyDateTime_GET_DAY(o)             # <<<<<<<<<<<<<<
 * 
 * # Get hour of time
 */
  __pyx_r = PyDateTime_GET_DAY(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":167
 * 
 * # Get day of datetime
 * cdef inline int datetime_day(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_DAY(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/datetime.pxd":171
 * 
 * # Get hour of time
 * cdef inline int time_hour(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_HOUR(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_time_hour(PyObject *__pyx_v_o) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("time_hour", 0);

  /* "cpython/datetime.pxd":172
 * # Get hour of time
 * cdef inline int time_hour(object o):
 *     return PyDateTime_TIME_GET_HOUR(o)             # <<<<<<<<<<<<<<
 * 
 * # Get minute of time
 */
  __pyx_r = PyDateTime_TIME_GET_HOUR(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":171
 * 
 * # Get hour of time
 * cdef inline int time_hour(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_HOUR(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/datetime.pxd":175
 * 
 * # Get minute of time
 * cdef inline int time_minute(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_MINUTE(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_time_minute(PyObject *__pyx_v_o) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("time_minute", 0);

  /* "cpython/datetime.pxd":176
 * # Get minute of time
 * cdef inline int time_minute(object o):
 *     return PyDateTime_TIME_GET_MINUTE(o)             # <<<<<<<<<<<<<<
 * 
 * # Get second of time
 */
  __pyx_r = PyDateTime_TIME_GET_MINUTE(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":175
 * 
 * # Get minute of time
 * cdef inline int time_minute(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_MINUTE(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/datetime.pxd":179
 * 
 * # Get second of time
 * cdef inline int time_second(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_SECOND(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_time_second(PyObject *__pyx_v_o) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("time_second", 0);

  /* "cpython/datetime.pxd":180
 * # Get second of time
 * cdef inline int time_second(object o):
 *     return PyDateTime_TIME_GET_SECOND(o)             # <<<<<<<<<<<<<<
 * 
 * # Get microsecond of time
 */
  __pyx_r = PyDateTime_TIME_GET_SECOND(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":179
 * 
 * # Get second of time
 * cdef inline int time_second(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_SECOND(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/datetime.pxd":183
 * 
 * # Get microsecond of time
 * cdef inline int time_microsecond(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_MICROSECOND(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_time_microsecond(PyObject *__pyx_v_o) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("time_microsecond", 0);

  /* "cpython/datetime.pxd":184
 * # Get microsecond of time
 * cdef inline int time_microsecond(object o):
 *     return PyDateTime_TIME_GET_MICROSECOND(o)             # <<<<<<<<<<<<<<
 * 
 * # Get hour of datetime
 */
  __pyx_r = PyDateTime_TIME_GET_MICROSECOND(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":183
 * 
 * # Get microsecond of time
 * cdef inline int time_microsecond(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_MICROSECOND(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/datetime.pxd":187
 * 
 * # Get hour of datetime
 * cdef inline int datetime_hour(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_HOUR(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_hour(PyObject *__pyx_v_o) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("datetime_hour", 0);

  /* "cpython/datetime.pxd":188
 * # Get hour of datetime
 * cdef inline int datetime_hour(object o):
 *     return PyDateTime_DATE_GET_HOUR(o)             # <<<<<<<<<<<<<<
 * 
 * # Get minute of datetime
 */
  __pyx_r = PyDateTime_DATE_GET_HOUR(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":187
 * 
 * # Get hour of datetime
 * cdef inline int datetime_hour(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_HOUR(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/datetime.pxd":191
 * 
 * # Get minute of datetime
 * cdef inline int datetime_minute(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_MINUTE(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_minute(PyObject *__pyx_v_o) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("datetime_minute", 0);

  /* "cpython/datetime.pxd":192
 * # Get minute of datetime
 * cdef inline int datetime_minute(object o):
 *     return PyDateTime_DATE_GET_MINUTE(o)             # <<<<<<<<<<<<<<
 * 
 * # Get second of datetime
 */
  __pyx_r = PyDateTime_DATE_GET_MINUTE(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":191
 * 
 * # Get minute of datetime
 * cdef inline int datetime_minute(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_MINUTE(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/datetime.pxd":195
 * 
 * # Get second of datetime
 * cdef inline int datetime_second(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_SECOND(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_second(PyObject *__pyx_v_o) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("datetime_second", 0);

  /* "cpython/datetime.pxd":196
 * # Get second of datetime
 * cdef inline int datetime_second(object o):
 *     return PyDateTime_DATE_GET_SECOND(o)             # <<<<<<<<<<<<<<
 * 
 * # Get microsecond of datetime
 */
  __pyx_r = PyDateTime_DATE_GET_SECOND(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":195
 * 
 * # Get second of datetime
 * cdef inline int datetime_second(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_SECOND(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/datetime.pxd":199
 * 
 * # Get microsecond of datetime
 * cdef inline int datetime_microsecond(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_MICROSECOND(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_microsecond(PyObject *__pyx_v_o) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("datetime_microsecond", 0);

  /* "cpython/datetime.pxd":200
 * # Get microsecond of datetime
 * cdef inline int datetime_microsecond(object o):
 *     return PyDateTime_DATE_GET_MICROSECOND(o)             # <<<<<<<<<<<<<<
 * 
 * # Get days of timedelta
 */
  __pyx_r = PyDateTime_DATE_GET_MICROSECOND(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":199
 * 
 * # Get microsecond of datetime
 * cdef inline int datetime_microsecond(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_MICROSECOND(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/datetime.pxd":203
 * 
 * # Get days of timedelta
 * cdef inline int timedelta_days(object o):             # <<<<<<<<<<<<<<
 *     return (<PyDateTime_Delta*>o).days
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_timedelta_days(PyObject *__pyx_v_o) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("timedelta_days", 0);

  /* "cpython/datetime.pxd":204
 * # Get days of timedelta
 * cdef inline int timedelta_days(object o):
 *     return (<PyDateTime_Delta*>o).days             # <<<<<<<<<<<<<<
 * 
 * # Get seconds of timedelta
 */
  __pyx_r = ((PyDateTime_Delta *)__pyx_v_o)->days;
  goto __pyx_L0;

  /* "cpython/datetime.pxd":203
 * 
 * # Get days of timedelta
 * cdef inline int timedelta_days(object o):             # <<<<<<<<<<<<<<
 *     return (<PyDateTime_Delta*>o).days
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/datetime.pxd":207
 * 
 * # Get seconds of timedelta
 * cdef inline int timedelta_seconds(object o):             # <<<<<<<<<<<<<<
 *     return (<PyDateTime_Delta*>o).seconds
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_timedelta_seconds(PyObject *__pyx_v_o) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("timedelta_seconds", 0);

  /* "cpython/datetime.pxd":208
 * # Get seconds of timedelta
 * cdef inline int timedelta_seconds(object o):
 *     return (<PyDateTime_Delta*>o).seconds             # <<<<<<<<<<<<<<
 * 
 * # Get microseconds of timedelta
 */
  __pyx_r = ((PyDateTime_Delta *)__pyx_v_o)->seconds;
  goto __pyx_L0;

  /* "cpython/datetime.pxd":207
 * 
 * # Get seconds of timedelta
 * cdef inline int timedelta_seconds(object o):             # <<<<<<<<<<<<<<
 *     return (<PyDateTime_Delta*>o).seconds
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/datetime.pxd":211
 * 
 * # Get microseconds of timedelta
 * cdef inline int timedelta_microseconds(object o):             # <<<<<<<<<<<<<<
 *     return (<PyDateTime_Delta*>o).microseconds
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_timedelta_microseconds(PyObject *__pyx_v_o) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("timedelta_microseconds", 0);

  /* "cpython/datetime.pxd":212
 * # Get microseconds of timedelta
 * cdef inline int timedelta_microseconds(object o):
 *     return (<PyDateTime_Delta*>o).microseconds             # <<<<<<<<<<<<<<
 */
  __pyx_r = ((PyDateTime_Delta *)__pyx_v_o)->microseconds;
  goto __pyx_L0;

  /* "cpython/datetime.pxd":211
 * 
 * # Get microseconds of timedelta
 * cdef inline int timedelta_microseconds(object o):             # <<<<<<<<<<<<<<
 *     return (<PyDateTime_Delta*>o).microseconds
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/includes/common.pxd":106
 *     T GetResultValue[T](CResult[T]) except *
 * 
 * cdef inline object PyObject_to_object(PyObject* o):             # <<<<<<<<<<<<<<
 *     # Cast to "object" increments reference count
 *     cdef object result = <object> o
 */

static CYTHON_INLINE PyObject *__pyx_f_7pyarrow_8includes_6common_PyObject_to_object(PyObject *__pyx_v_o) {
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("PyObject_to_object", 0);

  /* "pyarrow/includes/common.pxd":108
 * cdef inline object PyObject_to_object(PyObject* o):
 *     # Cast to "object" increments reference count
 *     cdef object result = <object> o             # <<<<<<<<<<<<<<
 *     cpython.Py_DECREF(result)
 *     return result
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_o);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/includes/common.pxd":109
 *     # Cast to "object" increments reference count
 *     cdef object result = <object> o
 *     cpython.Py_DECREF(result)             # <<<<<<<<<<<<<<
 *     return result
 */
  Py_DECREF(__pyx_v_result);

  /* "pyarrow/includes/common.pxd":110
 *     cdef object result = <object> o
 *     cpython.Py_DECREF(result)
 *     return result             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/includes/common.pxd":106
 *     T GetResultValue[T](CResult[T]) except *
 * 
 * cdef inline object PyObject_to_object(PyObject* o):             # <<<<<<<<<<<<<<
 *     # Cast to "object" increments reference count
 *     cdef object result = <object> o
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "string.to_py":31
 * 
 * @cname("__pyx_convert_PyObject_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())
 * cdef extern from *:
 */

static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__pyx_convert_PyObject_string_to_py_std__in_string", 0);

  /* "string.to_py":32
 * @cname("__pyx_convert_PyObject_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s):
 *     return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())             # <<<<<<<<<<<<<<
 * cdef extern from *:
 *     cdef object __Pyx_PyUnicode_FromStringAndSize(const char*, size_t)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "string.to_py":31
 * 
 * @cname("__pyx_convert_PyObject_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())
 * cdef extern from *:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("string.to_py.__pyx_convert_PyObject_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "string.to_py":37
 * 
 * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size())
 * cdef extern from *:
 */

static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__pyx_convert_PyUnicode_string_to_py_std__in_string", 0);

  /* "string.to_py":38
 * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s):
 *     return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size())             # <<<<<<<<<<<<<<
 * cdef extern from *:
 *     cdef object __Pyx_PyStr_FromStringAndSize(const char*, size_t)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyUnicode_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "string.to_py":37
 * 
 * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size())
 * cdef extern from *:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("string.to_py.__pyx_convert_PyUnicode_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "string.to_py":43
 * 
 * @cname("__pyx_convert_PyStr_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyStr_FromStringAndSize(s.data(), s.size())
 * cdef extern from *:
 */

static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__pyx_convert_PyStr_string_to_py_std__in_string", 0);

  /* "string.to_py":44
 * @cname("__pyx_convert_PyStr_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s):
 *     return __Pyx_PyStr_FromStringAndSize(s.data(), s.size())             # <<<<<<<<<<<<<<
 * cdef extern from *:
 *     cdef object __Pyx_PyBytes_FromStringAndSize(const char*, size_t)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyStr_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "string.to_py":43
 * 
 * @cname("__pyx_convert_PyStr_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyStr_FromStringAndSize(s.data(), s.size())
 * cdef extern from *:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("string.to_py.__pyx_convert_PyStr_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "string.to_py":49
 * 
 * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size())
 * cdef extern from *:
 */

static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__pyx_convert_PyBytes_string_to_py_std__in_string", 0);

  /* "string.to_py":50
 * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s):
 *     return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size())             # <<<<<<<<<<<<<<
 * cdef extern from *:
 *     cdef object __Pyx_PyByteArray_FromStringAndSize(const char*, size_t)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "string.to_py":49
 * 
 * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size())
 * cdef extern from *:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("string.to_py.__pyx_convert_PyBytes_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "string.to_py":55
 * 
 * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())
 * 
 */

static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__pyx_convert_PyByteArray_string_to_py_std__in_string", 0);

  /* "string.to_py":56
 * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s):
 *     return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())             # <<<<<<<<<<<<<<
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyByteArray_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "string.to_py":55
 * 
 * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string")
 * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s):             # <<<<<<<<<<<<<<
 *     return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("string.to_py.__pyx_convert_PyByteArray_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "string.from_py":13
 * 
 * @cname("__pyx_convert_string_from_py_std__in_string")
 * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length = 0
 *     cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
 */

static std::string __pyx_convert_string_from_py_std__in_string(PyObject *__pyx_v_o) {
  Py_ssize_t __pyx_v_length;
  char const *__pyx_v_data;
  std::string __pyx_r;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  __Pyx_RefNannySetupContext("__pyx_convert_string_from_py_std__in_string", 0);

  /* "string.from_py":14
 * @cname("__pyx_convert_string_from_py_std__in_string")
 * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:
 *     cdef Py_ssize_t length = 0             # <<<<<<<<<<<<<<
 *     cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
 *     return string(data, length)
 */
  __pyx_v_length = 0;

  /* "string.from_py":15
 * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:
 *     cdef Py_ssize_t length = 0
 *     cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)             # <<<<<<<<<<<<<<
 *     return string(data, length)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_AsStringAndSize(__pyx_v_o, (&__pyx_v_length)); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(10, 15, __pyx_L1_error)
  __pyx_v_data = __pyx_t_1;

  /* "string.from_py":16
 *     cdef Py_ssize_t length = 0
 *     cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
 *     return string(data, length)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = std::string(__pyx_v_data, __pyx_v_length);
  goto __pyx_L0;

  /* "string.from_py":13
 * 
 * @cname("__pyx_convert_string_from_py_std__in_string")
 * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length = 0
 *     cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("string.from_py.__pyx_convert_string_from_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "vector.to_py":60
 * 
 * @cname("__pyx_convert_vector_to_py_int8_t")
 * cdef object __pyx_convert_vector_to_py_int8_t(vector[X]& v):             # <<<<<<<<<<<<<<
 *     return [v[i] for i in range(v.size())]
 * 
 */

static PyObject *__pyx_convert_vector_to_py_int8_t(const std::vector<int8_t>  &__pyx_v_v) {
  size_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_int8_t", 0);

  /* "vector.to_py":61
 * @cname("__pyx_convert_vector_to_py_int8_t")
 * cdef object __pyx_convert_vector_to_py_int8_t(vector[X]& v):
 *     return [v[i] for i in range(v.size())]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_v_v.size();
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;
    __pyx_t_5 = __Pyx_PyInt_From_int8_t((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 61, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(10, 61, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "vector.to_py":60
 * 
 * @cname("__pyx_convert_vector_to_py_int8_t")
 * cdef object __pyx_convert_vector_to_py_int8_t(vector[X]& v):             # <<<<<<<<<<<<<<
 *     return [v[i] for i in range(v.size())]
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_int8_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "vector.from_py":45
 * 
 * @cname("__pyx_convert_vector_from_py_int8_t")
 * cdef vector[X] __pyx_convert_vector_from_py_int8_t(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef vector[X] v
 *     for item in o:
 */

static std::vector<int8_t>  __pyx_convert_vector_from_py_int8_t(PyObject *__pyx_v_o) {
  std::vector<int8_t>  __pyx_v_v;
  PyObject *__pyx_v_item = NULL;
  std::vector<int8_t>  __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int8_t __pyx_t_5;
  __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_int8_t", 0);

  /* "vector.from_py":47
 * cdef vector[X] __pyx_convert_vector_from_py_int8_t(object o) except *:
 *     cdef vector[X] v
 *     for item in o:             # <<<<<<<<<<<<<<
 *         v.push_back(<X>item)
 *     return v
 */
  if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
    __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 47, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 47, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(10, 47, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 47, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(10, 47, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 47, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(10, 47, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "vector.from_py":48
 *     cdef vector[X] v
 *     for item in o:
 *         v.push_back(<X>item)             # <<<<<<<<<<<<<<
 *     return v
 * 
 */
    __pyx_t_5 = __Pyx_PyInt_As_int8_t(__pyx_v_item); if (unlikely((__pyx_t_5 == ((int8_t)-1)) && PyErr_Occurred())) __PYX_ERR(10, 48, __pyx_L1_error)
    __pyx_v_v.push_back(((int8_t)__pyx_t_5));

    /* "vector.from_py":47
 * cdef vector[X] __pyx_convert_vector_from_py_int8_t(object o) except *:
 *     cdef vector[X] v
 *     for item in o:             # <<<<<<<<<<<<<<
 *         v.push_back(<X>item)
 *     return v
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "vector.from_py":49
 *     for item in o:
 *         v.push_back(<X>item)
 *     return v             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_v;
  goto __pyx_L0;

  /* "vector.from_py":45
 * 
 * @cname("__pyx_convert_vector_from_py_int8_t")
 * cdef vector[X] __pyx_convert_vector_from_py_int8_t(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef vector[X] v
 *     for item in o:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py_int8_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "set.from_py":108
 * 
 * @cname("__pyx_convert_unordered_set_from_py_std_3a__3a_string")
 * cdef set[X] __pyx_convert_unordered_set_from_py_std_3a__3a_string(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef set[X] s
 *     for item in o:
 */

static std::unordered_set<std::string>  __pyx_convert_unordered_set_from_py_std_3a__3a_string(PyObject *__pyx_v_o) {
  std::unordered_set<std::string>  __pyx_v_s;
  PyObject *__pyx_v_item = NULL;
  std::unordered_set<std::string>  __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  std::string __pyx_t_5;
  __Pyx_RefNannySetupContext("__pyx_convert_unordered_set_from_py_std_3a__3a_string", 0);

  /* "set.from_py":110
 * cdef set[X] __pyx_convert_unordered_set_from_py_std_3a__3a_string(object o) except *:
 *     cdef set[X] s
 *     for item in o:             # <<<<<<<<<<<<<<
 *         s.insert(<X>item)
 *     return s
 */
  if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
    __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 110, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 110, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(10, 110, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 110, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(10, 110, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 110, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(10, 110, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "set.from_py":111
 *     cdef set[X] s
 *     for item in o:
 *         s.insert(<X>item)             # <<<<<<<<<<<<<<
 *     return s
 * 
 */
    __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_v_item); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 111, __pyx_L1_error)
    __pyx_v_s.insert(((std::string)__pyx_t_5));

    /* "set.from_py":110
 * cdef set[X] __pyx_convert_unordered_set_from_py_std_3a__3a_string(object o) except *:
 *     cdef set[X] s
 *     for item in o:             # <<<<<<<<<<<<<<
 *         s.insert(<X>item)
 *     return s
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "set.from_py":112
 *     for item in o:
 *         s.insert(<X>item)
 *     return s             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_s;
  goto __pyx_L0;

  /* "set.from_py":108
 * 
 * @cname("__pyx_convert_unordered_set_from_py_std_3a__3a_string")
 * cdef set[X] __pyx_convert_unordered_set_from_py_std_3a__3a_string(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef set[X] s
 *     for item in o:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("set.from_py.__pyx_convert_unordered_set_from_py_std_3a__3a_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "vector.to_py":60
 * 
 * @cname("__pyx_convert_vector_to_py_std_3a__3a_string")
 * cdef object __pyx_convert_vector_to_py_std_3a__3a_string(vector[X]& v):             # <<<<<<<<<<<<<<
 *     return [v[i] for i in range(v.size())]
 * 
 */

static PyObject *__pyx_convert_vector_to_py_std_3a__3a_string(const std::vector<std::string>  &__pyx_v_v) {
  size_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_std_3a__3a_string", 0);

  /* "vector.to_py":61
 * @cname("__pyx_convert_vector_to_py_std_3a__3a_string")
 * cdef object __pyx_convert_vector_to_py_std_3a__3a_string(vector[X]& v):
 *     return [v[i] for i in range(v.size())]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_v_v.size();
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;
    __pyx_t_5 = __pyx_convert_PyBytes_string_to_py_std__in_string((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 61, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(10, 61, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "vector.to_py":60
 * 
 * @cname("__pyx_convert_vector_to_py_std_3a__3a_string")
 * cdef object __pyx_convert_vector_to_py_std_3a__3a_string(vector[X]& v):             # <<<<<<<<<<<<<<
 *     return [v[i] for i in range(v.size())]
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_std_3a__3a_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_convert_vector_to_py_int64_t(const std::vector<int64_t>  &__pyx_v_v) {
  size_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_int64_t", 0);

  /* "vector.to_py":61
 * @cname("__pyx_convert_vector_to_py_int64_t")
 * cdef object __pyx_convert_vector_to_py_int64_t(vector[X]& v):
 *     return [v[i] for i in range(v.size())]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_v_v.size();
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;
    __pyx_t_5 = __Pyx_PyInt_From_int64_t((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 61, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(10, 61, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "vector.to_py":60
 * 
 * @cname("__pyx_convert_vector_to_py_int64_t")
 * cdef object __pyx_convert_vector_to_py_int64_t(vector[X]& v):             # <<<<<<<<<<<<<<
 *     return [v[i] for i in range(v.size())]
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_int64_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "map.from_py":174
 * 
 * @cname("__pyx_convert_unordered_map_from_py_std_3a__3a_string__and_std_3a__3a_string")
 * cdef map[X,Y] __pyx_convert_unordered_map_from_py_std_3a__3a_string__and_std_3a__3a_string(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef dict d = o
 *     cdef map[X,Y] m
 */

static std::unordered_map<std::string,std::string>  __pyx_convert_unordered_map_from_py_std_3a__3a_string__and_std_3a__3a_string(PyObject *__pyx_v_o) {
  PyObject *__pyx_v_d = 0;
  std::unordered_map<std::string,std::string>  __pyx_v_m;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_value = NULL;
  std::unordered_map<std::string,std::string>  __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  std::string __pyx_t_8;
  std::string __pyx_t_9;
  __Pyx_RefNannySetupContext("__pyx_convert_unordered_map_from_py_std_3a__3a_string__and_std_3a__3a_string", 0);

  /* "map.from_py":175
 * @cname("__pyx_convert_unordered_map_from_py_std_3a__3a_string__and_std_3a__3a_string")
 * cdef map[X,Y] __pyx_convert_unordered_map_from_py_std_3a__3a_string__and_std_3a__3a_string(object o) except *:
 *     cdef dict d = o             # <<<<<<<<<<<<<<
 *     cdef map[X,Y] m
 *     for key, value in d.iteritems():
 */
  if (!(likely(PyDict_CheckExact(__pyx_v_o))||((__pyx_v_o) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_o)->tp_name), 0))) __PYX_ERR(10, 175, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_o;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_d = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "map.from_py":177
 *     cdef dict d = o
 *     cdef map[X,Y] m
 *     for key, value in d.iteritems():             # <<<<<<<<<<<<<<
 *         m.insert(pair[X,Y](<X>key, <Y>value))
 *     return m
 */
  __pyx_t_2 = 0;
  if (unlikely(__pyx_v_d == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
    __PYX_ERR(10, 177, __pyx_L1_error)
  }
  __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_d, 1, __pyx_n_s_iteritems, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_1);
  __pyx_t_1 = __pyx_t_5;
  __pyx_t_5 = 0;
  while (1) {
    __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4);
    if (unlikely(__pyx_t_7 == 0)) break;
    if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(10, 177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "map.from_py":178
 *     cdef map[X,Y] m
 *     for key, value in d.iteritems():
 *         m.insert(pair[X,Y](<X>key, <Y>value))             # <<<<<<<<<<<<<<
 *     return m
 * 
 */
    __pyx_t_8 = __pyx_convert_string_from_py_std__in_string(__pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 178, __pyx_L1_error)
    __pyx_t_9 = __pyx_convert_string_from_py_std__in_string(__pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 178, __pyx_L1_error)
    __pyx_v_m.insert(std::pair<std::string,std::string> (((std::string)__pyx_t_8), ((std::string)__pyx_t_9)));
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "map.from_py":179
 *     for key, value in d.iteritems():
 *         m.insert(pair[X,Y](<X>key, <Y>value))
 *     return m             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_m;
  goto __pyx_L0;

  /* "map.from_py":174
 * 
 * @cname("__pyx_convert_unordered_map_from_py_std_3a__3a_string__and_std_3a__3a_string")
 * cdef map[X,Y] __pyx_convert_unordered_map_from_py_std_3a__3a_string__and_std_3a__3a_string(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef dict d = o
 *     cdef map[X,Y] m
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("map.from_py.__pyx_convert_unordered_map_from_py_std_3a__3a_string__and_std_3a__3a_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_d);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "vector.from_py":45
 * 
 * @cname("__pyx_convert_vector_from_py_std_3a__3a_string")
 * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_string(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef vector[X] v
 *     for item in o:
 */

static std::vector<std::string>  __pyx_convert_vector_from_py_std_3a__3a_string(PyObject *__pyx_v_o) {
  std::vector<std::string>  __pyx_v_v;
  PyObject *__pyx_v_item = NULL;
  std::vector<std::string>  __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  std::string __pyx_t_5;
  __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_std_3a__3a_string", 0);

  /* "vector.from_py":47
 * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_string(object o) except *:
 *     cdef vector[X] v
 *     for item in o:             # <<<<<<<<<<<<<<
 *         v.push_back(<X>item)
 *     return v
 */
  if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
    __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 47, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 47, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(10, 47, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 47, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(10, 47, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 47, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(10, 47, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "vector.from_py":48
 *     cdef vector[X] v
 *     for item in o:
 *         v.push_back(<X>item)             # <<<<<<<<<<<<<<
 *     return v
 * 
 */
    __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_v_item); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 48, __pyx_L1_error)
    __pyx_v_v.push_back(((std::string)__pyx_t_5));

    /* "vector.from_py":47
 * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_string(object o) except *:
 *     cdef vector[X] v
 *     for item in o:             # <<<<<<<<<<<<<<
 *         v.push_back(<X>item)
 *     return v
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "vector.from_py":49
 *     for item in o:
 *         v.push_back(<X>item)
 *     return v             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_v;
  goto __pyx_L0;

  /* "vector.from_py":45
 * 
 * @cname("__pyx_convert_vector_from_py_std_3a__3a_string")
 * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_string(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef vector[X] v
 *     for item in o:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py_std_3a__3a_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_tp_new_7pyarrow_3lib_Message(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Message *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Message *)o);
  new((void*)&(p->message)) std::unique_ptr< arrow::ipc::Message> ();
  if (unlikely(__pyx_pw_7pyarrow_3lib_7Message_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_Message(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_Message *p = (struct __pyx_obj_7pyarrow_3lib_Message *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->message);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_7Message_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_7Message_4type_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_7Message_metadata(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_7Message_8metadata_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_7Message_body(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_7Message_4body_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Message[] = {
  {"equals", (PyCFunction)__pyx_pw_7pyarrow_3lib_7Message_5equals, METH_O, __pyx_doc_7pyarrow_3lib_7Message_4equals},
  {"serialize_to", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_7Message_7serialize_to, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_7Message_6serialize_to},
  {"serialize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_7Message_9serialize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_7Message_8serialize},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_7Message_13__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_7Message_12__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_7Message_15__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_7Message_14__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_Message[] = {
  {(char *)"type", __pyx_getprop_7pyarrow_3lib_7Message_type, 0, (char *)0, 0},
  {(char *)"metadata", __pyx_getprop_7pyarrow_3lib_7Message_metadata, 0, (char *)0, 0},
  {(char *)"body", __pyx_getprop_7pyarrow_3lib_7Message_body, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Message = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Message", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Message), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Message, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_7pyarrow_3lib_7Message_11__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "Message()\n\n    Container for an Arrow IPC message with metadata and optional body\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Message, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_Message, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_7Message_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Message, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_MemoryPool __pyx_vtable_7pyarrow_3lib_MemoryPool;

static PyObject *__pyx_tp_new_7pyarrow_3lib_MemoryPool(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_MemoryPool;
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_MemoryPool(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_MemoryPool[] = {
  {"bytes_allocated", (PyCFunction)__pyx_pw_7pyarrow_3lib_10MemoryPool_3bytes_allocated, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10MemoryPool_2bytes_allocated},
  {"max_memory", (PyCFunction)__pyx_pw_7pyarrow_3lib_10MemoryPool_5max_memory, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10MemoryPool_4max_memory},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10MemoryPool_7__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10MemoryPool_6__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10MemoryPool_9__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_10MemoryPool_8__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_MemoryPool = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.MemoryPool", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_MemoryPool), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_MemoryPool, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "MemoryPool()\n\n    Base class for memory allocation.\n\n    Besides tracking its number of allocated bytes, a memory pool also\n    takes care of the required 64-byte alignment for Arrow data.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_MemoryPool, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_10MemoryPool_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_MemoryPool, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DataType __pyx_vtable_7pyarrow_3lib_DataType;

static PyObject *__pyx_tp_new_7pyarrow_3lib_DataType(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_DataType *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_DataType *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_DataType;
  new((void*)&(p->sp_type)) std::shared_ptr< arrow::DataType> ();
  p->pep3118_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7pyarrow_3lib_8DataType_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_DataType(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_DataType *p = (struct __pyx_obj_7pyarrow_3lib_DataType *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  if (p->__weakref__) PyObject_ClearWeakRefs(o);
  __Pyx_call_destructor(p->sp_type);
  Py_CLEAR(p->pep3118_format);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_tp_richcompare_7pyarrow_3lib_DataType(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_3lib_8DataType_13__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_3lib_8DataType_13__eq__(o1, o2);
      if (likely(ret && ret != Py_NotImplemented)) {
        int b = __Pyx_PyObject_IsTrue(ret); Py_DECREF(ret);
        if (unlikely(b < 0)) return NULL;
        ret = (b) ? Py_False : Py_True;
        Py_INCREF(ret);
      }
      return ret;
    }
    default: {
      return __Pyx_NewRef(Py_NotImplemented);
    }
  }
}

static PyObject *__pyx_getprop_7pyarrow_3lib_8DataType_id(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_8DataType_2id_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_8DataType_bit_width(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_8DataType_9bit_width_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_8DataType_num_children(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_8DataType_12num_children_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_8DataType_num_buffers(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_8DataType_11num_buffers_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_DataType[] = {
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_8DataType_9__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_8DataType_8__reduce__},
  {"equals", (PyCFunction)__pyx_pw_7pyarrow_3lib_8DataType_15equals, METH_O, __pyx_doc_7pyarrow_3lib_8DataType_14equals},
  {"to_pandas_dtype", (PyCFunction)__pyx_pw_7pyarrow_3lib_8DataType_17to_pandas_dtype, METH_NOARGS, __pyx_doc_7pyarrow_3lib_8DataType_16to_pandas_dtype},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_DataType[] = {
  {(char *)"id", __pyx_getprop_7pyarrow_3lib_8DataType_id, 0, (char *)0, 0},
  {(char *)"bit_width", __pyx_getprop_7pyarrow_3lib_8DataType_bit_width, 0, (char *)0, 0},
  {(char *)"num_children", __pyx_getprop_7pyarrow_3lib_8DataType_num_children, 0, (char *)"\n        The number of child fields.\n        ", 0},
  {(char *)"num_buffers", __pyx_getprop_7pyarrow_3lib_8DataType_num_buffers, 0, (char *)"\n        Number of data buffers required to construct Array type\n        excluding children\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_DataType = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.DataType", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_DataType), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DataType, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_7pyarrow_3lib_8DataType_11__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  __pyx_pw_7pyarrow_3lib_8DataType_7__hash__, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_7pyarrow_3lib_8DataType_5__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "DataType()\n\n    Base class of all Arrow data types.\n\n    Each data type is an *instance* of this class.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_3lib_DataType, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_DataType, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_DataType, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_8DataType_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_DataType, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ListType __pyx_vtable_7pyarrow_3lib_ListType;

static PyObject *__pyx_tp_new_7pyarrow_3lib_ListType(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_ListType *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_DataType(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_ListType *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_DataType*)__pyx_vtabptr_7pyarrow_3lib_ListType;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_8ListType_value_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_8ListType_10value_type_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_ListType[] = {
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_8ListType_1__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_8ListType___reduce__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_ListType[] = {
  {(char *)"value_type", __pyx_getprop_7pyarrow_3lib_8ListType_value_type, 0, (char *)"\n        The data type of list values.\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_ListType = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.ListType", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_ListType), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DataType, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_11__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Concrete class for list data types.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_ListType, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_ListType, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_3__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_ListType, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_LargeListType __pyx_vtable_7pyarrow_3lib_LargeListType;

static PyObject *__pyx_tp_new_7pyarrow_3lib_LargeListType(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_LargeListType *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_DataType(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_LargeListType *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_DataType*)__pyx_vtabptr_7pyarrow_3lib_LargeListType;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_13LargeListType_value_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_13LargeListType_10value_type_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_LargeListType[] = {
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_13LargeListType_1__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_13LargeListType___reduce__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_LargeListType[] = {
  {(char *)"value_type", __pyx_getprop_7pyarrow_3lib_13LargeListType_value_type, 0, (char *)"\n        The data type of large list values.\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_LargeListType = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.LargeListType", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_LargeListType), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DataType, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_11__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Concrete class for large list data types\n    (like ListType, but with 64-bit offsets).\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_LargeListType, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_LargeListType, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_3__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_LargeListType, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_MapType __pyx_vtable_7pyarrow_3lib_MapType;

static PyObject *__pyx_tp_new_7pyarrow_3lib_MapType(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_MapType *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_DataType(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_MapType *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_DataType*)__pyx_vtabptr_7pyarrow_3lib_MapType;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_7MapType_key_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_7MapType_8key_type_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_7MapType_item_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_7MapType_9item_type_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_MapType[] = {
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_7MapType_1__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_7MapType___reduce__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_MapType[] = {
  {(char *)"key_type", __pyx_getprop_7pyarrow_3lib_7MapType_key_type, 0, (char *)"\n        The data type of keys in the map entries.\n        ", 0},
  {(char *)"item_type", __pyx_getprop_7pyarrow_3lib_7MapType_item_type, 0, (char *)"\n        The data type of items in the map entries.\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_MapType = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.MapType", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_MapType), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DataType, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_11__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Concrete class for map data types.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_MapType, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_MapType, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_3__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_MapType, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeListType __pyx_vtable_7pyarrow_3lib_FixedSizeListType;

static PyObject *__pyx_tp_new_7pyarrow_3lib_FixedSizeListType(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_FixedSizeListType *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_DataType(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_FixedSizeListType *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_DataType*)__pyx_vtabptr_7pyarrow_3lib_FixedSizeListType;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_17FixedSizeListType_value_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_17FixedSizeListType_10value_type_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_17FixedSizeListType_list_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_17FixedSizeListType_9list_size_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_FixedSizeListType[] = {
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_17FixedSizeListType_1__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_17FixedSizeListType___reduce__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_FixedSizeListType[] = {
  {(char *)"value_type", __pyx_getprop_7pyarrow_3lib_17FixedSizeListType_value_type, 0, (char *)"\n        The data type of large list values.\n        ", 0},
  {(char *)"list_size", __pyx_getprop_7pyarrow_3lib_17FixedSizeListType_list_size, 0, (char *)"\n        The size of the fixed size lists.\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_FixedSizeListType = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.FixedSizeListType", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedSizeListType), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DataType, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_11__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Concrete class for fixed size list data types.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_FixedSizeListType, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_FixedSizeListType, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_3__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_FixedSizeListType, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_StructType __pyx_vtable_7pyarrow_3lib_StructType;

static PyObject *__pyx_tp_new_7pyarrow_3lib_StructType(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_StructType *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_DataType(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_StructType *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_DataType*)__pyx_vtabptr_7pyarrow_3lib_StructType;
  return o;
}
static PyObject *__pyx_sq_item_7pyarrow_3lib_StructType(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_StructType[] = {
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10StructType_8__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10StructType_7__reduce__},
  {0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_StructType = {
  __pyx_pw_7pyarrow_3lib_10StructType_1__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_7pyarrow_3lib_StructType, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_StructType = {
  __pyx_pw_7pyarrow_3lib_10StructType_1__len__, /*mp_length*/
  __pyx_pw_7pyarrow_3lib_10StructType_6__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7pyarrow_3lib_StructType = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.StructType", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_StructType), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DataType, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_11__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_StructType, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_StructType, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Concrete class for struct data types.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7pyarrow_3lib_10StructType_3__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_StructType, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_3__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_StructType, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib_DictionaryMemo(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *)o);
  new((void*)&(p->sp_memo)) std::shared_ptr< arrow::ipc::DictionaryMemo> ();
  if (unlikely(__pyx_pw_7pyarrow_3lib_14DictionaryMemo_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_DictionaryMemo(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *p = (struct __pyx_obj_7pyarrow_3lib_DictionaryMemo *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->sp_memo);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_DictionaryMemo[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_14DictionaryMemo_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_14DictionaryMemo_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_14DictionaryMemo_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_14DictionaryMemo_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_DictionaryMemo = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.DictionaryMemo", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_DictionaryMemo), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DictionaryMemo, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Tracking container for dictionary-encoded fields\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_DictionaryMemo, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_DictionaryMemo, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DictionaryType __pyx_vtable_7pyarrow_3lib_DictionaryType;

static PyObject *__pyx_tp_new_7pyarrow_3lib_DictionaryType(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_DictionaryType *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_DataType(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_DictionaryType *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_DataType*)__pyx_vtabptr_7pyarrow_3lib_DictionaryType;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14DictionaryType_ordered(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14DictionaryType_7ordered_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14DictionaryType_index_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14DictionaryType_10index_type_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14DictionaryType_value_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14DictionaryType_10value_type_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_DictionaryType[] = {
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_14DictionaryType_1__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_14DictionaryType___reduce__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_DictionaryType[] = {
  {(char *)"ordered", __pyx_getprop_7pyarrow_3lib_14DictionaryType_ordered, 0, (char *)"\n        Whether the dictionary is ordered, i.e. whether the ordering of values\n        in the dictionary is important.\n        ", 0},
  {(char *)"index_type", __pyx_getprop_7pyarrow_3lib_14DictionaryType_index_type, 0, (char *)"\n        The data type of dictionary indices (a signed integer type).\n        ", 0},
  {(char *)"value_type", __pyx_getprop_7pyarrow_3lib_14DictionaryType_value_type, 0, (char *)"\n        The dictionary value type. The dictionary values are found in an\n        instance of DictionaryArray\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_DictionaryType = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.DictionaryType", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_DictionaryType), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DataType, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_11__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Concrete class for dictionary data types.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_DictionaryType, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_DictionaryType, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_3__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_DictionaryType, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_TimestampType __pyx_vtable_7pyarrow_3lib_TimestampType;

static PyObject *__pyx_tp_new_7pyarrow_3lib_TimestampType(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_TimestampType *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_DataType(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_TimestampType *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_DataType*)__pyx_vtabptr_7pyarrow_3lib_TimestampType;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_13TimestampType_unit(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_13TimestampType_4unit_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_13TimestampType_tz(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_13TimestampType_2tz_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_TimestampType[] = {
  {"to_pandas_dtype", (PyCFunction)__pyx_pw_7pyarrow_3lib_13TimestampType_1to_pandas_dtype, METH_NOARGS, __pyx_doc_7pyarrow_3lib_13TimestampType_to_pandas_dtype},
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_13TimestampType_3__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_13TimestampType_2__reduce__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_TimestampType[] = {
  {(char *)"unit", __pyx_getprop_7pyarrow_3lib_13TimestampType_unit, 0, (char *)"\n        The timestamp unit ('s', 'ms', 'us' or 'ns').\n        ", 0},
  {(char *)"tz", __pyx_getprop_7pyarrow_3lib_13TimestampType_tz, 0, (char *)"\n        The timestamp time zone, if any, or None.\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_TimestampType = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.TimestampType", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_TimestampType), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DataType, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_11__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Concrete class for timestamp data types.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_TimestampType, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_TimestampType, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_3__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_TimestampType, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Time32Type __pyx_vtable_7pyarrow_3lib_Time32Type;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Time32Type(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Time32Type *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_DataType(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Time32Type *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_DataType*)__pyx_vtabptr_7pyarrow_3lib_Time32Type;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_10Time32Type_unit(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_10Time32Type_4unit_1__get__(o);
}

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_Time32Type[] = {
  {(char *)"unit", __pyx_getprop_7pyarrow_3lib_10Time32Type_unit, 0, (char *)"\n        The time unit ('s', 'ms', 'us' or 'ns').\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Time32Type = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Time32Type", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Time32Type), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DataType, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_11__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Concrete class for time32 data types.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_Time32Type, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_3__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Time32Type, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Time64Type __pyx_vtable_7pyarrow_3lib_Time64Type;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Time64Type(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Time64Type *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_DataType(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Time64Type *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_DataType*)__pyx_vtabptr_7pyarrow_3lib_Time64Type;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_10Time64Type_unit(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_10Time64Type_4unit_1__get__(o);
}

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_Time64Type[] = {
  {(char *)"unit", __pyx_getprop_7pyarrow_3lib_10Time64Type_unit, 0, (char *)"\n        The time unit ('s', 'ms', 'us' or 'ns').\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Time64Type = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Time64Type", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Time64Type), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DataType, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_11__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Concrete class for time64 data types.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_Time64Type, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_3__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Time64Type, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DurationType __pyx_vtable_7pyarrow_3lib_DurationType;

static PyObject *__pyx_tp_new_7pyarrow_3lib_DurationType(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_DurationType *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_DataType(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_DurationType *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_DataType*)__pyx_vtabptr_7pyarrow_3lib_DurationType;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_12DurationType_unit(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_12DurationType_4unit_1__get__(o);
}

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_DurationType[] = {
  {(char *)"unit", __pyx_getprop_7pyarrow_3lib_12DurationType_unit, 0, (char *)"\n        The duration unit ('s', 'ms', 'us' or 'ns').\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_DurationType = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.DurationType", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_DurationType), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DataType, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_11__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Concrete class for duration data types.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_DurationType, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_3__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_DurationType, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBinaryType __pyx_vtable_7pyarrow_3lib_FixedSizeBinaryType;

static PyObject *__pyx_tp_new_7pyarrow_3lib_FixedSizeBinaryType(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_DataType(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_DataType*)__pyx_vtabptr_7pyarrow_3lib_FixedSizeBinaryType;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_19FixedSizeBinaryType_byte_width(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_19FixedSizeBinaryType_10byte_width_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_FixedSizeBinaryType[] = {
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_19FixedSizeBinaryType_1__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_19FixedSizeBinaryType___reduce__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_FixedSizeBinaryType[] = {
  {(char *)"byte_width", __pyx_getprop_7pyarrow_3lib_19FixedSizeBinaryType_byte_width, 0, (char *)"\n        The binary size in bytes.\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_FixedSizeBinaryType = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.FixedSizeBinaryType", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DataType, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_11__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Concrete class for fixed-size binary data types.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_FixedSizeBinaryType, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_FixedSizeBinaryType, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_3__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_FixedSizeBinaryType, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Decimal128Type __pyx_vtable_7pyarrow_3lib_Decimal128Type;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Decimal128Type(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Decimal128Type *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_FixedSizeBinaryType(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Decimal128Type *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_DataType*)__pyx_vtabptr_7pyarrow_3lib_Decimal128Type;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14Decimal128Type_precision(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14Decimal128Type_9precision_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14Decimal128Type_scale(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14Decimal128Type_5scale_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Decimal128Type[] = {
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_14Decimal128Type_1__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_14Decimal128Type___reduce__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_Decimal128Type[] = {
  {(char *)"precision", __pyx_getprop_7pyarrow_3lib_14Decimal128Type_precision, 0, (char *)"\n        The decimal precision, in number of decimal digits (an integer).\n        ", 0},
  {(char *)"scale", __pyx_getprop_7pyarrow_3lib_14Decimal128Type_scale, 0, (char *)"\n        The decimal scale (an integer).\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Decimal128Type = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Decimal128Type", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal128Type), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DataType, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_11__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Concrete class for decimal128 data types.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Decimal128Type, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_Decimal128Type, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_3__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Decimal128Type, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BaseExtensionType __pyx_vtable_7pyarrow_3lib_BaseExtensionType;

static PyObject *__pyx_tp_new_7pyarrow_3lib_BaseExtensionType(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_BaseExtensionType *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_DataType(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_BaseExtensionType *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_DataType*)__pyx_vtabptr_7pyarrow_3lib_BaseExtensionType;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_17BaseExtensionType_extension_name(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_17BaseExtensionType_14extension_name_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_17BaseExtensionType_storage_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_17BaseExtensionType_12storage_type_1__get__(o);
}

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_BaseExtensionType[] = {
  {(char *)"extension_name", __pyx_getprop_7pyarrow_3lib_17BaseExtensionType_extension_name, 0, (char *)"\n        The extension type name.\n        ", 0},
  {(char *)"storage_type", __pyx_getprop_7pyarrow_3lib_17BaseExtensionType_storage_type, 0, (char *)"\n        The underlying storage type.\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_BaseExtensionType = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.BaseExtensionType", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_BaseExtensionType), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DataType, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_11__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Concrete base class for extension types.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_BaseExtensionType, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_3__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_BaseExtensionType, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ExtensionType __pyx_vtable_7pyarrow_3lib_ExtensionType;

static PyObject *__pyx_tp_new_7pyarrow_3lib_ExtensionType(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_ExtensionType *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_BaseExtensionType(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_ExtensionType *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_DataType*)__pyx_vtabptr_7pyarrow_3lib_ExtensionType;
  if (unlikely(__pyx_pw_7pyarrow_3lib_13ExtensionType_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static PyObject *__pyx_tp_richcompare_7pyarrow_3lib_ExtensionType(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_3lib_13ExtensionType_5__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_3lib_13ExtensionType_5__eq__(o1, o2);
      if (likely(ret && ret != Py_NotImplemented)) {
        int b = __Pyx_PyObject_IsTrue(ret); Py_DECREF(ret);
        if (unlikely(b < 0)) return NULL;
        ret = (b) ? Py_False : Py_True;
        Py_INCREF(ret);
      }
      return ret;
    }
    default: {
      return __Pyx_NewRef(Py_NotImplemented);
    }
  }
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_ExtensionType[] = {
  {"__arrow_ext_serialize__", (PyCFunction)__pyx_pw_7pyarrow_3lib_13ExtensionType_7__arrow_ext_serialize__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_13ExtensionType_6__arrow_ext_serialize__},
  {"__arrow_ext_deserialize__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_13ExtensionType_9__arrow_ext_deserialize__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_13ExtensionType_8__arrow_ext_deserialize__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_ExtensionType = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.ExtensionType", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_ExtensionType), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DataType, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_11__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "ExtensionType(DataType storage_type, extension_name)\n\n    Concrete base class for Python-defined extension types.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_3lib_ExtensionType, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_ExtensionType, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_13ExtensionType_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_ExtensionType, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_PyExtensionType __pyx_vtable_7pyarrow_3lib_PyExtensionType;

static PyObject *__pyx_tp_new_7pyarrow_3lib_PyExtensionType(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_PyExtensionType *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ExtensionType(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_PyExtensionType *)o);
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_DataType*)__pyx_vtabptr_7pyarrow_3lib_PyExtensionType;
  if (unlikely(__pyx_pw_7pyarrow_3lib_15PyExtensionType_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_PyExtensionType[] = {
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_15PyExtensionType_5__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_15PyExtensionType_4__reduce__},
  {"__arrow_ext_serialize__", (PyCFunction)__pyx_pw_7pyarrow_3lib_15PyExtensionType_7__arrow_ext_serialize__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_15PyExtensionType_6__arrow_ext_serialize__},
  {"__arrow_ext_deserialize__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_15PyExtensionType_9__arrow_ext_deserialize__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_15PyExtensionType_8__arrow_ext_deserialize__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_PyExtensionType = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.PyExtensionType", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_PyExtensionType), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DataType, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_11__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "PyExtensionType(DataType storage_type)\n\n    Concrete base class for Python-defined extension types based on pickle\n    for (de)serialization.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_PyExtensionType, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_15PyExtensionType_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_PyExtensionType, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Field __pyx_vtable_7pyarrow_3lib_Field;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Field(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Field *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Field *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_Field;
  new((void*)&(p->sp_field)) std::shared_ptr< arrow::Field> ();
  p->type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7pyarrow_3lib_5Field_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_Field(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_Field *p = (struct __pyx_obj_7pyarrow_3lib_Field *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->sp_field);
  Py_CLEAR(p->type);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_Field(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_Field *p = (struct __pyx_obj_7pyarrow_3lib_Field *)o;
  if (p->type) {
    e = (*v)(((PyObject *)p->type), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_Field(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_Field *p = (struct __pyx_obj_7pyarrow_3lib_Field *)o;
  tmp = ((PyObject*)p->type);
  p->type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_tp_richcompare_7pyarrow_3lib_Field(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_3lib_5Field_7__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_3lib_5Field_7__eq__(o1, o2);
      if (likely(ret && ret != Py_NotImplemented)) {
        int b = __Pyx_PyObject_IsTrue(ret); Py_DECREF(ret);
        if (unlikely(b < 0)) return NULL;
        ret = (b) ? Py_False : Py_True;
        Py_INCREF(ret);
      }
      return ret;
    }
    default: {
      return __Pyx_NewRef(Py_NotImplemented);
    }
  }
}

static PyObject *__pyx_getprop_7pyarrow_3lib_5Field_nullable(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_5Field_8nullable_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_5Field_name(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_5Field_4name_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_5Field_metadata(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_5Field_8metadata_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_5Field_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_5Field_4type_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Field[] = {
  {"equals", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Field_5equals, METH_O, __pyx_doc_7pyarrow_3lib_5Field_4equals},
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Field_9__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Field_8__reduce__},
  {"add_metadata", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Field_17add_metadata, METH_O, __pyx_doc_7pyarrow_3lib_5Field_16add_metadata},
  {"with_metadata", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Field_19with_metadata, METH_O, __pyx_doc_7pyarrow_3lib_5Field_18with_metadata},
  {"remove_metadata", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Field_21remove_metadata, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Field_20remove_metadata},
  {"flatten", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Field_23flatten, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Field_22flatten},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_Field[] = {
  {(char *)"nullable", __pyx_getprop_7pyarrow_3lib_5Field_nullable, 0, (char *)0, 0},
  {(char *)"name", __pyx_getprop_7pyarrow_3lib_5Field_name, 0, (char *)0, 0},
  {(char *)"metadata", __pyx_getprop_7pyarrow_3lib_5Field_metadata, 0, (char *)0, 0},
  {(char *)"type", __pyx_getprop_7pyarrow_3lib_5Field_type, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Field = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Field", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Field), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Field, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_7pyarrow_3lib_5Field_13__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  __pyx_pw_7pyarrow_3lib_5Field_15__hash__, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_7pyarrow_3lib_5Field_11__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Field()\n\n    A named field, with a data type, nullability, and optional metadata.\n\n    Notes\n    -----\n    Do not use this class's constructor directly; use pyarrow.field\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Field, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Field, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_3lib_Field, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Field, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_Field, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_5Field_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Field, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Schema __pyx_vtable_7pyarrow_3lib_Schema;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Schema(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Schema *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Schema *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_Schema;
  new((void*)&(p->sp_schema)) std::shared_ptr< arrow::Schema> ();
  if (unlikely(__pyx_pw_7pyarrow_3lib_6Schema_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_Schema(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_Schema *p = (struct __pyx_obj_7pyarrow_3lib_Schema *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->sp_schema);
  (*Py_TYPE(o)->tp_free)(o);
}
static PyObject *__pyx_sq_item_7pyarrow_3lib_Schema(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyObject *__pyx_tp_richcompare_7pyarrow_3lib_Schema(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_3lib_6Schema_18__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_3lib_6Schema_18__eq__(o1, o2);
      if (likely(ret && ret != Py_NotImplemented)) {
        int b = __Pyx_PyObject_IsTrue(ret); Py_DECREF(ret);
        if (unlikely(b < 0)) return NULL;
        ret = (b) ? Py_False : Py_True;
        Py_INCREF(ret);
      }
      return ret;
    }
    default: {
      return __Pyx_NewRef(Py_NotImplemented);
    }
  }
}

static PyObject *__pyx_getprop_7pyarrow_3lib_6Schema_pandas_metadata(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Schema_15pandas_metadata_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_6Schema_names(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Schema_5names_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_6Schema_types(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Schema_5types_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_6Schema_metadata(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Schema_8metadata_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Schema[] = {
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Schema_12__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_6Schema_11__reduce__},
  {"__sizeof__", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Schema_16__sizeof__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_6Schema_15__sizeof__},
  {"empty_table", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Schema_20empty_table, METH_NOARGS, __pyx_doc_7pyarrow_3lib_6Schema_19empty_table},
  {"equals", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_6Schema_22equals, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_6Schema_21equals},
  {"from_pandas", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_6Schema_24from_pandas, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_6Schema_23from_pandas},
  {"field", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Schema_26field, METH_O, __pyx_doc_7pyarrow_3lib_6Schema_25field},
  {"_field", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Schema_28_field, METH_O, __pyx_doc_7pyarrow_3lib_6Schema_27_field},
  {"field_by_name", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Schema_30field_by_name, METH_O, __pyx_doc_7pyarrow_3lib_6Schema_29field_by_name},
  {"get_field_index", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Schema_32get_field_index, METH_O, __pyx_doc_7pyarrow_3lib_6Schema_31get_field_index},
  {"append", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Schema_34append, METH_O, __pyx_doc_7pyarrow_3lib_6Schema_33append},
  {"insert", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_6Schema_36insert, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_6Schema_35insert},
  {"remove", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Schema_38remove, METH_O, __pyx_doc_7pyarrow_3lib_6Schema_37remove},
  {"set", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_6Schema_40set, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_6Schema_39set},
  {"add_metadata", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Schema_42add_metadata, METH_O, __pyx_doc_7pyarrow_3lib_6Schema_41add_metadata},
  {"with_metadata", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Schema_44with_metadata, METH_O, __pyx_doc_7pyarrow_3lib_6Schema_43with_metadata},
  {"serialize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_6Schema_46serialize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_6Schema_45serialize},
  {"remove_metadata", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Schema_48remove_metadata, METH_NOARGS, __pyx_doc_7pyarrow_3lib_6Schema_47remove_metadata},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_Schema[] = {
  {(char *)"pandas_metadata", __pyx_getprop_7pyarrow_3lib_6Schema_pandas_metadata, 0, (char *)"\n        Return deserialized-from-JSON pandas metadata field (if it exists)\n        ", 0},
  {(char *)"names", __pyx_getprop_7pyarrow_3lib_6Schema_names, 0, (char *)"\n        The schema's field names.\n\n        Returns\n        -------\n        list of str\n        ", 0},
  {(char *)"types", __pyx_getprop_7pyarrow_3lib_6Schema_types, 0, (char *)"\n        The schema's field types.\n\n        Returns\n        -------\n        list of DataType\n        ", 0},
  {(char *)"metadata", __pyx_getprop_7pyarrow_3lib_6Schema_metadata, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_Schema = {
  __pyx_pw_7pyarrow_3lib_6Schema_5__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_7pyarrow_3lib_Schema, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Schema = {
  __pyx_pw_7pyarrow_3lib_6Schema_5__len__, /*mp_length*/
  __pyx_pw_7pyarrow_3lib_6Schema_7__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Schema = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Schema", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Schema), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Schema, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_7pyarrow_3lib_6Schema_52__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_Schema, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Schema, /*tp_as_mapping*/
  __pyx_pw_7pyarrow_3lib_6Schema_14__hash__, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_7pyarrow_3lib_6Schema_50__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "Schema()", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_3lib_Schema, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7pyarrow_3lib_6Schema_9__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Schema, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_Schema, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_6Schema_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Schema, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib_Scalar(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Scalar *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Scalar *)o);
  p->type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_Scalar(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_Scalar *p = (struct __pyx_obj_7pyarrow_3lib_Scalar *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->type);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_Scalar(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_Scalar *p = (struct __pyx_obj_7pyarrow_3lib_Scalar *)o;
  if (p->type) {
    e = (*v)(((PyObject *)p->type), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_Scalar(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_Scalar *p = (struct __pyx_obj_7pyarrow_3lib_Scalar *)o;
  tmp = ((PyObject*)p->type);
  p->type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_6Scalar_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Scalar_4type_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Scalar[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Scalar_1__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_6Scalar___reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Scalar_3__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_6Scalar_2__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_Scalar[] = {
  {(char *)"type", __pyx_getprop_7pyarrow_3lib_6Scalar_type, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Scalar = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Scalar", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Scalar), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Scalar, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    The base class for all array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Scalar, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_Scalar, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Scalar, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib_NAType(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Scalar(t, a, k);
  if (unlikely(!o)) return 0;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_NAType = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.NAType", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_NAType), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Scalar, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_NAType, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue __pyx_vtable_7pyarrow_3lib_ArrayValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_ArrayValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Scalar(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_ArrayValue *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  new((void*)&(p->sp_array)) std::shared_ptr< arrow::Array> ();
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue *p = (struct __pyx_obj_7pyarrow_3lib_ArrayValue *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->sp_array);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib_Scalar(o);
}

static PyObject *__pyx_tp_richcompare_7pyarrow_3lib_ArrayValue(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_3lib_10ArrayValue_7__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_3lib_10ArrayValue_7__eq__(o1, o2);
      if (likely(ret && ret != Py_NotImplemented)) {
        int b = __Pyx_PyObject_IsTrue(ret); Py_DECREF(ret);
        if (unlikely(b < 0)) return NULL;
        ret = (b) ? Py_False : Py_True;
        Py_INCREF(ret);
      }
      return ret;
    }
    default: {
      return __Pyx_NewRef(Py_NotImplemented);
    }
  }
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_ArrayValue[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10ArrayValue_11__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10ArrayValue_10__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10ArrayValue_13__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_10ArrayValue_12__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_ArrayValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.ArrayValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_ArrayValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  __pyx_pw_7pyarrow_3lib_10ArrayValue_9__hash__, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "ArrayValue()\n\n    The base class for non-null array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_3lib_ArrayValue, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_ArrayValue, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_ArrayValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue __pyx_vtable_7pyarrow_3lib_ScalarValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_ScalarValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_ScalarValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Scalar(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_ScalarValue *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_ScalarValue;
  new((void*)&(p->sp_scalar)) std::shared_ptr< arrow::Scalar> ();
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_ScalarValue(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_ScalarValue *p = (struct __pyx_obj_7pyarrow_3lib_ScalarValue *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->sp_scalar);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib_Scalar(o);
}

static PyObject *__pyx_tp_richcompare_7pyarrow_3lib_ScalarValue(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_3lib_11ScalarValue_7__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_3lib_11ScalarValue_7__eq__(o1, o2);
      if (likely(ret && ret != Py_NotImplemented)) {
        int b = __Pyx_PyObject_IsTrue(ret); Py_DECREF(ret);
        if (unlikely(b < 0)) return NULL;
        ret = (b) ? Py_False : Py_True;
        Py_INCREF(ret);
      }
      return ret;
    }
    default: {
      return __Pyx_NewRef(Py_NotImplemented);
    }
  }
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_ScalarValue[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11ScalarValue_11__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11ScalarValue_10__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11ScalarValue_13__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11ScalarValue_12__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_ScalarValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.ScalarValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_ScalarValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ScalarValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_7pyarrow_3lib_11ScalarValue_3__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  __pyx_pw_7pyarrow_3lib_11ScalarValue_9__hash__, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_7pyarrow_3lib_11ScalarValue_5__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "ScalarValue()\n\n    The base class for scalars.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_3lib_ScalarValue, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_ScalarValue, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_11ScalarValue_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_ScalarValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int8Value __pyx_vtable_7pyarrow_3lib_Int8Value;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Int8Value(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Int8Value *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Int8Value *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_Int8Value;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Int8Value[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_9Int8Value_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_9Int8Value_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_9Int8Value_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_9Int8Value_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_9Int8Value_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_9Int8Value_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Int8Value = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Int8Value", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int8Value), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for int8 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Int8Value, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Int8Value, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int64Value __pyx_vtable_7pyarrow_3lib_Int64Value;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Int64Value(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Int64Value *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Int64Value *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_Int64Value;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Int64Value[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_10Int64Value_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10Int64Value_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10Int64Value_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10Int64Value_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10Int64Value_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_10Int64Value_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Int64Value = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Int64Value", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int64Value), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for int64 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Int64Value, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Int64Value, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ListValue __pyx_vtable_7pyarrow_3lib_ListValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_ListValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_ListValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_ListValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_ListValue;
  p->value_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_ListValue(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_ListValue *p = (struct __pyx_obj_7pyarrow_3lib_ListValue *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->value_type);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_ListValue(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_ListValue *p = (struct __pyx_obj_7pyarrow_3lib_ListValue *)o;
  e = __pyx_tp_traverse_7pyarrow_3lib_Scalar(o, v, a); if (e) return e;
  if (p->value_type) {
    e = (*v)(((PyObject *)p->value_type), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_ListValue(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_ListValue *p = (struct __pyx_obj_7pyarrow_3lib_ListValue *)o;
  __pyx_tp_clear_7pyarrow_3lib_Scalar(o);
  tmp = ((PyObject*)p->value_type);
  p->value_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
static PyObject *__pyx_sq_item_7pyarrow_3lib_ListValue(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_9ListValue_value_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_9ListValue_10value_type_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_ListValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_9ListValue_8as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_9ListValue_7as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_9ListValue_10__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_9ListValue_9__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_9ListValue_12__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_9ListValue_11__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_ListValue[] = {
  {(char *)"value_type", __pyx_getprop_7pyarrow_3lib_9ListValue_value_type, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_ListValue = {
  __pyx_pw_7pyarrow_3lib_9ListValue_1__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_7pyarrow_3lib_ListValue, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_ListValue = {
  __pyx_pw_7pyarrow_3lib_9ListValue_1__len__, /*mp_length*/
  __pyx_pw_7pyarrow_3lib_9ListValue_3__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7pyarrow_3lib_ListValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.ListValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_ListValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ListValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_ListValue, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_ListValue, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for list array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_ListValue, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_ListValue, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7pyarrow_3lib_9ListValue_5__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_ListValue, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_ListValue, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_ListValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_LargeListValue __pyx_vtable_7pyarrow_3lib_LargeListValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_LargeListValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_LargeListValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_LargeListValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_LargeListValue;
  p->value_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_LargeListValue(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_LargeListValue *p = (struct __pyx_obj_7pyarrow_3lib_LargeListValue *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->value_type);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_LargeListValue(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_LargeListValue *p = (struct __pyx_obj_7pyarrow_3lib_LargeListValue *)o;
  e = __pyx_tp_traverse_7pyarrow_3lib_Scalar(o, v, a); if (e) return e;
  if (p->value_type) {
    e = (*v)(((PyObject *)p->value_type), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_LargeListValue(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_LargeListValue *p = (struct __pyx_obj_7pyarrow_3lib_LargeListValue *)o;
  __pyx_tp_clear_7pyarrow_3lib_Scalar(o);
  tmp = ((PyObject*)p->value_type);
  p->value_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
static PyObject *__pyx_sq_item_7pyarrow_3lib_LargeListValue(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14LargeListValue_value_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14LargeListValue_10value_type_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_LargeListValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_14LargeListValue_8as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_14LargeListValue_7as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_14LargeListValue_10__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_14LargeListValue_9__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_14LargeListValue_12__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_14LargeListValue_11__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_LargeListValue[] = {
  {(char *)"value_type", __pyx_getprop_7pyarrow_3lib_14LargeListValue_value_type, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_LargeListValue = {
  __pyx_pw_7pyarrow_3lib_14LargeListValue_1__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_7pyarrow_3lib_LargeListValue, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_LargeListValue = {
  __pyx_pw_7pyarrow_3lib_14LargeListValue_1__len__, /*mp_length*/
  __pyx_pw_7pyarrow_3lib_14LargeListValue_3__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7pyarrow_3lib_LargeListValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.LargeListValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_LargeListValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_LargeListValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_LargeListValue, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_LargeListValue, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for large list array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_LargeListValue, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_LargeListValue, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7pyarrow_3lib_14LargeListValue_5__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_LargeListValue, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_LargeListValue, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_LargeListValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_MapValue __pyx_vtable_7pyarrow_3lib_MapValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_MapValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_MapValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_MapValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_MapValue;
  p->key_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  p->item_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_MapValue(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_MapValue *p = (struct __pyx_obj_7pyarrow_3lib_MapValue *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->key_type);
  Py_CLEAR(p->item_type);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_MapValue(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_MapValue *p = (struct __pyx_obj_7pyarrow_3lib_MapValue *)o;
  e = __pyx_tp_traverse_7pyarrow_3lib_Scalar(o, v, a); if (e) return e;
  if (p->key_type) {
    e = (*v)(((PyObject *)p->key_type), a); if (e) return e;
  }
  if (p->item_type) {
    e = (*v)(((PyObject *)p->item_type), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_MapValue(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_MapValue *p = (struct __pyx_obj_7pyarrow_3lib_MapValue *)o;
  __pyx_tp_clear_7pyarrow_3lib_Scalar(o);
  tmp = ((PyObject*)p->key_type);
  p->key_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->item_type);
  p->item_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
static PyObject *__pyx_sq_item_7pyarrow_3lib_MapValue(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_8MapValue_key_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_8MapValue_8key_type_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_8MapValue_item_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_8MapValue_9item_type_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_MapValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_8MapValue_8as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_8MapValue_7as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_8MapValue_10__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_8MapValue_9__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_8MapValue_12__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_8MapValue_11__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_MapValue[] = {
  {(char *)"key_type", __pyx_getprop_7pyarrow_3lib_8MapValue_key_type, 0, (char *)0, 0},
  {(char *)"item_type", __pyx_getprop_7pyarrow_3lib_8MapValue_item_type, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_MapValue = {
  __pyx_pw_7pyarrow_3lib_8MapValue_1__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_7pyarrow_3lib_MapValue, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_MapValue = {
  __pyx_pw_7pyarrow_3lib_8MapValue_1__len__, /*mp_length*/
  __pyx_pw_7pyarrow_3lib_8MapValue_3__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7pyarrow_3lib_MapValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.MapValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_MapValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_MapValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_MapValue, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_MapValue, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for map array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_MapValue, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_MapValue, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7pyarrow_3lib_8MapValue_5__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_MapValue, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_MapValue, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_MapValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeListValue __pyx_vtable_7pyarrow_3lib_FixedSizeListValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_FixedSizeListValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_FixedSizeListValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_FixedSizeListValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_FixedSizeListValue;
  p->value_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_FixedSizeListValue(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_FixedSizeListValue *p = (struct __pyx_obj_7pyarrow_3lib_FixedSizeListValue *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->value_type);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_FixedSizeListValue(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_FixedSizeListValue *p = (struct __pyx_obj_7pyarrow_3lib_FixedSizeListValue *)o;
  e = __pyx_tp_traverse_7pyarrow_3lib_Scalar(o, v, a); if (e) return e;
  if (p->value_type) {
    e = (*v)(((PyObject *)p->value_type), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_FixedSizeListValue(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_FixedSizeListValue *p = (struct __pyx_obj_7pyarrow_3lib_FixedSizeListValue *)o;
  __pyx_tp_clear_7pyarrow_3lib_Scalar(o);
  tmp = ((PyObject*)p->value_type);
  p->value_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
static PyObject *__pyx_sq_item_7pyarrow_3lib_FixedSizeListValue(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_18FixedSizeListValue_value_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_18FixedSizeListValue_10value_type_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_FixedSizeListValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_18FixedSizeListValue_8as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_18FixedSizeListValue_7as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_18FixedSizeListValue_10__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_18FixedSizeListValue_9__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_18FixedSizeListValue_12__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_18FixedSizeListValue_11__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_FixedSizeListValue[] = {
  {(char *)"value_type", __pyx_getprop_7pyarrow_3lib_18FixedSizeListValue_value_type, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_FixedSizeListValue = {
  __pyx_pw_7pyarrow_3lib_18FixedSizeListValue_1__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_7pyarrow_3lib_FixedSizeListValue, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_FixedSizeListValue = {
  __pyx_pw_7pyarrow_3lib_18FixedSizeListValue_1__len__, /*mp_length*/
  __pyx_pw_7pyarrow_3lib_18FixedSizeListValue_3__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7pyarrow_3lib_FixedSizeListValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.FixedSizeListValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedSizeListValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_FixedSizeListValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_FixedSizeListValue, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_FixedSizeListValue, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for fixed size list array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_FixedSizeListValue, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_FixedSizeListValue, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7pyarrow_3lib_18FixedSizeListValue_5__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_FixedSizeListValue, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_FixedSizeListValue, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_FixedSizeListValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_StructValue __pyx_vtable_7pyarrow_3lib_StructValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_StructValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_StructValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_StructValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_StructValue;
  return o;
}
static PyObject *__pyx_sq_item_7pyarrow_3lib_StructValue(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_StructValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11StructValue_3as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11StructValue_2as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11StructValue_5__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11StructValue_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11StructValue_7__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11StructValue_6__setstate_cython__},
  {0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_StructValue = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_7pyarrow_3lib_StructValue, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_StructValue = {
  0, /*mp_length*/
  __pyx_pw_7pyarrow_3lib_11StructValue_1__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7pyarrow_3lib_StructValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.StructValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_StructValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_StructValue, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_StructValue, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for struct array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_StructValue, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_StructValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UnionValue __pyx_vtable_7pyarrow_3lib_UnionValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UnionValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UnionValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UnionValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_UnionValue;
  p->value_types = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_UnionValue(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_UnionValue *p = (struct __pyx_obj_7pyarrow_3lib_UnionValue *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->value_types);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_UnionValue(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_UnionValue *p = (struct __pyx_obj_7pyarrow_3lib_UnionValue *)o;
  e = __pyx_tp_traverse_7pyarrow_3lib_Scalar(o, v, a); if (e) return e;
  if (p->value_types) {
    e = (*v)(p->value_types, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_UnionValue(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_UnionValue *p = (struct __pyx_obj_7pyarrow_3lib_UnionValue *)o;
  __pyx_tp_clear_7pyarrow_3lib_Scalar(o);
  tmp = ((PyObject*)p->value_types);
  p->value_types = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_UnionValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_10UnionValue_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10UnionValue_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10UnionValue_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10UnionValue_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10UnionValue_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_10UnionValue_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_UnionValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UnionValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UnionValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_UnionValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for union array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_UnionValue, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_UnionValue, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_UnionValue, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UnionValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_StringValue __pyx_vtable_7pyarrow_3lib_StringValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_StringValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_StringValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_StringValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_StringValue;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_StringValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11StringValue_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11StringValue_as_py},
  {"as_buffer", (PyCFunction)__pyx_pw_7pyarrow_3lib_11StringValue_3as_buffer, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11StringValue_2as_buffer},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11StringValue_5__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11StringValue_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11StringValue_7__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11StringValue_6__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_StringValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.StringValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_StringValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for string (utf8) array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_StringValue, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_StringValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBinaryValue __pyx_vtable_7pyarrow_3lib_FixedSizeBinaryValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_FixedSizeBinaryValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_FixedSizeBinaryValue;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_FixedSizeBinaryValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_20FixedSizeBinaryValue_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_20FixedSizeBinaryValue_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_20FixedSizeBinaryValue_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_20FixedSizeBinaryValue_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_20FixedSizeBinaryValue_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_20FixedSizeBinaryValue_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_FixedSizeBinaryValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.FixedSizeBinaryValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for fixed-size binary array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_FixedSizeBinaryValue, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_FixedSizeBinaryValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib__PandasConvertible(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib__PandasConvertible(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib__PandasConvertible[] = {
  {"to_pandas", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_18_PandasConvertible_1to_pandas, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_18_PandasConvertible_to_pandas},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_18_PandasConvertible_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_18_PandasConvertible_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_18_PandasConvertible_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_18_PandasConvertible_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib__PandasConvertible = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib._PandasConvertible", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib__PandasConvertible), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib__PandasConvertible, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib__PandasConvertible, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib__PandasConvertible, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Array __pyx_vtable_7pyarrow_3lib_Array;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Array *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib__PandasConvertible(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Array *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_Array;
  new((void*)&(p->sp_array)) std::shared_ptr< arrow::Array> ();
  p->type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  p->_name = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_Array(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_Array *p = (struct __pyx_obj_7pyarrow_3lib_Array *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  if (p->__weakref__) PyObject_ClearWeakRefs(o);
  __Pyx_call_destructor(p->sp_array);
  Py_CLEAR(p->type);
  Py_CLEAR(p->_name);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib__PandasConvertible(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_Array(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_Array *p = (struct __pyx_obj_7pyarrow_3lib_Array *)o;
  e = ((likely(__pyx_ptype_7pyarrow_3lib__PandasConvertible)) ? ((__pyx_ptype_7pyarrow_3lib__PandasConvertible->tp_traverse) ? __pyx_ptype_7pyarrow_3lib__PandasConvertible->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7pyarrow_3lib_Array)); if (e) return e;
  if (p->type) {
    e = (*v)(((PyObject *)p->type), a); if (e) return e;
  }
  if (p->_name) {
    e = (*v)(p->_name, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_Array(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_Array *p = (struct __pyx_obj_7pyarrow_3lib_Array *)o;
  if (likely(__pyx_ptype_7pyarrow_3lib__PandasConvertible)) { if (__pyx_ptype_7pyarrow_3lib__PandasConvertible->tp_clear) __pyx_ptype_7pyarrow_3lib__PandasConvertible->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7pyarrow_3lib_Array);
  tmp = ((PyObject*)p->type);
  p->type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_name);
  p->_name = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
static PyObject *__pyx_sq_item_7pyarrow_3lib_Array(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyObject *__pyx_tp_richcompare_7pyarrow_3lib_Array(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_3lib_5Array_3__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_3lib_5Array_3__eq__(o1, o2);
      if (likely(ret && ret != Py_NotImplemented)) {
        int b = __Pyx_PyObject_IsTrue(ret); Py_DECREF(ret);
        if (unlikely(b < 0)) return NULL;
        ret = (b) ? Py_False : Py_True;
        Py_INCREF(ret);
      }
      return ret;
    }
    default: {
      return __Pyx_NewRef(Py_NotImplemented);
    }
  }
}

static PyObject *__pyx_getprop_7pyarrow_3lib_5Array_null_count(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_5Array_10null_count_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_5Array_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_5Array_6nbytes_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_5Array_offset(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_5Array_6offset_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_5Array_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_5Array_4type_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_5Array__name(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_5Array_5_name_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Array[] = {
  {"_debug_print", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_5_debug_print, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Array_4_debug_print},
  {"diff", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_7diff, METH_O, __pyx_doc_7pyarrow_3lib_5Array_6diff},
  {"cast", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Array_9cast, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Array_8cast},
  {"view", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_11view, METH_O, __pyx_doc_7pyarrow_3lib_5Array_10view},
  {"sum", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_13sum, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Array_12sum},
  {"unique", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_15unique, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Array_14unique},
  {"dictionary_encode", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_17dictionary_encode, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Array_16dictionary_encode},
  {"from_pandas", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Array_19from_pandas, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Array_18from_pandas},
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_21__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Array_20__reduce__},
  {"from_buffers", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Array_23from_buffers, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Array_22from_buffers},
  {"__sizeof__", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_25__sizeof__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Array_24__sizeof__},
  {"format", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Array_32format, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Array_31format},
  {"equals", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_36equals, METH_O, __pyx_doc_7pyarrow_3lib_5Array_35equals},
  {"isnull", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_40isnull, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Array_39isnull},
  {"slice", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Array_44slice, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Array_43slice},
  {"take", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_46take, METH_O, __pyx_doc_7pyarrow_3lib_5Array_45take},
  {"filter", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_48filter, METH_O, __pyx_doc_7pyarrow_3lib_5Array_47filter},
  {"_to_pandas", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Array_50_to_pandas, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Array_49_to_pandas},
  {"__array__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Array_52__array__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Array_51__array__},
  {"to_numpy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Array_54to_numpy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Array_53to_numpy},
  {"to_pylist", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_56to_pylist, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Array_55to_pylist},
  {"validate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Array_58validate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Array_57validate},
  {"buffers", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_60buffers, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Array_59buffers},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_Array[] = {
  {(char *)"null_count", __pyx_getprop_7pyarrow_3lib_5Array_null_count, 0, (char *)0, 0},
  {(char *)"nbytes", __pyx_getprop_7pyarrow_3lib_5Array_nbytes, 0, (char *)"Total number of bytes consumed by the elements of the array.", 0},
  {(char *)"offset", __pyx_getprop_7pyarrow_3lib_5Array_offset, 0, (char *)"\n        A relative position into another array's data, to enable zero-copy\n        slicing. This value defaults to zero but must be applied on all\n        operations with the physical storage buffers.\n        ", 0},
  {(char *)"type", __pyx_getprop_7pyarrow_3lib_5Array_type, 0, (char *)0, 0},
  {(char *)"_name", __pyx_getprop_7pyarrow_3lib_5Array__name, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_Array = {
  __pyx_pw_7pyarrow_3lib_5Array_38__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_7pyarrow_3lib_Array, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Array = {
  __pyx_pw_7pyarrow_3lib_5Array_38__len__, /*mp_length*/
  __pyx_pw_7pyarrow_3lib_5Array_42__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Array = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Array", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Array), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_7pyarrow_3lib_5Array_30__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_Array, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Array, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_7pyarrow_3lib_5Array_34__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Array()\n\n    The base class for all Arrow arrays.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_3lib_Array, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7pyarrow_3lib_5Array_27__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Array, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_Array, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Tensor __pyx_vtable_7pyarrow_3lib_Tensor;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Tensor(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Tensor *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Tensor *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_Tensor;
  new((void*)&(p->sp_tensor)) std::shared_ptr< arrow::Tensor> ();
  p->type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_Tensor(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_Tensor *p = (struct __pyx_obj_7pyarrow_3lib_Tensor *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->sp_tensor);
  Py_CLEAR(p->type);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_Tensor(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_Tensor *p = (struct __pyx_obj_7pyarrow_3lib_Tensor *)o;
  if (p->type) {
    e = (*v)(((PyObject *)p->type), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_Tensor(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_Tensor *p = (struct __pyx_obj_7pyarrow_3lib_Tensor *)o;
  tmp = ((PyObject*)p->type);
  p->type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_tp_richcompare_7pyarrow_3lib_Tensor(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_3lib_6Tensor_11__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_3lib_6Tensor_11__eq__(o1, o2);
      if (likely(ret && ret != Py_NotImplemented)) {
        int b = __Pyx_PyObject_IsTrue(ret); Py_DECREF(ret);
        if (unlikely(b < 0)) return NULL;
        ret = (b) ? Py_False : Py_True;
        Py_INCREF(ret);
      }
      return ret;
    }
    default: {
      return __Pyx_NewRef(Py_NotImplemented);
    }
  }
}

static PyObject *__pyx_getprop_7pyarrow_3lib_6Tensor_dim_names(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Tensor_9dim_names_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_6Tensor_is_mutable(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Tensor_10is_mutable_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_6Tensor_is_contiguous(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Tensor_13is_contiguous_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_6Tensor_ndim(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Tensor_4ndim_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_6Tensor_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Tensor_4size_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_6Tensor_shape(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Tensor_5shape_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_6Tensor_strides(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Tensor_7strides_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_6Tensor_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Tensor_4type_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Tensor[] = {
  {"from_numpy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_6Tensor_5from_numpy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_6Tensor_4from_numpy},
  {"to_numpy", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Tensor_7to_numpy, METH_NOARGS, __pyx_doc_7pyarrow_3lib_6Tensor_6to_numpy},
  {"equals", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Tensor_9equals, METH_O, __pyx_doc_7pyarrow_3lib_6Tensor_8equals},
  {"dim_name", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Tensor_13dim_name, METH_O, __pyx_doc_7pyarrow_3lib_6Tensor_12dim_name},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Tensor_17__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_6Tensor_16__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Tensor_19__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_6Tensor_18__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_Tensor[] = {
  {(char *)"dim_names", __pyx_getprop_7pyarrow_3lib_6Tensor_dim_names, 0, (char *)0, 0},
  {(char *)"is_mutable", __pyx_getprop_7pyarrow_3lib_6Tensor_is_mutable, 0, (char *)0, 0},
  {(char *)"is_contiguous", __pyx_getprop_7pyarrow_3lib_6Tensor_is_contiguous, 0, (char *)0, 0},
  {(char *)"ndim", __pyx_getprop_7pyarrow_3lib_6Tensor_ndim, 0, (char *)0, 0},
  {(char *)"size", __pyx_getprop_7pyarrow_3lib_6Tensor_size, 0, (char *)0, 0},
  {(char *)"shape", __pyx_getprop_7pyarrow_3lib_6Tensor_shape, 0, (char *)0, 0},
  {(char *)"strides", __pyx_getprop_7pyarrow_3lib_6Tensor_strides, 0, (char *)0, 0},
  {(char *)"type", __pyx_getprop_7pyarrow_3lib_6Tensor_type, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyBufferProcs __pyx_tp_as_buffer_Tensor = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  __pyx_pw_7pyarrow_3lib_6Tensor_15__getbuffer__, /*bf_getbuffer*/
  0, /*bf_releasebuffer*/
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Tensor = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Tensor", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Tensor), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Tensor, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_7pyarrow_3lib_6Tensor_3__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Tensor, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Tensor()\n\n    A n-dimensional array a.k.a Tensor.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Tensor, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Tensor, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_3lib_Tensor, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Tensor, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_Tensor, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_6Tensor_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Tensor, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_SparseCSRMatrix __pyx_vtable_7pyarrow_3lib_SparseCSRMatrix;

static PyObject *__pyx_tp_new_7pyarrow_3lib_SparseCSRMatrix(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_SparseCSRMatrix;
  new((void*)&(p->sp_sparse_tensor)) std::shared_ptr< arrow::SparseCSRMatrix> ();
  p->type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_SparseCSRMatrix(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *p = (struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->sp_sparse_tensor);
  Py_CLEAR(p->type);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_SparseCSRMatrix(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *p = (struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *)o;
  if (p->type) {
    e = (*v)(((PyObject *)p->type), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_SparseCSRMatrix(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *p = (struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *)o;
  tmp = ((PyObject*)p->type);
  p->type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_tp_richcompare_7pyarrow_3lib_SparseCSRMatrix(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_21__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_21__eq__(o1, o2);
      if (likely(ret && ret != Py_NotImplemented)) {
        int b = __Pyx_PyObject_IsTrue(ret); Py_DECREF(ret);
        if (unlikely(b < 0)) return NULL;
        ret = (b) ? Py_False : Py_True;
        Py_INCREF(ret);
      }
      return ret;
    }
    default: {
      return __Pyx_NewRef(Py_NotImplemented);
    }
  }
}

static PyObject *__pyx_getprop_7pyarrow_3lib_15SparseCSRMatrix_is_mutable(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_10is_mutable_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_15SparseCSRMatrix_ndim(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_4ndim_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_15SparseCSRMatrix_shape(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_5shape_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_15SparseCSRMatrix_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_4size_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_15SparseCSRMatrix_dim_names(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_9dim_names_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_15SparseCSRMatrix_non_zero_length(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_15non_zero_length_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_15SparseCSRMatrix_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_4type_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_SparseCSRMatrix[] = {
  {"from_dense_numpy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_5from_dense_numpy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_15SparseCSRMatrix_4from_dense_numpy},
  {"from_numpy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_7from_numpy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_15SparseCSRMatrix_6from_numpy},
  {"from_scipy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_9from_scipy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_15SparseCSRMatrix_8from_scipy},
  {"from_tensor", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_11from_tensor, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_15SparseCSRMatrix_10from_tensor},
  {"to_numpy", (PyCFunction)__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_13to_numpy, METH_NOARGS, __pyx_doc_7pyarrow_3lib_15SparseCSRMatrix_12to_numpy},
  {"to_scipy", (PyCFunction)__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_15to_scipy, METH_NOARGS, __pyx_doc_7pyarrow_3lib_15SparseCSRMatrix_14to_scipy},
  {"to_tensor", (PyCFunction)__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_17to_tensor, METH_NOARGS, __pyx_doc_7pyarrow_3lib_15SparseCSRMatrix_16to_tensor},
  {"equals", (PyCFunction)__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_19equals, METH_O, __pyx_doc_7pyarrow_3lib_15SparseCSRMatrix_18equals},
  {"dim_name", (PyCFunction)__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_23dim_name, METH_O, __pyx_doc_7pyarrow_3lib_15SparseCSRMatrix_22dim_name},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_25__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_15SparseCSRMatrix_24__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_27__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_15SparseCSRMatrix_26__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_SparseCSRMatrix[] = {
  {(char *)"is_mutable", __pyx_getprop_7pyarrow_3lib_15SparseCSRMatrix_is_mutable, 0, (char *)0, 0},
  {(char *)"ndim", __pyx_getprop_7pyarrow_3lib_15SparseCSRMatrix_ndim, 0, (char *)0, 0},
  {(char *)"shape", __pyx_getprop_7pyarrow_3lib_15SparseCSRMatrix_shape, 0, (char *)0, 0},
  {(char *)"size", __pyx_getprop_7pyarrow_3lib_15SparseCSRMatrix_size, 0, (char *)0, 0},
  {(char *)"dim_names", __pyx_getprop_7pyarrow_3lib_15SparseCSRMatrix_dim_names, 0, (char *)0, 0},
  {(char *)"non_zero_length", __pyx_getprop_7pyarrow_3lib_15SparseCSRMatrix_non_zero_length, 0, (char *)0, 0},
  {(char *)"type", __pyx_getprop_7pyarrow_3lib_15SparseCSRMatrix_type, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_SparseCSRMatrix = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.SparseCSRMatrix", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_SparseCSRMatrix, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_3__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "SparseCSRMatrix()\n\n    A sparse CSR tensor.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_SparseCSRMatrix, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_SparseCSRMatrix, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_3lib_SparseCSRMatrix, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_SparseCSRMatrix, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_SparseCSRMatrix, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_15SparseCSRMatrix_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_SparseCSRMatrix, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_SparseCOOTensor __pyx_vtable_7pyarrow_3lib_SparseCOOTensor;

static PyObject *__pyx_tp_new_7pyarrow_3lib_SparseCOOTensor(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_SparseCOOTensor;
  new((void*)&(p->sp_sparse_tensor)) std::shared_ptr< arrow::SparseCOOTensor> ();
  p->type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_SparseCOOTensor(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *p = (struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->sp_sparse_tensor);
  Py_CLEAR(p->type);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_SparseCOOTensor(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *p = (struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *)o;
  if (p->type) {
    e = (*v)(((PyObject *)p->type), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_SparseCOOTensor(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *p = (struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *)o;
  tmp = ((PyObject*)p->type);
  p->type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_tp_richcompare_7pyarrow_3lib_SparseCOOTensor(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_3lib_15SparseCOOTensor_25__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_3lib_15SparseCOOTensor_25__eq__(o1, o2);
      if (likely(ret && ret != Py_NotImplemented)) {
        int b = __Pyx_PyObject_IsTrue(ret); Py_DECREF(ret);
        if (unlikely(b < 0)) return NULL;
        ret = (b) ? Py_False : Py_True;
        Py_INCREF(ret);
      }
      return ret;
    }
    default: {
      return __Pyx_NewRef(Py_NotImplemented);
    }
  }
}

static PyObject *__pyx_getprop_7pyarrow_3lib_15SparseCOOTensor_is_mutable(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_15SparseCOOTensor_10is_mutable_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_15SparseCOOTensor_ndim(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_15SparseCOOTensor_4ndim_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_15SparseCOOTensor_shape(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_15SparseCOOTensor_5shape_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_15SparseCOOTensor_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_15SparseCOOTensor_4size_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_15SparseCOOTensor_dim_names(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_15SparseCOOTensor_9dim_names_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_15SparseCOOTensor_non_zero_length(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_15SparseCOOTensor_15non_zero_length_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_15SparseCOOTensor_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_15SparseCOOTensor_4type_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_SparseCOOTensor[] = {
  {"from_dense_numpy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_5from_dense_numpy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_15SparseCOOTensor_4from_dense_numpy},
  {"from_numpy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_7from_numpy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_15SparseCOOTensor_6from_numpy},
  {"from_scipy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_9from_scipy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_15SparseCOOTensor_8from_scipy},
  {"from_pydata_sparse", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_11from_pydata_sparse, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_15SparseCOOTensor_10from_pydata_sparse},
  {"from_tensor", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_13from_tensor, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_15SparseCOOTensor_12from_tensor},
  {"to_numpy", (PyCFunction)__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_15to_numpy, METH_NOARGS, __pyx_doc_7pyarrow_3lib_15SparseCOOTensor_14to_numpy},
  {"to_scipy", (PyCFunction)__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_17to_scipy, METH_NOARGS, __pyx_doc_7pyarrow_3lib_15SparseCOOTensor_16to_scipy},
  {"to_pydata_sparse", (PyCFunction)__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_19to_pydata_sparse, METH_NOARGS, __pyx_doc_7pyarrow_3lib_15SparseCOOTensor_18to_pydata_sparse},
  {"to_tensor", (PyCFunction)__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_21to_tensor, METH_NOARGS, __pyx_doc_7pyarrow_3lib_15SparseCOOTensor_20to_tensor},
  {"equals", (PyCFunction)__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_23equals, METH_O, __pyx_doc_7pyarrow_3lib_15SparseCOOTensor_22equals},
  {"dim_name", (PyCFunction)__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_27dim_name, METH_O, __pyx_doc_7pyarrow_3lib_15SparseCOOTensor_26dim_name},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_29__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_15SparseCOOTensor_28__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_15SparseCOOTensor_31__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_15SparseCOOTensor_30__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_SparseCOOTensor[] = {
  {(char *)"is_mutable", __pyx_getprop_7pyarrow_3lib_15SparseCOOTensor_is_mutable, 0, (char *)0, 0},
  {(char *)"ndim", __pyx_getprop_7pyarrow_3lib_15SparseCOOTensor_ndim, 0, (char *)0, 0},
  {(char *)"shape", __pyx_getprop_7pyarrow_3lib_15SparseCOOTensor_shape, 0, (char *)0, 0},
  {(char *)"size", __pyx_getprop_7pyarrow_3lib_15SparseCOOTensor_size, 0, (char *)0, 0},
  {(char *)"dim_names", __pyx_getprop_7pyarrow_3lib_15SparseCOOTensor_dim_names, 0, (char *)0, 0},
  {(char *)"non_zero_length", __pyx_getprop_7pyarrow_3lib_15SparseCOOTensor_non_zero_length, 0, (char *)0, 0},
  {(char *)"type", __pyx_getprop_7pyarrow_3lib_15SparseCOOTensor_type, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_SparseCOOTensor = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.SparseCOOTensor", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_SparseCOOTensor, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_7pyarrow_3lib_15SparseCOOTensor_3__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "SparseCOOTensor()\n\n    A sparse COO tensor.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_SparseCOOTensor, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_SparseCOOTensor, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_3lib_SparseCOOTensor, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_SparseCOOTensor, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_SparseCOOTensor, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_15SparseCOOTensor_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_SparseCOOTensor, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_NullArray __pyx_vtable_7pyarrow_3lib_NullArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_NullArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_NullArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Array(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_NullArray *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_NullArray;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_NullArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.NullArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_NullArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_30__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_34__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of null data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_27__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_NullArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BooleanArray __pyx_vtable_7pyarrow_3lib_BooleanArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_BooleanArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_BooleanArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Array(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_BooleanArray *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_BooleanArray;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_BooleanArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.BooleanArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_BooleanArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_30__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_34__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of boolean data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_27__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_BooleanArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_NumericArray __pyx_vtable_7pyarrow_3lib_NumericArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_NumericArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_NumericArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Array(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_NumericArray *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_NumericArray;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_NumericArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.NumericArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_NumericArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_30__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_34__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    A base class for Arrow numeric arrays.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_27__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_NumericArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_IntegerArray __pyx_vtable_7pyarrow_3lib_IntegerArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_IntegerArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_IntegerArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NumericArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_IntegerArray *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_IntegerArray;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_IntegerArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.IntegerArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_IntegerArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_30__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_34__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    A base class for Arrow integer arrays.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_27__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_IntegerArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FloatingPointArray __pyx_vtable_7pyarrow_3lib_FloatingPointArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_FloatingPointArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_FloatingPointArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NumericArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_FloatingPointArray *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_FloatingPointArray;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_FloatingPointArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.FloatingPointArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_FloatingPointArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_30__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_34__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    A base class for Arrow floating-point arrays.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_27__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_FloatingPointArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int8Array __pyx_vtable_7pyarrow_3lib_Int8Array;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Int8Array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Int8Array *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_IntegerArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Int8Array *)o);
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_Int8Array;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_Int8Array = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Int8Array", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int8Array), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_30__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_34__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of int8 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_27__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Int8Array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt8Array __pyx_vtable_7pyarrow_3lib_UInt8Array;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt8Array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UInt8Array *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_IntegerArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UInt8Array *)o);
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_UInt8Array;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_UInt8Array = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UInt8Array", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt8Array), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_30__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_34__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of uint8 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_27__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UInt8Array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int16Array __pyx_vtable_7pyarrow_3lib_Int16Array;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Int16Array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Int16Array *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_IntegerArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Int16Array *)o);
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_Int16Array;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_Int16Array = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Int16Array", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int16Array), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_30__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_34__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of int16 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_27__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Int16Array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt16Array __pyx_vtable_7pyarrow_3lib_UInt16Array;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt16Array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UInt16Array *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_IntegerArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UInt16Array *)o);
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_UInt16Array;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_UInt16Array = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UInt16Array", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt16Array), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_30__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_34__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of uint16 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_27__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UInt16Array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int32Array __pyx_vtable_7pyarrow_3lib_Int32Array;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Int32Array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Int32Array *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_IntegerArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Int32Array *)o);
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_Int32Array;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_Int32Array = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Int32Array", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int32Array), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_30__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_34__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of int32 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_27__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Int32Array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt32Array __pyx_vtable_7pyarrow_3lib_UInt32Array;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt32Array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UInt32Array *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_IntegerArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UInt32Array *)o);
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_UInt32Array;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_UInt32Array = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UInt32Array", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt32Array), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_30__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_34__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of uint32 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_27__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UInt32Array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int64Array __pyx_vtable_7pyarrow_3lib_Int64Array;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Int64Array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Int64Array *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_IntegerArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Int64Array *)o);
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_Int64Array;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_Int64Array = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Int64Array", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int64Array), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_30__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_34__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of int64 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_27__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Int64Array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt64Array __pyx_vtable_7pyarrow_3lib_UInt64Array;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt64Array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UInt64Array *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_IntegerArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UInt64Array *)o);
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_UInt64Array;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_UInt64Array = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UInt64Array", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt64Array), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_30__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_34__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of uint64 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_27__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UInt64Array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_HalfFloatArray __pyx_vtable_7pyarrow_3lib_HalfFloatArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_HalfFloatArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_HalfFloatArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_FloatingPointArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_HalfFloatArray *)o);
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_HalfFloatArray;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_HalfFloatArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.HalfFloatArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_HalfFloatArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_30__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_34__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of float16 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_27__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_HalfFloatArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FloatArray __pyx_vtable_7pyarrow_3lib_FloatArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_FloatArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_FloatArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_FloatingPointArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_FloatArray *)o);
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_FloatArray;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_FloatArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.FloatArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_FloatArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_30__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_34__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of float32 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_27__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_FloatArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DoubleArray __pyx_vtable_7pyarrow_3lib_DoubleArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_DoubleArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_DoubleArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_FloatingPointArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_DoubleArray *)o);
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_DoubleArray;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_DoubleArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.DoubleArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_DoubleArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_30__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_34__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of float64 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_27__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_DoubleArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBinaryArray __pyx_vtable_7pyarrow_3lib_FixedSizeBinaryArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_FixedSizeBinaryArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Array(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryArray *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_FixedSizeBinaryArray;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_FixedSizeBinaryArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.FixedSizeBinaryArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_30__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_34__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of a fixed-size binary data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_27__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_FixedSizeBinaryArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Decimal128Array __pyx_vtable_7pyarrow_3lib_Decimal128Array;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Decimal128Array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Decimal128Array *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_FixedSizeBinaryArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Decimal128Array *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_Decimal128Array;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_Decimal128Array = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Decimal128Array", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal128Array), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_30__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_34__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of decimal128 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_27__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Decimal128Array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_StructArray __pyx_vtable_7pyarrow_3lib_StructArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_StructArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_StructArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Array(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_StructArray *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_StructArray;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_StructArray[] = {
  {"field", (PyCFunction)__pyx_pw_7pyarrow_3lib_11StructArray_1field, METH_O, __pyx_doc_7pyarrow_3lib_11StructArray_field},
  {"flatten", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_11StructArray_3flatten, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_11StructArray_2flatten},
  {"from_arrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_11StructArray_5from_arrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_11StructArray_4from_arrays},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_StructArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.StructArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_StructArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_30__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_34__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of a struct data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_27__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_StructArray, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_StructArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ListArray __pyx_vtable_7pyarrow_3lib_ListArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_ListArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_ListArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Array(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_ListArray *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_ListArray;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_9ListArray_values(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_9ListArray_6values_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_9ListArray_offsets(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_9ListArray_7offsets_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_ListArray[] = {
  {"from_arrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_9ListArray_1from_arrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_9ListArray_from_arrays},
  {"flatten", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_9ListArray_3flatten, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_9ListArray_2flatten},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_ListArray[] = {
  {(char *)"values", __pyx_getprop_7pyarrow_3lib_9ListArray_values, 0, (char *)0, 0},
  {(char *)"offsets", __pyx_getprop_7pyarrow_3lib_9ListArray_offsets, 0, (char *)"\n        Return the offsets as an int32 array.\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_ListArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.ListArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_ListArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_30__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_34__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of a list data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_27__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_ListArray, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_ListArray, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_ListArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_LargeListArray __pyx_vtable_7pyarrow_3lib_LargeListArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_LargeListArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_LargeListArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Array(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_LargeListArray *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_LargeListArray;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14LargeListArray_values(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14LargeListArray_6values_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14LargeListArray_offsets(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14LargeListArray_7offsets_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_LargeListArray[] = {
  {"from_arrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_14LargeListArray_1from_arrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_14LargeListArray_from_arrays},
  {"flatten", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_14LargeListArray_3flatten, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_14LargeListArray_2flatten},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_LargeListArray[] = {
  {(char *)"values", __pyx_getprop_7pyarrow_3lib_14LargeListArray_values, 0, (char *)0, 0},
  {(char *)"offsets", __pyx_getprop_7pyarrow_3lib_14LargeListArray_offsets, 0, (char *)"\n        Return the offsets as an int64 array.\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_LargeListArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.LargeListArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_LargeListArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_30__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_34__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of a large list data type\n    (like ListArray, but 64-bit offsets).\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_27__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_LargeListArray, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_LargeListArray, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_LargeListArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_MapArray __pyx_vtable_7pyarrow_3lib_MapArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_MapArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_MapArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Array(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_MapArray *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_MapArray;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_8MapArray_keys(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_8MapArray_4keys_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_8MapArray_items(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_8MapArray_5items_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_MapArray[] = {
  {"from_arrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_8MapArray_1from_arrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_8MapArray_from_arrays},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_MapArray[] = {
  {(char *)"keys", __pyx_getprop_7pyarrow_3lib_8MapArray_keys, 0, (char *)0, 0},
  {(char *)"items", __pyx_getprop_7pyarrow_3lib_8MapArray_items, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_MapArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.MapArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_MapArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_30__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_34__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of a map data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_27__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_MapArray, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_MapArray, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_MapArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeListArray __pyx_vtable_7pyarrow_3lib_FixedSizeListArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_FixedSizeListArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_FixedSizeListArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Array(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_FixedSizeListArray *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_FixedSizeListArray;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_18FixedSizeListArray_values(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_18FixedSizeListArray_6values_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_FixedSizeListArray[] = {
  {"from_arrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_18FixedSizeListArray_1from_arrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_18FixedSizeListArray_from_arrays},
  {"flatten", (PyCFunction)__pyx_pw_7pyarrow_3lib_18FixedSizeListArray_3flatten, METH_NOARGS, __pyx_doc_7pyarrow_3lib_18FixedSizeListArray_2flatten},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_FixedSizeListArray[] = {
  {(char *)"values", __pyx_getprop_7pyarrow_3lib_18FixedSizeListArray_values, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_FixedSizeListArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.FixedSizeListArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedSizeListArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_30__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_34__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of a fixed size list data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_27__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_FixedSizeListArray, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_FixedSizeListArray, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_FixedSizeListArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UnionArray __pyx_vtable_7pyarrow_3lib_UnionArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UnionArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UnionArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Array(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UnionArray *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_UnionArray;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_UnionArray[] = {
  {"from_dense", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10UnionArray_1from_dense, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10UnionArray_from_dense},
  {"from_sparse", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10UnionArray_3from_sparse, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10UnionArray_2from_sparse},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_UnionArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UnionArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UnionArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_30__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_34__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of a Union data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_27__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_UnionArray, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UnionArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_StringArray __pyx_vtable_7pyarrow_3lib_StringArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_StringArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_StringArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Array(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_StringArray *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_StringArray;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_StringArray[] = {
  {"from_buffers", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_11StringArray_1from_buffers, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_11StringArray_from_buffers},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_StringArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.StringArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_StringArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_30__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_34__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of string (or utf8) data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_27__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_StringArray, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_StringArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BinaryArray __pyx_vtable_7pyarrow_3lib_BinaryArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_BinaryArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_BinaryArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Array(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_BinaryArray *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_BinaryArray;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_BinaryArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.BinaryArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_BinaryArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_30__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_34__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of variable-sized binary data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_27__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_BinaryArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DictionaryArray __pyx_vtable_7pyarrow_3lib_DictionaryArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_DictionaryArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_DictionaryArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Array(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_DictionaryArray *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_DictionaryArray;
  p->_indices = Py_None; Py_INCREF(Py_None);
  p->_dictionary = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_DictionaryArray(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_DictionaryArray *p = (struct __pyx_obj_7pyarrow_3lib_DictionaryArray *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->_indices);
  Py_CLEAR(p->_dictionary);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib_Array(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_DictionaryArray(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_DictionaryArray *p = (struct __pyx_obj_7pyarrow_3lib_DictionaryArray *)o;
  e = __pyx_tp_traverse_7pyarrow_3lib_Array(o, v, a); if (e) return e;
  if (p->_indices) {
    e = (*v)(p->_indices, a); if (e) return e;
  }
  if (p->_dictionary) {
    e = (*v)(p->_dictionary, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_DictionaryArray(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_DictionaryArray *p = (struct __pyx_obj_7pyarrow_3lib_DictionaryArray *)o;
  __pyx_tp_clear_7pyarrow_3lib_Array(o);
  tmp = ((PyObject*)p->_indices);
  p->_indices = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_dictionary);
  p->_dictionary = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_15DictionaryArray_dictionary(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_15DictionaryArray_10dictionary_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_15DictionaryArray_indices(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_15DictionaryArray_7indices_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_DictionaryArray[] = {
  {"dictionary_encode", (PyCFunction)__pyx_pw_7pyarrow_3lib_15DictionaryArray_1dictionary_encode, METH_NOARGS, __pyx_doc_7pyarrow_3lib_15DictionaryArray_dictionary_encode},
  {"from_arrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_15DictionaryArray_3from_arrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_15DictionaryArray_2from_arrays},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_DictionaryArray[] = {
  {(char *)"dictionary", __pyx_getprop_7pyarrow_3lib_15DictionaryArray_dictionary, 0, (char *)0, 0},
  {(char *)"indices", __pyx_getprop_7pyarrow_3lib_15DictionaryArray_indices, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_DictionaryArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.DictionaryArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_DictionaryArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DictionaryArray, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_30__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_34__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for dictionary-encoded Arrow arrays.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_DictionaryArray, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_DictionaryArray, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_27__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_DictionaryArray, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_DictionaryArray, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_DictionaryArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ExtensionArray __pyx_vtable_7pyarrow_3lib_ExtensionArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_ExtensionArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_ExtensionArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Array(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_ExtensionArray *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_ExtensionArray;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14ExtensionArray_storage(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14ExtensionArray_7storage_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_ExtensionArray[] = {
  {"from_storage", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_14ExtensionArray_1from_storage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_14ExtensionArray_from_storage},
  {"_to_pandas", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_14ExtensionArray_3_to_pandas, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_14ExtensionArray_2_to_pandas},
  {"to_numpy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_14ExtensionArray_5to_numpy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_14ExtensionArray_4to_numpy},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_ExtensionArray[] = {
  {(char *)"storage", __pyx_getprop_7pyarrow_3lib_14ExtensionArray_storage, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_ExtensionArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.ExtensionArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_ExtensionArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_30__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_34__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow extension arrays.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_27__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_ExtensionArray, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_ExtensionArray, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_ExtensionArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ChunkedArray __pyx_vtable_7pyarrow_3lib_ChunkedArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_ChunkedArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_ChunkedArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib__PandasConvertible(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_ChunkedArray;
  new((void*)&(p->sp_chunked_array)) std::shared_ptr< arrow::ChunkedArray> ();
  p->_name = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7pyarrow_3lib_12ChunkedArray_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_ChunkedArray(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_ChunkedArray *p = (struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->sp_chunked_array);
  Py_CLEAR(p->_name);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib__PandasConvertible(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_ChunkedArray(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_ChunkedArray *p = (struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)o;
  e = ((likely(__pyx_ptype_7pyarrow_3lib__PandasConvertible)) ? ((__pyx_ptype_7pyarrow_3lib__PandasConvertible->tp_traverse) ? __pyx_ptype_7pyarrow_3lib__PandasConvertible->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7pyarrow_3lib_ChunkedArray)); if (e) return e;
  if (p->_name) {
    e = (*v)(p->_name, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_ChunkedArray(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_ChunkedArray *p = (struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)o;
  if (likely(__pyx_ptype_7pyarrow_3lib__PandasConvertible)) { if (__pyx_ptype_7pyarrow_3lib__PandasConvertible->tp_clear) __pyx_ptype_7pyarrow_3lib__PandasConvertible->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7pyarrow_3lib_ChunkedArray);
  tmp = ((PyObject*)p->_name);
  p->_name = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
static PyObject *__pyx_sq_item_7pyarrow_3lib_ChunkedArray(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyObject *__pyx_tp_richcompare_7pyarrow_3lib_ChunkedArray(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_3lib_12ChunkedArray_26__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_3lib_12ChunkedArray_26__eq__(o1, o2);
      if (likely(ret && ret != Py_NotImplemented)) {
        int b = __Pyx_PyObject_IsTrue(ret); Py_DECREF(ret);
        if (unlikely(b < 0)) return NULL;
        ret = (b) ? Py_False : Py_True;
        Py_INCREF(ret);
      }
      return ret;
    }
    default: {
      return __Pyx_NewRef(Py_NotImplemented);
    }
  }
}

static PyObject *__pyx_getprop_7pyarrow_3lib_12ChunkedArray_data(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_12ChunkedArray_4data_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_12ChunkedArray_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_12ChunkedArray_4type_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_12ChunkedArray_null_count(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_12ChunkedArray_10null_count_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_12ChunkedArray_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_12ChunkedArray_6nbytes_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_12ChunkedArray_num_chunks(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_12ChunkedArray_10num_chunks_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_12ChunkedArray_chunks(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_12ChunkedArray_6chunks_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_12ChunkedArray__name(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_12ChunkedArray_5_name_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_ChunkedArray[] = {
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12ChunkedArray_5__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12ChunkedArray_4__reduce__},
  {"length", (PyCFunction)__pyx_pw_7pyarrow_3lib_12ChunkedArray_7length, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12ChunkedArray_6length},
  {"format", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_12ChunkedArray_13format, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_12ChunkedArray_12format},
  {"validate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_12ChunkedArray_17validate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_12ChunkedArray_16validate},
  {"__sizeof__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12ChunkedArray_19__sizeof__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12ChunkedArray_18__sizeof__},
  {"equals", (PyCFunction)__pyx_pw_7pyarrow_3lib_12ChunkedArray_28equals, METH_O, __pyx_doc_7pyarrow_3lib_12ChunkedArray_27equals},
  {"_to_pandas", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_12ChunkedArray_30_to_pandas, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_12ChunkedArray_29_to_pandas},
  {"__array__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_12ChunkedArray_32__array__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_12ChunkedArray_31__array__},
  {"cast", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_12ChunkedArray_34cast, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_12ChunkedArray_33cast},
  {"dictionary_encode", (PyCFunction)__pyx_pw_7pyarrow_3lib_12ChunkedArray_36dictionary_encode, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12ChunkedArray_35dictionary_encode},
  {"flatten", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_12ChunkedArray_38flatten, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_12ChunkedArray_37flatten},
  {"unique", (PyCFunction)__pyx_pw_7pyarrow_3lib_12ChunkedArray_40unique, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12ChunkedArray_39unique},
  {"slice", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_12ChunkedArray_42slice, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_12ChunkedArray_41slice},
  {"chunk", (PyCFunction)__pyx_pw_7pyarrow_3lib_12ChunkedArray_44chunk, METH_O, __pyx_doc_7pyarrow_3lib_12ChunkedArray_43chunk},
  {"iterchunks", (PyCFunction)__pyx_pw_7pyarrow_3lib_12ChunkedArray_46iterchunks, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12ChunkedArray_45iterchunks},
  {"to_pylist", (PyCFunction)__pyx_pw_7pyarrow_3lib_12ChunkedArray_49to_pylist, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12ChunkedArray_48to_pylist},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_ChunkedArray[] = {
  {(char *)"data", __pyx_getprop_7pyarrow_3lib_12ChunkedArray_data, 0, (char *)0, 0},
  {(char *)"type", __pyx_getprop_7pyarrow_3lib_12ChunkedArray_type, 0, (char *)0, 0},
  {(char *)"null_count", __pyx_getprop_7pyarrow_3lib_12ChunkedArray_null_count, 0, (char *)"\n        Number of null entires\n\n        Returns\n        -------\n        int\n        ", 0},
  {(char *)"nbytes", __pyx_getprop_7pyarrow_3lib_12ChunkedArray_nbytes, 0, (char *)"\n        Total number of bytes consumed by the elements of the chunked array.\n        ", 0},
  {(char *)"num_chunks", __pyx_getprop_7pyarrow_3lib_12ChunkedArray_num_chunks, 0, (char *)"\n        Number of underlying chunks\n\n        Returns\n        -------\n        int\n        ", 0},
  {(char *)"chunks", __pyx_getprop_7pyarrow_3lib_12ChunkedArray_chunks, 0, (char *)0, 0},
  {(char *)"_name", __pyx_getprop_7pyarrow_3lib_12ChunkedArray__name, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_ChunkedArray = {
  __pyx_pw_7pyarrow_3lib_12ChunkedArray_9__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_7pyarrow_3lib_ChunkedArray, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_ChunkedArray = {
  __pyx_pw_7pyarrow_3lib_12ChunkedArray_9__len__, /*mp_length*/
  __pyx_pw_7pyarrow_3lib_12ChunkedArray_24__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7pyarrow_3lib_ChunkedArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.ChunkedArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_ChunkedArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ChunkedArray, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_7pyarrow_3lib_12ChunkedArray_11__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_ChunkedArray, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_ChunkedArray, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_7pyarrow_3lib_12ChunkedArray_15__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "ChunkedArray()\n\n    Array backed via one or more memory chunks.\n\n    Warning\n    -------\n    Do not call this class's constructor directly.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_ChunkedArray, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_ChunkedArray, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_3lib_ChunkedArray, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7pyarrow_3lib_12ChunkedArray_21__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_ChunkedArray, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_ChunkedArray, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_12ChunkedArray_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_ChunkedArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Table __pyx_vtable_7pyarrow_3lib_Table;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Table(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Table *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib__PandasConvertible(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Table *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_Table;
  new((void*)&(p->sp_table)) std::shared_ptr< arrow::Table> ();
  if (unlikely(__pyx_pw_7pyarrow_3lib_5Table_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_Table(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_Table *p = (struct __pyx_obj_7pyarrow_3lib_Table *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->sp_table);
  __pyx_tp_dealloc_7pyarrow_3lib__PandasConvertible(o);
}
static PyObject *__pyx_sq_item_7pyarrow_3lib_Table(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyObject *__pyx_tp_richcompare_7pyarrow_3lib_Table(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_3lib_5Table_21__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_3lib_5Table_21__eq__(o1, o2);
      if (likely(ret && ret != Py_NotImplemented)) {
        int b = __Pyx_PyObject_IsTrue(ret); Py_DECREF(ret);
        if (unlikely(b < 0)) return NULL;
        ret = (b) ? Py_False : Py_True;
        Py_INCREF(ret);
      }
      return ret;
    }
    default: {
      return __Pyx_NewRef(Py_NotImplemented);
    }
  }
}

static PyObject *__pyx_getprop_7pyarrow_3lib_5Table_schema(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_5Table_6schema_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_5Table_columns(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_5Table_7columns_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_5Table_num_columns(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_5Table_11num_columns_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_5Table_num_rows(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_5Table_8num_rows_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_5Table_shape(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_5Table_5shape_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_5Table_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_5Table_6nbytes_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_5Table_column_names(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_5Table_12column_names_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Table[] = {
  {"validate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_7validate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_6validate},
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Table_9__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Table_8__reduce__},
  {"slice", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_13slice, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_12slice},
  {"replace_schema_metadata", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_15replace_schema_metadata, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_14replace_schema_metadata},
  {"flatten", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_17flatten, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_16flatten},
  {"combine_chunks", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_19combine_chunks, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_18combine_chunks},
  {"equals", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Table_23equals, METH_O, __pyx_doc_7pyarrow_3lib_5Table_22equals},
  {"cast", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_25cast, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_24cast},
  {"from_pandas", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_27from_pandas, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_26from_pandas},
  {"from_arrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_29from_arrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_28from_arrays},
  {"from_pydict", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_31from_pydict, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_30from_pydict},
  {"from_batches", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_33from_batches, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_32from_batches},
  {"to_batches", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_35to_batches, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_34to_batches},
  {"_to_pandas", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_37_to_pandas, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_36_to_pandas},
  {"to_pydict", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Table_39to_pydict, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Table_38to_pydict},
  {"field", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Table_41field, METH_O, __pyx_doc_7pyarrow_3lib_5Table_40field},
  {"column", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Table_43column, METH_O, __pyx_doc_7pyarrow_3lib_5Table_42column},
  {"_column", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Table_45_column, METH_O, __pyx_doc_7pyarrow_3lib_5Table_44_column},
  {"itercolumns", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Table_47itercolumns, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Table_46itercolumns},
  {"__sizeof__", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Table_52__sizeof__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Table_51__sizeof__},
  {"add_column", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_54add_column, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_53add_column},
  {"append_column", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_56append_column, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_55append_column},
  {"remove_column", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Table_58remove_column, METH_O, __pyx_doc_7pyarrow_3lib_5Table_57remove_column},
  {"set_column", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_60set_column, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_59set_column},
  {"rename_columns", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Table_62rename_columns, METH_O, __pyx_doc_7pyarrow_3lib_5Table_61rename_columns},
  {"drop", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Table_64drop, METH_O, __pyx_doc_7pyarrow_3lib_5Table_63drop},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_Table[] = {
  {(char *)"schema", __pyx_getprop_7pyarrow_3lib_5Table_schema, 0, (char *)"\n        Schema of the table and its columns\n\n        Returns\n        -------\n        pyarrow.Schema\n        ", 0},
  {(char *)"columns", __pyx_getprop_7pyarrow_3lib_5Table_columns, 0, (char *)"\n        List of all columns in numerical order\n\n        Returns\n        -------\n        list of pa.ChunkedArray\n        ", 0},
  {(char *)"num_columns", __pyx_getprop_7pyarrow_3lib_5Table_num_columns, 0, (char *)"\n        Number of columns in this table\n\n        Returns\n        -------\n        int\n        ", 0},
  {(char *)"num_rows", __pyx_getprop_7pyarrow_3lib_5Table_num_rows, 0, (char *)"\n        Number of rows in this table.\n\n        Due to the definition of a table, all columns have the same number of\n        rows.\n\n        Returns\n        -------\n        int\n        ", 0},
  {(char *)"shape", __pyx_getprop_7pyarrow_3lib_5Table_shape, 0, (char *)"\n        Dimensions of the table: (#rows, #columns)\n\n        Returns\n        -------\n        (int, int)\n        ", 0},
  {(char *)"nbytes", __pyx_getprop_7pyarrow_3lib_5Table_nbytes, 0, (char *)"\n        Total number of bytes consumed by the elements of the table.\n        ", 0},
  {(char *)"column_names", __pyx_getprop_7pyarrow_3lib_5Table_column_names, 0, (char *)"\n        Names of the table's columns\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_Table = {
  __pyx_pw_7pyarrow_3lib_5Table_50__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_7pyarrow_3lib_Table, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Table = {
  __pyx_pw_7pyarrow_3lib_5Table_50__len__, /*mp_length*/
  __pyx_pw_7pyarrow_3lib_5Table_11__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Table = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Table", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Table), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Table, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_7pyarrow_3lib_5Table_5__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_Table, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Table, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "Table()\n\n    A collection of top-level named, equal length Arrow arrays.\n\n    Warning\n    -------\n    Do not call this class's constructor directly, use one of the ``from_*``\n    methods instead.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_3lib_Table, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Table, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_Table, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_5Table_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Table, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_RecordBatch __pyx_vtable_7pyarrow_3lib_RecordBatch;

static PyObject *__pyx_tp_new_7pyarrow_3lib_RecordBatch(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_RecordBatch *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib__PandasConvertible(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_RecordBatch;
  new((void*)&(p->sp_batch)) std::shared_ptr< arrow::RecordBatch> ();
  p->_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7pyarrow_3lib_11RecordBatch_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_RecordBatch(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_RecordBatch *p = (struct __pyx_obj_7pyarrow_3lib_RecordBatch *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->sp_batch);
  Py_CLEAR(p->_schema);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib__PandasConvertible(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_RecordBatch(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_RecordBatch *p = (struct __pyx_obj_7pyarrow_3lib_RecordBatch *)o;
  e = ((likely(__pyx_ptype_7pyarrow_3lib__PandasConvertible)) ? ((__pyx_ptype_7pyarrow_3lib__PandasConvertible->tp_traverse) ? __pyx_ptype_7pyarrow_3lib__PandasConvertible->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7pyarrow_3lib_RecordBatch)); if (e) return e;
  if (p->_schema) {
    e = (*v)(((PyObject *)p->_schema), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_RecordBatch(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_RecordBatch *p = (struct __pyx_obj_7pyarrow_3lib_RecordBatch *)o;
  if (likely(__pyx_ptype_7pyarrow_3lib__PandasConvertible)) { if (__pyx_ptype_7pyarrow_3lib__PandasConvertible->tp_clear) __pyx_ptype_7pyarrow_3lib__PandasConvertible->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7pyarrow_3lib_RecordBatch);
  tmp = ((PyObject*)p->_schema);
  p->_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
static PyObject *__pyx_sq_item_7pyarrow_3lib_RecordBatch(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_11RecordBatch_num_columns(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_11RecordBatch_11num_columns_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_11RecordBatch_num_rows(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_11RecordBatch_8num_rows_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_11RecordBatch_schema(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_11RecordBatch_6schema_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_11RecordBatch_columns(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_11RecordBatch_7columns_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_11RecordBatch_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_11RecordBatch_6nbytes_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_RecordBatch[] = {
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11RecordBatch_5__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11RecordBatch_4__reduce__},
  {"validate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_11RecordBatch_9validate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_11RecordBatch_8validate},
  {"replace_schema_metadata", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_11RecordBatch_11replace_schema_metadata, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_11RecordBatch_10replace_schema_metadata},
  {"column", (PyCFunction)__pyx_pw_7pyarrow_3lib_11RecordBatch_13column, METH_O, __pyx_doc_7pyarrow_3lib_11RecordBatch_12column},
  {"__sizeof__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11RecordBatch_15__sizeof__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11RecordBatch_14__sizeof__},
  {"serialize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_11RecordBatch_19serialize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_11RecordBatch_18serialize},
  {"slice", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_11RecordBatch_21slice, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_11RecordBatch_20slice},
  {"equals", (PyCFunction)__pyx_pw_7pyarrow_3lib_11RecordBatch_23equals, METH_O, __pyx_doc_7pyarrow_3lib_11RecordBatch_22equals},
  {"to_pydict", (PyCFunction)__pyx_pw_7pyarrow_3lib_11RecordBatch_25to_pydict, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11RecordBatch_24to_pydict},
  {"_to_pandas", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_11RecordBatch_27_to_pandas, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_11RecordBatch_26_to_pandas},
  {"from_pandas", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_11RecordBatch_29from_pandas, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_11RecordBatch_28from_pandas},
  {"from_arrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_11RecordBatch_31from_arrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_11RecordBatch_30from_arrays},
  {"from_struct_array", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_11RecordBatch_33from_struct_array, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_11RecordBatch_32from_struct_array},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_RecordBatch[] = {
  {(char *)"num_columns", __pyx_getprop_7pyarrow_3lib_11RecordBatch_num_columns, 0, (char *)"\n        Number of columns\n\n        Returns\n        -------\n        int\n        ", 0},
  {(char *)"num_rows", __pyx_getprop_7pyarrow_3lib_11RecordBatch_num_rows, 0, (char *)"\n        Number of rows\n\n        Due to the definition of a RecordBatch, all columns have the same\n        number of rows.\n\n        Returns\n        -------\n        int\n        ", 0},
  {(char *)"schema", __pyx_getprop_7pyarrow_3lib_11RecordBatch_schema, 0, (char *)"\n        Schema of the RecordBatch and its columns\n\n        Returns\n        -------\n        pyarrow.Schema\n        ", 0},
  {(char *)"columns", __pyx_getprop_7pyarrow_3lib_11RecordBatch_columns, 0, (char *)"\n        List of all columns in numerical order\n\n        Returns\n        -------\n        list of pa.Array\n        ", 0},
  {(char *)"nbytes", __pyx_getprop_7pyarrow_3lib_11RecordBatch_nbytes, 0, (char *)"\n        Total number of bytes consumed by the elements of the record batch.\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_RecordBatch = {
  __pyx_pw_7pyarrow_3lib_11RecordBatch_7__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_7pyarrow_3lib_RecordBatch, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_RecordBatch = {
  __pyx_pw_7pyarrow_3lib_11RecordBatch_7__len__, /*mp_length*/
  __pyx_pw_7pyarrow_3lib_11RecordBatch_17__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7pyarrow_3lib_RecordBatch = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.RecordBatch", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_RecordBatch), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_RecordBatch, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_RecordBatch, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_RecordBatch, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "RecordBatch()\n\n    Batch of rows of columns of equal length\n\n    Warning\n    -------\n    Do not call this class's constructor directly, use one of the\n    ``RecordBatch.from_*`` functions instead.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_RecordBatch, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_RecordBatch, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_RecordBatch, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_RecordBatch, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_11RecordBatch_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_RecordBatch, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Buffer __pyx_vtable_7pyarrow_3lib_Buffer;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Buffer(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Buffer *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_Buffer;
  new((void*)&(p->buffer)) std::shared_ptr< arrow::Buffer> ();
  if (unlikely(__pyx_pw_7pyarrow_3lib_6Buffer_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_Buffer(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_Buffer *p = (struct __pyx_obj_7pyarrow_3lib_Buffer *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->buffer);
  (*Py_TYPE(o)->tp_free)(o);
}
static PyObject *__pyx_sq_item_7pyarrow_3lib_Buffer(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyObject *__pyx_tp_richcompare_7pyarrow_3lib_Buffer(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_3lib_6Buffer_15__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_3lib_6Buffer_15__eq__(o1, o2);
      if (likely(ret && ret != Py_NotImplemented)) {
        int b = __Pyx_PyObject_IsTrue(ret); Py_DECREF(ret);
        if (unlikely(b < 0)) return NULL;
        ret = (b) ? Py_False : Py_True;
        Py_INCREF(ret);
      }
      return ret;
    }
    default: {
      return __Pyx_NewRef(Py_NotImplemented);
    }
  }
}

static PyObject *__pyx_getprop_7pyarrow_3lib_6Buffer_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Buffer_4size_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_6Buffer_address(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Buffer_7address_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_6Buffer_is_mutable(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Buffer_10is_mutable_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_6Buffer_parent(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Buffer_6parent_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Buffer[] = {
  {"hex", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Buffer_7hex, METH_NOARGS, __pyx_doc_7pyarrow_3lib_6Buffer_6hex},
  {"slice", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_6Buffer_11slice, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_6Buffer_10slice},
  {"equals", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Buffer_13equals, METH_O, __pyx_doc_7pyarrow_3lib_6Buffer_12equals},
  {"__reduce_ex__", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Buffer_17__reduce_ex__, METH_O, __pyx_doc_7pyarrow_3lib_6Buffer_16__reduce_ex__},
  {"to_pybytes", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Buffer_19to_pybytes, METH_NOARGS, __pyx_doc_7pyarrow_3lib_6Buffer_18to_pybytes},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_Buffer[] = {
  {(char *)"size", __pyx_getprop_7pyarrow_3lib_6Buffer_size, 0, (char *)"\n        The buffer size in bytes.\n        ", 0},
  {(char *)"address", __pyx_getprop_7pyarrow_3lib_6Buffer_address, 0, (char *)"\n        The buffer's address, as an integer.\n        ", 0},
  {(char *)"is_mutable", __pyx_getprop_7pyarrow_3lib_6Buffer_is_mutable, 0, (char *)"\n        Whether the buffer is mutable.\n        ", 0},
  {(char *)"parent", __pyx_getprop_7pyarrow_3lib_6Buffer_parent, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_Buffer = {
  __pyx_pw_7pyarrow_3lib_6Buffer_5__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_7pyarrow_3lib_Buffer, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Buffer = {
  __pyx_pw_7pyarrow_3lib_6Buffer_5__len__, /*mp_length*/
  __pyx_pw_7pyarrow_3lib_6Buffer_9__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Buffer = {
  #if PY_MAJOR_VERSION < 3
  __pyx_pw_7pyarrow_3lib_6Buffer_25__getreadbuffer__, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_pw_7pyarrow_3lib_6Buffer_27__getwritebuffer__, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_pw_7pyarrow_3lib_6Buffer_23__getsegcount__, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  __pyx_pw_7pyarrow_3lib_6Buffer_21__getbuffer__, /*bf_getbuffer*/
  0, /*bf_releasebuffer*/
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Buffer = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Buffer", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Buffer), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Buffer, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_Buffer, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Buffer, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Buffer, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "Buffer()\n\n    The base class for all Arrow buffers.\n\n    A buffer represents a contiguous memory area.  Many buffers will own\n    their memory, though not all of them do.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_3lib_Buffer, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Buffer, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_Buffer, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_6Buffer_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Buffer, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ResizableBuffer __pyx_vtable_7pyarrow_3lib_ResizableBuffer;

static PyObject *__pyx_tp_new_7pyarrow_3lib_ResizableBuffer(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_ResizableBuffer *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Buffer(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_ResizableBuffer *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Buffer*)__pyx_vtabptr_7pyarrow_3lib_ResizableBuffer;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_ResizableBuffer[] = {
  {"resize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_15ResizableBuffer_1resize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_15ResizableBuffer_resize},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_ResizableBuffer = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.ResizableBuffer", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_ResizableBuffer), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Buffer, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    A base class for buffers that can be resized.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_ResizableBuffer, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_6Buffer_3__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_ResizableBuffer, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile __pyx_vtable_7pyarrow_3lib_NativeFile;

static PyObject *__pyx_tp_new_7pyarrow_3lib_NativeFile(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_NativeFile *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_NativeFile;
  new((void*)&(p->input_stream)) std::shared_ptr< arrow::io::InputStream> ();
  new((void*)&(p->random_access)) std::shared_ptr< arrow::io::RandomAccessFile> ();
  new((void*)&(p->output_stream)) std::shared_ptr< arrow::io::OutputStream> ();
  if (unlikely(__pyx_pw_7pyarrow_3lib_10NativeFile_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_NativeFile(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_NativeFile *p = (struct __pyx_obj_7pyarrow_3lib_NativeFile *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_7pyarrow_3lib_10NativeFile_3__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  if (p->__weakref__) PyObject_ClearWeakRefs(o);
  __Pyx_call_destructor(p->input_stream);
  __Pyx_call_destructor(p->random_access);
  __Pyx_call_destructor(p->output_stream);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_10NativeFile_mode(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_10NativeFile_4mode_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_10NativeFile_closed(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_10NativeFile_6closed_1__get__(o);
}

static PyObject *__pyx_specialmethod___pyx_pw_7pyarrow_3lib_10NativeFile_55__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_7pyarrow_3lib_10NativeFile_55__next__(self);}

static PyMethodDef __pyx_methods_7pyarrow_3lib_NativeFile[] = {
  {"__enter__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_5__enter__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_4__enter__},
  {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10NativeFile_7__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10NativeFile_6__exit__},
  {"readable", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_9readable, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_8readable},
  {"writable", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_11writable, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_10writable},
  {"seekable", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_13seekable, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_12seekable},
  {"isatty", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_15isatty, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_14isatty},
  {"fileno", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_17fileno, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_16fileno},
  {"close", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_19close, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_18close},
  {"_assert_open", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_21_assert_open, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_20_assert_open},
  {"_assert_readable", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_23_assert_readable, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_22_assert_readable},
  {"_assert_writable", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_25_assert_writable, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_24_assert_writable},
  {"_assert_seekable", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_27_assert_seekable, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_26_assert_seekable},
  {"size", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_29size, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_28size},
  {"tell", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_31tell, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_30tell},
  {"seek", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10NativeFile_33seek, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10NativeFile_32seek},
  {"flush", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_35flush, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_34flush},
  {"write", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_37write, METH_O, __pyx_doc_7pyarrow_3lib_10NativeFile_36write},
  {"read", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10NativeFile_39read, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10NativeFile_38read},
  {"read_at", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10NativeFile_41read_at, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10NativeFile_40read_at},
  {"read1", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10NativeFile_43read1, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10NativeFile_42read1},
  {"readall", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_45readall, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_44readall},
  {"readinto", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_47readinto, METH_O, __pyx_doc_7pyarrow_3lib_10NativeFile_46readinto},
  {"readline", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10NativeFile_49readline, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10NativeFile_48readline},
  {"readlines", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10NativeFile_51readlines, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10NativeFile_50readlines},
  {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_7pyarrow_3lib_10NativeFile_55__next__, METH_NOARGS|METH_COEXIST, 0},
  {"read_buffer", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10NativeFile_57read_buffer, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10NativeFile_56read_buffer},
  {"truncate", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_59truncate, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_58truncate},
  {"writelines", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_61writelines, METH_O, __pyx_doc_7pyarrow_3lib_10NativeFile_60writelines},
  {"download", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10NativeFile_63download, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10NativeFile_62download},
  {"upload", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10NativeFile_65upload, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10NativeFile_64upload},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_67__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_66__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_69__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_10NativeFile_68__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_NativeFile[] = {
  {(char *)"mode", __pyx_getprop_7pyarrow_3lib_10NativeFile_mode, 0, (char *)"\n        The file mode. Currently instances of NativeFile may support:\n\n        * rb: binary read\n        * wb: binary write\n        * rb+: binary read and write\n        ", 0},
  {(char *)"closed", __pyx_getprop_7pyarrow_3lib_10NativeFile_closed, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_NativeFile = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.NativeFile", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_NativeFile), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_NativeFile, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    The base class for all Arrow streams.\n\n    Streams are either readable, writable, or both.\n    They optionally support seeking.\n\n    While this class exposes methods to read or write data from Python, the\n    primary intent of using a Arrow stream is to pass it to other Arrow\n    facilities that will make use of it, such as Arrow IPC routines.\n\n    Be aware that there are subtle differences with regular Python files,\n    e.g. destroying a writable Arrow stream without closing it explicitly\n    will not flush any pending data.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7pyarrow_3lib_10NativeFile_53__iter__, /*tp_iter*/
  __pyx_pw_7pyarrow_3lib_10NativeFile_55__next__, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_NativeFile, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_NativeFile, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_NativeFile, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BufferedInputStream __pyx_vtable_7pyarrow_3lib_BufferedInputStream;

static PyObject *__pyx_tp_new_7pyarrow_3lib_BufferedInputStream(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_BufferedInputStream *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NativeFile(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_BufferedInputStream *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile*)__pyx_vtabptr_7pyarrow_3lib_BufferedInputStream;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_BufferedInputStream[] = {
  {"detach", (PyCFunction)__pyx_pw_7pyarrow_3lib_19BufferedInputStream_3detach, METH_NOARGS, __pyx_doc_7pyarrow_3lib_19BufferedInputStream_2detach},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_19BufferedInputStream_5__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_19BufferedInputStream_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_19BufferedInputStream_7__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_19BufferedInputStream_6__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_BufferedInputStream = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.BufferedInputStream", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_BufferedInputStream), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_NativeFile, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "BufferedInputStream(NativeFile stream, int buffer_size, MemoryPool memory_pool=None)", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_53__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_55__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  __pyx_methods_7pyarrow_3lib_BufferedInputStream, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_19BufferedInputStream_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_BufferedInputStream, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BufferedOutputStream __pyx_vtable_7pyarrow_3lib_BufferedOutputStream;

static PyObject *__pyx_tp_new_7pyarrow_3lib_BufferedOutputStream(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NativeFile(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile*)__pyx_vtabptr_7pyarrow_3lib_BufferedOutputStream;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_BufferedOutputStream[] = {
  {"detach", (PyCFunction)__pyx_pw_7pyarrow_3lib_20BufferedOutputStream_3detach, METH_NOARGS, __pyx_doc_7pyarrow_3lib_20BufferedOutputStream_2detach},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_20BufferedOutputStream_5__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_20BufferedOutputStream_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_20BufferedOutputStream_7__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_20BufferedOutputStream_6__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_BufferedOutputStream = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.BufferedOutputStream", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_NativeFile, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "BufferedOutputStream(NativeFile stream, int buffer_size, MemoryPool memory_pool=None)", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_53__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_55__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  __pyx_methods_7pyarrow_3lib_BufferedOutputStream, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_20BufferedOutputStream_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_BufferedOutputStream, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_CompressedInputStream __pyx_vtable_7pyarrow_3lib_CompressedInputStream;

static PyObject *__pyx_tp_new_7pyarrow_3lib_CompressedInputStream(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_CompressedInputStream *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NativeFile(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_CompressedInputStream *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile*)__pyx_vtabptr_7pyarrow_3lib_CompressedInputStream;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_CompressedInputStream[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_21CompressedInputStream_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_21CompressedInputStream_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_21CompressedInputStream_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_21CompressedInputStream_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_CompressedInputStream = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.CompressedInputStream", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_CompressedInputStream), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_NativeFile, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "CompressedInputStream(NativeFile stream, compression)\n\n    An input stream wrapper which decompresses data on the fly.\n\n    Parameters\n    ----------\n    stream : pa.NativeFile\n    compression : str\n        The compression type (\"bz2\", \"brotli\", \"gzip\", \"lz4\" or \"zstd\")\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_53__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_55__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  __pyx_methods_7pyarrow_3lib_CompressedInputStream, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_21CompressedInputStream_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_CompressedInputStream, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_CompressedOutputStream __pyx_vtable_7pyarrow_3lib_CompressedOutputStream;

static PyObject *__pyx_tp_new_7pyarrow_3lib_CompressedOutputStream(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NativeFile(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile*)__pyx_vtabptr_7pyarrow_3lib_CompressedOutputStream;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_CompressedOutputStream[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_22CompressedOutputStream_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_22CompressedOutputStream_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_22CompressedOutputStream_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_22CompressedOutputStream_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_CompressedOutputStream = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.CompressedOutputStream", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_NativeFile, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "CompressedOutputStream(NativeFile stream, compression)\n\n    An output stream wrapper which compresses data on the fly.\n\n    Parameters\n    ----------\n    stream : pa.NativeFile\n    compression : str\n        The compression type (\"bz2\", \"brotli\", \"gzip\", \"lz4\" or \"zstd\")\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_53__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_55__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  __pyx_methods_7pyarrow_3lib_CompressedOutputStream, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_22CompressedOutputStream_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_CompressedOutputStream, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib__CRecordBatchWriter(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *)o);
  new((void*)&(p->writer)) std::shared_ptr< arrow::ipc::RecordBatchWriter> ();
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib__CRecordBatchWriter(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *p = (struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->writer);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib__CRecordBatchWriter[] = {
  {"write", (PyCFunction)__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_1write, METH_O, __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_write},
  {"write_batch", (PyCFunction)__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_3write_batch, METH_O, __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_2write_batch},
  {"write_table", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_5write_table, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_4write_table},
  {"close", (PyCFunction)__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_7close, METH_NOARGS, __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_6close},
  {"__enter__", (PyCFunction)__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_9__enter__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_8__enter__},
  {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_11__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_10__exit__},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_13__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_12__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_19_CRecordBatchWriter_15__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_19_CRecordBatchWriter_14__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib__CRecordBatchWriter = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib._CRecordBatchWriter", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib__CRecordBatchWriter, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "The base RecordBatchWriter wrapper.\n\n    Provides common implementations of convenience methods. Should not\n    be instantiated directly by user code.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib__CRecordBatchWriter, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib__CRecordBatchWriter, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib__CRecordBatchReader(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *)o);
  new((void*)&(p->reader)) std::shared_ptr< arrow::RecordBatchReader> ();
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib__CRecordBatchReader(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *p = (struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->reader);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib__CRecordBatchReader[] = {
  {"get_next_batch", (PyCFunction)__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_4get_next_batch, METH_NOARGS, __pyx_doc_7pyarrow_3lib_19_CRecordBatchReader_3get_next_batch},
  {"read_next_batch", (PyCFunction)__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_6read_next_batch, METH_NOARGS, __pyx_doc_7pyarrow_3lib_19_CRecordBatchReader_5read_next_batch},
  {"read_all", (PyCFunction)__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_8read_all, METH_NOARGS, __pyx_doc_7pyarrow_3lib_19_CRecordBatchReader_7read_all},
  {"__enter__", (PyCFunction)__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_10__enter__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_19_CRecordBatchReader_9__enter__},
  {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_12__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_19_CRecordBatchReader_11__exit__},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_14__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_19_CRecordBatchReader_13__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_16__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_19_CRecordBatchReader_15__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib__CRecordBatchReader = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib._CRecordBatchReader", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib__CRecordBatchReader), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib__CRecordBatchReader, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "The base RecordBatchReader wrapper.\n\n    Provides common implementations of convenience methods. Should not\n    be instantiated directly by user code.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_1__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib__CRecordBatchReader, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib__CRecordBatchReader, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_CastOptions __pyx_vtable_7pyarrow_3lib_CastOptions;

static PyObject *__pyx_tp_new_7pyarrow_3lib_CastOptions(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_CastOptions *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_CastOptions *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_CastOptions;
  new((void*)&(p->options))  arrow::compute::CastOptions();
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_CastOptions(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_CastOptions *p = (struct __pyx_obj_7pyarrow_3lib_CastOptions *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->options);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_11CastOptions_allow_int_overflow(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_11CastOptions_18allow_int_overflow_1__get__(o);
}

static int __pyx_setprop_7pyarrow_3lib_11CastOptions_allow_int_overflow(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7pyarrow_3lib_11CastOptions_18allow_int_overflow_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_7pyarrow_3lib_11CastOptions_allow_time_truncate(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_11CastOptions_19allow_time_truncate_1__get__(o);
}

static int __pyx_setprop_7pyarrow_3lib_11CastOptions_allow_time_truncate(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7pyarrow_3lib_11CastOptions_19allow_time_truncate_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_7pyarrow_3lib_11CastOptions_allow_time_overflow(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_11CastOptions_19allow_time_overflow_1__get__(o);
}

static int __pyx_setprop_7pyarrow_3lib_11CastOptions_allow_time_overflow(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7pyarrow_3lib_11CastOptions_19allow_time_overflow_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_7pyarrow_3lib_11CastOptions_allow_float_truncate(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_11CastOptions_20allow_float_truncate_1__get__(o);
}

static int __pyx_setprop_7pyarrow_3lib_11CastOptions_allow_float_truncate(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7pyarrow_3lib_11CastOptions_20allow_float_truncate_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_7pyarrow_3lib_11CastOptions_allow_invalid_utf8(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_11CastOptions_18allow_invalid_utf8_1__get__(o);
}

static int __pyx_setprop_7pyarrow_3lib_11CastOptions_allow_invalid_utf8(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7pyarrow_3lib_11CastOptions_18allow_invalid_utf8_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_CastOptions[] = {
  {"safe", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_11CastOptions_3safe, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_11CastOptions_2safe},
  {"unsafe", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_11CastOptions_5unsafe, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_11CastOptions_4unsafe},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11CastOptions_7__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11CastOptions_6__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11CastOptions_9__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11CastOptions_8__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_CastOptions[] = {
  {(char *)"allow_int_overflow", __pyx_getprop_7pyarrow_3lib_11CastOptions_allow_int_overflow, __pyx_setprop_7pyarrow_3lib_11CastOptions_allow_int_overflow, (char *)0, 0},
  {(char *)"allow_time_truncate", __pyx_getprop_7pyarrow_3lib_11CastOptions_allow_time_truncate, __pyx_setprop_7pyarrow_3lib_11CastOptions_allow_time_truncate, (char *)0, 0},
  {(char *)"allow_time_overflow", __pyx_getprop_7pyarrow_3lib_11CastOptions_allow_time_overflow, __pyx_setprop_7pyarrow_3lib_11CastOptions_allow_time_overflow, (char *)0, 0},
  {(char *)"allow_float_truncate", __pyx_getprop_7pyarrow_3lib_11CastOptions_allow_float_truncate, __pyx_setprop_7pyarrow_3lib_11CastOptions_allow_float_truncate, (char *)0, 0},
  {(char *)"allow_invalid_utf8", __pyx_getprop_7pyarrow_3lib_11CastOptions_allow_invalid_utf8, __pyx_setprop_7pyarrow_3lib_11CastOptions_allow_invalid_utf8, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_CastOptions = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.CastOptions", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_CastOptions), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_CastOptions, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "CastOptions(allow_int_overflow=None, allow_time_truncate=None, allow_time_overflow=None, allow_float_truncate=None, allow_invalid_utf8=None)", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_CastOptions, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_CastOptions, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_11CastOptions_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_CastOptions, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib__PandasAPIShim __pyx_vtable_7pyarrow_3lib__PandasAPIShim;

static PyObject *__pyx_tp_new_7pyarrow_3lib__PandasAPIShim(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib__PandasAPIShim;
  p->_loose_version = Py_None; Py_INCREF(Py_None);
  p->_version = Py_None; Py_INCREF(Py_None);
  p->_pd = Py_None; Py_INCREF(Py_None);
  p->_types_api = Py_None; Py_INCREF(Py_None);
  p->_compat_module = Py_None; Py_INCREF(Py_None);
  p->_data_frame = Py_None; Py_INCREF(Py_None);
  p->_index = Py_None; Py_INCREF(Py_None);
  p->_series = Py_None; Py_INCREF(Py_None);
  p->_categorical_type = Py_None; Py_INCREF(Py_None);
  p->_datetimetz_type = Py_None; Py_INCREF(Py_None);
  p->_extension_array = Py_None; Py_INCREF(Py_None);
  p->_extension_dtype = Py_None; Py_INCREF(Py_None);
  p->_array_like_types = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib__PandasAPIShim(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *p = (struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->_loose_version);
  Py_CLEAR(p->_version);
  Py_CLEAR(p->_pd);
  Py_CLEAR(p->_types_api);
  Py_CLEAR(p->_compat_module);
  Py_CLEAR(p->_data_frame);
  Py_CLEAR(p->_index);
  Py_CLEAR(p->_series);
  Py_CLEAR(p->_categorical_type);
  Py_CLEAR(p->_datetimetz_type);
  Py_CLEAR(p->_extension_array);
  Py_CLEAR(p->_extension_dtype);
  Py_CLEAR(p->_array_like_types);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib__PandasAPIShim(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *p = (struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)o;
  if (p->_loose_version) {
    e = (*v)(p->_loose_version, a); if (e) return e;
  }
  if (p->_version) {
    e = (*v)(p->_version, a); if (e) return e;
  }
  if (p->_pd) {
    e = (*v)(p->_pd, a); if (e) return e;
  }
  if (p->_types_api) {
    e = (*v)(p->_types_api, a); if (e) return e;
  }
  if (p->_compat_module) {
    e = (*v)(p->_compat_module, a); if (e) return e;
  }
  if (p->_data_frame) {
    e = (*v)(p->_data_frame, a); if (e) return e;
  }
  if (p->_index) {
    e = (*v)(p->_index, a); if (e) return e;
  }
  if (p->_series) {
    e = (*v)(p->_series, a); if (e) return e;
  }
  if (p->_categorical_type) {
    e = (*v)(p->_categorical_type, a); if (e) return e;
  }
  if (p->_datetimetz_type) {
    e = (*v)(p->_datetimetz_type, a); if (e) return e;
  }
  if (p->_extension_array) {
    e = (*v)(p->_extension_array, a); if (e) return e;
  }
  if (p->_extension_dtype) {
    e = (*v)(p->_extension_dtype, a); if (e) return e;
  }
  if (p->_array_like_types) {
    e = (*v)(p->_array_like_types, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib__PandasAPIShim(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *p = (struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)o;
  tmp = ((PyObject*)p->_loose_version);
  p->_loose_version = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_version);
  p->_version = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_pd);
  p->_pd = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_types_api);
  p->_types_api = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_compat_module);
  p->_compat_module = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_data_frame);
  p->_data_frame = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_index);
  p->_index = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_series);
  p->_series = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_categorical_type);
  p->_categorical_type = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_datetimetz_type);
  p->_datetimetz_type = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_extension_array);
  p->_extension_array = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_extension_dtype);
  p->_extension_dtype = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_array_like_types);
  p->_array_like_types = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_have_pandas(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_11have_pandas_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_compat(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_6compat_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_pd(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_2pd_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_loose_version(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_13loose_version_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_version(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_7version_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_categorical_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_16categorical_type_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_datetimetz_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_15datetimetz_type_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_extension_dtype(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_15extension_dtype_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__loose_version(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_14_loose_version_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__version(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_8_version_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__pd(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_3_pd_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__types_api(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_10_types_api_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__compat_module(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_14_compat_module_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__data_frame(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_11_data_frame_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__index(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_6_index_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__series(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_7_series_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__categorical_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_17_categorical_type_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__datetimetz_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_16_datetimetz_type_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__extension_array(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_16_extension_array_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__extension_dtype(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_16_extension_dtype_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__array_like_types(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_17_array_like_types_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_has_sparse(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_10has_sparse_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__pd024(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_6_pd024_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib__PandasAPIShim[] = {
  {"series", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_3series, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_2series},
  {"data_frame", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_5data_frame, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_4data_frame},
  {"infer_dtype", (PyCFunction)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_7infer_dtype, METH_O, __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_6infer_dtype},
  {"pandas_dtype", (PyCFunction)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_9pandas_dtype, METH_O, __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_8pandas_dtype},
  {"is_array_like", (PyCFunction)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_11is_array_like, METH_O, __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_10is_array_like},
  {"is_categorical", (PyCFunction)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_13is_categorical, METH_O, __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_12is_categorical},
  {"is_datetimetz", (PyCFunction)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_15is_datetimetz, METH_O, __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_14is_datetimetz},
  {"is_sparse", (PyCFunction)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_17is_sparse, METH_O, __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_16is_sparse},
  {"is_data_frame", (PyCFunction)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_19is_data_frame, METH_O, __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_18is_data_frame},
  {"is_series", (PyCFunction)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_21is_series, METH_O, __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_20is_series},
  {"is_index", (PyCFunction)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_23is_index, METH_O, __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_22is_index},
  {"get_values", (PyCFunction)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_25get_values, METH_O, __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_24get_values},
  {"assert_frame_equal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_27assert_frame_equal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_26assert_frame_equal},
  {"get_rangeindex_attribute", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_29get_rangeindex_attribute, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_28get_rangeindex_attribute},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_31__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_30__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_14_PandasAPIShim_33__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_14_PandasAPIShim_32__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib__PandasAPIShim[] = {
  {(char *)"have_pandas", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_have_pandas, 0, (char *)0, 0},
  {(char *)"compat", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_compat, 0, (char *)0, 0},
  {(char *)"pd", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_pd, 0, (char *)0, 0},
  {(char *)"loose_version", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_loose_version, 0, (char *)0, 0},
  {(char *)"version", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_version, 0, (char *)0, 0},
  {(char *)"categorical_type", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_categorical_type, 0, (char *)0, 0},
  {(char *)"datetimetz_type", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_datetimetz_type, 0, (char *)0, 0},
  {(char *)"extension_dtype", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_extension_dtype, 0, (char *)0, 0},
  {(char *)"_loose_version", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__loose_version, 0, (char *)0, 0},
  {(char *)"_version", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__version, 0, (char *)0, 0},
  {(char *)"_pd", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__pd, 0, (char *)0, 0},
  {(char *)"_types_api", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__types_api, 0, (char *)0, 0},
  {(char *)"_compat_module", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__compat_module, 0, (char *)0, 0},
  {(char *)"_data_frame", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__data_frame, 0, (char *)0, 0},
  {(char *)"_index", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__index, 0, (char *)0, 0},
  {(char *)"_series", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__series, 0, (char *)0, 0},
  {(char *)"_categorical_type", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__categorical_type, 0, (char *)0, 0},
  {(char *)"_datetimetz_type", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__datetimetz_type, 0, (char *)0, 0},
  {(char *)"_extension_array", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__extension_array, 0, (char *)0, 0},
  {(char *)"_extension_dtype", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__extension_dtype, 0, (char *)0, 0},
  {(char *)"_array_like_types", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__array_like_types, 0, (char *)0, 0},
  {(char *)"has_sparse", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim_has_sparse, 0, (char *)0, 0},
  {(char *)"_pd024", __pyx_getprop_7pyarrow_3lib_14_PandasAPIShim__pd024, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib__PandasAPIShim = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib._PandasAPIShim", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib__PandasAPIShim, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "_PandasAPIShim()\n\n    Lazy pandas importer that isolates usages of pandas APIs and avoids\n    importing pandas until it's actually needed\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib__PandasAPIShim, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib__PandasAPIShim, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib__PandasAPIShim, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib__PandasAPIShim, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_14_PandasAPIShim_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib__PandasAPIShim, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_LoggingMemoryPool __pyx_vtable_7pyarrow_3lib_LoggingMemoryPool;

static PyObject *__pyx_tp_new_7pyarrow_3lib_LoggingMemoryPool(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_MemoryPool(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_MemoryPool*)__pyx_vtabptr_7pyarrow_3lib_LoggingMemoryPool;
  new((void*)&(p->logging_pool)) std::unique_ptr< arrow::LoggingMemoryPool> ();
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_LoggingMemoryPool(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *p = (struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->logging_pool);
  __pyx_tp_dealloc_7pyarrow_3lib_MemoryPool(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_LoggingMemoryPool[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_17LoggingMemoryPool_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_17LoggingMemoryPool_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_17LoggingMemoryPool_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_17LoggingMemoryPool_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_LoggingMemoryPool = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.LoggingMemoryPool", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_LoggingMemoryPool, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "LoggingMemoryPool()", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_LoggingMemoryPool, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_17LoggingMemoryPool_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_LoggingMemoryPool, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ProxyMemoryPool __pyx_vtable_7pyarrow_3lib_ProxyMemoryPool;

static PyObject *__pyx_tp_new_7pyarrow_3lib_ProxyMemoryPool(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_MemoryPool(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_MemoryPool*)__pyx_vtabptr_7pyarrow_3lib_ProxyMemoryPool;
  new((void*)&(p->proxy_pool)) std::unique_ptr< arrow::ProxyMemoryPool> ();
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_ProxyMemoryPool(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool *p = (struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->proxy_pool);
  __pyx_tp_dealloc_7pyarrow_3lib_MemoryPool(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_ProxyMemoryPool[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_15ProxyMemoryPool_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_15ProxyMemoryPool_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_15ProxyMemoryPool_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_15ProxyMemoryPool_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_ProxyMemoryPool = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.ProxyMemoryPool", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ProxyMemoryPool, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "ProxyMemoryPool()\n\n    Memory pool implementation that tracks the number of bytes and\n    maximum memory allocated through its direct calls, while redirecting\n    to another memory pool.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_ProxyMemoryPool, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_15ProxyMemoryPool_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_ProxyMemoryPool, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UnionType __pyx_vtable_7pyarrow_3lib_UnionType;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UnionType(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UnionType *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_DataType(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UnionType *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_DataType*)__pyx_vtabptr_7pyarrow_3lib_UnionType;
  return o;
}
static PyObject *__pyx_sq_item_7pyarrow_3lib_UnionType(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_9UnionType_mode(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_9UnionType_4mode_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_9UnionType_type_codes(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_9UnionType_10type_codes_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_UnionType[] = {
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_9UnionType_8__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_9UnionType_7__reduce__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_UnionType[] = {
  {(char *)"mode", __pyx_getprop_7pyarrow_3lib_9UnionType_mode, 0, (char *)"\n        The mode of the union (\"dense\" or \"sparse\").\n        ", 0},
  {(char *)"type_codes", __pyx_getprop_7pyarrow_3lib_9UnionType_type_codes, 0, (char *)"\n        The type code to indicate each data type in this union.\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_UnionType = {
  __pyx_pw_7pyarrow_3lib_9UnionType_1__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_7pyarrow_3lib_UnionType, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_UnionType = {
  __pyx_pw_7pyarrow_3lib_9UnionType_1__len__, /*mp_length*/
  __pyx_pw_7pyarrow_3lib_9UnionType_6__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7pyarrow_3lib_UnionType = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UnionType", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UnionType), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_DataType, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_11__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_UnionType, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_UnionType, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Concrete class for struct data types.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7pyarrow_3lib_9UnionType_3__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_UnionType, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_UnionType, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_3__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UnionType, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UnknownExtensionType __pyx_vtable_7pyarrow_3lib_UnknownExtensionType;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UnknownExtensionType(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UnknownExtensionType *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_PyExtensionType(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UnknownExtensionType *)o);
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_DataType*)__pyx_vtabptr_7pyarrow_3lib_UnknownExtensionType;
  p->serialized = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_UnknownExtensionType(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_UnknownExtensionType *p = (struct __pyx_obj_7pyarrow_3lib_UnknownExtensionType *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  Py_CLEAR(p->serialized);
  __pyx_tp_dealloc_7pyarrow_3lib_DataType(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_UnknownExtensionType[] = {
  {"__arrow_ext_serialize__", (PyCFunction)__pyx_pw_7pyarrow_3lib_20UnknownExtensionType_3__arrow_ext_serialize__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_20UnknownExtensionType_2__arrow_ext_serialize__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_UnknownExtensionType = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UnknownExtensionType", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UnknownExtensionType), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_UnknownExtensionType, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_11__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_8DataType_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "UnknownExtensionType(DataType storage_type, serialized)\n\n    A concrete class for Python-defined extension types that refer to\n    an unknown Python implementation.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_UnknownExtensionType, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_20UnknownExtensionType_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UnknownExtensionType, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib__ExtensionRegistryNanny(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib__ExtensionRegistryNanny *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib__ExtensionRegistryNanny *)o);
  new((void*)&(p->registry)) std::shared_ptr< arrow::ExtensionTypeRegistry> ();
  if (unlikely(__pyx_pw_7pyarrow_3lib_23_ExtensionRegistryNanny_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib__ExtensionRegistryNanny(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib__ExtensionRegistryNanny *p = (struct __pyx_obj_7pyarrow_3lib__ExtensionRegistryNanny *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->registry);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib__ExtensionRegistryNanny[] = {
  {"release_registry", (PyCFunction)__pyx_pw_7pyarrow_3lib_23_ExtensionRegistryNanny_3release_registry, METH_NOARGS, __pyx_doc_7pyarrow_3lib_23_ExtensionRegistryNanny_2release_registry},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_23_ExtensionRegistryNanny_5__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_23_ExtensionRegistryNanny_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_23_ExtensionRegistryNanny_7__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_23_ExtensionRegistryNanny_6__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib__ExtensionRegistryNanny = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib._ExtensionRegistryNanny", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib__ExtensionRegistryNanny), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib__ExtensionRegistryNanny, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib__ExtensionRegistryNanny, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib__ExtensionRegistryNanny, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib_NullType(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Scalar(t, a, k);
  if (unlikely(!o)) return 0;
  if (unlikely(__pyx_pw_7pyarrow_3lib_8NullType_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static PyObject *__pyx_tp_richcompare_7pyarrow_3lib_NullType(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_3lib_8NullType_7__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_3lib_8NullType_7__eq__(o1, o2);
      if (likely(ret && ret != Py_NotImplemented)) {
        int b = __Pyx_PyObject_IsTrue(ret); Py_DECREF(ret);
        if (unlikely(b < 0)) return NULL;
        ret = (b) ? Py_False : Py_True;
        Py_INCREF(ret);
      }
      return ret;
    }
    default: {
      return __Pyx_NewRef(Py_NotImplemented);
    }
  }
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_NullType[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_8NullType_5as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_8NullType_4as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_8NullType_9__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_8NullType_8__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_8NullType_11__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_8NullType_10__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_NullType = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.NullType", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_NullType), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Scalar, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_7pyarrow_3lib_8NullType_3__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Singleton for null array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_3lib_NullType, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_NullType, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_NullType, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BooleanValue __pyx_vtable_7pyarrow_3lib_BooleanValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_BooleanValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_BooleanValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_BooleanValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_BooleanValue;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_BooleanValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_12BooleanValue_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12BooleanValue_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12BooleanValue_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12BooleanValue_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12BooleanValue_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_12BooleanValue_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_BooleanValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.BooleanValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_BooleanValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for boolean array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_BooleanValue, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_BooleanValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt8Value __pyx_vtable_7pyarrow_3lib_UInt8Value;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt8Value(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UInt8Value *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UInt8Value *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_UInt8Value;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_UInt8Value[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_10UInt8Value_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10UInt8Value_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10UInt8Value_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10UInt8Value_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10UInt8Value_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_10UInt8Value_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_UInt8Value = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UInt8Value", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt8Value), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for uint8 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_UInt8Value, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UInt8Value, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int16Value __pyx_vtable_7pyarrow_3lib_Int16Value;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Int16Value(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Int16Value *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Int16Value *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_Int16Value;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Int16Value[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_10Int16Value_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10Int16Value_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10Int16Value_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10Int16Value_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10Int16Value_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_10Int16Value_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Int16Value = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Int16Value", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int16Value), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for int16 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Int16Value, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Int16Value, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt16Value __pyx_vtable_7pyarrow_3lib_UInt16Value;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt16Value(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UInt16Value *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UInt16Value *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_UInt16Value;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_UInt16Value[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11UInt16Value_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11UInt16Value_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11UInt16Value_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11UInt16Value_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11UInt16Value_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11UInt16Value_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_UInt16Value = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UInt16Value", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt16Value), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for uint16 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_UInt16Value, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UInt16Value, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int32Value __pyx_vtable_7pyarrow_3lib_Int32Value;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Int32Value(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Int32Value *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Int32Value *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_Int32Value;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Int32Value[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_10Int32Value_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10Int32Value_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10Int32Value_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10Int32Value_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10Int32Value_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_10Int32Value_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Int32Value = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Int32Value", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int32Value), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for int32 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Int32Value, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Int32Value, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt32Value __pyx_vtable_7pyarrow_3lib_UInt32Value;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt32Value(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UInt32Value *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UInt32Value *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_UInt32Value;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_UInt32Value[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11UInt32Value_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11UInt32Value_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11UInt32Value_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11UInt32Value_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11UInt32Value_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11UInt32Value_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_UInt32Value = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UInt32Value", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt32Value), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for uint32 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_UInt32Value, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UInt32Value, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt64Value __pyx_vtable_7pyarrow_3lib_UInt64Value;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt64Value(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UInt64Value *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UInt64Value *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_UInt64Value;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_UInt64Value[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11UInt64Value_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11UInt64Value_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11UInt64Value_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11UInt64Value_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11UInt64Value_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11UInt64Value_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_UInt64Value = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UInt64Value", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt64Value), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for uint64 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_UInt64Value, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UInt64Value, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Date32Value __pyx_vtable_7pyarrow_3lib_Date32Value;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Date32Value(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Date32Value *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Date32Value *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_Date32Value;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Date32Value[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Date32Value_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11Date32Value_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Date32Value_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11Date32Value_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Date32Value_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11Date32Value_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Date32Value = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Date32Value", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Date32Value), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for date32 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Date32Value, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Date32Value, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Date64Value __pyx_vtable_7pyarrow_3lib_Date64Value;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Date64Value(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Date64Value *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Date64Value *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_Date64Value;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Date64Value[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Date64Value_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11Date64Value_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Date64Value_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11Date64Value_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Date64Value_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11Date64Value_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Date64Value = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Date64Value", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Date64Value), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for date64 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Date64Value, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Date64Value, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Time32Value __pyx_vtable_7pyarrow_3lib_Time32Value;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Time32Value(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Time32Value *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Time32Value *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_Time32Value;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Time32Value[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Time32Value_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11Time32Value_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Time32Value_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11Time32Value_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Time32Value_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11Time32Value_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Time32Value = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Time32Value", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Time32Value), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for time32 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Time32Value, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Time32Value, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Time64Value __pyx_vtable_7pyarrow_3lib_Time64Value;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Time64Value(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Time64Value *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Time64Value *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_Time64Value;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Time64Value[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Time64Value_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11Time64Value_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Time64Value_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11Time64Value_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Time64Value_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11Time64Value_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Time64Value = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Time64Value", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Time64Value), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for time64 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Time64Value, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Time64Value, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_TimestampValue __pyx_vtable_7pyarrow_3lib_TimestampValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_TimestampValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_TimestampValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_TimestampValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_TimestampValue;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_14TimestampValue_value(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14TimestampValue_5value_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_TimestampValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_14TimestampValue_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_14TimestampValue_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_14TimestampValue_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_14TimestampValue_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_14TimestampValue_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_14TimestampValue_4__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_TimestampValue[] = {
  {(char *)"value", __pyx_getprop_7pyarrow_3lib_14TimestampValue_value, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_TimestampValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.TimestampValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_TimestampValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for timestamp array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_TimestampValue, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_TimestampValue, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_TimestampValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DurationValue __pyx_vtable_7pyarrow_3lib_DurationValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_DurationValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_DurationValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_DurationValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_DurationValue;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_13DurationValue_value(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_13DurationValue_5value_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_DurationValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_13DurationValue_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_13DurationValue_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_13DurationValue_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_13DurationValue_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_13DurationValue_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_13DurationValue_4__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_DurationValue[] = {
  {(char *)"value", __pyx_getprop_7pyarrow_3lib_13DurationValue_value, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_DurationValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.DurationValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_DurationValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for duration array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_DurationValue, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_DurationValue, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_DurationValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_HalfFloatValue __pyx_vtable_7pyarrow_3lib_HalfFloatValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_HalfFloatValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_HalfFloatValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_HalfFloatValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_HalfFloatValue;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_HalfFloatValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_14HalfFloatValue_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_14HalfFloatValue_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_14HalfFloatValue_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_14HalfFloatValue_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_14HalfFloatValue_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_14HalfFloatValue_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_HalfFloatValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.HalfFloatValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_HalfFloatValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for float16 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_HalfFloatValue, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_HalfFloatValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FloatValue __pyx_vtable_7pyarrow_3lib_FloatValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_FloatValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_FloatValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_FloatValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_FloatValue;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_FloatValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_10FloatValue_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10FloatValue_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10FloatValue_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10FloatValue_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10FloatValue_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_10FloatValue_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_FloatValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.FloatValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_FloatValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for float32 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_FloatValue, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_FloatValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DoubleValue __pyx_vtable_7pyarrow_3lib_DoubleValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_DoubleValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_DoubleValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_DoubleValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_DoubleValue;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_DoubleValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11DoubleValue_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11DoubleValue_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11DoubleValue_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11DoubleValue_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11DoubleValue_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11DoubleValue_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_DoubleValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.DoubleValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_DoubleValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for float64 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_DoubleValue, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_DoubleValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DecimalValue __pyx_vtable_7pyarrow_3lib_DecimalValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_DecimalValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_DecimalValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_DecimalValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_DecimalValue;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_DecimalValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_12DecimalValue_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12DecimalValue_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12DecimalValue_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12DecimalValue_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12DecimalValue_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_12DecimalValue_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_DecimalValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.DecimalValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_DecimalValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for decimal128 array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_DecimalValue, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_DecimalValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_LargeStringValue __pyx_vtable_7pyarrow_3lib_LargeStringValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_LargeStringValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_LargeStringValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_LargeStringValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_LargeStringValue;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_LargeStringValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_16LargeStringValue_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_16LargeStringValue_as_py},
  {"as_buffer", (PyCFunction)__pyx_pw_7pyarrow_3lib_16LargeStringValue_3as_buffer, METH_NOARGS, __pyx_doc_7pyarrow_3lib_16LargeStringValue_2as_buffer},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_16LargeStringValue_5__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_16LargeStringValue_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_16LargeStringValue_7__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_16LargeStringValue_6__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_LargeStringValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.LargeStringValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_LargeStringValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for large string (utf8) array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_LargeStringValue, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_LargeStringValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BinaryValue __pyx_vtable_7pyarrow_3lib_BinaryValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_BinaryValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_BinaryValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_BinaryValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_BinaryValue;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_BinaryValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11BinaryValue_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11BinaryValue_as_py},
  {"as_buffer", (PyCFunction)__pyx_pw_7pyarrow_3lib_11BinaryValue_3as_buffer, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11BinaryValue_2as_buffer},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11BinaryValue_5__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11BinaryValue_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11BinaryValue_7__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11BinaryValue_6__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_BinaryValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.BinaryValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_BinaryValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for variable-sized binary array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_BinaryValue, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_BinaryValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_LargeBinaryValue __pyx_vtable_7pyarrow_3lib_LargeBinaryValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_LargeBinaryValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_LargeBinaryValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_LargeBinaryValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_LargeBinaryValue;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_LargeBinaryValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_16LargeBinaryValue_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_16LargeBinaryValue_as_py},
  {"as_buffer", (PyCFunction)__pyx_pw_7pyarrow_3lib_16LargeBinaryValue_3as_buffer, METH_NOARGS, __pyx_doc_7pyarrow_3lib_16LargeBinaryValue_2as_buffer},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_16LargeBinaryValue_5__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_16LargeBinaryValue_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_16LargeBinaryValue_7__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_16LargeBinaryValue_6__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_LargeBinaryValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.LargeBinaryValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_LargeBinaryValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for large variable-sized binary array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_LargeBinaryValue, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_LargeBinaryValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DictionaryValue __pyx_vtable_7pyarrow_3lib_DictionaryValue;

static PyObject *__pyx_tp_new_7pyarrow_3lib_DictionaryValue(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_DictionaryValue *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ArrayValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_DictionaryValue *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayValue*)__pyx_vtabptr_7pyarrow_3lib_DictionaryValue;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_15DictionaryValue_index_value(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_15DictionaryValue_11index_value_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_15DictionaryValue_dictionary_value(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_15DictionaryValue_16dictionary_value_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_DictionaryValue[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_15DictionaryValue_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_15DictionaryValue_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_15DictionaryValue_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_15DictionaryValue_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_15DictionaryValue_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_15DictionaryValue_4__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_DictionaryValue[] = {
  {(char *)"index_value", __pyx_getprop_7pyarrow_3lib_15DictionaryValue_index_value, 0, (char *)"\n        Return this value's underlying index as a ArrayValue of the right\n        signed integer type.\n        ", 0},
  {(char *)"dictionary_value", __pyx_getprop_7pyarrow_3lib_15DictionaryValue_dictionary_value, 0, (char *)"\n        Return this value's underlying dictionary value as a ArrayValue.\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_DictionaryValue = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.DictionaryValue", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_DictionaryValue), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ArrayValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for dictionary-encoded array elements.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_DictionaryValue, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_DictionaryValue, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10ArrayValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_DictionaryValue, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt8Scalar __pyx_vtable_7pyarrow_3lib_UInt8Scalar;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt8Scalar(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UInt8Scalar *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ScalarValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UInt8Scalar *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue*)__pyx_vtabptr_7pyarrow_3lib_UInt8Scalar;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_UInt8Scalar[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11UInt8Scalar_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11UInt8Scalar_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11UInt8Scalar_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11UInt8Scalar_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11UInt8Scalar_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11UInt8Scalar_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_UInt8Scalar = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UInt8Scalar", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt8Scalar), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ScalarValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for uint8 scalars.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_UInt8Scalar, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UInt8Scalar, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int8Scalar __pyx_vtable_7pyarrow_3lib_Int8Scalar;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Int8Scalar(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Int8Scalar *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ScalarValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Int8Scalar *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue*)__pyx_vtabptr_7pyarrow_3lib_Int8Scalar;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Int8Scalar[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_10Int8Scalar_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10Int8Scalar_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10Int8Scalar_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10Int8Scalar_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10Int8Scalar_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_10Int8Scalar_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Int8Scalar = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Int8Scalar", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int8Scalar), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ScalarValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for int8 scalars.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Int8Scalar, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Int8Scalar, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt16Scalar __pyx_vtable_7pyarrow_3lib_UInt16Scalar;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt16Scalar(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UInt16Scalar *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ScalarValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UInt16Scalar *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue*)__pyx_vtabptr_7pyarrow_3lib_UInt16Scalar;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_UInt16Scalar[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_12UInt16Scalar_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12UInt16Scalar_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12UInt16Scalar_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12UInt16Scalar_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12UInt16Scalar_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_12UInt16Scalar_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_UInt16Scalar = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UInt16Scalar", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt16Scalar), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ScalarValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for uint16 scalars.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_UInt16Scalar, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UInt16Scalar, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int16Scalar __pyx_vtable_7pyarrow_3lib_Int16Scalar;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Int16Scalar(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Int16Scalar *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ScalarValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Int16Scalar *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue*)__pyx_vtabptr_7pyarrow_3lib_Int16Scalar;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Int16Scalar[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Int16Scalar_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11Int16Scalar_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Int16Scalar_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11Int16Scalar_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Int16Scalar_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11Int16Scalar_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Int16Scalar = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Int16Scalar", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int16Scalar), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ScalarValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for int16 scalars.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Int16Scalar, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Int16Scalar, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt32Scalar __pyx_vtable_7pyarrow_3lib_UInt32Scalar;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt32Scalar(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UInt32Scalar *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ScalarValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UInt32Scalar *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue*)__pyx_vtabptr_7pyarrow_3lib_UInt32Scalar;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_UInt32Scalar[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_12UInt32Scalar_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12UInt32Scalar_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12UInt32Scalar_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12UInt32Scalar_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12UInt32Scalar_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_12UInt32Scalar_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_UInt32Scalar = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UInt32Scalar", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt32Scalar), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ScalarValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for uint32 scalars.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_UInt32Scalar, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UInt32Scalar, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int32Scalar __pyx_vtable_7pyarrow_3lib_Int32Scalar;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Int32Scalar(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Int32Scalar *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ScalarValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Int32Scalar *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue*)__pyx_vtabptr_7pyarrow_3lib_Int32Scalar;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Int32Scalar[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Int32Scalar_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11Int32Scalar_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Int32Scalar_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11Int32Scalar_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Int32Scalar_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11Int32Scalar_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Int32Scalar = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Int32Scalar", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int32Scalar), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ScalarValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for int32 scalars.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Int32Scalar, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Int32Scalar, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt64Scalar __pyx_vtable_7pyarrow_3lib_UInt64Scalar;

static PyObject *__pyx_tp_new_7pyarrow_3lib_UInt64Scalar(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_UInt64Scalar *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ScalarValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_UInt64Scalar *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue*)__pyx_vtabptr_7pyarrow_3lib_UInt64Scalar;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_UInt64Scalar[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_12UInt64Scalar_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12UInt64Scalar_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12UInt64Scalar_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12UInt64Scalar_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12UInt64Scalar_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_12UInt64Scalar_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_UInt64Scalar = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.UInt64Scalar", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt64Scalar), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ScalarValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for uint64 scalars.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_UInt64Scalar, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_UInt64Scalar, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int64Scalar __pyx_vtable_7pyarrow_3lib_Int64Scalar;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Int64Scalar(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Int64Scalar *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ScalarValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Int64Scalar *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue*)__pyx_vtabptr_7pyarrow_3lib_Int64Scalar;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Int64Scalar[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Int64Scalar_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11Int64Scalar_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Int64Scalar_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11Int64Scalar_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11Int64Scalar_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11Int64Scalar_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Int64Scalar = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Int64Scalar", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int64Scalar), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ScalarValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for int64 scalars.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Int64Scalar, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Int64Scalar, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FloatScalar __pyx_vtable_7pyarrow_3lib_FloatScalar;

static PyObject *__pyx_tp_new_7pyarrow_3lib_FloatScalar(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_FloatScalar *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ScalarValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_FloatScalar *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue*)__pyx_vtabptr_7pyarrow_3lib_FloatScalar;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_FloatScalar[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_11FloatScalar_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11FloatScalar_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11FloatScalar_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11FloatScalar_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11FloatScalar_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11FloatScalar_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_FloatScalar = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.FloatScalar", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_FloatScalar), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ScalarValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for float scalars.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_FloatScalar, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_FloatScalar, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DoubleScalar __pyx_vtable_7pyarrow_3lib_DoubleScalar;

static PyObject *__pyx_tp_new_7pyarrow_3lib_DoubleScalar(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_DoubleScalar *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_ScalarValue(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_DoubleScalar *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_ScalarValue*)__pyx_vtabptr_7pyarrow_3lib_DoubleScalar;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_DoubleScalar[] = {
  {"as_py", (PyCFunction)__pyx_pw_7pyarrow_3lib_12DoubleScalar_1as_py, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12DoubleScalar_as_py},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12DoubleScalar_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12DoubleScalar_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12DoubleScalar_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_12DoubleScalar_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_DoubleScalar = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.DoubleScalar", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_DoubleScalar), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_ScalarValue, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_3__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for double scalars.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Scalar, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Scalar, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_DoubleScalar, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_11ScalarValue_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_DoubleScalar, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib__FunctionContext(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib__FunctionContext *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib__FunctionContext *)o);
  new((void*)&(p->ctx)) std::unique_ptr< arrow::compute::FunctionContext> ();
  if (unlikely(__pyx_pw_7pyarrow_3lib_16_FunctionContext_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib__FunctionContext(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib__FunctionContext *p = (struct __pyx_obj_7pyarrow_3lib__FunctionContext *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->ctx);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib__FunctionContext[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_16_FunctionContext_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_16_FunctionContext_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_16_FunctionContext_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_16_FunctionContext_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib__FunctionContext = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib._FunctionContext", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib__FunctionContext), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib__FunctionContext, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib__FunctionContext, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib__FunctionContext, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Date32Array __pyx_vtable_7pyarrow_3lib_Date32Array;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Date32Array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Date32Array *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NumericArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Date32Array *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_Date32Array;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_Date32Array = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Date32Array", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Date32Array), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_30__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_34__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of date32 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_27__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Date32Array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Date64Array __pyx_vtable_7pyarrow_3lib_Date64Array;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Date64Array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Date64Array *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NumericArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Date64Array *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_Date64Array;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_Date64Array = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Date64Array", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Date64Array), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_30__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_34__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of date64 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_27__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Date64Array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_TimestampArray __pyx_vtable_7pyarrow_3lib_TimestampArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_TimestampArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_TimestampArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NumericArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_TimestampArray *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_TimestampArray;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_TimestampArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.TimestampArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_TimestampArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_30__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_34__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of timestamp data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_27__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_TimestampArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Time32Array __pyx_vtable_7pyarrow_3lib_Time32Array;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Time32Array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Time32Array *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NumericArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Time32Array *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_Time32Array;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_Time32Array = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Time32Array", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Time32Array), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_30__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_34__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of time32 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_27__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Time32Array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Time64Array __pyx_vtable_7pyarrow_3lib_Time64Array;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Time64Array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Time64Array *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NumericArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_Time64Array *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_Time64Array;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_Time64Array = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Time64Array", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Time64Array), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_30__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_34__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of time64 data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_27__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Time64Array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DurationArray __pyx_vtable_7pyarrow_3lib_DurationArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_DurationArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_DurationArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NumericArray(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_DurationArray *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_DurationArray;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_DurationArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.DurationArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_DurationArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_30__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_34__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of duration data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_27__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_DurationArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_LargeStringArray __pyx_vtable_7pyarrow_3lib_LargeStringArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_LargeStringArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_LargeStringArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Array(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_LargeStringArray *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_LargeStringArray;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_LargeStringArray[] = {
  {"from_buffers", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_16LargeStringArray_1from_buffers, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_16LargeStringArray_from_buffers},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_LargeStringArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.LargeStringArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_LargeStringArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_30__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_34__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of large string (or utf8) data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_27__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_LargeStringArray, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_LargeStringArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_LargeBinaryArray __pyx_vtable_7pyarrow_3lib_LargeBinaryArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_LargeBinaryArray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_LargeBinaryArray *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_Array(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_LargeBinaryArray *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__pyx_vtabptr_7pyarrow_3lib_LargeBinaryArray;
  return o;
}

static PyTypeObject __pyx_type_7pyarrow_3lib_LargeBinaryArray = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.LargeBinaryArray", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_LargeBinaryArray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_30__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_34__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Concrete class for Arrow arrays of large variable-sized binary data type.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_Array, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_Array, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_27__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_5Array_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_LargeBinaryArray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib_StringBuilder(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_StringBuilder *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_StringBuilder *)o);
  new((void*)&(p->builder)) std::unique_ptr< arrow::StringBuilder> ();
  if (unlikely(__pyx_pw_7pyarrow_3lib_13StringBuilder_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_StringBuilder(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_StringBuilder *p = (struct __pyx_obj_7pyarrow_3lib_StringBuilder *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->builder);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_13StringBuilder_null_count(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_13StringBuilder_10null_count_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_StringBuilder[] = {
  {"append", (PyCFunction)__pyx_pw_7pyarrow_3lib_13StringBuilder_3append, METH_O, __pyx_doc_7pyarrow_3lib_13StringBuilder_2append},
  {"append_values", (PyCFunction)__pyx_pw_7pyarrow_3lib_13StringBuilder_5append_values, METH_O, __pyx_doc_7pyarrow_3lib_13StringBuilder_4append_values},
  {"finish", (PyCFunction)__pyx_pw_7pyarrow_3lib_13StringBuilder_7finish, METH_NOARGS, __pyx_doc_7pyarrow_3lib_13StringBuilder_6finish},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_13StringBuilder_11__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_13StringBuilder_10__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_13StringBuilder_13__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_13StringBuilder_12__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_StringBuilder[] = {
  {(char *)"null_count", __pyx_getprop_7pyarrow_3lib_13StringBuilder_null_count, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_StringBuilder = {
  __pyx_pw_7pyarrow_3lib_13StringBuilder_9__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_StringBuilder = {
  __pyx_pw_7pyarrow_3lib_13StringBuilder_9__len__, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7pyarrow_3lib_StringBuilder = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.StringBuilder", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_StringBuilder), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_StringBuilder, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_StringBuilder, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_StringBuilder, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Builder class for UTF8 strings. This class exposes facilities for\n    incrementally adding string values and building the null bitmap\n    for a pyarrow.Array (type='string').\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_StringBuilder, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_StringBuilder, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_StringBuilder, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_PythonFile __pyx_vtable_7pyarrow_3lib_PythonFile;

static PyObject *__pyx_tp_new_7pyarrow_3lib_PythonFile(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_PythonFile *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NativeFile(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_PythonFile *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile*)__pyx_vtabptr_7pyarrow_3lib_PythonFile;
  p->handle = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7pyarrow_3lib_10PythonFile_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_PythonFile(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_PythonFile *p = (struct __pyx_obj_7pyarrow_3lib_PythonFile *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->handle);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib_NativeFile(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_PythonFile(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_PythonFile *p = (struct __pyx_obj_7pyarrow_3lib_PythonFile *)o;
  e = ((likely(__pyx_ptype_7pyarrow_3lib_NativeFile)) ? ((__pyx_ptype_7pyarrow_3lib_NativeFile->tp_traverse) ? __pyx_ptype_7pyarrow_3lib_NativeFile->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7pyarrow_3lib_PythonFile)); if (e) return e;
  if (p->handle) {
    e = (*v)(p->handle, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_PythonFile(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_PythonFile *p = (struct __pyx_obj_7pyarrow_3lib_PythonFile *)o;
  if (likely(__pyx_ptype_7pyarrow_3lib_NativeFile)) { if (__pyx_ptype_7pyarrow_3lib_NativeFile->tp_clear) __pyx_ptype_7pyarrow_3lib_NativeFile->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7pyarrow_3lib_PythonFile);
  tmp = ((PyObject*)p->handle);
  p->handle = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_PythonFile[] = {
  {"truncate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10PythonFile_3truncate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10PythonFile_2truncate},
  {"readline", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10PythonFile_5readline, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10PythonFile_4readline},
  {"readlines", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10PythonFile_7readlines, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10PythonFile_6readlines},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10PythonFile_9__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10PythonFile_8__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10PythonFile_11__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_10PythonFile_10__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_PythonFile = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.PythonFile", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_PythonFile), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_PythonFile, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    A stream backed by a Python file object.\n\n    This class allows using Python file objects with arbitrary Arrow\n    functions, including functions written in another language than Python.\n\n    As a downside, there is a non-zero redirection cost in translating\n    Arrow stream calls to Python method calls.  Furthermore, Python's\n    Global Interpreter Lock may limit parallelism in some situations.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_PythonFile, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_PythonFile, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_53__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_55__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  __pyx_methods_7pyarrow_3lib_PythonFile, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_PythonFile, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_MemoryMappedFile __pyx_vtable_7pyarrow_3lib_MemoryMappedFile;

static PyObject *__pyx_tp_new_7pyarrow_3lib_MemoryMappedFile(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NativeFile(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile*)__pyx_vtabptr_7pyarrow_3lib_MemoryMappedFile;
  new((void*)&(p->handle)) std::shared_ptr< arrow::io::MemoryMappedFile> ();
  p->path = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_MemoryMappedFile(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *p = (struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->handle);
  Py_CLEAR(p->path);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib_NativeFile(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_MemoryMappedFile(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *p = (struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *)o;
  e = ((likely(__pyx_ptype_7pyarrow_3lib_NativeFile)) ? ((__pyx_ptype_7pyarrow_3lib_NativeFile->tp_traverse) ? __pyx_ptype_7pyarrow_3lib_NativeFile->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7pyarrow_3lib_MemoryMappedFile)); if (e) return e;
  if (p->path) {
    e = (*v)(p->path, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_MemoryMappedFile(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *p = (struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile *)o;
  if (likely(__pyx_ptype_7pyarrow_3lib_NativeFile)) { if (__pyx_ptype_7pyarrow_3lib_NativeFile->tp_clear) __pyx_ptype_7pyarrow_3lib_NativeFile->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7pyarrow_3lib_MemoryMappedFile);
  tmp = ((PyObject*)p->path);
  p->path = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_MemoryMappedFile[] = {
  {"create", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_1create, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_16MemoryMappedFile_create},
  {"_open", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_3_open, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_16MemoryMappedFile_2_open},
  {"resize", (PyCFunction)__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_5resize, METH_O, __pyx_doc_7pyarrow_3lib_16MemoryMappedFile_4resize},
  {"fileno", (PyCFunction)__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_7fileno, METH_NOARGS, __pyx_doc_7pyarrow_3lib_16MemoryMappedFile_6fileno},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_9__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_16MemoryMappedFile_8__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_16MemoryMappedFile_11__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_16MemoryMappedFile_10__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_MemoryMappedFile = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.MemoryMappedFile", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_MemoryMappedFile, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    A stream that represents a memory-mapped file.\n\n    Supports 'r', 'r+', 'w' modes.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_MemoryMappedFile, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_MemoryMappedFile, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_53__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_55__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  __pyx_methods_7pyarrow_3lib_MemoryMappedFile, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_MemoryMappedFile, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_OSFile __pyx_vtable_7pyarrow_3lib_OSFile;

static PyObject *__pyx_tp_new_7pyarrow_3lib_OSFile(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_OSFile *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NativeFile(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_OSFile *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile*)__pyx_vtabptr_7pyarrow_3lib_OSFile;
  p->path = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7pyarrow_3lib_6OSFile_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_OSFile(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_OSFile *p = (struct __pyx_obj_7pyarrow_3lib_OSFile *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->path);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib_NativeFile(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_OSFile(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_OSFile *p = (struct __pyx_obj_7pyarrow_3lib_OSFile *)o;
  e = ((likely(__pyx_ptype_7pyarrow_3lib_NativeFile)) ? ((__pyx_ptype_7pyarrow_3lib_NativeFile->tp_traverse) ? __pyx_ptype_7pyarrow_3lib_NativeFile->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7pyarrow_3lib_OSFile)); if (e) return e;
  if (p->path) {
    e = (*v)(p->path, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_OSFile(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_OSFile *p = (struct __pyx_obj_7pyarrow_3lib_OSFile *)o;
  if (likely(__pyx_ptype_7pyarrow_3lib_NativeFile)) { if (__pyx_ptype_7pyarrow_3lib_NativeFile->tp_clear) __pyx_ptype_7pyarrow_3lib_NativeFile->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7pyarrow_3lib_OSFile);
  tmp = ((PyObject*)p->path);
  p->path = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_OSFile[] = {
  {"fileno", (PyCFunction)__pyx_pw_7pyarrow_3lib_6OSFile_3fileno, METH_NOARGS, __pyx_doc_7pyarrow_3lib_6OSFile_2fileno},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_6OSFile_5__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_6OSFile_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_6OSFile_7__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_6OSFile_6__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_OSFile = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.OSFile", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_OSFile), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_OSFile, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    A stream backed by a regular file descriptor.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_OSFile, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_OSFile, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_53__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_55__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  __pyx_methods_7pyarrow_3lib_OSFile, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_OSFile, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBufferWriter __pyx_vtable_7pyarrow_3lib_FixedSizeBufferWriter;

static PyObject *__pyx_tp_new_7pyarrow_3lib_FixedSizeBufferWriter(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NativeFile(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile*)__pyx_vtabptr_7pyarrow_3lib_FixedSizeBufferWriter;
  if (unlikely(__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_FixedSizeBufferWriter[] = {
  {"set_memcopy_threads", (PyCFunction)__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_3set_memcopy_threads, METH_O, __pyx_doc_7pyarrow_3lib_21FixedSizeBufferWriter_2set_memcopy_threads},
  {"set_memcopy_blocksize", (PyCFunction)__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_5set_memcopy_blocksize, METH_O, __pyx_doc_7pyarrow_3lib_21FixedSizeBufferWriter_4set_memcopy_blocksize},
  {"set_memcopy_threshold", (PyCFunction)__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_7set_memcopy_threshold, METH_O, __pyx_doc_7pyarrow_3lib_21FixedSizeBufferWriter_6set_memcopy_threshold},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_9__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_21FixedSizeBufferWriter_8__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_21FixedSizeBufferWriter_11__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_21FixedSizeBufferWriter_10__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_FixedSizeBufferWriter = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.FixedSizeBufferWriter", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_NativeFile, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    A stream writing to a Arrow buffer.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_53__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_55__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  __pyx_methods_7pyarrow_3lib_FixedSizeBufferWriter, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_FixedSizeBufferWriter, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BufferOutputStream __pyx_vtable_7pyarrow_3lib_BufferOutputStream;

static PyObject *__pyx_tp_new_7pyarrow_3lib_BufferOutputStream(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NativeFile(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile*)__pyx_vtabptr_7pyarrow_3lib_BufferOutputStream;
  new((void*)&(p->buffer)) std::shared_ptr< arrow::ResizableBuffer> ();
  if (unlikely(__pyx_pw_7pyarrow_3lib_18BufferOutputStream_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_BufferOutputStream(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *p = (struct __pyx_obj_7pyarrow_3lib_BufferOutputStream *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->buffer);
  __pyx_tp_dealloc_7pyarrow_3lib_NativeFile(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_BufferOutputStream[] = {
  {"getvalue", (PyCFunction)__pyx_pw_7pyarrow_3lib_18BufferOutputStream_3getvalue, METH_NOARGS, __pyx_doc_7pyarrow_3lib_18BufferOutputStream_2getvalue},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_18BufferOutputStream_5__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_18BufferOutputStream_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_18BufferOutputStream_7__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_18BufferOutputStream_6__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_BufferOutputStream = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.BufferOutputStream", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_BufferOutputStream), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_BufferOutputStream, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_53__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_55__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  __pyx_methods_7pyarrow_3lib_BufferOutputStream, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_BufferOutputStream, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_MockOutputStream __pyx_vtable_7pyarrow_3lib_MockOutputStream;

static PyObject *__pyx_tp_new_7pyarrow_3lib_MockOutputStream(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_MockOutputStream *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NativeFile(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_MockOutputStream *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile*)__pyx_vtabptr_7pyarrow_3lib_MockOutputStream;
  if (unlikely(__pyx_pw_7pyarrow_3lib_16MockOutputStream_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_MockOutputStream[] = {
  {"size", (PyCFunction)__pyx_pw_7pyarrow_3lib_16MockOutputStream_3size, METH_NOARGS, __pyx_doc_7pyarrow_3lib_16MockOutputStream_2size},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_16MockOutputStream_5__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_16MockOutputStream_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_16MockOutputStream_7__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_16MockOutputStream_6__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_MockOutputStream = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.MockOutputStream", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_MockOutputStream), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_NativeFile, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_53__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_55__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  __pyx_methods_7pyarrow_3lib_MockOutputStream, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_MockOutputStream, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BufferReader __pyx_vtable_7pyarrow_3lib_BufferReader;

static PyObject *__pyx_tp_new_7pyarrow_3lib_BufferReader(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_BufferReader *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NativeFile(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_BufferReader *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile*)__pyx_vtabptr_7pyarrow_3lib_BufferReader;
  p->buffer = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7pyarrow_3lib_12BufferReader_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_BufferReader(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_BufferReader *p = (struct __pyx_obj_7pyarrow_3lib_BufferReader *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->buffer);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib_NativeFile(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_BufferReader(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_BufferReader *p = (struct __pyx_obj_7pyarrow_3lib_BufferReader *)o;
  e = ((likely(__pyx_ptype_7pyarrow_3lib_NativeFile)) ? ((__pyx_ptype_7pyarrow_3lib_NativeFile->tp_traverse) ? __pyx_ptype_7pyarrow_3lib_NativeFile->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7pyarrow_3lib_BufferReader)); if (e) return e;
  if (p->buffer) {
    e = (*v)(((PyObject *)p->buffer), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_BufferReader(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_BufferReader *p = (struct __pyx_obj_7pyarrow_3lib_BufferReader *)o;
  if (likely(__pyx_ptype_7pyarrow_3lib_NativeFile)) { if (__pyx_ptype_7pyarrow_3lib_NativeFile->tp_clear) __pyx_ptype_7pyarrow_3lib_NativeFile->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7pyarrow_3lib_BufferReader);
  tmp = ((PyObject*)p->buffer);
  p->buffer = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_BufferReader[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12BufferReader_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12BufferReader_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_12BufferReader_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_12BufferReader_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_BufferReader = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.BufferReader", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_BufferReader), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_BufferReader, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Zero-copy reader from objects convertible to Arrow buffer\n\n    Parameters\n    ----------\n    obj : Python bytes or pyarrow.Buffer\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_BufferReader, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_BufferReader, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_53__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_55__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  __pyx_methods_7pyarrow_3lib_BufferReader, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_BufferReader, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_HadoopFileSystem __pyx_vtable_7pyarrow_3lib_HadoopFileSystem;

static PyObject *__pyx_tp_new_7pyarrow_3lib_HadoopFileSystem(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_HadoopFileSystem;
  new((void*)&(p->client)) std::shared_ptr<arrow::io::HadoopFileSystem> ();
  p->host = Py_None; Py_INCREF(Py_None);
  p->user = Py_None; Py_INCREF(Py_None);
  p->kerb_ticket = Py_None; Py_INCREF(Py_None);
  p->driver = Py_None; Py_INCREF(Py_None);
  p->extra_conf = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_HadoopFileSystem(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *p = (struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_7pyarrow_3lib_16HadoopFileSystem_5__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  __Pyx_call_destructor(p->client);
  Py_CLEAR(p->host);
  Py_CLEAR(p->user);
  Py_CLEAR(p->kerb_ticket);
  Py_CLEAR(p->driver);
  Py_CLEAR(p->extra_conf);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_HadoopFileSystem(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *p = (struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)o;
  if (p->host) {
    e = (*v)(p->host, a); if (e) return e;
  }
  if (p->user) {
    e = (*v)(p->user, a); if (e) return e;
  }
  if (p->kerb_ticket) {
    e = (*v)(p->kerb_ticket, a); if (e) return e;
  }
  if (p->driver) {
    e = (*v)(p->driver, a); if (e) return e;
  }
  if (p->extra_conf) {
    e = (*v)(p->extra_conf, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_HadoopFileSystem(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *p = (struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *)o;
  tmp = ((PyObject*)p->host);
  p->host = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->user);
  p->user = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->kerb_ticket);
  p->kerb_ticket = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->driver);
  p->driver = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->extra_conf);
  p->extra_conf = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_16HadoopFileSystem_is_open(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_16HadoopFileSystem_7is_open_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_16HadoopFileSystem_host(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_16HadoopFileSystem_4host_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_16HadoopFileSystem_user(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_16HadoopFileSystem_4user_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_16HadoopFileSystem_kerb_ticket(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_16HadoopFileSystem_11kerb_ticket_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_16HadoopFileSystem_driver(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_16HadoopFileSystem_6driver_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_16HadoopFileSystem_port(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_16HadoopFileSystem_4port_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_16HadoopFileSystem_extra_conf(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_16HadoopFileSystem_10extra_conf_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_HadoopFileSystem[] = {
  {"_connect", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_1_connect, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem__connect},
  {"connect", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_3connect, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_2connect},
  {"close", (PyCFunction)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_7close, METH_NOARGS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_6close},
  {"exists", (PyCFunction)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_9exists, METH_O, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_8exists},
  {"isdir", (PyCFunction)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_11isdir, METH_O, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_10isdir},
  {"isfile", (PyCFunction)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_13isfile, METH_O, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_12isfile},
  {"get_capacity", (PyCFunction)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_15get_capacity, METH_NOARGS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_14get_capacity},
  {"get_space_used", (PyCFunction)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_17get_space_used, METH_NOARGS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_16get_space_used},
  {"df", (PyCFunction)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_19df, METH_NOARGS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_18df},
  {"rename", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_21rename, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_20rename},
  {"info", (PyCFunction)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_23info, METH_O, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_22info},
  {"stat", (PyCFunction)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_25stat, METH_O, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_24stat},
  {"ls", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_27ls, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_26ls},
  {"chmod", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_29chmod, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_28chmod},
  {"chown", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_31chown, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_30chown},
  {"mkdir", (PyCFunction)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_33mkdir, METH_O, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_32mkdir},
  {"delete", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_35delete, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_34delete},
  {"open", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_37open, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_36open},
  {"download", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_39download, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_38download},
  {"upload", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_41upload, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_40upload},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_43__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_42__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_16HadoopFileSystem_45__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_16HadoopFileSystem_44__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_HadoopFileSystem[] = {
  {(char *)"is_open", __pyx_getprop_7pyarrow_3lib_16HadoopFileSystem_is_open, 0, (char *)0, 0},
  {(char *)"host", __pyx_getprop_7pyarrow_3lib_16HadoopFileSystem_host, 0, (char *)0, 0},
  {(char *)"user", __pyx_getprop_7pyarrow_3lib_16HadoopFileSystem_user, 0, (char *)0, 0},
  {(char *)"kerb_ticket", __pyx_getprop_7pyarrow_3lib_16HadoopFileSystem_kerb_ticket, 0, (char *)0, 0},
  {(char *)"driver", __pyx_getprop_7pyarrow_3lib_16HadoopFileSystem_driver, 0, (char *)0, 0},
  {(char *)"port", __pyx_getprop_7pyarrow_3lib_16HadoopFileSystem_port, 0, (char *)0, 0},
  {(char *)"extra_conf", __pyx_getprop_7pyarrow_3lib_16HadoopFileSystem_extra_conf, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_HadoopFileSystem = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.HadoopFileSystem", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_HadoopFileSystem, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_HadoopFileSystem, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_HadoopFileSystem, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_HadoopFileSystem, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_HadoopFileSystem, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_HadoopFileSystem, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib__HdfsFileNanny(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *)o);
  p->client = Py_None; Py_INCREF(Py_None);
  p->file_handle_ref = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7pyarrow_3lib_14_HdfsFileNanny_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib__HdfsFileNanny(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *p = (struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_7pyarrow_3lib_14_HdfsFileNanny_3__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->client);
  Py_CLEAR(p->file_handle_ref);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib__HdfsFileNanny(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *p = (struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *)o;
  if (p->client) {
    e = (*v)(p->client, a); if (e) return e;
  }
  if (p->file_handle_ref) {
    e = (*v)(p->file_handle_ref, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib__HdfsFileNanny(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *p = (struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny *)o;
  tmp = ((PyObject*)p->client);
  p->client = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->file_handle_ref);
  p->file_handle_ref = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib__HdfsFileNanny[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_14_HdfsFileNanny_5__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_14_HdfsFileNanny_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_14_HdfsFileNanny_7__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_14_HdfsFileNanny_6__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib__HdfsFileNanny = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib._HdfsFileNanny", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib__HdfsFileNanny), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib__HdfsFileNanny, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib__HdfsFileNanny, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib__HdfsFileNanny, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib__HdfsFileNanny, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib__HdfsFileNanny, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_HdfsFile __pyx_vtable_7pyarrow_3lib_HdfsFile;

static PyObject *__pyx_tp_new_7pyarrow_3lib_HdfsFile(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_HdfsFile *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib_NativeFile(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_HdfsFile *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile*)__pyx_vtabptr_7pyarrow_3lib_HdfsFile;
  p->mode = Py_None; Py_INCREF(Py_None);
  p->parent = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_HdfsFile(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_HdfsFile *p = (struct __pyx_obj_7pyarrow_3lib_HdfsFile *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_7pyarrow_3lib_8HdfsFile_1__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->mode);
  Py_CLEAR(p->parent);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib_NativeFile(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_HdfsFile(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_HdfsFile *p = (struct __pyx_obj_7pyarrow_3lib_HdfsFile *)o;
  e = ((likely(__pyx_ptype_7pyarrow_3lib_NativeFile)) ? ((__pyx_ptype_7pyarrow_3lib_NativeFile->tp_traverse) ? __pyx_ptype_7pyarrow_3lib_NativeFile->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7pyarrow_3lib_HdfsFile)); if (e) return e;
  if (p->mode) {
    e = (*v)(p->mode, a); if (e) return e;
  }
  if (p->parent) {
    e = (*v)(p->parent, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_HdfsFile(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_HdfsFile *p = (struct __pyx_obj_7pyarrow_3lib_HdfsFile *)o;
  if (likely(__pyx_ptype_7pyarrow_3lib_NativeFile)) { if (__pyx_ptype_7pyarrow_3lib_NativeFile->tp_clear) __pyx_ptype_7pyarrow_3lib_NativeFile->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7pyarrow_3lib_HdfsFile);
  tmp = ((PyObject*)p->mode);
  p->mode = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->parent);
  p->parent = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_8HdfsFile_buffer_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_8HdfsFile_11buffer_size_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_8HdfsFile_mode(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_8HdfsFile_4mode_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_8HdfsFile_parent(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_8HdfsFile_6parent_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_HdfsFile[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_8HdfsFile_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_8HdfsFile_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_8HdfsFile_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_8HdfsFile_4__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_HdfsFile[] = {
  {(char *)"buffer_size", __pyx_getprop_7pyarrow_3lib_8HdfsFile_buffer_size, 0, (char *)0, 0},
  {(char *)"mode", __pyx_getprop_7pyarrow_3lib_8HdfsFile_mode, 0, (char *)0, 0},
  {(char *)"parent", __pyx_getprop_7pyarrow_3lib_8HdfsFile_parent, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_HdfsFile = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.HdfsFile", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_HdfsFile), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_HdfsFile, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_HdfsFile, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_HdfsFile, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_53__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_55__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  __pyx_methods_7pyarrow_3lib_HdfsFile, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_HdfsFile, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_HdfsFile, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib_MessageReader(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_MessageReader *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_MessageReader *)o);
  new((void*)&(p->reader)) std::unique_ptr< arrow::ipc::MessageReader> ();
  if (unlikely(__pyx_pw_7pyarrow_3lib_13MessageReader_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_MessageReader(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_MessageReader *p = (struct __pyx_obj_7pyarrow_3lib_MessageReader *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->reader);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_MessageReader[] = {
  {"open_stream", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_13MessageReader_5open_stream, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_13MessageReader_4open_stream},
  {"read_next_message", (PyCFunction)__pyx_pw_7pyarrow_3lib_13MessageReader_10read_next_message, METH_NOARGS, __pyx_doc_7pyarrow_3lib_13MessageReader_9read_next_message},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_13MessageReader_12__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_13MessageReader_11__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_13MessageReader_14__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_13MessageReader_13__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_MessageReader = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.MessageReader", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_MessageReader), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_MessageReader, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "MessageReader()\n\n    Interface for reading Message objects from some source (like an\n    InputStream)\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7pyarrow_3lib_13MessageReader_7__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_MessageReader, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_13MessageReader_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_MessageReader, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib__RecordBatchStreamWriter(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib__CRecordBatchWriter(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *)o);
  new((void*)&(p->sink)) std::shared_ptr< arrow::io::OutputStream> ();
  new((void*)&(p->options))  arrow::ipc::IpcOptions();
  if (unlikely(__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib__RecordBatchStreamWriter(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *p = (struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_3__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  __Pyx_call_destructor(p->sink);
  __Pyx_call_destructor(p->options);
  __pyx_tp_dealloc_7pyarrow_3lib__CRecordBatchWriter(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_24_RecordBatchStreamWriter__use_legacy_format(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_18_use_legacy_format_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib__RecordBatchStreamWriter[] = {
  {"_open", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_5_open, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_24_RecordBatchStreamWriter_4_open},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_7__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_24_RecordBatchStreamWriter_6__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamWriter_9__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_24_RecordBatchStreamWriter_8__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib__RecordBatchStreamWriter[] = {
  {(char *)"_use_legacy_format", __pyx_getprop_7pyarrow_3lib_24_RecordBatchStreamWriter__use_legacy_format, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib__RecordBatchStreamWriter = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib._RecordBatchStreamWriter", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamWriter), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib__RecordBatchStreamWriter, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib__RecordBatchStreamWriter, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib__RecordBatchStreamWriter, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib__RecordBatchStreamWriter, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib__RecordBatchStreamReader(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *p;
  PyObject *o = __pyx_tp_new_7pyarrow_3lib__CRecordBatchReader(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *)o);
  new((void*)&(p->in_stream)) std::shared_ptr< arrow::io::InputStream> ();
  p->schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib__RecordBatchStreamReader(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *p = (struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->in_stream);
  Py_CLEAR(p->schema);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7pyarrow_3lib__CRecordBatchReader(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib__RecordBatchStreamReader(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *p = (struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *)o;
  e = ((likely(__pyx_ptype_7pyarrow_3lib__CRecordBatchReader)) ? ((__pyx_ptype_7pyarrow_3lib__CRecordBatchReader->tp_traverse) ? __pyx_ptype_7pyarrow_3lib__CRecordBatchReader->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7pyarrow_3lib__RecordBatchStreamReader)); if (e) return e;
  if (p->schema) {
    e = (*v)(((PyObject *)p->schema), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib__RecordBatchStreamReader(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *p = (struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader *)o;
  if (likely(__pyx_ptype_7pyarrow_3lib__CRecordBatchReader)) { if (__pyx_ptype_7pyarrow_3lib__CRecordBatchReader->tp_clear) __pyx_ptype_7pyarrow_3lib__CRecordBatchReader->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7pyarrow_3lib__RecordBatchStreamReader);
  tmp = ((PyObject*)p->schema);
  p->schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_24_RecordBatchStreamReader_schema(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_6schema_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib__RecordBatchStreamReader[] = {
  {"_open", (PyCFunction)__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_3_open, METH_O, __pyx_doc_7pyarrow_3lib_24_RecordBatchStreamReader_2_open},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_5__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_24_RecordBatchStreamReader_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_24_RecordBatchStreamReader_7__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_24_RecordBatchStreamReader_6__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib__RecordBatchStreamReader[] = {
  {(char *)"schema", __pyx_getprop_7pyarrow_3lib_24_RecordBatchStreamReader_schema, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib__RecordBatchStreamReader = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib._RecordBatchStreamReader", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib__RecordBatchStreamReader), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib__RecordBatchStreamReader, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib__RecordBatchStreamReader, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib__RecordBatchStreamReader, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_19_CRecordBatchReader_1__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib__RecordBatchStreamReader, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib__RecordBatchStreamReader, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib__RecordBatchStreamReader, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib__RecordBatchFileWriter(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_tp_new_7pyarrow_3lib__RecordBatchStreamWriter(t, a, k);
  if (unlikely(!o)) return 0;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib__RecordBatchFileWriter[] = {
  {"_open", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_22_RecordBatchFileWriter_1_open, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_22_RecordBatchFileWriter__open},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_22_RecordBatchFileWriter_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_22_RecordBatchFileWriter_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_22_RecordBatchFileWriter_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_22_RecordBatchFileWriter_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib__RecordBatchFileWriter = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib._RecordBatchFileWriter", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib__RecordBatchFileWriter), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib__RecordBatchStreamWriter, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib__RecordBatchFileWriter, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib__RecordBatchFileWriter, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib__RecordBatchFileReader(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *)o);
  new((void*)&(p->reader)) std::shared_ptr< arrow::ipc::RecordBatchFileReader> ();
  new((void*)&(p->file)) std::shared_ptr< arrow::io::RandomAccessFile> ();
  p->schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib__RecordBatchFileReader(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *p = (struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->reader);
  __Pyx_call_destructor(p->file);
  Py_CLEAR(p->schema);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib__RecordBatchFileReader(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *p = (struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *)o;
  if (p->schema) {
    e = (*v)(((PyObject *)p->schema), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib__RecordBatchFileReader(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *p = (struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *)o;
  tmp = ((PyObject*)p->schema);
  p->schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_22_RecordBatchFileReader_num_record_batches(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_18num_record_batches_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_22_RecordBatchFileReader_schema(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_6schema_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib__RecordBatchFileReader[] = {
  {"_open", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_3_open, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_22_RecordBatchFileReader_2_open},
  {"get_batch", (PyCFunction)__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_5get_batch, METH_O, __pyx_doc_7pyarrow_3lib_22_RecordBatchFileReader_4get_batch},
  {"read_all", (PyCFunction)__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_7read_all, METH_NOARGS, __pyx_doc_7pyarrow_3lib_22_RecordBatchFileReader_6read_all},
  {"__enter__", (PyCFunction)__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_9__enter__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_22_RecordBatchFileReader_8__enter__},
  {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_11__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_22_RecordBatchFileReader_10__exit__},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_13__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_22_RecordBatchFileReader_12__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_15__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_22_RecordBatchFileReader_14__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib__RecordBatchFileReader[] = {
  {(char *)"num_record_batches", __pyx_getprop_7pyarrow_3lib_22_RecordBatchFileReader_num_record_batches, 0, (char *)0, 0},
  {(char *)"schema", __pyx_getprop_7pyarrow_3lib_22_RecordBatchFileReader_schema, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib__RecordBatchFileReader = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib._RecordBatchFileReader", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib__RecordBatchFileReader, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib__RecordBatchFileReader, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib__RecordBatchFileReader, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib__RecordBatchFileReader, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib__RecordBatchFileReader, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib__RecordBatchFileReader, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib_FeatherWriter(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_FeatherWriter *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_FeatherWriter *)o);
  new((void*)&(p->writer)) std::unique_ptr< arrow::ipc::feather::TableWriter> ();
  if (unlikely(__pyx_pw_7pyarrow_3lib_13FeatherWriter_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_FeatherWriter(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_FeatherWriter *p = (struct __pyx_obj_7pyarrow_3lib_FeatherWriter *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->writer);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_13FeatherWriter_num_rows(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_13FeatherWriter_8num_rows_1__get__(o);
}

static int __pyx_setprop_7pyarrow_3lib_13FeatherWriter_num_rows(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7pyarrow_3lib_13FeatherWriter_8num_rows_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_FeatherWriter[] = {
  {"open", (PyCFunction)__pyx_pw_7pyarrow_3lib_13FeatherWriter_3open, METH_O, __pyx_doc_7pyarrow_3lib_13FeatherWriter_2open},
  {"close", (PyCFunction)__pyx_pw_7pyarrow_3lib_13FeatherWriter_5close, METH_NOARGS, __pyx_doc_7pyarrow_3lib_13FeatherWriter_4close},
  {"write_array", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_13FeatherWriter_7write_array, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_13FeatherWriter_6write_array},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_13FeatherWriter_9__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_13FeatherWriter_8__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_13FeatherWriter_11__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_13FeatherWriter_10__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_FeatherWriter[] = {
  {(char *)"num_rows", __pyx_getprop_7pyarrow_3lib_13FeatherWriter_num_rows, __pyx_setprop_7pyarrow_3lib_13FeatherWriter_num_rows, (char *)"num_rows: 'int64_t'", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_FeatherWriter = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.FeatherWriter", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_FeatherWriter), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_FeatherWriter, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_FeatherWriter, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_FeatherWriter, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_FeatherWriter, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib_FeatherReader(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_FeatherReader *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_FeatherReader *)o);
  new((void*)&(p->reader)) std::unique_ptr< arrow::ipc::feather::TableReader> ();
  if (unlikely(__pyx_pw_7pyarrow_3lib_13FeatherReader_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_FeatherReader(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_FeatherReader *p = (struct __pyx_obj_7pyarrow_3lib_FeatherReader *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->reader);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_13FeatherReader_num_rows(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_13FeatherReader_8num_rows_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_13FeatherReader_num_columns(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_13FeatherReader_11num_columns_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_FeatherReader[] = {
  {"open", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_13FeatherReader_3open, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_13FeatherReader_2open},
  {"get_column_name", (PyCFunction)__pyx_pw_7pyarrow_3lib_13FeatherReader_5get_column_name, METH_O, __pyx_doc_7pyarrow_3lib_13FeatherReader_4get_column_name},
  {"get_column", (PyCFunction)__pyx_pw_7pyarrow_3lib_13FeatherReader_7get_column, METH_O, __pyx_doc_7pyarrow_3lib_13FeatherReader_6get_column},
  {"_read", (PyCFunction)__pyx_pw_7pyarrow_3lib_13FeatherReader_9_read, METH_NOARGS, __pyx_doc_7pyarrow_3lib_13FeatherReader_8_read},
  {"_read_indices", (PyCFunction)__pyx_pw_7pyarrow_3lib_13FeatherReader_11_read_indices, METH_O, __pyx_doc_7pyarrow_3lib_13FeatherReader_10_read_indices},
  {"_read_names", (PyCFunction)__pyx_pw_7pyarrow_3lib_13FeatherReader_13_read_names, METH_O, __pyx_doc_7pyarrow_3lib_13FeatherReader_12_read_names},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_13FeatherReader_15__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_13FeatherReader_14__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_13FeatherReader_17__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_13FeatherReader_16__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_FeatherReader[] = {
  {(char *)"num_rows", __pyx_getprop_7pyarrow_3lib_13FeatherReader_num_rows, 0, (char *)0, 0},
  {(char *)"num_columns", __pyx_getprop_7pyarrow_3lib_13FeatherReader_num_columns, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_FeatherReader = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.FeatherReader", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_FeatherReader), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_FeatherReader, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_FeatherReader, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_FeatherReader, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_FeatherReader, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_7pyarrow_3lib_SerializationContext(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_SerializationContext *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_SerializationContext *)o);
  p->type_to_type_id = Py_None; Py_INCREF(Py_None);
  p->whitelisted_types = Py_None; Py_INCREF(Py_None);
  p->types_to_pickle = Py_None; Py_INCREF(Py_None);
  p->custom_serializers = Py_None; Py_INCREF(Py_None);
  p->custom_deserializers = Py_None; Py_INCREF(Py_None);
  p->pickle_serializer = Py_None; Py_INCREF(Py_None);
  p->pickle_deserializer = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_SerializationContext(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_SerializationContext *p = (struct __pyx_obj_7pyarrow_3lib_SerializationContext *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->type_to_type_id);
  Py_CLEAR(p->whitelisted_types);
  Py_CLEAR(p->types_to_pickle);
  Py_CLEAR(p->custom_serializers);
  Py_CLEAR(p->custom_deserializers);
  Py_CLEAR(p->pickle_serializer);
  Py_CLEAR(p->pickle_deserializer);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_SerializationContext(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_SerializationContext *p = (struct __pyx_obj_7pyarrow_3lib_SerializationContext *)o;
  if (p->type_to_type_id) {
    e = (*v)(p->type_to_type_id, a); if (e) return e;
  }
  if (p->whitelisted_types) {
    e = (*v)(p->whitelisted_types, a); if (e) return e;
  }
  if (p->types_to_pickle) {
    e = (*v)(p->types_to_pickle, a); if (e) return e;
  }
  if (p->custom_serializers) {
    e = (*v)(p->custom_serializers, a); if (e) return e;
  }
  if (p->custom_deserializers) {
    e = (*v)(p->custom_deserializers, a); if (e) return e;
  }
  if (p->pickle_serializer) {
    e = (*v)(p->pickle_serializer, a); if (e) return e;
  }
  if (p->pickle_deserializer) {
    e = (*v)(p->pickle_deserializer, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_SerializationContext(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_SerializationContext *p = (struct __pyx_obj_7pyarrow_3lib_SerializationContext *)o;
  tmp = ((PyObject*)p->type_to_type_id);
  p->type_to_type_id = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->whitelisted_types);
  p->whitelisted_types = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->types_to_pickle);
  p->types_to_pickle = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->custom_serializers);
  p->custom_serializers = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->custom_deserializers);
  p->custom_deserializers = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->pickle_serializer);
  p->pickle_serializer = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->pickle_deserializer);
  p->pickle_deserializer = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_SerializationContext[] = {
  {"set_pickle", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_20SerializationContext_3set_pickle, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_20SerializationContext_2set_pickle},
  {"clone", (PyCFunction)__pyx_pw_7pyarrow_3lib_20SerializationContext_5clone, METH_NOARGS, __pyx_doc_7pyarrow_3lib_20SerializationContext_4clone},
  {"register_type", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_20SerializationContext_7register_type, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_20SerializationContext_6register_type},
  {"_serialize_callback", (PyCFunction)__pyx_pw_7pyarrow_3lib_20SerializationContext_9_serialize_callback, METH_O, __pyx_doc_7pyarrow_3lib_20SerializationContext_8_serialize_callback},
  {"_deserialize_callback", (PyCFunction)__pyx_pw_7pyarrow_3lib_20SerializationContext_11_deserialize_callback, METH_O, __pyx_doc_7pyarrow_3lib_20SerializationContext_10_deserialize_callback},
  {"serialize", (PyCFunction)__pyx_pw_7pyarrow_3lib_20SerializationContext_13serialize, METH_O, __pyx_doc_7pyarrow_3lib_20SerializationContext_12serialize},
  {"serialize_to", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_20SerializationContext_15serialize_to, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_20SerializationContext_14serialize_to},
  {"deserialize", (PyCFunction)__pyx_pw_7pyarrow_3lib_20SerializationContext_17deserialize, METH_O, __pyx_doc_7pyarrow_3lib_20SerializationContext_16deserialize},
  {"deserialize_components", (PyCFunction)__pyx_pw_7pyarrow_3lib_20SerializationContext_19deserialize_components, METH_O, __pyx_doc_7pyarrow_3lib_20SerializationContext_18deserialize_components},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_20SerializationContext_21__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_20SerializationContext_20__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_20SerializationContext_23__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_20SerializationContext_22__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_SerializationContext = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.SerializationContext", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_SerializationContext), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_SerializationContext, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "SerializationContext()", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_SerializationContext, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_SerializationContext, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_SerializationContext, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_20SerializationContext_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_SerializationContext, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_7pyarrow_3lib_SerializedPyObject __pyx_vtable_7pyarrow_3lib_SerializedPyObject;

static PyObject *__pyx_tp_new_7pyarrow_3lib_SerializedPyObject(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_SerializedPyObject;
  new((void*)&(p->data))  arrow::py::SerializedPyObject();
  p->base = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib_SerializedPyObject(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *p = (struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->data);
  Py_CLEAR(p->base);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib_SerializedPyObject(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *p = (struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *)o;
  if (p->base) {
    e = (*v)(p->base, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib_SerializedPyObject(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *p = (struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *)o;
  tmp = ((PyObject*)p->base);
  p->base = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7pyarrow_3lib_18SerializedPyObject_total_bytes(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_18SerializedPyObject_11total_bytes_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_18SerializedPyObject_base(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_18SerializedPyObject_4base_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_SerializedPyObject[] = {
  {"write_to", (PyCFunction)__pyx_pw_7pyarrow_3lib_18SerializedPyObject_1write_to, METH_O, __pyx_doc_7pyarrow_3lib_18SerializedPyObject_write_to},
  {"deserialize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_18SerializedPyObject_3deserialize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_18SerializedPyObject_2deserialize},
  {"to_buffer", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_18SerializedPyObject_5to_buffer, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_18SerializedPyObject_4to_buffer},
  {"from_components", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_18SerializedPyObject_7from_components, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_18SerializedPyObject_6from_components},
  {"to_components", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_18SerializedPyObject_9to_components, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_18SerializedPyObject_8to_components},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_18SerializedPyObject_11__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_18SerializedPyObject_10__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_18SerializedPyObject_13__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_18SerializedPyObject_12__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_SerializedPyObject[] = {
  {(char *)"total_bytes", __pyx_getprop_7pyarrow_3lib_18SerializedPyObject_total_bytes, 0, (char *)0, 0},
  {(char *)"base", __pyx_getprop_7pyarrow_3lib_18SerializedPyObject_base, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib_SerializedPyObject = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.SerializedPyObject", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_SerializedPyObject, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Arrow-serialized representation of Python object\n    ", /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib_SerializedPyObject, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib_SerializedPyObject, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_SerializedPyObject, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_SerializedPyObject, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_SerializedPyObject, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__ *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct____iter__[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct____iter__ = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct____iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct____iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct____iter__[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct____iter__];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct____iter__(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct____iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct____iter__[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct____iter__++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct____iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct____iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct____iter__", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct____iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct____iter__, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct____iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct____iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__ *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_1___iter__[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_1___iter__ = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_1___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_1___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_1___iter__[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_1___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_1___iter__(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_1___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_1___iter__[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_1___iter__++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_1___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct_1___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_1___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_1___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_1___iter__, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_1___iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_1___iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__ *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_2___iter__[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_2___iter__ = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_2___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_2___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_2___iter__[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_2___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_2___iter__(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_2___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_2___iter__[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_2___iter__++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_2___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct_2___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_2___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_2___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_2___iter__, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_2___iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_2___iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_pd);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions *)o;
  if (p->__pyx_v_pd) {
    e = (*v)(p->__pyx_v_pd, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions *)o;
  tmp = ((PyObject*)p->__pyx_v_pd);
  p->__pyx_v_pd = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_3__datetime_conversion_functions", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_pd);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions *)o;
  if (p->__pyx_v_pd) {
    e = (*v)(p->__pyx_v_pd, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions *)o;
  tmp = ((PyObject*)p->__pyx_v_pd);
  p->__pyx_v_pd = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_4__timedelta_conversion_functions", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__ *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_5___iter__[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_5___iter__ = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_5___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_5___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_5___iter__[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_5___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_5___iter__(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_5___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_5___iter__[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_5___iter__++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_5___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct_5___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_5___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_5___iter__, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_5___iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_5___iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__ *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_6___iter__[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_6___iter__ = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_6___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_6___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_6___iter__[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_6___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_6___iter__(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_6___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_6___iter__[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_6___iter__++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_6___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct_6___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_6___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_6___iter__, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_6___iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_6___iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7___iter__ *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_7___iter__[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_7___iter__ = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_7___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_7___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7___iter__)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_7___iter__[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_7___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7___iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_7___iter__(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7___iter__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_7___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7___iter__)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_7___iter__[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_7___iter__++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_7___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7___iter__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct_7___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_7___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_7___iter__, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_7___iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_7___iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8___iter__ *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_8___iter__[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_8___iter__ = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_8___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_8___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8___iter__)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_8___iter__[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_8___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8___iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_8___iter__(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8___iter__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_8___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8___iter__)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_8___iter__[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_8___iter__++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_8___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8___iter__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct_8___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_8___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_8___iter__, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_8___iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_8___iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9___iter__ *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_9___iter__[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_9___iter__ = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_9___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_9___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9___iter__)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_9___iter__[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_9___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9___iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_9___iter__(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9___iter__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_9___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9___iter__)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_9___iter__[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_9___iter__++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_9___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9___iter__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct_9___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_9___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_9___iter__, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_9___iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_9___iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10___iter__ *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_10___iter__[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_10___iter__ = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_10___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_10___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10___iter__)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_10___iter__[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_10___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10___iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_10___iter__(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10___iter__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_chunk);
  Py_CLEAR(p->__pyx_v_item);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_t_1);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_10___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10___iter__)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_10___iter__[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_10___iter__++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_10___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10___iter__ *)o;
  if (p->__pyx_v_chunk) {
    e = (*v)(p->__pyx_v_chunk, a); if (e) return e;
  }
  if (p->__pyx_v_item) {
    e = (*v)(p->__pyx_v_item, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  if (p->__pyx_t_1) {
    e = (*v)(p->__pyx_t_1, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct_10___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_10___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_10___iter__, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_10___iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_10___iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11_iterchunks *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_11_iterchunks[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_11_iterchunks = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_11_iterchunks(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_11_iterchunks > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11_iterchunks)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_11_iterchunks[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_11_iterchunks];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11_iterchunks));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_11_iterchunks(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11_iterchunks *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11_iterchunks *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_i);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_11_iterchunks < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11_iterchunks)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_11_iterchunks[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_11_iterchunks++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11_iterchunks *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_11_iterchunks(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11_iterchunks *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11_iterchunks *)o;
  if (p->__pyx_v_i) {
    e = (*v)(p->__pyx_v_i, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct_11_iterchunks = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_11_iterchunks", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11_iterchunks), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_11_iterchunks, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_11_iterchunks, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_11_iterchunks, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12_itercolumns *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_12_itercolumns[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_12_itercolumns = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_12_itercolumns(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_12_itercolumns > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12_itercolumns)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_12_itercolumns[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_12_itercolumns];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12_itercolumns));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_12_itercolumns(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12_itercolumns *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12_itercolumns *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_i);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_12_itercolumns < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12_itercolumns)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_12_itercolumns[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_12_itercolumns++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12_itercolumns *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_12_itercolumns(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12_itercolumns *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12_itercolumns *)o;
  if (p->__pyx_v_i) {
    e = (*v)(p->__pyx_v_i, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct_12_itercolumns = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_12_itercolumns", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12_itercolumns), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_12_itercolumns, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_12_itercolumns, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_12_itercolumns, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13___get__ *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_13___get__[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_13___get__ = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_13___get__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_13___get__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13___get__)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_13___get__[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_13___get__];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13___get__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_13___get__(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13___get__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13___get__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_13___get__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13___get__)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_13___get__[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_13___get__++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13___get__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_13___get__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13___get__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13___get__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib___pyx_scope_struct_13___get__(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13___get__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13___get__ *)o;
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = ((struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct_13___get__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_13___get__", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13___get__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_13___get__, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_13___get__, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib___pyx_scope_struct_13___get__, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_13___get__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_genexpr *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_14_genexpr[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_14_genexpr = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_14_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_14_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_14_genexpr[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_14_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_14_genexpr(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_genexpr *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_x);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_14_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_genexpr)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_14_genexpr[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_14_genexpr++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_14_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_genexpr *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_x) {
    e = (*v)(p->__pyx_v_x, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct_14_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_14_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_14_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_14_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_14_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_14_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_15___get__ *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_15___get__[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_15___get__ = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_15___get__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_15___get__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_15___get__)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_15___get__[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_15___get__];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_15___get__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_15___get__(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_15___get__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_15___get__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_15___get__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_15___get__)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_15___get__[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_15___get__++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_15___get__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_15___get__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_15___get__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_15___get__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib___pyx_scope_struct_15___get__(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_15___get__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_15___get__ *)o;
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = ((struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct_15___get__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_15___get__", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_15___get__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_15___get__, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_15___get__, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib___pyx_scope_struct_15___get__, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_15___get__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_16_genexpr *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_16_genexpr[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_16_genexpr = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_16_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_16_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_16_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_16_genexpr[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_16_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_16_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_16_genexpr(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_16_genexpr *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_16_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_x);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_16_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_16_genexpr)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_16_genexpr[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_16_genexpr++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_16_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_16_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_16_genexpr *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_16_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_x) {
    e = (*v)(p->__pyx_v_x, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct_16_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_16_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_16_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_16_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_16_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_16_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_17_download *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_17_download[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_17_download = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_17_download(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_17_download > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_17_download)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_17_download[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_17_download];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_17_download));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_17_download(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_17_download *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_17_download *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_cleanup);
  Py_CLEAR(p->__pyx_v_stream);
  Py_CLEAR(p->__pyx_v_write_queue);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_17_download < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_17_download)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_17_download[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_17_download++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_17_download *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_17_download(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_17_download *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_17_download *)o;
  if (p->__pyx_v_cleanup) {
    e = (*v)(p->__pyx_v_cleanup, a); if (e) return e;
  }
  if (p->__pyx_v_stream) {
    e = (*v)(p->__pyx_v_stream, a); if (e) return e;
  }
  if (p->__pyx_v_write_queue) {
    e = (*v)(p->__pyx_v_write_queue, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib___pyx_scope_struct_17_download(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_17_download *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_17_download *)o;
  tmp = ((PyObject*)p->__pyx_v_cleanup);
  p->__pyx_v_cleanup = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_stream);
  p->__pyx_v_stream = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_write_queue);
  p->__pyx_v_write_queue = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct_17_download = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_17_download", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_17_download), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_17_download, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_17_download, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib___pyx_scope_struct_17_download, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_17_download, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_18_upload *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_18_upload[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_18_upload = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_18_upload(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_18_upload > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_18_upload)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_18_upload[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_18_upload];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_18_upload));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_18_upload(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_18_upload *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_18_upload *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_write_queue);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_18_upload < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_18_upload)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_18_upload[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_18_upload++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_18_upload *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_18_upload(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_18_upload *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_18_upload *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  if (p->__pyx_v_write_queue) {
    e = (*v)(p->__pyx_v_write_queue, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib___pyx_scope_struct_18_upload(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_18_upload *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_18_upload *)o;
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_write_queue);
  p->__pyx_v_write_queue = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct_18_upload = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_18_upload", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_18_upload), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_18_upload, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_18_upload, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib___pyx_scope_struct_18_upload, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_18_upload, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_19___iter__ *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_19___iter__[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_19___iter__ = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_19___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_19___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_19___iter__)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_19___iter__[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_19___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_19___iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_19___iter__(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_19___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_19___iter__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_19___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_19___iter__)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_19___iter__[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_19___iter__++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_19___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_19___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_19___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_19___iter__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct_19___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_19___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_19___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_19___iter__, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_19___iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_19___iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_20___iter__ *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_20___iter__[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_20___iter__ = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_20___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_20___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_20___iter__)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_20___iter__[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_20___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_20___iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_20___iter__(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_20___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_20___iter__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_20___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_20___iter__)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_20___iter__[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_20___iter__++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_20___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_20___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_20___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_20___iter__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct_20___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_20___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_20___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_20___iter__, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_20___iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_20___iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_f);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple *)o;
  if (p->__pyx_v_f) {
    e = (*v)(p->__pyx_v_f, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple *)o;
  tmp = ((PyObject*)p->__pyx_v_f);
  p->__pyx_v_f = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_21_is_named_tuple", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_22_genexpr *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_22_genexpr[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_22_genexpr = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_22_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_22_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_22_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_22_genexpr[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_22_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_22_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_22_genexpr(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_22_genexpr *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_22_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_n);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_22_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_22_genexpr)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_22_genexpr[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_22_genexpr++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_22_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_22_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_22_genexpr *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_22_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_n) {
    e = (*v)(p->__pyx_v_n, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_7pyarrow_3lib___pyx_scope_struct_22_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_22_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_22_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_22_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_22_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_22_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {"decimal128", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_69decimal128, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_68decimal128},
  {"large_list", (PyCFunction)__pyx_pw_7pyarrow_3lib_85large_list, METH_O, __pyx_doc_7pyarrow_3lib_84large_list},
  {"map_", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_87map_, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_86map_},
  {"dictionary", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_89dictionary, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_88dictionary},
  {"_box_time_milli", (PyCFunction)__pyx_pw_7pyarrow_3lib_111_box_time_milli, METH_O, __pyx_doc_7pyarrow_3lib_110_box_time_milli},
  {"_box_time_micro", (PyCFunction)__pyx_pw_7pyarrow_3lib_113_box_time_micro, METH_O, __pyx_doc_7pyarrow_3lib_112_box_time_micro},
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
#if CYTHON_PEP489_MULTI_PHASE_INIT
static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
static int __pyx_pymod_exec_lib(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec_lib},
  {0, NULL}
};
#endif

static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    "lib",
    0, /* m_doc */
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    0, /* m_size */
  #else
    -1, /* m_size */
  #endif
    __pyx_methods /* m_methods */,
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    __pyx_moduledef_slots, /* m_slots */
  #else
    NULL, /* m_reload */
  #endif
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif
#ifndef CYTHON_SMALL_CODE
#if defined(__clang__)
    #define CYTHON_SMALL_CODE
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
    #define CYTHON_SMALL_CODE __attribute__((cold))
#else
    #define CYTHON_SMALL_CODE
#endif
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_u_02d_02d, __pyx_k_02d_02d, sizeof(__pyx_k_02d_02d), 0, 1, 0, 0},
  {&__pyx_kp_u_0_0_9_1_0_9_2_0_3_0_5_0_9, __pyx_k_0_0_9_1_0_9_2_0_3_0_5_0_9, sizeof(__pyx_k_0_0_9_1_0_9_2_0_3_0_5_0_9), 0, 1, 0, 0},
  {&__pyx_kp_u_0_1, __pyx_k_0_1, sizeof(__pyx_k_0_1), 0, 1, 0, 0},
  {&__pyx_kp_u_0_19_0, __pyx_k_0_19_0, sizeof(__pyx_k_0_19_0), 0, 1, 0, 0},
  {&__pyx_kp_u_0_20_0, __pyx_k_0_20_0, sizeof(__pyx_k_0_20_0), 0, 1, 0, 0},
  {&__pyx_kp_u_0_23_0, __pyx_k_0_23_0, sizeof(__pyx_k_0_23_0), 0, 1, 0, 0},
  {&__pyx_kp_u_0_24, __pyx_k_0_24, sizeof(__pyx_k_0_24), 0, 1, 0, 0},
  {&__pyx_kp_u_0_25, __pyx_k_0_25, sizeof(__pyx_k_0_25), 0, 1, 0, 0},
  {&__pyx_kp_u_0___class_____name___0, __pyx_k_0___class_____name___0, sizeof(__pyx_k_0___class_____name___0), 0, 1, 0, 0},
  {&__pyx_n_s_Array, __pyx_k_Array, sizeof(__pyx_k_Array), 0, 0, 1, 1},
  {&__pyx_n_s_ArrayValue, __pyx_k_ArrayValue, sizeof(__pyx_k_ArrayValue), 0, 0, 1, 1},
  {&__pyx_n_s_Array___iter, __pyx_k_Array___iter, sizeof(__pyx_k_Array___iter), 0, 0, 1, 1},
  {&__pyx_kp_u_Array_cast_line_611, __pyx_k_Array_cast_line_611, sizeof(__pyx_k_Array_cast_line_611), 0, 1, 0, 0},
  {&__pyx_kp_u_Array_data_type_was_NULL, __pyx_k_Array_data_type_was_NULL, sizeof(__pyx_k_Array_data_type_was_NULL), 0, 1, 0, 0},
  {&__pyx_kp_u_Array_filter_line_966, __pyx_k_Array_filter_line_966, sizeof(__pyx_k_Array_filter_line_966), 0, 1, 0, 0},
  {&__pyx_kp_u_Array_take_line_923, __pyx_k_Array_take_line_923, sizeof(__pyx_k_Array_take_line_923), 0, 1, 0, 0},
  {&__pyx_kp_u_Array_was_NULL, __pyx_k_Array_was_NULL, sizeof(__pyx_k_Array_was_NULL), 0, 1, 0, 0},
  {&__pyx_kp_u_Arrays_were_not_all_the_same_len, __pyx_k_Arrays_were_not_all_the_same_len, sizeof(__pyx_k_Arrays_were_not_all_the_same_len), 0, 1, 0, 0},
  {&__pyx_n_s_ArrowCapacityError, __pyx_k_ArrowCapacityError, sizeof(__pyx_k_ArrowCapacityError), 0, 0, 1, 1},
  {&__pyx_n_s_ArrowException, __pyx_k_ArrowException, sizeof(__pyx_k_ArrowException), 0, 0, 1, 1},
  {&__pyx_n_s_ArrowIOError, __pyx_k_ArrowIOError, sizeof(__pyx_k_ArrowIOError), 0, 0, 1, 1},
  {&__pyx_n_s_ArrowIndexError, __pyx_k_ArrowIndexError, sizeof(__pyx_k_ArrowIndexError), 0, 0, 1, 1},
  {&__pyx_n_s_ArrowInvalid, __pyx_k_ArrowInvalid, sizeof(__pyx_k_ArrowInvalid), 0, 0, 1, 1},
  {&__pyx_n_s_ArrowKeyError, __pyx_k_ArrowKeyError, sizeof(__pyx_k_ArrowKeyError), 0, 0, 1, 1},
  {&__pyx_n_s_ArrowKeyError___str, __pyx_k_ArrowKeyError___str, sizeof(__pyx_k_ArrowKeyError___str), 0, 0, 1, 1},
  {&__pyx_n_s_ArrowMemoryError, __pyx_k_ArrowMemoryError, sizeof(__pyx_k_ArrowMemoryError), 0, 0, 1, 1},
  {&__pyx_n_s_ArrowNotImplementedError, __pyx_k_ArrowNotImplementedError, sizeof(__pyx_k_ArrowNotImplementedError), 0, 0, 1, 1},
  {&__pyx_n_s_ArrowSerializationError, __pyx_k_ArrowSerializationError, sizeof(__pyx_k_ArrowSerializationError), 0, 0, 1, 1},
  {&__pyx_n_s_ArrowTypeError, __pyx_k_ArrowTypeError, sizeof(__pyx_k_ArrowTypeError), 0, 0, 1, 1},
  {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1},
  {&__pyx_n_b_B, __pyx_k_B, sizeof(__pyx_k_B), 0, 0, 0, 1},
  {&__pyx_n_s_BaseExtensionType, __pyx_k_BaseExtensionType, sizeof(__pyx_k_BaseExtensionType), 0, 0, 1, 1},
  {&__pyx_n_s_BaseTzInfo, __pyx_k_BaseTzInfo, sizeof(__pyx_k_BaseTzInfo), 0, 0, 1, 1},
  {&__pyx_kp_u_Batch_number_0_out_of_range, __pyx_k_Batch_number_0_out_of_range, sizeof(__pyx_k_Batch_number_0_out_of_range), 0, 1, 0, 0},
  {&__pyx_n_s_BinaryArray, __pyx_k_BinaryArray, sizeof(__pyx_k_BinaryArray), 0, 0, 1, 1},
  {&__pyx_n_s_BinaryValue, __pyx_k_BinaryValue, sizeof(__pyx_k_BinaryValue), 0, 0, 1, 1},
  {&__pyx_n_s_BooleanArray, __pyx_k_BooleanArray, sizeof(__pyx_k_BooleanArray), 0, 0, 1, 1},
  {&__pyx_n_s_BooleanValue, __pyx_k_BooleanValue, sizeof(__pyx_k_BooleanValue), 0, 0, 1, 1},
  {&__pyx_n_s_Buffer, __pyx_k_Buffer, sizeof(__pyx_k_Buffer), 0, 0, 1, 1},
  {&__pyx_n_s_BufferError, __pyx_k_BufferError, sizeof(__pyx_k_BufferError), 0, 0, 1, 1},
  {&__pyx_n_s_BufferOutputStream, __pyx_k_BufferOutputStream, sizeof(__pyx_k_BufferOutputStream), 0, 0, 1, 1},
  {&__pyx_n_s_BufferReader, __pyx_k_BufferReader, sizeof(__pyx_k_BufferReader), 0, 0, 1, 1},
  {&__pyx_kp_u_Buffer_size_must_be_larger_than, __pyx_k_Buffer_size_must_be_larger_than, sizeof(__pyx_k_Buffer_size_must_be_larger_than), 0, 1, 0, 0},
  {&__pyx_n_s_BufferedIOBase, __pyx_k_BufferedIOBase, sizeof(__pyx_k_BufferedIOBase), 0, 0, 1, 1},
  {&__pyx_n_s_BufferedInputStream, __pyx_k_BufferedInputStream, sizeof(__pyx_k_BufferedInputStream), 0, 0, 1, 1},
  {&__pyx_n_s_BufferedOutputStream, __pyx_k_BufferedOutputStream, sizeof(__pyx_k_BufferedOutputStream), 0, 0, 1, 1},
  {&__pyx_n_u_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 1, 0, 1},
  {&__pyx_n_s_COO, __pyx_k_COO, sizeof(__pyx_k_COO), 0, 0, 1, 1},
  {&__pyx_kp_u_CPU_count_must_be_strictly_posit, __pyx_k_CPU_count_must_be_strictly_posit, sizeof(__pyx_k_CPU_count_must_be_strictly_posit), 0, 1, 0, 0},
  {&__pyx_n_s_CRecordBatchReader, __pyx_k_CRecordBatchReader, sizeof(__pyx_k_CRecordBatchReader), 0, 0, 1, 1},
  {&__pyx_n_s_CRecordBatchReader___iter, __pyx_k_CRecordBatchReader___iter, sizeof(__pyx_k_CRecordBatchReader___iter), 0, 0, 1, 1},
  {&__pyx_n_s_CRecordBatchWriter, __pyx_k_CRecordBatchWriter, sizeof(__pyx_k_CRecordBatchWriter), 0, 0, 1, 1},
  {&__pyx_kp_u_Calling_data_on_ChunkedArray_is, __pyx_k_Calling_data_on_ChunkedArray_is, sizeof(__pyx_k_Calling_data_on_ChunkedArray_is), 0, 1, 0, 0},
  {&__pyx_kp_u_Can_only_instantiate_subclasses, __pyx_k_Can_only_instantiate_subclasses, sizeof(__pyx_k_Can_only_instantiate_subclasses), 0, 1, 0, 0},
  {&__pyx_kp_u_Can_only_instantiate_subclasses_2, __pyx_k_Can_only_instantiate_subclasses_2, sizeof(__pyx_k_Can_only_instantiate_subclasses_2), 0, 1, 0, 0},
  {&__pyx_kp_u_Cannot_compare_Arrow_values_that, __pyx_k_Cannot_compare_Arrow_values_that, sizeof(__pyx_k_Cannot_compare_Arrow_values_that), 0, 1, 0, 0},
  {&__pyx_kp_u_Cannot_compare_scalars_that_don, __pyx_k_Cannot_compare_scalars_that_don, sizeof(__pyx_k_Cannot_compare_scalars_that_don), 0, 1, 0, 0},
  {&__pyx_kp_u_Cannot_construct_a_chunked_array, __pyx_k_Cannot_construct_a_chunked_array, sizeof(__pyx_k_Cannot_construct_a_chunked_array), 0, 1, 0, 0},
  {&__pyx_kp_u_Cannot_convert_nanosecond_timest, __pyx_k_Cannot_convert_nanosecond_timest, sizeof(__pyx_k_Cannot_convert_nanosecond_timest), 0, 1, 0, 0},
  {&__pyx_kp_u_Cannot_create_multiple_NAType_in, __pyx_k_Cannot_create_multiple_NAType_in, sizeof(__pyx_k_Cannot_create_multiple_NAType_in), 0, 1, 0, 0},
  {&__pyx_kp_u_Cannot_pass_a_numpy_masked_array, __pyx_k_Cannot_pass_a_numpy_masked_array, sizeof(__pyx_k_Cannot_pass_a_numpy_masked_array), 0, 1, 0, 0},
  {&__pyx_kp_u_Cannot_pass_both_schema_and_meta, __pyx_k_Cannot_pass_both_schema_and_meta, sizeof(__pyx_k_Cannot_pass_both_schema_and_meta), 0, 1, 0, 0},
  {&__pyx_kp_u_Cannot_pass_both_schema_and_name, __pyx_k_Cannot_pass_both_schema_and_name, sizeof(__pyx_k_Cannot_pass_both_schema_and_name), 0, 1, 0, 0},
  {&__pyx_kp_u_Cannot_return_a_writable_array_i, __pyx_k_Cannot_return_a_writable_array_i, sizeof(__pyx_k_Cannot_return_a_writable_array_i), 0, 1, 0, 0},
  {&__pyx_kp_u_Cannot_specify_a_mask_or_a_size, __pyx_k_Cannot_specify_a_mask_or_a_size, sizeof(__pyx_k_Cannot_specify_a_mask_or_a_size), 0, 1, 0, 0},
  {&__pyx_n_s_CastOptions, __pyx_k_CastOptions, sizeof(__pyx_k_CastOptions), 0, 0, 1, 1},
  {&__pyx_kp_u_Cast_array_values_to_another_da, __pyx_k_Cast_array_values_to_another_da, sizeof(__pyx_k_Cast_array_values_to_another_da), 0, 1, 0, 0},
  {&__pyx_n_s_Categorical, __pyx_k_Categorical, sizeof(__pyx_k_Categorical), 0, 0, 1, 1},
  {&__pyx_kp_u_Chunk_index_out_of_range, __pyx_k_Chunk_index_out_of_range, sizeof(__pyx_k_Chunk_index_out_of_range), 0, 1, 0, 0},
  {&__pyx_n_s_ChunkedArray, __pyx_k_ChunkedArray, sizeof(__pyx_k_ChunkedArray), 0, 0, 1, 1},
  {&__pyx_n_s_ChunkedArray___iter, __pyx_k_ChunkedArray___iter, sizeof(__pyx_k_ChunkedArray___iter), 0, 0, 1, 1},
  {&__pyx_kp_u_ChunkedArray_data_type_was_NULL, __pyx_k_ChunkedArray_data_type_was_NULL, sizeof(__pyx_k_ChunkedArray_data_type_was_NULL), 0, 1, 0, 0},
  {&__pyx_n_s_ChunkedArray_iterchunks, __pyx_k_ChunkedArray_iterchunks, sizeof(__pyx_k_ChunkedArray_iterchunks), 0, 0, 1, 1},
  {&__pyx_kp_u_ChunkedArray_was_NULL, __pyx_k_ChunkedArray_was_NULL, sizeof(__pyx_k_ChunkedArray_was_NULL), 0, 1, 0, 0},
  {&__pyx_kp_u_Column_does_not_exist_in_schema, __pyx_k_Column_does_not_exist_in_schema, sizeof(__pyx_k_Column_does_not_exist_in_schema), 0, 1, 0, 0},
  {&__pyx_kp_u_Column_does_not_exist_in_table, __pyx_k_Column_does_not_exist_in_table, sizeof(__pyx_k_Column_does_not_exist_in_table), 0, 1, 0, 0},
  {&__pyx_kp_u_Column_r_not_found, __pyx_k_Column_r_not_found, sizeof(__pyx_k_Column_r_not_found), 0, 1, 0, 0},
  {&__pyx_kp_u_Comparisons_with_pyarrow_Array_a, __pyx_k_Comparisons_with_pyarrow_Array_a, sizeof(__pyx_k_Comparisons_with_pyarrow_Array_a), 0, 1, 0, 0},
  {&__pyx_n_s_CompressedInputStream, __pyx_k_CompressedInputStream, sizeof(__pyx_k_CompressedInputStream), 0, 0, 1, 1},
  {&__pyx_n_s_CompressedOutputStream, __pyx_k_CompressedOutputStream, sizeof(__pyx_k_CompressedOutputStream), 0, 0, 1, 1},
  {&__pyx_kp_u_Convert_pandas_DataFrame_to_an, __pyx_k_Convert_pandas_DataFrame_to_an, sizeof(__pyx_k_Convert_pandas_DataFrame_to_an), 0, 1, 0, 0},
  {&__pyx_kp_u_Create_pyarrow_Array_instance_f, __pyx_k_Create_pyarrow_Array_instance_f, sizeof(__pyx_k_Create_pyarrow_Array_instance_f), 0, 1, 0, 0},
  {&__pyx_n_s_DEFAULT_BUFFER_SIZE, __pyx_k_DEFAULT_BUFFER_SIZE, sizeof(__pyx_k_DEFAULT_BUFFER_SIZE), 0, 0, 1, 1},
  {&__pyx_n_s_DataFrame, __pyx_k_DataFrame, sizeof(__pyx_k_DataFrame), 0, 0, 1, 1},
  {&__pyx_n_s_DataType, __pyx_k_DataType, sizeof(__pyx_k_DataType), 0, 0, 1, 1},
  {&__pyx_kp_u_DataType_expected_got_r, __pyx_k_DataType_expected_got_r, sizeof(__pyx_k_DataType_expected_got_r), 0, 1, 0, 0},
  {&__pyx_n_s_Date32Array, __pyx_k_Date32Array, sizeof(__pyx_k_Date32Array), 0, 0, 1, 1},
  {&__pyx_n_s_Date32Value, __pyx_k_Date32Value, sizeof(__pyx_k_Date32Value), 0, 0, 1, 1},
  {&__pyx_n_s_Date64Array, __pyx_k_Date64Array, sizeof(__pyx_k_Date64Array), 0, 0, 1, 1},
  {&__pyx_n_s_Date64Value, __pyx_k_Date64Value, sizeof(__pyx_k_Date64Value), 0, 0, 1, 1},
  {&__pyx_n_s_DatetimeTZDtype, __pyx_k_DatetimeTZDtype, sizeof(__pyx_k_DatetimeTZDtype), 0, 0, 1, 1},
  {&__pyx_n_s_Decimal, __pyx_k_Decimal, sizeof(__pyx_k_Decimal), 0, 0, 1, 1},
  {&__pyx_n_s_Decimal128Array, __pyx_k_Decimal128Array, sizeof(__pyx_k_Decimal128Array), 0, 0, 1, 1},
  {&__pyx_n_s_Decimal128Type, __pyx_k_Decimal128Type, sizeof(__pyx_k_Decimal128Type), 0, 0, 1, 1},
  {&__pyx_n_s_DecimalValue, __pyx_k_DecimalValue, sizeof(__pyx_k_DecimalValue), 0, 0, 1, 1},
  {&__pyx_n_s_DeserializationCallbackError, __pyx_k_DeserializationCallbackError, sizeof(__pyx_k_DeserializationCallbackError), 0, 0, 1, 1},
  {&__pyx_n_s_DeserializationCallbackError___i, __pyx_k_DeserializationCallbackError___i, sizeof(__pyx_k_DeserializationCallbackError___i), 0, 0, 1, 1},
  {&__pyx_kp_u_Detail, __pyx_k_Detail, sizeof(__pyx_k_Detail), 0, 1, 0, 0},
  {&__pyx_n_s_DictionaryArray, __pyx_k_DictionaryArray, sizeof(__pyx_k_DictionaryArray), 0, 0, 1, 1},
  {&__pyx_n_s_DictionaryMemo, __pyx_k_DictionaryMemo, sizeof(__pyx_k_DictionaryMemo), 0, 0, 1, 1},
  {&__pyx_n_s_DictionaryType, __pyx_k_DictionaryType, sizeof(__pyx_k_DictionaryType), 0, 0, 1, 1},
  {&__pyx_n_s_DictionaryValue, __pyx_k_DictionaryValue, sizeof(__pyx_k_DictionaryValue), 0, 0, 1, 1},
  {&__pyx_kp_u_Do_not_call_Buffer_s_constructor, __pyx_k_Do_not_call_Buffer_s_constructor, sizeof(__pyx_k_Do_not_call_Buffer_s_constructor), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_ChunkedArray_s_const, __pyx_k_Do_not_call_ChunkedArray_s_const, sizeof(__pyx_k_Do_not_call_ChunkedArray_s_const), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_Field_s_constructor, __pyx_k_Do_not_call_Field_s_constructor, sizeof(__pyx_k_Do_not_call_Field_s_constructor), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_RecordBatch_s_constr, __pyx_k_Do_not_call_RecordBatch_s_constr, sizeof(__pyx_k_Do_not_call_RecordBatch_s_constr), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_Schema_s_constructor, __pyx_k_Do_not_call_Schema_s_constructor, sizeof(__pyx_k_Do_not_call_Schema_s_constructor), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_SparseCOOTensor_s_co, __pyx_k_Do_not_call_SparseCOOTensor_s_co, sizeof(__pyx_k_Do_not_call_SparseCOOTensor_s_co), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_SparseCSRMatrix_s_co, __pyx_k_Do_not_call_SparseCSRMatrix_s_co, sizeof(__pyx_k_Do_not_call_SparseCSRMatrix_s_co), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_Table_s_constructor, __pyx_k_Do_not_call_Table_s_constructor, sizeof(__pyx_k_Do_not_call_Table_s_constructor), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_Tensor_s_constructor, __pyx_k_Do_not_call_Tensor_s_constructor, sizeof(__pyx_k_Do_not_call_Tensor_s_constructor), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_s_constructor_direct, __pyx_k_Do_not_call_s_constructor_direct, sizeof(__pyx_k_Do_not_call_s_constructor_direct), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_s_constructor_direct_2, __pyx_k_Do_not_call_s_constructor_direct_2, sizeof(__pyx_k_Do_not_call_s_constructor_direct_2), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_s_constructor_direct_3, __pyx_k_Do_not_call_s_constructor_direct_3, sizeof(__pyx_k_Do_not_call_s_constructor_direct_3), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_s_constructor_direct_4, __pyx_k_Do_not_call_s_constructor_direct_4, sizeof(__pyx_k_Do_not_call_s_constructor_direct_4), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_s_constructor_direct_5, __pyx_k_Do_not_call_s_constructor_direct_5, sizeof(__pyx_k_Do_not_call_s_constructor_direct_5), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_s_constructor_direct_6, __pyx_k_Do_not_call_s_constructor_direct_6, sizeof(__pyx_k_Do_not_call_s_constructor_direct_6), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_s_constructor_direct_7, __pyx_k_Do_not_call_s_constructor_direct_7, sizeof(__pyx_k_Do_not_call_s_constructor_direct_7), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_s_constructor_direct_8, __pyx_k_Do_not_call_s_constructor_direct_8, sizeof(__pyx_k_Do_not_call_s_constructor_direct_8), 0, 1, 0, 0},
  {&__pyx_kp_u_Do_not_call_s_constructor_direct_9, __pyx_k_Do_not_call_s_constructor_direct_9, sizeof(__pyx_k_Do_not_call_s_constructor_direct_9), 0, 1, 0, 0},
  {&__pyx_n_s_DoubleArray, __pyx_k_DoubleArray, sizeof(__pyx_k_DoubleArray), 0, 0, 1, 1},
  {&__pyx_n_s_DoubleScalar, __pyx_k_DoubleScalar, sizeof(__pyx_k_DoubleScalar), 0, 0, 1, 1},
  {&__pyx_n_s_DoubleValue, __pyx_k_DoubleValue, sizeof(__pyx_k_DoubleValue), 0, 0, 1, 1},
  {&__pyx_n_s_DurationArray, __pyx_k_DurationArray, sizeof(__pyx_k_DurationArray), 0, 0, 1, 1},
  {&__pyx_n_s_DurationType, __pyx_k_DurationType, sizeof(__pyx_k_DurationType), 0, 0, 1, 1},
  {&__pyx_n_s_DurationValue, __pyx_k_DurationValue, sizeof(__pyx_k_DurationValue), 0, 0, 1, 1},
  {&__pyx_n_s_EOFError, __pyx_k_EOFError, sizeof(__pyx_k_EOFError), 0, 0, 1, 1},
  {&__pyx_n_s_Empty, __pyx_k_Empty, sizeof(__pyx_k_Empty), 0, 0, 1, 1},
  {&__pyx_kp_u_End_of_Arrow_stream, __pyx_k_End_of_Arrow_stream, sizeof(__pyx_k_End_of_Arrow_stream), 0, 1, 0, 0},
  {&__pyx_kp_u_Expected_1_dimensional_array_for, __pyx_k_Expected_1_dimensional_array_for, sizeof(__pyx_k_Expected_1_dimensional_array_for), 0, 1, 0, 0},
  {&__pyx_kp_u_Expected_1_dimensional_array_for_2, __pyx_k_Expected_1_dimensional_array_for_2, sizeof(__pyx_k_Expected_1_dimensional_array_for_2), 0, 1, 0, 0},
  {&__pyx_kp_u_Expected_2_dimensional_array_for, __pyx_k_Expected_2_dimensional_array_for, sizeof(__pyx_k_Expected_2_dimensional_array_for), 0, 1, 0, 0},
  {&__pyx_kp_u_Expected_integer_or_string_index, __pyx_k_Expected_integer_or_string_index, sizeof(__pyx_k_Expected_integer_or_string_index), 0, 1, 0, 0},
  {&__pyx_kp_u_Expected_pandas_DataFrame_or_lis, __pyx_k_Expected_pandas_DataFrame_or_lis, sizeof(__pyx_k_Expected_pandas_DataFrame_or_lis), 0, 1, 0, 0},
  {&__pyx_kp_u_Expected_pandas_DataFrame_python, __pyx_k_Expected_pandas_DataFrame_python, sizeof(__pyx_k_Expected_pandas_DataFrame_python), 0, 1, 0, 0},
  {&__pyx_kp_u_Expected_scipy_sparse_coo_matrix, __pyx_k_Expected_scipy_sparse_coo_matrix, sizeof(__pyx_k_Expected_scipy_sparse_coo_matrix), 0, 1, 0, 0},
  {&__pyx_kp_u_Expected_scipy_sparse_csr_matrix, __pyx_k_Expected_scipy_sparse_csr_matrix, sizeof(__pyx_k_Expected_scipy_sparse_csr_matrix), 0, 1, 0, 0},
  {&__pyx_kp_u_Expected_sparse_COO_got, __pyx_k_Expected_sparse_COO_got, sizeof(__pyx_k_Expected_sparse_COO_got), 0, 1, 0, 0},
  {&__pyx_kp_u_Expected_storage_type_0_but_got, __pyx_k_Expected_storage_type_0_but_got, sizeof(__pyx_k_Expected_storage_type_0_but_got), 0, 1, 0, 0},
  {&__pyx_n_s_ExtensionArray, __pyx_k_ExtensionArray, sizeof(__pyx_k_ExtensionArray), 0, 0, 1, 1},
  {&__pyx_n_s_ExtensionDtype, __pyx_k_ExtensionDtype, sizeof(__pyx_k_ExtensionDtype), 0, 0, 1, 1},
  {&__pyx_n_s_ExtensionRegistryNanny, __pyx_k_ExtensionRegistryNanny, sizeof(__pyx_k_ExtensionRegistryNanny), 0, 0, 1, 1},
  {&__pyx_n_s_ExtensionType, __pyx_k_ExtensionType, sizeof(__pyx_k_ExtensionType), 0, 0, 1, 1},
  {&__pyx_n_s_FIXED_OFFSET_RE, __pyx_k_FIXED_OFFSET_RE, sizeof(__pyx_k_FIXED_OFFSET_RE), 0, 0, 1, 1},
  {&__pyx_kp_u_Failed_to_allocate_0_bytes, __pyx_k_Failed_to_allocate_0_bytes, sizeof(__pyx_k_Failed_to_allocate_0_bytes), 0, 1, 0, 0},
  {&__pyx_n_s_FeatherError, __pyx_k_FeatherError, sizeof(__pyx_k_FeatherError), 0, 0, 1, 1},
  {&__pyx_n_s_FeatherReader, __pyx_k_FeatherReader, sizeof(__pyx_k_FeatherReader), 0, 0, 1, 1},
  {&__pyx_n_s_FeatherWriter, __pyx_k_FeatherWriter, sizeof(__pyx_k_FeatherWriter), 0, 0, 1, 1},
  {&__pyx_n_s_Field, __pyx_k_Field, sizeof(__pyx_k_Field), 0, 0, 1, 1},
  {&__pyx_kp_u_File_object_is_malformed_has_no, __pyx_k_File_object_is_malformed_has_no, sizeof(__pyx_k_File_object_is_malformed_has_no), 0, 1, 0, 0},
  {&__pyx_kp_u_Filter_the_array_with_a_boolean, __pyx_k_Filter_the_array_with_a_boolean, sizeof(__pyx_k_Filter_the_array_with_a_boolean), 0, 1, 0, 0},
  {&__pyx_n_s_FixedOffset, __pyx_k_FixedOffset, sizeof(__pyx_k_FixedOffset), 0, 0, 1, 1},
  {&__pyx_n_s_FixedOffset_2, __pyx_k_FixedOffset_2, sizeof(__pyx_k_FixedOffset_2), 0, 0, 1, 1},
  {&__pyx_n_s_FixedSizeBinaryArray, __pyx_k_FixedSizeBinaryArray, sizeof(__pyx_k_FixedSizeBinaryArray), 0, 0, 1, 1},
  {&__pyx_n_s_FixedSizeBinaryType, __pyx_k_FixedSizeBinaryType, sizeof(__pyx_k_FixedSizeBinaryType), 0, 0, 1, 1},
  {&__pyx_n_s_FixedSizeBinaryValue, __pyx_k_FixedSizeBinaryValue, sizeof(__pyx_k_FixedSizeBinaryValue), 0, 0, 1, 1},
  {&__pyx_n_s_FixedSizeBufferWriter, __pyx_k_FixedSizeBufferWriter, sizeof(__pyx_k_FixedSizeBufferWriter), 0, 0, 1, 1},
  {&__pyx_n_s_FixedSizeListArray, __pyx_k_FixedSizeListArray, sizeof(__pyx_k_FixedSizeListArray), 0, 0, 1, 1},
  {&__pyx_n_s_FixedSizeListType, __pyx_k_FixedSizeListType, sizeof(__pyx_k_FixedSizeListType), 0, 0, 1, 1},
  {&__pyx_n_s_FixedSizeListValue, __pyx_k_FixedSizeListValue, sizeof(__pyx_k_FixedSizeListValue), 0, 0, 1, 1},
  {&__pyx_n_s_FixedSizeListValue___iter, __pyx_k_FixedSizeListValue___iter, sizeof(__pyx_k_FixedSizeListValue___iter), 0, 0, 1, 1},
  {&__pyx_n_s_FloatArray, __pyx_k_FloatArray, sizeof(__pyx_k_FloatArray), 0, 0, 1, 1},
  {&__pyx_n_s_FloatScalar, __pyx_k_FloatScalar, sizeof(__pyx_k_FloatScalar), 0, 0, 1, 1},
  {&__pyx_n_s_FloatValue, __pyx_k_FloatValue, sizeof(__pyx_k_FloatValue), 0, 0, 1, 1},
  {&__pyx_n_s_FloatingPointArray, __pyx_k_FloatingPointArray, sizeof(__pyx_k_FloatingPointArray), 0, 0, 1, 1},
  {&__pyx_n_s_Full, __pyx_k_Full, sizeof(__pyx_k_Full), 0, 0, 1, 1},
  {&__pyx_n_s_FunctionContext, __pyx_k_FunctionContext, sizeof(__pyx_k_FunctionContext), 0, 0, 1, 1},
  {&__pyx_n_s_FutureWarning, __pyx_k_FutureWarning, sizeof(__pyx_k_FutureWarning), 0, 0, 1, 1},
  {&__pyx_n_b_H, __pyx_k_H, sizeof(__pyx_k_H), 0, 0, 0, 1},
  {&__pyx_n_s_HDFS_PATH_RE, __pyx_k_HDFS_PATH_RE, sizeof(__pyx_k_HDFS_PATH_RE), 0, 0, 1, 1},
  {&__pyx_kp_u_HDFS_client_improperly_initializ, __pyx_k_HDFS_client_improperly_initializ, sizeof(__pyx_k_HDFS_client_improperly_initializ), 0, 1, 0, 0},
  {&__pyx_kp_u_HDFS_client_is_closed, __pyx_k_HDFS_client_is_closed, sizeof(__pyx_k_HDFS_client_is_closed), 0, 1, 0, 0},
  {&__pyx_n_s_HadoopFileSystem, __pyx_k_HadoopFileSystem, sizeof(__pyx_k_HadoopFileSystem), 0, 0, 1, 1},
  {&__pyx_n_s_HalfFloatArray, __pyx_k_HalfFloatArray, sizeof(__pyx_k_HalfFloatArray), 0, 0, 1, 1},
  {&__pyx_n_s_HalfFloatValue, __pyx_k_HalfFloatValue, sizeof(__pyx_k_HalfFloatValue), 0, 0, 1, 1},
  {&__pyx_n_s_HdfsFile, __pyx_k_HdfsFile, sizeof(__pyx_k_HdfsFile), 0, 0, 1, 1},
  {&__pyx_n_s_HdfsFileNanny, __pyx_k_HdfsFileNanny, sizeof(__pyx_k_HdfsFileNanny), 0, 0, 1, 1},
  {&__pyx_n_b_I, __pyx_k_I, sizeof(__pyx_k_I), 0, 0, 0, 1},
  {&__pyx_n_s_IOBase, __pyx_k_IOBase, sizeof(__pyx_k_IOBase), 0, 0, 1, 1},
  {&__pyx_n_s_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 0, 0, 1, 1},
  {&__pyx_kp_u_I_O_operation_on_closed_file, __pyx_k_I_O_operation_on_closed_file, sizeof(__pyx_k_I_O_operation_on_closed_file), 0, 1, 0, 0},
  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
  {&__pyx_kp_s_Incompatible_checksums_s_vs_0x3f, __pyx_k_Incompatible_checksums_s_vs_0x3f, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x3f), 0, 0, 1, 0},
  {&__pyx_kp_s_Incompatible_checksums_s_vs_0x59, __pyx_k_Incompatible_checksums_s_vs_0x59, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x59), 0, 0, 1, 0},
  {&__pyx_kp_s_Incompatible_checksums_s_vs_0x9a, __pyx_k_Incompatible_checksums_s_vs_0x9a, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x9a), 0, 0, 1, 0},
  {&__pyx_kp_s_Incompatible_checksums_s_vs_0xd4, __pyx_k_Incompatible_checksums_s_vs_0xd4, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xd4), 0, 0, 1, 0},
  {&__pyx_kp_u_Incompatible_storage_type_0_for, __pyx_k_Incompatible_storage_type_0_for, sizeof(__pyx_k_Incompatible_storage_type_0_for), 0, 1, 0, 0},
  {&__pyx_n_s_Index, __pyx_k_Index, sizeof(__pyx_k_Index), 0, 0, 1, 1},
  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
  {&__pyx_kp_u_Index_must_either_be_string_or_i, __pyx_k_Index_must_either_be_string_or_i, sizeof(__pyx_k_Index_must_either_be_string_or_i), 0, 1, 0, 0},
  {&__pyx_kp_u_Indices_must_be_integer_type, __pyx_k_Indices_must_be_integer_type, sizeof(__pyx_k_Indices_must_be_integer_type), 0, 1, 0, 0},
  {&__pyx_n_s_Int16Array, __pyx_k_Int16Array, sizeof(__pyx_k_Int16Array), 0, 0, 1, 1},
  {&__pyx_n_s_Int16Scalar, __pyx_k_Int16Scalar, sizeof(__pyx_k_Int16Scalar), 0, 0, 1, 1},
  {&__pyx_n_s_Int16Value, __pyx_k_Int16Value, sizeof(__pyx_k_Int16Value), 0, 0, 1, 1},
  {&__pyx_n_s_Int32Array, __pyx_k_Int32Array, sizeof(__pyx_k_Int32Array), 0, 0, 1, 1},
  {&__pyx_n_s_Int32Scalar, __pyx_k_Int32Scalar, sizeof(__pyx_k_Int32Scalar), 0, 0, 1, 1},
  {&__pyx_n_s_Int32Value, __pyx_k_Int32Value, sizeof(__pyx_k_Int32Value), 0, 0, 1, 1},
  {&__pyx_n_s_Int64Array, __pyx_k_Int64Array, sizeof(__pyx_k_Int64Array), 0, 0, 1, 1},
  {&__pyx_n_s_Int64Scalar, __pyx_k_Int64Scalar, sizeof(__pyx_k_Int64Scalar), 0, 0, 1, 1},
  {&__pyx_n_s_Int64Value, __pyx_k_Int64Value, sizeof(__pyx_k_Int64Value), 0, 0, 1, 1},
  {&__pyx_n_s_Int8Array, __pyx_k_Int8Array, sizeof(__pyx_k_Int8Array), 0, 0, 1, 1},
  {&__pyx_n_s_Int8Scalar, __pyx_k_Int8Scalar, sizeof(__pyx_k_Int8Scalar), 0, 0, 1, 1},
  {&__pyx_n_s_Int8Value, __pyx_k_Int8Value, sizeof(__pyx_k_Int8Value), 0, 0, 1, 1},
  {&__pyx_n_s_IntegerArray, __pyx_k_IntegerArray, sizeof(__pyx_k_IntegerArray), 0, 0, 1, 1},
  {&__pyx_n_s_IntervalDtype, __pyx_k_IntervalDtype, sizeof(__pyx_k_IntervalDtype), 0, 0, 1, 1},
  {&__pyx_kp_u_Invalid_TimeUnit_for_time32, __pyx_k_Invalid_TimeUnit_for_time32, sizeof(__pyx_k_Invalid_TimeUnit_for_time32), 0, 1, 0, 0},
  {&__pyx_kp_u_Invalid_TimeUnit_for_time64, __pyx_k_Invalid_TimeUnit_for_time64, sizeof(__pyx_k_Invalid_TimeUnit_for_time64), 0, 1, 0, 0},
  {&__pyx_kp_u_Invalid_TimeUnit_string, __pyx_k_Invalid_TimeUnit_string, sizeof(__pyx_k_Invalid_TimeUnit_string), 0, 1, 0, 0},
  {&__pyx_kp_u_Invalid_file_mode_0, __pyx_k_Invalid_file_mode_0, sizeof(__pyx_k_Invalid_file_mode_0), 0, 1, 0, 0},
  {&__pyx_kp_u_Invalid_union_mode_0_r, __pyx_k_Invalid_union_mode_0_r, sizeof(__pyx_k_Invalid_union_mode_0_r), 0, 1, 0, 0},
  {&__pyx_kp_u_Invalid_value_for_compression_r, __pyx_k_Invalid_value_for_compression_r, sizeof(__pyx_k_Invalid_value_for_compression_r), 0, 1, 0, 0},
  {&__pyx_kp_u_Invalid_value_of_whence_0, __pyx_k_Invalid_value_of_whence_0, sizeof(__pyx_k_Invalid_value_of_whence_0), 0, 1, 0, 0},
  {&__pyx_n_s_K, __pyx_k_K, sizeof(__pyx_k_K), 0, 0, 1, 1},
  {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
  {&__pyx_n_s_LargeBinaryArray, __pyx_k_LargeBinaryArray, sizeof(__pyx_k_LargeBinaryArray), 0, 0, 1, 1},
  {&__pyx_n_s_LargeBinaryValue, __pyx_k_LargeBinaryValue, sizeof(__pyx_k_LargeBinaryValue), 0, 0, 1, 1},
  {&__pyx_n_s_LargeListArray, __pyx_k_LargeListArray, sizeof(__pyx_k_LargeListArray), 0, 0, 1, 1},
  {&__pyx_n_s_LargeListType, __pyx_k_LargeListType, sizeof(__pyx_k_LargeListType), 0, 0, 1, 1},
  {&__pyx_n_s_LargeListValue, __pyx_k_LargeListValue, sizeof(__pyx_k_LargeListValue), 0, 0, 1, 1},
  {&__pyx_n_s_LargeListValue___iter, __pyx_k_LargeListValue___iter, sizeof(__pyx_k_LargeListValue___iter), 0, 0, 1, 1},
  {&__pyx_n_s_LargeStringArray, __pyx_k_LargeStringArray, sizeof(__pyx_k_LargeStringArray), 0, 0, 1, 1},
  {&__pyx_n_s_LargeStringValue, __pyx_k_LargeStringValue, sizeof(__pyx_k_LargeStringValue), 0, 0, 1, 1},
  {&__pyx_kp_u_Length_of_names_does_not_match_l, __pyx_k_Length_of_names_does_not_match_l, sizeof(__pyx_k_Length_of_names_does_not_match_l), 0, 1, 0, 0},
  {&__pyx_n_s_ListArray, __pyx_k_ListArray, sizeof(__pyx_k_ListArray), 0, 0, 1, 1},
  {&__pyx_n_s_ListType, __pyx_k_ListType, sizeof(__pyx_k_ListType), 0, 0, 1, 1},
  {&__pyx_n_s_ListValue, __pyx_k_ListValue, sizeof(__pyx_k_ListValue), 0, 0, 1, 1},
  {&__pyx_n_s_ListValue___iter, __pyx_k_ListValue___iter, sizeof(__pyx_k_ListValue___iter), 0, 0, 1, 1},
  {&__pyx_kp_u_List_requires_DataType_or_Field, __pyx_k_List_requires_DataType_or_Field, sizeof(__pyx_k_List_requires_DataType_or_Field), 0, 1, 0, 0},
  {&__pyx_n_s_LoggingMemoryPool, __pyx_k_LoggingMemoryPool, sizeof(__pyx_k_LoggingMemoryPool), 0, 0, 1, 1},
  {&__pyx_n_s_LooseVersion, __pyx_k_LooseVersion, sizeof(__pyx_k_LooseVersion), 0, 0, 1, 1},
  {&__pyx_n_s_MapArray, __pyx_k_MapArray, sizeof(__pyx_k_MapArray), 0, 0, 1, 1},
  {&__pyx_n_s_MapType, __pyx_k_MapType, sizeof(__pyx_k_MapType), 0, 0, 1, 1},
  {&__pyx_n_s_MapValue, __pyx_k_MapValue, sizeof(__pyx_k_MapValue), 0, 0, 1, 1},
  {&__pyx_n_s_MapValue___iter, __pyx_k_MapValue___iter, sizeof(__pyx_k_MapValue___iter), 0, 0, 1, 1},
  {&__pyx_n_s_Mapping, __pyx_k_Mapping, sizeof(__pyx_k_Mapping), 0, 0, 1, 1},
  {&__pyx_n_s_MaskedArray, __pyx_k_MaskedArray, sizeof(__pyx_k_MaskedArray), 0, 0, 1, 1},
  {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
  {&__pyx_n_s_MemoryMappedFile, __pyx_k_MemoryMappedFile, sizeof(__pyx_k_MemoryMappedFile), 0, 0, 1, 1},
  {&__pyx_n_s_MemoryPool, __pyx_k_MemoryPool, sizeof(__pyx_k_MemoryPool), 0, 0, 1, 1},
  {&__pyx_n_s_Message, __pyx_k_Message, sizeof(__pyx_k_Message), 0, 0, 1, 1},
  {&__pyx_n_s_MessageReader, __pyx_k_MessageReader, sizeof(__pyx_k_MessageReader), 0, 0, 1, 1},
  {&__pyx_n_s_MessageReader___iter, __pyx_k_MessageReader___iter, sizeof(__pyx_k_MessageReader___iter), 0, 0, 1, 1},
  {&__pyx_kp_u_Metadata_must_be_an_instance_of, __pyx_k_Metadata_must_be_an_instance_of, sizeof(__pyx_k_Metadata_must_be_an_instance_of), 0, 1, 0, 0},
  {&__pyx_n_s_MockOutputStream, __pyx_k_MockOutputStream, sizeof(__pyx_k_MockOutputStream), 0, 0, 1, 1},
  {&__pyx_kp_u_Mode_must_be_rb_read_wb_write_ne, __pyx_k_Mode_must_be_rb_read_wb_write_ne, sizeof(__pyx_k_Mode_must_be_rb_read_wb_write_ne), 0, 1, 0, 0},
  {&__pyx_kp_u_Must_be_an_instance_of_datetime, __pyx_k_Must_be_an_instance_of_datetime, sizeof(__pyx_k_Must_be_an_instance_of_datetime), 0, 1, 0, 0},
  {&__pyx_kp_u_Must_pass_decompressed_size_for, __pyx_k_Must_pass_decompressed_size_for, sizeof(__pyx_k_Must_pass_decompressed_size_for), 0, 1, 0, 0},
  {&__pyx_kp_u_Must_pass_either_names_or_fields, __pyx_k_Must_pass_either_names_or_fields, sizeof(__pyx_k_Must_pass_either_names_or_fields), 0, 1, 0, 0},
  {&__pyx_kp_u_Must_pass_either_names_or_fields_2, __pyx_k_Must_pass_either_names_or_fields_2, sizeof(__pyx_k_Must_pass_either_names_or_fields_2), 0, 1, 0, 0},
  {&__pyx_kp_u_Must_pass_names_or_schema_to_Tab, __pyx_k_Must_pass_names_or_schema_to_Tab, sizeof(__pyx_k_Must_pass_names_or_schema_to_Tab), 0, 1, 0, 0},
  {&__pyx_kp_u_Must_pass_schema_or_at_least_one, __pyx_k_Must_pass_schema_or_at_least_one, sizeof(__pyx_k_Must_pass_schema_or_at_least_one), 0, 1, 0, 0},
  {&__pyx_n_s_NA, __pyx_k_NA, sizeof(__pyx_k_NA), 0, 0, 1, 1},
  {&__pyx_n_s_NAType, __pyx_k_NAType, sizeof(__pyx_k_NAType), 0, 0, 1, 1},
  {&__pyx_n_u_NULL, __pyx_k_NULL, sizeof(__pyx_k_NULL), 0, 1, 0, 1},
  {&__pyx_n_s_NULL_2, __pyx_k_NULL_2, sizeof(__pyx_k_NULL_2), 0, 0, 1, 1},
  {&__pyx_kp_u_Nanosecond_duration_is_not_safel, __pyx_k_Nanosecond_duration_is_not_safel, sizeof(__pyx_k_Nanosecond_duration_is_not_safel), 0, 1, 0, 0},
  {&__pyx_kp_u_Nanosecond_timestamp_is_not_safe, __pyx_k_Nanosecond_timestamp_is_not_safe, sizeof(__pyx_k_Nanosecond_timestamp_is_not_safe), 0, 1, 0, 0},
  {&__pyx_n_s_NativeFile, __pyx_k_NativeFile, sizeof(__pyx_k_NativeFile), 0, 0, 1, 1},
  {&__pyx_kp_u_No_type_alias_for_0, __pyx_k_No_type_alias_for_0, sizeof(__pyx_k_No_type_alias_for_0), 0, 1, 0, 0},
  {&__pyx_kp_u_Non_fixed_width_type, __pyx_k_Non_fixed_width_type, sizeof(__pyx_k_Non_fixed_width_type), 0, 1, 0, 0},
  {&__pyx_n_u_None, __pyx_k_None, sizeof(__pyx_k_None), 0, 1, 0, 1},
  {&__pyx_n_s_NotImplemented, __pyx_k_NotImplemented, sizeof(__pyx_k_NotImplemented), 0, 0, 1, 1},
  {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1},
  {&__pyx_n_s_NullArray, __pyx_k_NullArray, sizeof(__pyx_k_NullArray), 0, 0, 1, 1},
  {&__pyx_n_s_NullType, __pyx_k_NullType, sizeof(__pyx_k_NullType), 0, 0, 1, 1},
  {&__pyx_n_s_NumericArray, __pyx_k_NumericArray, sizeof(__pyx_k_NumericArray), 0, 0, 1, 1},
  {&__pyx_n_s_OSFile, __pyx_k_OSFile, sizeof(__pyx_k_OSFile), 0, 0, 1, 1},
  {&__pyx_kp_u_Offset_must_be_non_negative, __pyx_k_Offset_must_be_non_negative, sizeof(__pyx_k_Offset_must_be_non_negative), 0, 1, 0, 0},
  {&__pyx_kp_u_Offset_must_represent_whole_numb, __pyx_k_Offset_must_represent_whole_numb, sizeof(__pyx_k_Offset_must_represent_whole_numb), 0, 1, 0, 0},
  {&__pyx_kp_u_Only_extension_types_can_be_regi, __pyx_k_Only_extension_types_can_be_regi, sizeof(__pyx_k_Only_extension_types_can_be_regi), 0, 1, 0, 0},
  {&__pyx_n_s_PY3, __pyx_k_PY3, sizeof(__pyx_k_PY3), 0, 0, 1, 1},
  {&__pyx_n_s_PandasAPIShim, __pyx_k_PandasAPIShim, sizeof(__pyx_k_PandasAPIShim), 0, 0, 1, 1},
  {&__pyx_n_s_PandasConvertible, __pyx_k_PandasConvertible, sizeof(__pyx_k_PandasConvertible), 0, 0, 1, 1},
  {&__pyx_n_s_PeriodDtype, __pyx_k_PeriodDtype, sizeof(__pyx_k_PeriodDtype), 0, 0, 1, 1},
  {&__pyx_n_s_PickleBuffer, __pyx_k_PickleBuffer, sizeof(__pyx_k_PickleBuffer), 0, 0, 1, 1},
  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
  {&__pyx_kp_u_Please_implement_0___reduce, __pyx_k_Please_implement_0___reduce, sizeof(__pyx_k_Please_implement_0___reduce), 0, 1, 0, 0},
  {&__pyx_kp_u_Please_use_read_next_batch_inste, __pyx_k_Please_use_read_next_batch_inste, sizeof(__pyx_k_Please_use_read_next_batch_inste), 0, 1, 0, 0},
  {&__pyx_n_s_ProxyMemoryPool, __pyx_k_ProxyMemoryPool, sizeof(__pyx_k_ProxyMemoryPool), 0, 0, 1, 1},
  {&__pyx_n_s_PyExtensionType, __pyx_k_PyExtensionType, sizeof(__pyx_k_PyExtensionType), 0, 0, 1, 1},
  {&__pyx_n_s_PythonFile, __pyx_k_PythonFile, sizeof(__pyx_k_PythonFile), 0, 0, 1, 1},
  {&__pyx_n_b_Q, __pyx_k_Q, sizeof(__pyx_k_Q), 0, 0, 0, 1},
  {&__pyx_n_s_Queue, __pyx_k_Queue, sizeof(__pyx_k_Queue), 0, 0, 1, 1},
  {&__pyx_n_s_QueueEmpty, __pyx_k_QueueEmpty, sizeof(__pyx_k_QueueEmpty), 0, 0, 1, 1},
  {&__pyx_n_s_QueueFull, __pyx_k_QueueFull, sizeof(__pyx_k_QueueFull), 0, 0, 1, 1},
  {&__pyx_n_s_RecordBatch, __pyx_k_RecordBatch, sizeof(__pyx_k_RecordBatch), 0, 0, 1, 1},
  {&__pyx_n_s_RecordBatchFileReader, __pyx_k_RecordBatchFileReader, sizeof(__pyx_k_RecordBatchFileReader), 0, 0, 1, 1},
  {&__pyx_n_s_RecordBatchFileWriter, __pyx_k_RecordBatchFileWriter, sizeof(__pyx_k_RecordBatchFileWriter), 0, 0, 1, 1},
  {&__pyx_n_s_RecordBatchStreamReader, __pyx_k_RecordBatchStreamReader, sizeof(__pyx_k_RecordBatchStreamReader), 0, 0, 1, 1},
  {&__pyx_n_s_RecordBatchStreamWriter, __pyx_k_RecordBatchStreamWriter, sizeof(__pyx_k_RecordBatchStreamWriter), 0, 0, 1, 1},
  {&__pyx_n_s_ResizableBuffer, __pyx_k_ResizableBuffer, sizeof(__pyx_k_ResizableBuffer), 0, 0, 1, 1},
  {&__pyx_kp_u_Returns_implied_schema_from_dat, __pyx_k_Returns_implied_schema_from_dat, sizeof(__pyx_k_Returns_implied_schema_from_dat), 0, 1, 0, 0},
  {&__pyx_n_s_Scalar, __pyx_k_Scalar, sizeof(__pyx_k_Scalar), 0, 0, 1, 1},
  {&__pyx_n_s_ScalarValue, __pyx_k_ScalarValue, sizeof(__pyx_k_ScalarValue), 0, 0, 1, 1},
  {&__pyx_kp_u_Scalar_data_type_was_NULL, __pyx_k_Scalar_data_type_was_NULL, sizeof(__pyx_k_Scalar_data_type_was_NULL), 0, 1, 0, 0},
  {&__pyx_kp_u_Scalar_was_NULL, __pyx_k_Scalar_was_NULL, sizeof(__pyx_k_Scalar_was_NULL), 0, 1, 0, 0},
  {&__pyx_n_s_Schema, __pyx_k_Schema, sizeof(__pyx_k_Schema), 0, 0, 1, 1},
  {&__pyx_n_s_Schema___iter, __pyx_k_Schema___iter, sizeof(__pyx_k_Schema___iter), 0, 0, 1, 1},
  {&__pyx_kp_u_Schema_and_number_of_arrays_uneq, __pyx_k_Schema_and_number_of_arrays_uneq, sizeof(__pyx_k_Schema_and_number_of_arrays_uneq), 0, 1, 0, 0},
  {&__pyx_kp_u_Schema_field_name_corresponds_to, __pyx_k_Schema_field_name_corresponds_to, sizeof(__pyx_k_Schema_field_name_corresponds_to), 0, 1, 0, 0},
  {&__pyx_kp_u_Schema_from_pandas_line_1045, __pyx_k_Schema_from_pandas_line_1045, sizeof(__pyx_k_Schema_from_pandas_line_1045), 0, 1, 0, 0},
  {&__pyx_kp_u_Schema_must_be_an_instance_of_py, __pyx_k_Schema_must_be_an_instance_of_py, sizeof(__pyx_k_Schema_must_be_an_instance_of_py), 0, 1, 0, 0},
  {&__pyx_kp_u_Schema_passed_to_names_option_pl, __pyx_k_Schema_passed_to_names_option_pl, sizeof(__pyx_k_Schema_passed_to_names_option_pl), 0, 1, 0, 0},
  {&__pyx_n_s_SerializationCallbackError, __pyx_k_SerializationCallbackError, sizeof(__pyx_k_SerializationCallbackError), 0, 0, 1, 1},
  {&__pyx_n_s_SerializationCallbackError___ini, __pyx_k_SerializationCallbackError___ini, sizeof(__pyx_k_SerializationCallbackError___ini), 0, 0, 1, 1},
  {&__pyx_n_s_SerializationContext, __pyx_k_SerializationContext, sizeof(__pyx_k_SerializationContext), 0, 0, 1, 1},
  {&__pyx_n_s_SerializedPyObject, __pyx_k_SerializedPyObject, sizeof(__pyx_k_SerializedPyObject), 0, 0, 1, 1},
  {&__pyx_n_s_Series, __pyx_k_Series, sizeof(__pyx_k_Series), 0, 0, 1, 1},
  {&__pyx_n_s_SparseCOOTensor, __pyx_k_SparseCOOTensor, sizeof(__pyx_k_SparseCOOTensor), 0, 0, 1, 1},
  {&__pyx_n_s_SparseCOOTensor___get___locals_g, __pyx_k_SparseCOOTensor___get___locals_g, sizeof(__pyx_k_SparseCOOTensor___get___locals_g), 0, 0, 1, 1},
  {&__pyx_kp_u_SparseCOOTensor_was_NULL, __pyx_k_SparseCOOTensor_was_NULL, sizeof(__pyx_k_SparseCOOTensor_was_NULL), 0, 1, 0, 0},
  {&__pyx_n_s_SparseCSRMatrix, __pyx_k_SparseCSRMatrix, sizeof(__pyx_k_SparseCSRMatrix), 0, 0, 1, 1},
  {&__pyx_n_s_SparseCSRMatrix___get___locals_g, __pyx_k_SparseCSRMatrix___get___locals_g, sizeof(__pyx_k_SparseCSRMatrix___get___locals_g), 0, 0, 1, 1},
  {&__pyx_kp_u_SparseCSRMatrix_was_NULL, __pyx_k_SparseCSRMatrix_was_NULL, sizeof(__pyx_k_SparseCSRMatrix_was_NULL), 0, 1, 0, 0},
  {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1},
  {&__pyx_n_s_StringArray, __pyx_k_StringArray, sizeof(__pyx_k_StringArray), 0, 0, 1, 1},
  {&__pyx_n_s_StringBuilder, __pyx_k_StringBuilder, sizeof(__pyx_k_StringBuilder), 0, 0, 1, 1},
  {&__pyx_kp_u_StringBuilder_only_accepts_strin, __pyx_k_StringBuilder_only_accepts_strin, sizeof(__pyx_k_StringBuilder_only_accepts_strin), 0, 1, 0, 0},
  {&__pyx_n_s_StringValue, __pyx_k_StringValue, sizeof(__pyx_k_StringValue), 0, 0, 1, 1},
  {&__pyx_n_s_StructArray, __pyx_k_StructArray, sizeof(__pyx_k_StructArray), 0, 0, 1, 1},
  {&__pyx_n_s_StructType, __pyx_k_StructType, sizeof(__pyx_k_StructType), 0, 0, 1, 1},
  {&__pyx_n_s_StructType___iter, __pyx_k_StructType___iter, sizeof(__pyx_k_StructType___iter), 0, 0, 1, 1},
  {&__pyx_n_s_StructValue, __pyx_k_StructValue, sizeof(__pyx_k_StructValue), 0, 0, 1, 1},
  {&__pyx_kp_u_Struct_field_name_corresponds_to, __pyx_k_Struct_field_name_corresponds_to, sizeof(__pyx_k_Struct_field_name_corresponds_to), 0, 1, 0, 0},
  {&__pyx_n_s_SystemError, __pyx_k_SystemError, sizeof(__pyx_k_SystemError), 0, 0, 1, 1},
  {&__pyx_n_s_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 1, 1},
  {&__pyx_n_s_Table, __pyx_k_Table, sizeof(__pyx_k_Table), 0, 0, 1, 1},
  {&__pyx_kp_u_Table_from_pandas_line_1118, __pyx_k_Table_from_pandas_line_1118, sizeof(__pyx_k_Table_from_pandas_line_1118), 0, 1, 0, 0},
  {&__pyx_n_s_Table_itercolumns, __pyx_k_Table_itercolumns, sizeof(__pyx_k_Table_itercolumns), 0, 0, 1, 1},
  {&__pyx_kp_u_Table_s_internal_pointer_is_NULL, __pyx_k_Table_s_internal_pointer_is_NULL, sizeof(__pyx_k_Table_s_internal_pointer_is_NULL), 0, 1, 0, 0},
  {&__pyx_kp_u_Take_elements_from_an_array_The, __pyx_k_Take_elements_from_an_array_The, sizeof(__pyx_k_Take_elements_from_an_array_The), 0, 1, 0, 0},
  {&__pyx_kp_u_Target_schema_s_field_names_are, __pyx_k_Target_schema_s_field_names_are, sizeof(__pyx_k_Target_schema_s_field_names_are), 0, 1, 0, 0},
  {&__pyx_n_s_Tensor, __pyx_k_Tensor, sizeof(__pyx_k_Tensor), 0, 0, 1, 1},
  {&__pyx_kp_u_Tensor_was_NULL, __pyx_k_Tensor_was_NULL, sizeof(__pyx_k_Tensor_was_NULL), 0, 1, 0, 0},
  {&__pyx_n_s_TextIOBase, __pyx_k_TextIOBase, sizeof(__pyx_k_TextIOBase), 0, 0, 1, 1},
  {&__pyx_kp_u_The_add_metadata_method_is_depre, __pyx_k_The_add_metadata_method_is_depre, sizeof(__pyx_k_The_add_metadata_method_is_depre), 0, 1, 0, 0},
  {&__pyx_kp_u_The_dictionary_index_type_should, __pyx_k_The_dictionary_index_type_should, sizeof(__pyx_k_The_dictionary_index_type_should), 0, 1, 0, 0},
  {&__pyx_kp_u_The_dtype_of_the_categories_of_t, __pyx_k_The_dtype_of_the_categories_of_t, sizeof(__pyx_k_The_dtype_of_the_categories_of_t), 0, 1, 0, 0},
  {&__pyx_kp_u_The_field_by_name_method_is_depr, __pyx_k_The_field_by_name_method_is_depr, sizeof(__pyx_k_The_field_by_name_method_is_depr), 0, 1, 0, 0},
  {&__pyx_kp_u_The_names_and_metadata_arguments, __pyx_k_The_names_and_metadata_arguments, sizeof(__pyx_k_The_names_and_metadata_arguments), 0, 1, 0, 0},
  {&__pyx_kp_u_The_names_argument_is_not_valid, __pyx_k_The_names_argument_is_not_valid, sizeof(__pyx_k_The_names_argument_is_not_valid), 0, 1, 0, 0},
  {&__pyx_kp_u_The_object_s___arrow_array___met, __pyx_k_The_object_s___arrow_array___met, sizeof(__pyx_k_The_object_s___arrow_array___met), 0, 1, 0, 0},
  {&__pyx_kp_u_The_ordered_flag_of_the_passed_c, __pyx_k_The_ordered_flag_of_the_passed_c, sizeof(__pyx_k_The_ordered_flag_of_the_passed_c), 0, 1, 0, 0},
  {&__pyx_kp_u_The_parameter_chunksize_is_depre, __pyx_k_The_parameter_chunksize_is_depre, sizeof(__pyx_k_The_parameter_chunksize_is_depre), 0, 1, 0, 0},
  {&__pyx_kp_u_The_parameter_chunksize_is_depre_2, __pyx_k_The_parameter_chunksize_is_depre_2, sizeof(__pyx_k_The_parameter_chunksize_is_depre_2), 0, 1, 0, 0},
  {&__pyx_kp_u_The_passed_mapping_doesn_t_conta, __pyx_k_The_passed_mapping_doesn_t_conta, sizeof(__pyx_k_The_passed_mapping_doesn_t_conta), 0, 1, 0, 0},
  {&__pyx_kp_u_The_type_id_argument_must_be_a_s, __pyx_k_The_type_id_argument_must_be_a_s, sizeof(__pyx_k_The_type_id_argument_must_be_a_s), 0, 1, 0, 0},
  {&__pyx_n_s_Thread, __pyx_k_Thread, sizeof(__pyx_k_Thread), 0, 0, 1, 1},
  {&__pyx_n_s_Time32Array, __pyx_k_Time32Array, sizeof(__pyx_k_Time32Array), 0, 0, 1, 1},
  {&__pyx_n_s_Time32Type, __pyx_k_Time32Type, sizeof(__pyx_k_Time32Type), 0, 0, 1, 1},
  {&__pyx_n_s_Time32Value, __pyx_k_Time32Value, sizeof(__pyx_k_Time32Value), 0, 0, 1, 1},
  {&__pyx_n_s_Time64Array, __pyx_k_Time64Array, sizeof(__pyx_k_Time64Array), 0, 0, 1, 1},
  {&__pyx_n_s_Time64Type, __pyx_k_Time64Type, sizeof(__pyx_k_Time64Type), 0, 0, 1, 1},
  {&__pyx_n_s_Time64Value, __pyx_k_Time64Value, sizeof(__pyx_k_Time64Value), 0, 0, 1, 1},
  {&__pyx_n_s_Timedelta, __pyx_k_Timedelta, sizeof(__pyx_k_Timedelta), 0, 0, 1, 1},
  {&__pyx_n_s_Timestamp, __pyx_k_Timestamp, sizeof(__pyx_k_Timestamp), 0, 0, 1, 1},
  {&__pyx_n_s_TimestampArray, __pyx_k_TimestampArray, sizeof(__pyx_k_TimestampArray), 0, 0, 1, 1},
  {&__pyx_n_s_TimestampType, __pyx_k_TimestampType, sizeof(__pyx_k_TimestampType), 0, 0, 1, 1},
  {&__pyx_n_s_TimestampValue, __pyx_k_TimestampValue, sizeof(__pyx_k_TimestampValue), 0, 0, 1, 1},
  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
  {&__pyx_n_s_Type_BINARY, __pyx_k_Type_BINARY, sizeof(__pyx_k_Type_BINARY), 0, 0, 1, 1},
  {&__pyx_n_s_Type_BOOL, __pyx_k_Type_BOOL, sizeof(__pyx_k_Type_BOOL), 0, 0, 1, 1},
  {&__pyx_n_s_Type_DATE32, __pyx_k_Type_DATE32, sizeof(__pyx_k_Type_DATE32), 0, 0, 1, 1},
  {&__pyx_n_s_Type_DATE64, __pyx_k_Type_DATE64, sizeof(__pyx_k_Type_DATE64), 0, 0, 1, 1},
  {&__pyx_n_s_Type_DECIMAL, __pyx_k_Type_DECIMAL, sizeof(__pyx_k_Type_DECIMAL), 0, 0, 1, 1},
  {&__pyx_n_s_Type_DICTIONARY, __pyx_k_Type_DICTIONARY, sizeof(__pyx_k_Type_DICTIONARY), 0, 0, 1, 1},
  {&__pyx_n_s_Type_DOUBLE, __pyx_k_Type_DOUBLE, sizeof(__pyx_k_Type_DOUBLE), 0, 0, 1, 1},
  {&__pyx_n_s_Type_DURATION, __pyx_k_Type_DURATION, sizeof(__pyx_k_Type_DURATION), 0, 0, 1, 1},
  {&__pyx_n_s_Type_FIXED_SIZE_BINARY, __pyx_k_Type_FIXED_SIZE_BINARY, sizeof(__pyx_k_Type_FIXED_SIZE_BINARY), 0, 0, 1, 1},
  {&__pyx_n_s_Type_FIXED_SIZE_LIST, __pyx_k_Type_FIXED_SIZE_LIST, sizeof(__pyx_k_Type_FIXED_SIZE_LIST), 0, 0, 1, 1},
  {&__pyx_n_s_Type_FLOAT, __pyx_k_Type_FLOAT, sizeof(__pyx_k_Type_FLOAT), 0, 0, 1, 1},
  {&__pyx_n_s_Type_HALF_FLOAT, __pyx_k_Type_HALF_FLOAT, sizeof(__pyx_k_Type_HALF_FLOAT), 0, 0, 1, 1},
  {&__pyx_kp_u_Type_ID, __pyx_k_Type_ID, sizeof(__pyx_k_Type_ID), 0, 1, 0, 0},
  {&__pyx_n_s_Type_INT16, __pyx_k_Type_INT16, sizeof(__pyx_k_Type_INT16), 0, 0, 1, 1},
  {&__pyx_n_s_Type_INT32, __pyx_k_Type_INT32, sizeof(__pyx_k_Type_INT32), 0, 0, 1, 1},
  {&__pyx_n_s_Type_INT64, __pyx_k_Type_INT64, sizeof(__pyx_k_Type_INT64), 0, 0, 1, 1},
  {&__pyx_n_s_Type_INT8, __pyx_k_Type_INT8, sizeof(__pyx_k_Type_INT8), 0, 0, 1, 1},
  {&__pyx_n_s_Type_LARGE_BINARY, __pyx_k_Type_LARGE_BINARY, sizeof(__pyx_k_Type_LARGE_BINARY), 0, 0, 1, 1},
  {&__pyx_n_s_Type_LARGE_LIST, __pyx_k_Type_LARGE_LIST, sizeof(__pyx_k_Type_LARGE_LIST), 0, 0, 1, 1},
  {&__pyx_n_s_Type_LARGE_STRING, __pyx_k_Type_LARGE_STRING, sizeof(__pyx_k_Type_LARGE_STRING), 0, 0, 1, 1},
  {&__pyx_n_s_Type_LIST, __pyx_k_Type_LIST, sizeof(__pyx_k_Type_LIST), 0, 0, 1, 1},
  {&__pyx_n_s_Type_MAP, __pyx_k_Type_MAP, sizeof(__pyx_k_Type_MAP), 0, 0, 1, 1},
  {&__pyx_n_s_Type_NA, __pyx_k_Type_NA, sizeof(__pyx_k_Type_NA), 0, 0, 1, 1},
  {&__pyx_n_s_Type_STRING, __pyx_k_Type_STRING, sizeof(__pyx_k_Type_STRING), 0, 0, 1, 1},
  {&__pyx_n_s_Type_STRUCT, __pyx_k_Type_STRUCT, sizeof(__pyx_k_Type_STRUCT), 0, 0, 1, 1},
  {&__pyx_n_s_Type_TIME32, __pyx_k_Type_TIME32, sizeof(__pyx_k_Type_TIME32), 0, 0, 1, 1},
  {&__pyx_n_s_Type_TIME64, __pyx_k_Type_TIME64, sizeof(__pyx_k_Type_TIME64), 0, 0, 1, 1},
  {&__pyx_n_s_Type_TIMESTAMP, __pyx_k_Type_TIMESTAMP, sizeof(__pyx_k_Type_TIMESTAMP), 0, 0, 1, 1},
  {&__pyx_n_s_Type_UINT16, __pyx_k_Type_UINT16, sizeof(__pyx_k_Type_UINT16), 0, 0, 1, 1},
  {&__pyx_n_s_Type_UINT32, __pyx_k_Type_UINT32, sizeof(__pyx_k_Type_UINT32), 0, 0, 1, 1},
  {&__pyx_n_s_Type_UINT64, __pyx_k_Type_UINT64, sizeof(__pyx_k_Type_UINT64), 0, 0, 1, 1},
  {&__pyx_n_s_Type_UINT8, __pyx_k_Type_UINT8, sizeof(__pyx_k_Type_UINT8), 0, 0, 1, 1},
  {&__pyx_n_s_Type_UNION, __pyx_k_Type_UNION, sizeof(__pyx_k_Type_UNION), 0, 0, 1, 1},
  {&__pyx_kp_u_Type_s_expected_number_of_buffer, __pyx_k_Type_s_expected_number_of_buffer, sizeof(__pyx_k_Type_s_expected_number_of_buffer), 0, 1, 0, 0},
  {&__pyx_kp_u_Type_s_expected_number_of_childr, __pyx_k_Type_s_expected_number_of_childr, sizeof(__pyx_k_Type_s_expected_number_of_childr), 0, 1, 0, 0},
  {&__pyx_n_s_UInt16Array, __pyx_k_UInt16Array, sizeof(__pyx_k_UInt16Array), 0, 0, 1, 1},
  {&__pyx_n_s_UInt16Scalar, __pyx_k_UInt16Scalar, sizeof(__pyx_k_UInt16Scalar), 0, 0, 1, 1},
  {&__pyx_n_s_UInt16Value, __pyx_k_UInt16Value, sizeof(__pyx_k_UInt16Value), 0, 0, 1, 1},
  {&__pyx_n_s_UInt32Array, __pyx_k_UInt32Array, sizeof(__pyx_k_UInt32Array), 0, 0, 1, 1},
  {&__pyx_n_s_UInt32Scalar, __pyx_k_UInt32Scalar, sizeof(__pyx_k_UInt32Scalar), 0, 0, 1, 1},
  {&__pyx_n_s_UInt32Value, __pyx_k_UInt32Value, sizeof(__pyx_k_UInt32Value), 0, 0, 1, 1},
  {&__pyx_n_s_UInt64Array, __pyx_k_UInt64Array, sizeof(__pyx_k_UInt64Array), 0, 0, 1, 1},
  {&__pyx_n_s_UInt64Scalar, __pyx_k_UInt64Scalar, sizeof(__pyx_k_UInt64Scalar), 0, 0, 1, 1},
  {&__pyx_n_s_UInt64Value, __pyx_k_UInt64Value, sizeof(__pyx_k_UInt64Value), 0, 0, 1, 1},
  {&__pyx_n_s_UInt8Array, __pyx_k_UInt8Array, sizeof(__pyx_k_UInt8Array), 0, 0, 1, 1},
  {&__pyx_n_s_UInt8Scalar, __pyx_k_UInt8Scalar, sizeof(__pyx_k_UInt8Scalar), 0, 0, 1, 1},
  {&__pyx_n_s_UInt8Value, __pyx_k_UInt8Value, sizeof(__pyx_k_UInt8Value), 0, 0, 1, 1},
  {&__pyx_kp_u_Unable_to_convert_timezone_to_st, __pyx_k_Unable_to_convert_timezone_to_st, sizeof(__pyx_k_Unable_to_convert_timezone_to_st), 0, 1, 0, 0},
  {&__pyx_kp_u_Unable_to_read_from_object_of_ty, __pyx_k_Unable_to_read_from_object_of_ty, sizeof(__pyx_k_Unable_to_read_from_object_of_ty), 0, 1, 0, 0},
  {&__pyx_kp_u_Unable_to_read_message_from_obje, __pyx_k_Unable_to_read_message_from_obje, sizeof(__pyx_k_Unable_to_read_message_from_obje), 0, 1, 0, 0},
  {&__pyx_kp_u_Unable_to_wrap_Datum_in_a_Python, __pyx_k_Unable_to_wrap_Datum_in_a_Python, sizeof(__pyx_k_Unable_to_wrap_Datum_in_a_Python), 0, 1, 0, 0},
  {&__pyx_n_s_UnionArray, __pyx_k_UnionArray, sizeof(__pyx_k_UnionArray), 0, 0, 1, 1},
  {&__pyx_n_s_UnionMode_DENSE, __pyx_k_UnionMode_DENSE, sizeof(__pyx_k_UnionMode_DENSE), 0, 0, 1, 1},
  {&__pyx_n_s_UnionMode_SPARSE, __pyx_k_UnionMode_SPARSE, sizeof(__pyx_k_UnionMode_SPARSE), 0, 0, 1, 1},
  {&__pyx_n_s_UnionType, __pyx_k_UnionType, sizeof(__pyx_k_UnionType), 0, 0, 1, 1},
  {&__pyx_n_s_UnionType___iter, __pyx_k_UnionType___iter, sizeof(__pyx_k_UnionType___iter), 0, 0, 1, 1},
  {&__pyx_n_s_UnionValue, __pyx_k_UnionValue, sizeof(__pyx_k_UnionValue), 0, 0, 1, 1},
  {&__pyx_n_s_UnknownExtensionType, __pyx_k_UnknownExtensionType, sizeof(__pyx_k_UnknownExtensionType), 0, 0, 1, 1},
  {&__pyx_kp_u_Unrecognized_compression_type, __pyx_k_Unrecognized_compression_type, sizeof(__pyx_k_Unrecognized_compression_type), 0, 1, 0, 0},
  {&__pyx_n_s_UnsupportedOperation, __pyx_k_UnsupportedOperation, sizeof(__pyx_k_UnsupportedOperation), 0, 0, 1, 1},
  {&__pyx_n_s_UserWarning, __pyx_k_UserWarning, sizeof(__pyx_k_UserWarning), 0, 0, 1, 1},
  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  {&__pyx_kp_u_We_do_not_know_how_to_serialize, __pyx_k_We_do_not_know_how_to_serialize, sizeof(__pyx_k_We_do_not_know_how_to_serialize), 0, 1, 0, 0},
  {&__pyx_kp_u_Writable_buffer_requested_but_Ar, __pyx_k_Writable_buffer_requested_but_Ar, sizeof(__pyx_k_Writable_buffer_requested_but_Ar), 0, 1, 0, 0},
  {&__pyx_kp_b__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 0, 0, 0},
  {&__pyx_kp_u__169, __pyx_k__169, sizeof(__pyx_k__169), 0, 1, 0, 0},
  {&__pyx_kp_b__198, __pyx_k__198, sizeof(__pyx_k__198), 0, 0, 0, 0},
  {&__pyx_n_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 1},
  {&__pyx_kp_u__27, __pyx_k__27, sizeof(__pyx_k__27), 0, 1, 0, 0},
  {&__pyx_kp_u__28, __pyx_k__28, sizeof(__pyx_k__28), 0, 1, 0, 0},
  {&__pyx_n_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 1},
  {&__pyx_n_u_ab, __pyx_k_ab, sizeof(__pyx_k_ab), 0, 1, 0, 1},
  {&__pyx_kp_u_accessing_non_existent_buffer_se, __pyx_k_accessing_non_existent_buffer_se, sizeof(__pyx_k_accessing_non_existent_buffer_se), 0, 1, 0, 0},
  {&__pyx_n_s_ad, __pyx_k_ad, sizeof(__pyx_k_ad), 0, 0, 1, 1},
  {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1},
  {&__pyx_n_s_add_column, __pyx_k_add_column, sizeof(__pyx_k_add_column), 0, 0, 1, 1},
  {&__pyx_n_s_address, __pyx_k_address, sizeof(__pyx_k_address), 0, 0, 1, 1},
  {&__pyx_n_s_alias, __pyx_k_alias, sizeof(__pyx_k_alias), 0, 0, 1, 1},
  {&__pyx_n_s_alignment, __pyx_k_alignment, sizeof(__pyx_k_alignment), 0, 0, 1, 1},
  {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
  {&__pyx_n_s_allow_float_truncate, __pyx_k_allow_float_truncate, sizeof(__pyx_k_allow_float_truncate), 0, 0, 1, 1},
  {&__pyx_n_s_allow_int_overflow, __pyx_k_allow_int_overflow, sizeof(__pyx_k_allow_int_overflow), 0, 0, 1, 1},
  {&__pyx_n_s_allow_invalid_utf8, __pyx_k_allow_invalid_utf8, sizeof(__pyx_k_allow_invalid_utf8), 0, 0, 1, 1},
  {&__pyx_n_s_allow_time_overflow, __pyx_k_allow_time_overflow, sizeof(__pyx_k_allow_time_overflow), 0, 0, 1, 1},
  {&__pyx_n_s_allow_time_truncate, __pyx_k_allow_time_truncate, sizeof(__pyx_k_allow_time_truncate), 0, 0, 1, 1},
  {&__pyx_n_s_api, __pyx_k_api, sizeof(__pyx_k_api), 0, 0, 1, 1},
  {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
  {&__pyx_n_s_arg_dict_memo, __pyx_k_arg_dict_memo, sizeof(__pyx_k_arg_dict_memo), 0, 0, 1, 1},
  {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
  {&__pyx_n_s_arr, __pyx_k_arr, sizeof(__pyx_k_arr), 0, 0, 1, 1},
  {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1},
  {&__pyx_n_s_array_2, __pyx_k_array_2, sizeof(__pyx_k_array_2), 0, 0, 1, 1},
  {&__pyx_n_s_array_data, __pyx_k_array_data, sizeof(__pyx_k_array_data), 0, 0, 1, 1},
  {&__pyx_kp_u_array_line_114, __pyx_k_array_line_114, sizeof(__pyx_k_array_line_114), 0, 1, 0, 0},
  {&__pyx_n_s_arrays, __pyx_k_arrays, sizeof(__pyx_k_arrays), 0, 0, 1, 1},
  {&__pyx_n_s_arrow_array, __pyx_k_arrow_array, sizeof(__pyx_k_arrow_array), 0, 0, 1, 1},
  {&__pyx_n_u_arrow_array, __pyx_k_arrow_array, sizeof(__pyx_k_arrow_array), 0, 1, 0, 1},
  {&__pyx_n_s_arrow_ext_deserialize, __pyx_k_arrow_ext_deserialize, sizeof(__pyx_k_arrow_ext_deserialize), 0, 0, 1, 1},
  {&__pyx_n_s_arrow_obj, __pyx_k_arrow_obj, sizeof(__pyx_k_arrow_obj), 0, 0, 1, 1},
  {&__pyx_kp_u_arrow_py_extension_type, __pyx_k_arrow_py_extension_type, sizeof(__pyx_k_arrow_py_extension_type), 0, 1, 0, 0},
  {&__pyx_n_s_as_buffer, __pyx_k_as_buffer, sizeof(__pyx_k_as_buffer), 0, 0, 1, 1},
  {&__pyx_n_s_as_py, __pyx_k_as_py, sizeof(__pyx_k_as_py), 0, 0, 1, 1},
  {&__pyx_n_u_as_py, __pyx_k_as_py, sizeof(__pyx_k_as_py), 0, 1, 0, 1},
  {&__pyx_n_s_asarray, __pyx_k_asarray, sizeof(__pyx_k_asarray), 0, 0, 1, 1},
  {&__pyx_n_s_asbytes, __pyx_k_asbytes, sizeof(__pyx_k_asbytes), 0, 0, 1, 1},
  {&__pyx_n_s_assert_frame_equal, __pyx_k_assert_frame_equal, sizeof(__pyx_k_assert_frame_equal), 0, 0, 1, 1},
  {&__pyx_n_s_assert_open, __pyx_k_assert_open, sizeof(__pyx_k_assert_open), 0, 0, 1, 1},
  {&__pyx_n_s_assert_readable, __pyx_k_assert_readable, sizeof(__pyx_k_assert_readable), 0, 0, 1, 1},
  {&__pyx_n_s_assert_seekable, __pyx_k_assert_seekable, sizeof(__pyx_k_assert_seekable), 0, 0, 1, 1},
  {&__pyx_n_s_assert_writable, __pyx_k_assert_writable, sizeof(__pyx_k_assert_writable), 0, 0, 1, 1},
  {&__pyx_n_s_astype, __pyx_k_astype, sizeof(__pyx_k_astype), 0, 0, 1, 1},
  {&__pyx_n_s_atexit, __pyx_k_atexit, sizeof(__pyx_k_atexit), 0, 0, 1, 1},
  {&__pyx_n_b_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 0, 1},
  {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1},
  {&__pyx_n_b_bBhHiIqQ, __pyx_k_bBhHiIqQ, sizeof(__pyx_k_bBhHiIqQ), 0, 0, 0, 1},
  {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
  {&__pyx_n_s_bases, __pyx_k_bases, sizeof(__pyx_k_bases), 0, 0, 1, 1},
  {&__pyx_n_s_batch, __pyx_k_batch, sizeof(__pyx_k_batch), 0, 0, 1, 1},
  {&__pyx_n_s_batches, __pyx_k_batches, sizeof(__pyx_k_batches), 0, 0, 1, 1},
  {&__pyx_n_s_benchmark_PandasObjectIsNull, __pyx_k_benchmark_PandasObjectIsNull, sizeof(__pyx_k_benchmark_PandasObjectIsNull), 0, 0, 1, 1},
  {&__pyx_n_s_bg_write, __pyx_k_bg_write, sizeof(__pyx_k_bg_write), 0, 0, 1, 1},
  {&__pyx_n_s_binary, __pyx_k_binary, sizeof(__pyx_k_binary), 0, 0, 1, 1},
  {&__pyx_n_u_binary, __pyx_k_binary, sizeof(__pyx_k_binary), 0, 1, 0, 1},
  {&__pyx_kp_u_binary_file_expected_got_text_fi, __pyx_k_binary_file_expected_got_text_fi, sizeof(__pyx_k_binary_file_expected_got_text_fi), 0, 1, 0, 0},
  {&__pyx_n_s_binary_type, __pyx_k_binary_type, sizeof(__pyx_k_binary_type), 0, 0, 1, 1},
  {&__pyx_n_s_bit_width, __pyx_k_bit_width, sizeof(__pyx_k_bit_width), 0, 0, 1, 1},
  {&__pyx_n_u_block_size, __pyx_k_block_size, sizeof(__pyx_k_block_size), 0, 1, 0, 1},
  {&__pyx_n_s_body, __pyx_k_body, sizeof(__pyx_k_body), 0, 0, 1, 1},
  {&__pyx_n_s_body_length, __pyx_k_body_length, sizeof(__pyx_k_body_length), 0, 0, 1, 1},
  {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1},
  {&__pyx_n_u_bool_2, __pyx_k_bool_2, sizeof(__pyx_k_bool_2), 0, 1, 0, 1},
  {&__pyx_n_u_boolean, __pyx_k_boolean, sizeof(__pyx_k_boolean), 0, 1, 0, 1},
  {&__pyx_n_u_brotli, __pyx_k_brotli, sizeof(__pyx_k_brotli), 0, 1, 0, 1},
  {&__pyx_n_s_buf, __pyx_k_buf, sizeof(__pyx_k_buf), 0, 0, 1, 1},
  {&__pyx_n_s_buffer, __pyx_k_buffer, sizeof(__pyx_k_buffer), 0, 0, 1, 1},
  {&__pyx_n_s_buffer_size, __pyx_k_buffer_size, sizeof(__pyx_k_buffer_size), 0, 0, 1, 1},
  {&__pyx_n_s_buffers, __pyx_k_buffers, sizeof(__pyx_k_buffers), 0, 0, 1, 1},
  {&__pyx_n_s_builtin_pickle, __pyx_k_builtin_pickle, sizeof(__pyx_k_builtin_pickle), 0, 0, 1, 1},
  {&__pyx_n_s_byte_width, __pyx_k_byte_width, sizeof(__pyx_k_byte_width), 0, 0, 1, 1},
  {&__pyx_n_u_bz2, __pyx_k_bz2, sizeof(__pyx_k_bz2), 0, 1, 0, 1},
  {&__pyx_kp_u_bz2_2, __pyx_k_bz2_2, sizeof(__pyx_k_bz2_2), 0, 1, 0, 0},
  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
  {&__pyx_n_s_c_addr, __pyx_k_c_addr, sizeof(__pyx_k_c_addr), 0, 0, 1, 1},
  {&__pyx_n_s_c_array, __pyx_k_c_array, sizeof(__pyx_k_c_array), 0, 0, 1, 1},
  {&__pyx_n_s_c_arrays, __pyx_k_c_arrays, sizeof(__pyx_k_c_arrays), 0, 0, 1, 1},
  {&__pyx_n_s_c_batches, __pyx_k_c_batches, sizeof(__pyx_k_c_batches), 0, 0, 1, 1},
  {&__pyx_n_s_c_buf, __pyx_k_c_buf, sizeof(__pyx_k_c_buf), 0, 0, 1, 1},
  {&__pyx_n_s_c_buffers, __pyx_k_c_buffers, sizeof(__pyx_k_c_buffers), 0, 0, 1, 1},
  {&__pyx_n_s_c_child_data, __pyx_k_c_child_data, sizeof(__pyx_k_c_child_data), 0, 0, 1, 1},
  {&__pyx_n_s_c_codec, __pyx_k_c_codec, sizeof(__pyx_k_c_codec), 0, 0, 1, 1},
  {&__pyx_n_s_c_dim_names, __pyx_k_c_dim_names, sizeof(__pyx_k_c_dim_names), 0, 0, 1, 1},
  {&__pyx_n_s_c_extension_name, __pyx_k_c_extension_name, sizeof(__pyx_k_c_extension_name), 0, 0, 1, 1},
  {&__pyx_n_s_c_field_names, __pyx_k_c_field_names, sizeof(__pyx_k_c_field_names), 0, 0, 1, 1},
  {&__pyx_n_s_c_fields, __pyx_k_c_fields, sizeof(__pyx_k_c_fields), 0, 0, 1, 1},
  {&__pyx_n_s_c_from_pandas, __pyx_k_c_from_pandas, sizeof(__pyx_k_c_from_pandas), 0, 0, 1, 1},
  {&__pyx_n_s_c_meta, __pyx_k_c_meta, sizeof(__pyx_k_c_meta), 0, 0, 1, 1},
  {&__pyx_n_s_c_names, __pyx_k_c_names, sizeof(__pyx_k_c_names), 0, 0, 1, 1},
  {&__pyx_n_s_c_options, __pyx_k_c_options, sizeof(__pyx_k_c_options), 0, 0, 1, 1},
  {&__pyx_n_s_c_ordered, __pyx_k_c_ordered, sizeof(__pyx_k_c_ordered), 0, 0, 1, 1},
  {&__pyx_n_s_c_path, __pyx_k_c_path, sizeof(__pyx_k_c_path), 0, 0, 1, 1},
  {&__pyx_n_s_c_record_batch, __pyx_k_c_record_batch, sizeof(__pyx_k_c_record_batch), 0, 0, 1, 1},
  {&__pyx_n_s_c_result, __pyx_k_c_result, sizeof(__pyx_k_c_result), 0, 0, 1, 1},
  {&__pyx_n_s_c_result_table, __pyx_k_c_result_table, sizeof(__pyx_k_c_result_table), 0, 0, 1, 1},
  {&__pyx_n_s_c_schema, __pyx_k_c_schema, sizeof(__pyx_k_c_schema), 0, 0, 1, 1},
  {&__pyx_n_s_c_shape, __pyx_k_c_shape, sizeof(__pyx_k_c_shape), 0, 0, 1, 1},
  {&__pyx_n_s_c_size, __pyx_k_c_size, sizeof(__pyx_k_c_size), 0, 0, 1, 1},
  {&__pyx_n_s_c_stream, __pyx_k_c_stream, sizeof(__pyx_k_c_stream), 0, 0, 1, 1},
  {&__pyx_n_s_c_table, __pyx_k_c_table, sizeof(__pyx_k_c_table), 0, 0, 1, 1},
  {&__pyx_n_s_c_tables, __pyx_k_c_tables, sizeof(__pyx_k_c_tables), 0, 0, 1, 1},
  {&__pyx_n_s_c_timezone, __pyx_k_c_timezone, sizeof(__pyx_k_c_timezone), 0, 0, 1, 1},
  {&__pyx_n_s_c_type, __pyx_k_c_type, sizeof(__pyx_k_c_type), 0, 0, 1, 1},
  {&__pyx_n_s_c_type_codes, __pyx_k_c_type_codes, sizeof(__pyx_k_c_type_codes), 0, 0, 1, 1},
  {&__pyx_n_s_c_type_name, __pyx_k_c_type_name, sizeof(__pyx_k_c_type_name), 0, 0, 1, 1},
  {&__pyx_n_s_cast, __pyx_k_cast, sizeof(__pyx_k_cast), 0, 0, 1, 1},
  {&__pyx_n_s_cat, __pyx_k_cat, sizeof(__pyx_k_cat), 0, 0, 1, 1},
  {&__pyx_n_s_categorical_type, __pyx_k_categorical_type, sizeof(__pyx_k_categorical_type), 0, 0, 1, 1},
  {&__pyx_n_s_categories, __pyx_k_categories, sizeof(__pyx_k_categories), 0, 0, 1, 1},
  {&__pyx_n_s_check_metadata, __pyx_k_check_metadata, sizeof(__pyx_k_check_metadata), 0, 0, 1, 1},
  {&__pyx_n_s_child, __pyx_k_child, sizeof(__pyx_k_child), 0, 0, 1, 1},
  {&__pyx_n_s_child_field, __pyx_k_child_field, sizeof(__pyx_k_child_field), 0, 0, 1, 1},
  {&__pyx_n_s_children, __pyx_k_children, sizeof(__pyx_k_children), 0, 0, 1, 1},
  {&__pyx_n_s_children_fields, __pyx_k_children_fields, sizeof(__pyx_k_children_fields), 0, 0, 1, 1},
  {&__pyx_n_s_chunk, __pyx_k_chunk, sizeof(__pyx_k_chunk), 0, 0, 1, 1},
  {&__pyx_n_s_chunked_array, __pyx_k_chunked_array, sizeof(__pyx_k_chunked_array), 0, 0, 1, 1},
  {&__pyx_n_s_chunks, __pyx_k_chunks, sizeof(__pyx_k_chunks), 0, 0, 1, 1},
  {&__pyx_n_u_chunksize, __pyx_k_chunksize, sizeof(__pyx_k_chunksize), 0, 1, 0, 1},
  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
  {&__pyx_n_s_cleanup, __pyx_k_cleanup, sizeof(__pyx_k_cleanup), 0, 0, 1, 1},
  {&__pyx_n_s_client, __pyx_k_client, sizeof(__pyx_k_client), 0, 0, 1, 1},
  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
  {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
  {&__pyx_n_u_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 1, 0, 1},
  {&__pyx_n_s_closed, __pyx_k_closed, sizeof(__pyx_k_closed), 0, 0, 1, 1},
  {&__pyx_n_u_closed, __pyx_k_closed, sizeof(__pyx_k_closed), 0, 1, 0, 1},
  {&__pyx_n_s_cls, __pyx_k_cls, sizeof(__pyx_k_cls), 0, 0, 1, 1},
  {&__pyx_n_s_code, __pyx_k_code, sizeof(__pyx_k_code), 0, 0, 1, 1},
  {&__pyx_n_s_codec, __pyx_k_codec, sizeof(__pyx_k_codec), 0, 0, 1, 1},
  {&__pyx_n_s_codes, __pyx_k_codes, sizeof(__pyx_k_codes), 0, 0, 1, 1},
  {&__pyx_n_s_col, __pyx_k_col, sizeof(__pyx_k_col), 0, 0, 1, 1},
  {&__pyx_n_s_column, __pyx_k_column, sizeof(__pyx_k_column), 0, 0, 1, 1},
  {&__pyx_n_s_column_2, __pyx_k_column_2, sizeof(__pyx_k_column_2), 0, 0, 1, 1},
  {&__pyx_n_s_columns, __pyx_k_columns, sizeof(__pyx_k_columns), 0, 0, 1, 1},
  {&__pyx_n_s_common, __pyx_k_common, sizeof(__pyx_k_common), 0, 0, 1, 1},
  {&__pyx_n_s_compat, __pyx_k_compat, sizeof(__pyx_k_compat), 0, 0, 1, 1},
  {&__pyx_n_s_compile, __pyx_k_compile, sizeof(__pyx_k_compile), 0, 0, 1, 1},
  {&__pyx_n_s_components, __pyx_k_components, sizeof(__pyx_k_components), 0, 0, 1, 1},
  {&__pyx_n_s_compress, __pyx_k_compress, sizeof(__pyx_k_compress), 0, 0, 1, 1},
  {&__pyx_n_s_compression, __pyx_k_compression, sizeof(__pyx_k_compression), 0, 0, 1, 1},
  {&__pyx_n_s_compression_type, __pyx_k_compression_type, sizeof(__pyx_k_compression_type), 0, 0, 1, 1},
  {&__pyx_n_s_concat_arrays, __pyx_k_concat_arrays, sizeof(__pyx_k_concat_arrays), 0, 0, 1, 1},
  {&__pyx_n_s_concat_tables, __pyx_k_concat_tables, sizeof(__pyx_k_concat_tables), 0, 0, 1, 1},
  {&__pyx_n_s_connect, __pyx_k_connect, sizeof(__pyx_k_connect), 0, 0, 1, 1},
  {&__pyx_n_s_context, __pyx_k_context, sizeof(__pyx_k_context), 0, 0, 1, 1},
  {&__pyx_n_s_converted_arrays, __pyx_k_converted_arrays, sizeof(__pyx_k_converted_arrays), 0, 0, 1, 1},
  {&__pyx_n_u_coo, __pyx_k_coo, sizeof(__pyx_k_coo), 0, 1, 0, 1},
  {&__pyx_n_s_coo_matrix, __pyx_k_coo_matrix, sizeof(__pyx_k_coo_matrix), 0, 0, 1, 1},
  {&__pyx_n_s_coords, __pyx_k_coords, sizeof(__pyx_k_coords), 0, 0, 1, 1},
  {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
  {&__pyx_n_s_core, __pyx_k_core, sizeof(__pyx_k_core), 0, 0, 1, 1},
  {&__pyx_kp_u_could_not_infer_open_mode_for_fi, __pyx_k_could_not_infer_open_mode_for_fi, sizeof(__pyx_k_could_not_infer_open_mode_for_fi), 0, 1, 0, 0},
  {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1},
  {&__pyx_n_s_cpool, __pyx_k_cpool, sizeof(__pyx_k_cpool), 0, 0, 1, 1},
  {&__pyx_n_s_cpp_file, __pyx_k_cpp_file, sizeof(__pyx_k_cpp_file), 0, 0, 1, 1},
  {&__pyx_n_s_cpu_count, __pyx_k_cpu_count, sizeof(__pyx_k_cpu_count), 0, 0, 1, 1},
  {&__pyx_n_s_cpy_ext_type, __pyx_k_cpy_ext_type, sizeof(__pyx_k_cpy_ext_type), 0, 0, 1, 1},
  {&__pyx_n_s_create, __pyx_k_create, sizeof(__pyx_k_create), 0, 0, 1, 1},
  {&__pyx_n_s_create_memory_map, __pyx_k_create_memory_map, sizeof(__pyx_k_create_memory_map), 0, 0, 1, 1},
  {&__pyx_n_s_csparse_tensor, __pyx_k_csparse_tensor, sizeof(__pyx_k_csparse_tensor), 0, 0, 1, 1},
  {&__pyx_n_u_csr, __pyx_k_csr, sizeof(__pyx_k_csr), 0, 1, 0, 1},
  {&__pyx_n_s_csr_matrix, __pyx_k_csr_matrix, sizeof(__pyx_k_csr_matrix), 0, 0, 1, 1},
  {&__pyx_n_s_ctensor, __pyx_k_ctensor, sizeof(__pyx_k_ctensor), 0, 0, 1, 1},
  {&__pyx_n_s_custom_deserializer, __pyx_k_custom_deserializer, sizeof(__pyx_k_custom_deserializer), 0, 0, 1, 1},
  {&__pyx_n_s_custom_serializer, __pyx_k_custom_serializer, sizeof(__pyx_k_custom_serializer), 0, 0, 1, 1},
  {&__pyx_n_b_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 0, 1},
  {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
  {&__pyx_n_u_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 1, 0, 1},
  {&__pyx_n_s_data_frame, __pyx_k_data_frame, sizeof(__pyx_k_data_frame), 0, 0, 1, 1},
  {&__pyx_n_s_dataframe_to_arrays, __pyx_k_dataframe_to_arrays, sizeof(__pyx_k_dataframe_to_arrays), 0, 0, 1, 1},
  {&__pyx_n_s_dataframe_to_types, __pyx_k_dataframe_to_types, sizeof(__pyx_k_dataframe_to_types), 0, 0, 1, 1},
  {&__pyx_n_s_date, __pyx_k_date, sizeof(__pyx_k_date), 0, 0, 1, 1},
  {&__pyx_n_s_date32, __pyx_k_date32, sizeof(__pyx_k_date32), 0, 0, 1, 1},
  {&__pyx_n_u_date32, __pyx_k_date32, sizeof(__pyx_k_date32), 0, 1, 0, 1},
  {&__pyx_kp_u_date32_day, __pyx_k_date32_day, sizeof(__pyx_k_date32_day), 0, 1, 0, 0},
  {&__pyx_n_s_date64, __pyx_k_date64, sizeof(__pyx_k_date64), 0, 0, 1, 1},
  {&__pyx_n_u_date64, __pyx_k_date64, sizeof(__pyx_k_date64), 0, 1, 0, 1},
  {&__pyx_kp_u_date64_ms, __pyx_k_date64_ms, sizeof(__pyx_k_date64_ms), 0, 1, 0, 0},
  {&__pyx_n_s_date_as_object, __pyx_k_date_as_object, sizeof(__pyx_k_date_as_object), 0, 0, 1, 1},
  {&__pyx_n_u_date_as_object, __pyx_k_date_as_object, sizeof(__pyx_k_date_as_object), 0, 1, 0, 1},
  {&__pyx_n_s_datetime, __pyx_k_datetime, sizeof(__pyx_k_datetime), 0, 0, 1, 1},
  {&__pyx_kp_u_datetime64_ns, __pyx_k_datetime64_ns, sizeof(__pyx_k_datetime64_ns), 0, 1, 0, 0},
  {&__pyx_n_s_datetime_conversion_functions, __pyx_k_datetime_conversion_functions, sizeof(__pyx_k_datetime_conversion_functions), 0, 0, 1, 1},
  {&__pyx_n_s_datetime_conversion_functions_l, __pyx_k_datetime_conversion_functions_l, sizeof(__pyx_k_datetime_conversion_functions_l), 0, 0, 1, 1},
  {&__pyx_n_s_days, __pyx_k_days, sizeof(__pyx_k_days), 0, 0, 1, 1},
  {&__pyx_n_s_decay_ms, __pyx_k_decay_ms, sizeof(__pyx_k_decay_ms), 0, 0, 1, 1},
  {&__pyx_n_s_decimal, __pyx_k_decimal, sizeof(__pyx_k_decimal), 0, 0, 1, 1},
  {&__pyx_n_s_decimal128, __pyx_k_decimal128, sizeof(__pyx_k_decimal128), 0, 0, 1, 1},
  {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1},
  {&__pyx_n_s_decompress, __pyx_k_decompress, sizeof(__pyx_k_decompress), 0, 0, 1, 1},
  {&__pyx_n_s_decompressed_size, __pyx_k_decompressed_size, sizeof(__pyx_k_decompressed_size), 0, 0, 1, 1},
  {&__pyx_n_s_deduplicate_objects, __pyx_k_deduplicate_objects, sizeof(__pyx_k_deduplicate_objects), 0, 0, 1, 1},
  {&__pyx_n_u_deduplicate_objects, __pyx_k_deduplicate_objects, sizeof(__pyx_k_deduplicate_objects), 0, 1, 0, 1},
  {&__pyx_n_s_default_block_size, __pyx_k_default_block_size, sizeof(__pyx_k_default_block_size), 0, 0, 1, 1},
  {&__pyx_n_s_default_context_initialized, __pyx_k_default_context_initialized, sizeof(__pyx_k_default_context_initialized), 0, 0, 1, 1},
  {&__pyx_n_s_default_memory_pool, __pyx_k_default_memory_pool, sizeof(__pyx_k_default_memory_pool), 0, 0, 1, 1},
  {&__pyx_n_s_default_serialization_context, __pyx_k_default_serialization_context, sizeof(__pyx_k_default_serialization_context), 0, 0, 1, 1},
  {&__pyx_n_u_dense, __pyx_k_dense, sizeof(__pyx_k_dense), 0, 1, 0, 1},
  {&__pyx_n_s_deserialize, __pyx_k_deserialize, sizeof(__pyx_k_deserialize), 0, 0, 1, 1},
  {&__pyx_n_s_deserialize_components, __pyx_k_deserialize_components, sizeof(__pyx_k_deserialize_components), 0, 0, 1, 1},
  {&__pyx_n_s_deserialize_from, __pyx_k_deserialize_from, sizeof(__pyx_k_deserialize_from), 0, 0, 1, 1},
  {&__pyx_n_s_deserializer, __pyx_k_deserializer, sizeof(__pyx_k_deserializer), 0, 0, 1, 1},
  {&__pyx_n_s_dest, __pyx_k_dest, sizeof(__pyx_k_dest), 0, 0, 1, 1},
  {&__pyx_n_u_detect, __pyx_k_detect, sizeof(__pyx_k_detect), 0, 1, 0, 1},
  {&__pyx_n_s_detect_compression, __pyx_k_detect_compression, sizeof(__pyx_k_detect_compression), 0, 0, 1, 1},
  {&__pyx_n_s_df, __pyx_k_df, sizeof(__pyx_k_df), 0, 0, 1, 1},
  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
  {&__pyx_n_u_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 1, 0, 1},
  {&__pyx_n_s_dictionary, __pyx_k_dictionary, sizeof(__pyx_k_dictionary), 0, 0, 1, 1},
  {&__pyx_n_u_dictionary, __pyx_k_dictionary, sizeof(__pyx_k_dictionary), 0, 1, 0, 1},
  {&__pyx_n_s_dictionary_2, __pyx_k_dictionary_2, sizeof(__pyx_k_dictionary_2), 0, 0, 1, 1},
  {&__pyx_n_s_dictionary_memo, __pyx_k_dictionary_memo, sizeof(__pyx_k_dictionary_memo), 0, 0, 1, 1},
  {&__pyx_n_s_dictionary_value, __pyx_k_dictionary_value, sizeof(__pyx_k_dictionary_value), 0, 0, 1, 1},
  {&__pyx_n_s_dim_names, __pyx_k_dim_names, sizeof(__pyx_k_dim_names), 0, 0, 1, 1},
  {&__pyx_n_u_directory, __pyx_k_directory, sizeof(__pyx_k_directory), 0, 1, 0, 1},
  {&__pyx_n_s_distutils_version, __pyx_k_distutils_version, sizeof(__pyx_k_distutils_version), 0, 0, 1, 1},
  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  {&__pyx_n_u_double, __pyx_k_double, sizeof(__pyx_k_double), 0, 1, 0, 1},
  {&__pyx_n_s_download, __pyx_k_download, sizeof(__pyx_k_download), 0, 0, 1, 1},
  {&__pyx_n_s_download_locals_bg_write, __pyx_k_download_locals_bg_write, sizeof(__pyx_k_download_locals_bg_write), 0, 0, 1, 1},
  {&__pyx_n_s_download_locals_cleanup, __pyx_k_download_locals_cleanup, sizeof(__pyx_k_download_locals_cleanup), 0, 0, 1, 1},
  {&__pyx_n_s_driver, __pyx_k_driver, sizeof(__pyx_k_driver), 0, 0, 1, 1},
  {&__pyx_n_s_dt, __pyx_k_dt, sizeof(__pyx_k_dt), 0, 0, 1, 1},
  {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
  {&__pyx_n_s_dumps, __pyx_k_dumps, sizeof(__pyx_k_dumps), 0, 0, 1, 1},
  {&__pyx_n_s_duration, __pyx_k_duration, sizeof(__pyx_k_duration), 0, 0, 1, 1},
  {&__pyx_kp_u_duration_ms, __pyx_k_duration_ms, sizeof(__pyx_k_duration_ms), 0, 1, 0, 0},
  {&__pyx_kp_u_duration_ns, __pyx_k_duration_ns, sizeof(__pyx_k_duration_ns), 0, 1, 0, 0},
  {&__pyx_kp_u_duration_s, __pyx_k_duration_s, sizeof(__pyx_k_duration_s), 0, 1, 0, 0},
  {&__pyx_kp_u_duration_us, __pyx_k_duration_us, sizeof(__pyx_k_duration_us), 0, 1, 0, 0},
  {&__pyx_n_b_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 0, 1},
  {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1},
  {&__pyx_n_s_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 0, 1, 1},
  {&__pyx_n_s_encode_file_path, __pyx_k_encode_file_path, sizeof(__pyx_k_encode_file_path), 0, 0, 1, 1},
  {&__pyx_n_s_endswith, __pyx_k_endswith, sizeof(__pyx_k_endswith), 0, 0, 1, 1},
  {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1},
  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
  {&__pyx_n_s_equals, __pyx_k_equals, sizeof(__pyx_k_equals), 0, 0, 1, 1},
  {&__pyx_n_s_example_object, __pyx_k_example_object, sizeof(__pyx_k_example_object), 0, 0, 1, 1},
  {&__pyx_n_s_exc_info, __pyx_k_exc_info, sizeof(__pyx_k_exc_info), 0, 0, 1, 1},
  {&__pyx_n_s_exc_tb, __pyx_k_exc_tb, sizeof(__pyx_k_exc_tb), 0, 0, 1, 1},
  {&__pyx_n_s_exc_type, __pyx_k_exc_type, sizeof(__pyx_k_exc_type), 0, 0, 1, 1},
  {&__pyx_n_s_exc_val, __pyx_k_exc_val, sizeof(__pyx_k_exc_val), 0, 0, 1, 1},
  {&__pyx_n_s_exc_value, __pyx_k_exc_value, sizeof(__pyx_k_exc_value), 0, 0, 1, 1},
  {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1},
  {&__pyx_n_s_ext_array, __pyx_k_ext_array, sizeof(__pyx_k_ext_array), 0, 0, 1, 1},
  {&__pyx_n_s_ext_type, __pyx_k_ext_type, sizeof(__pyx_k_ext_type), 0, 0, 1, 1},
  {&__pyx_n_s_extension_columns, __pyx_k_extension_columns, sizeof(__pyx_k_extension_columns), 0, 0, 1, 1},
  {&__pyx_n_s_extension_name, __pyx_k_extension_name, sizeof(__pyx_k_extension_name), 0, 0, 1, 1},
  {&__pyx_n_s_extensions, __pyx_k_extensions, sizeof(__pyx_k_extensions), 0, 0, 1, 1},
  {&__pyx_n_s_extra_conf, __pyx_k_extra_conf, sizeof(__pyx_k_extra_conf), 0, 0, 1, 1},
  {&__pyx_n_b_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 0, 1},
  {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1},
  {&__pyx_n_u_f2, __pyx_k_f2, sizeof(__pyx_k_f2), 0, 1, 0, 1},
  {&__pyx_n_u_f4, __pyx_k_f4, sizeof(__pyx_k_f4), 0, 1, 0, 1},
  {&__pyx_n_u_f8, __pyx_k_f8, sizeof(__pyx_k_f8), 0, 1, 0, 1},
  {&__pyx_n_s_fastpath, __pyx_k_fastpath, sizeof(__pyx_k_fastpath), 0, 0, 1, 1},
  {&__pyx_n_s_field, __pyx_k_field, sizeof(__pyx_k_field), 0, 0, 1, 1},
  {&__pyx_n_s_field_2, __pyx_k_field_2, sizeof(__pyx_k_field_2), 0, 0, 1, 1},
  {&__pyx_n_s_field_3, __pyx_k_field_3, sizeof(__pyx_k_field_3), 0, 0, 1, 1},
  {&__pyx_n_s_field_names, __pyx_k_field_names, sizeof(__pyx_k_field_names), 0, 0, 1, 1},
  {&__pyx_kp_u_field_or_tuple_expected_got_None, __pyx_k_field_or_tuple_expected_got_None, sizeof(__pyx_k_field_or_tuple_expected_got_None), 0, 1, 0, 0},
  {&__pyx_n_s_fields, __pyx_k_fields, sizeof(__pyx_k_fields), 0, 0, 1, 1},
  {&__pyx_n_u_fields_2, __pyx_k_fields_2, sizeof(__pyx_k_fields_2), 0, 1, 0, 1},
  {&__pyx_n_u_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 1, 0, 1},
  {&__pyx_n_s_file_descriptor, __pyx_k_file_descriptor, sizeof(__pyx_k_file_descriptor), 0, 0, 1, 1},
  {&__pyx_n_s_file_handle, __pyx_k_file_handle, sizeof(__pyx_k_file_handle), 0, 0, 1, 1},
  {&__pyx_n_s_file_type, __pyx_k_file_type, sizeof(__pyx_k_file_type), 0, 0, 1, 1},
  {&__pyx_n_s_fixed_offset_to_string, __pyx_k_fixed_offset_to_string, sizeof(__pyx_k_fixed_offset_to_string), 0, 0, 1, 1},
  {&__pyx_n_s_fixed_size_binary_type, __pyx_k_fixed_size_binary_type, sizeof(__pyx_k_fixed_size_binary_type), 0, 0, 1, 1},
  {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
  {&__pyx_n_s_flatten, __pyx_k_flatten, sizeof(__pyx_k_flatten), 0, 0, 1, 1},
  {&__pyx_n_u_float, __pyx_k_float, sizeof(__pyx_k_float), 0, 1, 0, 1},
  {&__pyx_n_s_float16, __pyx_k_float16, sizeof(__pyx_k_float16), 0, 0, 1, 1},
  {&__pyx_n_u_float16, __pyx_k_float16, sizeof(__pyx_k_float16), 0, 1, 0, 1},
  {&__pyx_n_s_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 0, 1, 1},
  {&__pyx_n_u_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 1, 0, 1},
  {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1},
  {&__pyx_n_u_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 1, 0, 1},
  {&__pyx_n_s_footer_offset, __pyx_k_footer_offset, sizeof(__pyx_k_footer_offset), 0, 0, 1, 1},
  {&__pyx_n_s_foreign_buffer, __pyx_k_foreign_buffer, sizeof(__pyx_k_foreign_buffer), 0, 0, 1, 1},
  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
  {&__pyx_n_s_from_arrays, __pyx_k_from_arrays, sizeof(__pyx_k_from_arrays), 0, 0, 1, 1},
  {&__pyx_n_s_from_batches, __pyx_k_from_batches, sizeof(__pyx_k_from_batches), 0, 0, 1, 1},
  {&__pyx_n_s_from_buffers, __pyx_k_from_buffers, sizeof(__pyx_k_from_buffers), 0, 0, 1, 1},
  {&__pyx_n_s_from_components, __pyx_k_from_components, sizeof(__pyx_k_from_components), 0, 0, 1, 1},
  {&__pyx_n_s_from_dense, __pyx_k_from_dense, sizeof(__pyx_k_from_dense), 0, 0, 1, 1},
  {&__pyx_n_s_from_dense_numpy, __pyx_k_from_dense_numpy, sizeof(__pyx_k_from_dense_numpy), 0, 0, 1, 1},
  {&__pyx_n_s_from_numpy, __pyx_k_from_numpy, sizeof(__pyx_k_from_numpy), 0, 0, 1, 1},
  {&__pyx_n_s_from_numpy_dtype, __pyx_k_from_numpy_dtype, sizeof(__pyx_k_from_numpy_dtype), 0, 0, 1, 1},
  {&__pyx_n_s_from_pandas, __pyx_k_from_pandas, sizeof(__pyx_k_from_pandas), 0, 0, 1, 1},
  {&__pyx_n_s_from_pydata_sparse, __pyx_k_from_pydata_sparse, sizeof(__pyx_k_from_pydata_sparse), 0, 0, 1, 1},
  {&__pyx_n_s_from_pydict, __pyx_k_from_pydict, sizeof(__pyx_k_from_pydict), 0, 0, 1, 1},
  {&__pyx_n_s_from_scipy, __pyx_k_from_scipy, sizeof(__pyx_k_from_scipy), 0, 0, 1, 1},
  {&__pyx_n_s_from_sparse, __pyx_k_from_sparse, sizeof(__pyx_k_from_sparse), 0, 0, 1, 1},
  {&__pyx_n_s_from_storage, __pyx_k_from_storage, sizeof(__pyx_k_from_storage), 0, 0, 1, 1},
  {&__pyx_n_s_from_struct_array, __pyx_k_from_struct_array, sizeof(__pyx_k_from_struct_array), 0, 0, 1, 1},
  {&__pyx_n_s_from_tensor, __pyx_k_from_tensor, sizeof(__pyx_k_from_tensor), 0, 0, 1, 1},
  {&__pyx_n_s_frombytes, __pyx_k_frombytes, sizeof(__pyx_k_frombytes), 0, 0, 1, 1},
  {&__pyx_n_s_fromutc, __pyx_k_fromutc, sizeof(__pyx_k_fromutc), 0, 0, 1, 1},
  {&__pyx_n_s_full, __pyx_k_full, sizeof(__pyx_k_full), 0, 0, 1, 1},
  {&__pyx_n_s_full_info, __pyx_k_full_info, sizeof(__pyx_k_full_info), 0, 0, 1, 1},
  {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1},
  {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
  {&__pyx_n_s_get_batch, __pyx_k_get_batch, sizeof(__pyx_k_get_batch), 0, 0, 1, 1},
  {&__pyx_n_s_get_capacity, __pyx_k_get_capacity, sizeof(__pyx_k_get_capacity), 0, 0, 1, 1},
  {&__pyx_n_s_get_datetimetz_type, __pyx_k_get_datetimetz_type, sizeof(__pyx_k_get_datetimetz_type), 0, 0, 1, 1},
  {&__pyx_n_s_get_default_context, __pyx_k_get_default_context, sizeof(__pyx_k_get_default_context), 0, 0, 1, 1},
  {&__pyx_n_s_get_field_index, __pyx_k_get_field_index, sizeof(__pyx_k_get_field_index), 0, 0, 1, 1},
  {&__pyx_n_s_get_record_batch, __pyx_k_get_record_batch, sizeof(__pyx_k_get_record_batch), 0, 0, 1, 1},
  {&__pyx_n_s_get_record_batch_size, __pyx_k_get_record_batch_size, sizeof(__pyx_k_get_record_batch_size), 0, 0, 1, 1},
  {&__pyx_n_s_get_space_used, __pyx_k_get_space_used, sizeof(__pyx_k_get_space_used), 0, 0, 1, 1},
  {&__pyx_n_s_get_tensor_size, __pyx_k_get_tensor_size, sizeof(__pyx_k_get_tensor_size), 0, 0, 1, 1},
  {&__pyx_n_s_get_values, __pyx_k_get_values, sizeof(__pyx_k_get_values), 0, 0, 1, 1},
  {&__pyx_n_s_getnewargs, __pyx_k_getnewargs, sizeof(__pyx_k_getnewargs), 0, 0, 1, 1},
  {&__pyx_n_s_getsizeof, __pyx_k_getsizeof, sizeof(__pyx_k_getsizeof), 0, 0, 1, 1},
  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
  {&__pyx_n_s_getvalue, __pyx_k_getvalue, sizeof(__pyx_k_getvalue), 0, 0, 1, 1},
  {&__pyx_kp_u_got_null_buffer, __pyx_k_got_null_buffer, sizeof(__pyx_k_got_null_buffer), 0, 1, 0, 0},
  {&__pyx_n_s_group, __pyx_k_group, sizeof(__pyx_k_group), 0, 0, 1, 1},
  {&__pyx_n_u_group, __pyx_k_group, sizeof(__pyx_k_group), 0, 1, 0, 1},
  {&__pyx_kp_u_gz, __pyx_k_gz, sizeof(__pyx_k_gz), 0, 1, 0, 0},
  {&__pyx_n_u_gzip, __pyx_k_gzip, sizeof(__pyx_k_gzip), 0, 1, 0, 1},
  {&__pyx_n_b_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 0, 1},
  {&__pyx_n_u_halffloat, __pyx_k_halffloat, sizeof(__pyx_k_halffloat), 0, 1, 0, 1},
  {&__pyx_n_s_handle, __pyx_k_handle, sizeof(__pyx_k_handle), 0, 0, 1, 1},
  {&__pyx_n_s_handle_arrow_array_protocol, __pyx_k_handle_arrow_array_protocol, sizeof(__pyx_k_handle_arrow_array_protocol), 0, 0, 1, 1},
  {&__pyx_n_s_have_libhdfs, __pyx_k_have_libhdfs, sizeof(__pyx_k_have_libhdfs), 0, 0, 1, 1},
  {&__pyx_n_s_have_libhdfs3, __pyx_k_have_libhdfs3, sizeof(__pyx_k_have_libhdfs3), 0, 0, 1, 1},
  {&__pyx_n_s_have_pandas, __pyx_k_have_pandas, sizeof(__pyx_k_have_pandas), 0, 0, 1, 1},
  {&__pyx_kp_u_hdfs_d, __pyx_k_hdfs_d, sizeof(__pyx_k_hdfs_d), 0, 1, 0, 0},
  {&__pyx_n_s_hint, __pyx_k_hint, sizeof(__pyx_k_hint), 0, 0, 1, 1},
  {&__pyx_n_s_host, __pyx_k_host, sizeof(__pyx_k_host), 0, 0, 1, 1},
  {&__pyx_n_s_hours, __pyx_k_hours, sizeof(__pyx_k_hours), 0, 0, 1, 1},
  {&__pyx_n_b_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 0, 1},
  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
  {&__pyx_n_u_i1, __pyx_k_i1, sizeof(__pyx_k_i1), 0, 1, 0, 1},
  {&__pyx_n_u_i2, __pyx_k_i2, sizeof(__pyx_k_i2), 0, 1, 0, 1},
  {&__pyx_n_u_i4, __pyx_k_i4, sizeof(__pyx_k_i4), 0, 1, 0, 1},
  {&__pyx_n_u_i8, __pyx_k_i8, sizeof(__pyx_k_i8), 0, 1, 0, 1},
  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
  {&__pyx_n_s_ignore_metadata, __pyx_k_ignore_metadata, sizeof(__pyx_k_ignore_metadata), 0, 0, 1, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_in_stream, __pyx_k_in_stream, sizeof(__pyx_k_in_stream), 0, 0, 1, 1},
  {&__pyx_n_s_indent, __pyx_k_indent, sizeof(__pyx_k_indent), 0, 0, 1, 1},
  {&__pyx_kp_u_index_out_of_bounds, __pyx_k_index_out_of_bounds, sizeof(__pyx_k_index_out_of_bounds), 0, 1, 0, 0},
  {&__pyx_n_s_index_type, __pyx_k_index_type, sizeof(__pyx_k_index_type), 0, 0, 1, 1},
  {&__pyx_n_s_index_value, __pyx_k_index_value, sizeof(__pyx_k_index_value), 0, 0, 1, 1},
  {&__pyx_n_s_indices, __pyx_k_indices, sizeof(__pyx_k_indices), 0, 0, 1, 1},
  {&__pyx_n_u_indices, __pyx_k_indices, sizeof(__pyx_k_indices), 0, 1, 0, 1},
  {&__pyx_n_s_indices_2, __pyx_k_indices_2, sizeof(__pyx_k_indices_2), 0, 0, 1, 1},
  {&__pyx_n_s_indptr, __pyx_k_indptr, sizeof(__pyx_k_indptr), 0, 0, 1, 1},
  {&__pyx_n_s_infer_dtype, __pyx_k_infer_dtype, sizeof(__pyx_k_infer_dtype), 0, 0, 1, 1},
  {&__pyx_n_s_infer_type, __pyx_k_infer_type, sizeof(__pyx_k_infer_type), 0, 0, 1, 1},
  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
  {&__pyx_n_s_input_stream, __pyx_k_input_stream, sizeof(__pyx_k_input_stream), 0, 0, 1, 1},
  {&__pyx_n_s_insert, __pyx_k_insert, sizeof(__pyx_k_insert), 0, 0, 1, 1},
  {&__pyx_n_s_int16, __pyx_k_int16, sizeof(__pyx_k_int16), 0, 0, 1, 1},
  {&__pyx_n_u_int16, __pyx_k_int16, sizeof(__pyx_k_int16), 0, 1, 0, 1},
  {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1},
  {&__pyx_n_u_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 1, 0, 1},
  {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1},
  {&__pyx_n_u_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 1, 0, 1},
  {&__pyx_n_s_int8, __pyx_k_int8, sizeof(__pyx_k_int8), 0, 0, 1, 1},
  {&__pyx_n_u_int8, __pyx_k_int8, sizeof(__pyx_k_int8), 0, 1, 0, 1},
  {&__pyx_n_s_integer_object_nulls, __pyx_k_integer_object_nulls, sizeof(__pyx_k_integer_object_nulls), 0, 0, 1, 1},
  {&__pyx_n_u_integer_object_nulls, __pyx_k_integer_object_nulls, sizeof(__pyx_k_integer_object_nulls), 0, 1, 0, 1},
  {&__pyx_n_s_integer_types, __pyx_k_integer_types, sizeof(__pyx_k_integer_types), 0, 0, 1, 1},
  {&__pyx_n_s_io, __pyx_k_io, sizeof(__pyx_k_io), 0, 0, 1, 1},
  {&__pyx_n_s_is_alive, __pyx_k_is_alive, sizeof(__pyx_k_is_alive), 0, 0, 1, 1},
  {&__pyx_n_s_is_array_like, __pyx_k_is_array_like, sizeof(__pyx_k_is_array_like), 0, 0, 1, 1},
  {&__pyx_n_s_is_boolean_value, __pyx_k_is_boolean_value, sizeof(__pyx_k_is_boolean_value), 0, 0, 1, 1},
  {&__pyx_n_s_is_categorical, __pyx_k_is_categorical, sizeof(__pyx_k_is_categorical), 0, 0, 1, 1},
  {&__pyx_n_s_is_data_frame, __pyx_k_is_data_frame, sizeof(__pyx_k_is_data_frame), 0, 0, 1, 1},
  {&__pyx_n_s_is_datetimetz, __pyx_k_is_datetimetz, sizeof(__pyx_k_is_datetimetz), 0, 0, 1, 1},
  {&__pyx_n_s_is_float_value, __pyx_k_is_float_value, sizeof(__pyx_k_is_float_value), 0, 0, 1, 1},
  {&__pyx_n_s_is_index, __pyx_k_is_index, sizeof(__pyx_k_is_index), 0, 0, 1, 1},
  {&__pyx_n_s_is_integer_value, __pyx_k_is_integer_value, sizeof(__pyx_k_is_integer_value), 0, 0, 1, 1},
  {&__pyx_n_s_is_named_tuple, __pyx_k_is_named_tuple, sizeof(__pyx_k_is_named_tuple), 0, 0, 1, 1},
  {&__pyx_n_s_is_named_tuple_locals_genexpr, __pyx_k_is_named_tuple_locals_genexpr, sizeof(__pyx_k_is_named_tuple_locals_genexpr), 0, 0, 1, 1},
  {&__pyx_n_s_is_pandas_object, __pyx_k_is_pandas_object, sizeof(__pyx_k_is_pandas_object), 0, 0, 1, 1},
  {&__pyx_n_s_is_primitive, __pyx_k_is_primitive, sizeof(__pyx_k_is_primitive), 0, 0, 1, 1},
  {&__pyx_n_s_is_series, __pyx_k_is_series, sizeof(__pyx_k_is_series), 0, 0, 1, 1},
  {&__pyx_n_s_is_sparse, __pyx_k_is_sparse, sizeof(__pyx_k_is_sparse), 0, 0, 1, 1},
  {&__pyx_n_s_item, __pyx_k_item, sizeof(__pyx_k_item), 0, 0, 1, 1},
  {&__pyx_n_u_item, __pyx_k_item, sizeof(__pyx_k_item), 0, 1, 0, 1},
  {&__pyx_n_s_item_type, __pyx_k_item_type, sizeof(__pyx_k_item_type), 0, 0, 1, 1},
  {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
  {&__pyx_n_s_items_2, __pyx_k_items_2, sizeof(__pyx_k_items_2), 0, 0, 1, 1},
  {&__pyx_n_s_iter, __pyx_k_iter, sizeof(__pyx_k_iter), 0, 0, 1, 1},
  {&__pyx_n_s_iterchunks, __pyx_k_iterchunks, sizeof(__pyx_k_iterchunks), 0, 0, 1, 1},
  {&__pyx_n_s_itercolumns, __pyx_k_itercolumns, sizeof(__pyx_k_itercolumns), 0, 0, 1, 1},
  {&__pyx_n_s_iteritems, __pyx_k_iteritems, sizeof(__pyx_k_iteritems), 0, 0, 1, 1},
  {&__pyx_n_s_jemalloc_set_decay_ms, __pyx_k_jemalloc_set_decay_ms, sizeof(__pyx_k_jemalloc_set_decay_ms), 0, 0, 1, 1},
  {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
  {&__pyx_n_s_json, __pyx_k_json, sizeof(__pyx_k_json), 0, 0, 1, 1},
  {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1},
  {&__pyx_n_s_kerb_ticket, __pyx_k_kerb_ticket, sizeof(__pyx_k_kerb_ticket), 0, 0, 1, 1},
  {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1},
  {&__pyx_kp_u_key_must_either_be_a_slice_or_in, __pyx_k_key_must_either_be_a_slice_or_in, sizeof(__pyx_k_key_must_either_be_a_slice_or_in), 0, 1, 0, 0},
  {&__pyx_n_s_key_type, __pyx_k_key_type, sizeof(__pyx_k_key_type), 0, 0, 1, 1},
  {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1},
  {&__pyx_n_s_keys_2, __pyx_k_keys_2, sizeof(__pyx_k_keys_2), 0, 0, 1, 1},
  {&__pyx_n_s_keys_sorted, __pyx_k_keys_sorted, sizeof(__pyx_k_keys_sorted), 0, 0, 1, 1},
  {&__pyx_n_u_kind, __pyx_k_kind, sizeof(__pyx_k_kind), 0, 1, 0, 1},
  {&__pyx_n_s_large_binary, __pyx_k_large_binary, sizeof(__pyx_k_large_binary), 0, 0, 1, 1},
  {&__pyx_n_u_large_binary, __pyx_k_large_binary, sizeof(__pyx_k_large_binary), 0, 1, 0, 1},
  {&__pyx_n_s_large_list, __pyx_k_large_list, sizeof(__pyx_k_large_list), 0, 0, 1, 1},
  {&__pyx_n_u_large_str, __pyx_k_large_str, sizeof(__pyx_k_large_str), 0, 1, 0, 1},
  {&__pyx_n_s_large_string, __pyx_k_large_string, sizeof(__pyx_k_large_string), 0, 0, 1, 1},
  {&__pyx_n_u_large_string, __pyx_k_large_string, sizeof(__pyx_k_large_string), 0, 1, 0, 1},
  {&__pyx_n_s_large_utf8, __pyx_k_large_utf8, sizeof(__pyx_k_large_utf8), 0, 0, 1, 1},
  {&__pyx_n_u_large_utf8, __pyx_k_large_utf8, sizeof(__pyx_k_large_utf8), 0, 1, 0, 1},
  {&__pyx_n_u_last_access_time, __pyx_k_last_access_time, sizeof(__pyx_k_last_access_time), 0, 1, 0, 1},
  {&__pyx_n_u_last_accessed, __pyx_k_last_accessed, sizeof(__pyx_k_last_accessed), 0, 1, 0, 1},
  {&__pyx_n_u_last_modified, __pyx_k_last_modified, sizeof(__pyx_k_last_modified), 0, 1, 0, 1},
  {&__pyx_n_u_last_modified_time, __pyx_k_last_modified_time, sizeof(__pyx_k_last_modified_time), 0, 1, 0, 1},
  {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1},
  {&__pyx_n_s_level, __pyx_k_level, sizeof(__pyx_k_level), 0, 0, 1, 1},
  {&__pyx_n_s_lib, __pyx_k_lib, sizeof(__pyx_k_lib), 0, 0, 1, 1},
  {&__pyx_n_u_libhdfs, __pyx_k_libhdfs, sizeof(__pyx_k_libhdfs), 0, 1, 0, 1},
  {&__pyx_n_u_libhdfs3, __pyx_k_libhdfs3, sizeof(__pyx_k_libhdfs3), 0, 1, 0, 1},
  {&__pyx_n_s_list, __pyx_k_list, sizeof(__pyx_k_list), 0, 0, 1, 1},
  {&__pyx_n_s_list_size, __pyx_k_list_size, sizeof(__pyx_k_list_size), 0, 0, 1, 1},
  {&__pyx_kp_u_list_size_should_be_a_positive_i, __pyx_k_list_size_should_be_a_positive_i, sizeof(__pyx_k_list_size_should_be_a_positive_i), 0, 1, 0, 0},
  {&__pyx_n_s_list_type, __pyx_k_list_type, sizeof(__pyx_k_list_type), 0, 0, 1, 1},
  {&__pyx_n_s_loads, __pyx_k_loads, sizeof(__pyx_k_loads), 0, 0, 1, 1},
  {&__pyx_n_s_log_memory_allocations, __pyx_k_log_memory_allocations, sizeof(__pyx_k_log_memory_allocations), 0, 0, 1, 1},
  {&__pyx_n_s_logging_memory_pool, __pyx_k_logging_memory_pool, sizeof(__pyx_k_logging_memory_pool), 0, 0, 1, 1},
  {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1},
  {&__pyx_n_u_lz4, __pyx_k_lz4, sizeof(__pyx_k_lz4), 0, 1, 0, 1},
  {&__pyx_kp_u_lz4_2, __pyx_k_lz4_2, sizeof(__pyx_k_lz4_2), 0, 1, 0, 0},
  {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1},
  {&__pyx_n_s_ma, __pyx_k_ma, sizeof(__pyx_k_ma), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_make_datetimetz, __pyx_k_make_datetimetz, sizeof(__pyx_k_make_datetimetz), 0, 0, 1, 1},
  {&__pyx_n_s_make_tz_aware, __pyx_k_make_tz_aware, sizeof(__pyx_k_make_tz_aware), 0, 0, 1, 1},
  {&__pyx_n_s_map, __pyx_k_map, sizeof(__pyx_k_map), 0, 0, 1, 1},
  {&__pyx_n_s_map_2, __pyx_k_map_2, sizeof(__pyx_k_map_2), 0, 0, 1, 1},
  {&__pyx_n_s_mapping, __pyx_k_mapping, sizeof(__pyx_k_mapping), 0, 0, 1, 1},
  {&__pyx_n_s_mask, __pyx_k_mask, sizeof(__pyx_k_mask), 0, 0, 1, 1},
  {&__pyx_kp_u_mask_not_implemented_with_Arrow, __pyx_k_mask_not_implemented_with_Arrow, sizeof(__pyx_k_mask_not_implemented_with_Arrow), 0, 1, 0, 0},
  {&__pyx_n_s_match, __pyx_k_match, sizeof(__pyx_k_match), 0, 0, 1, 1},
  {&__pyx_n_s_max_chunksize, __pyx_k_max_chunksize, sizeof(__pyx_k_max_chunksize), 0, 0, 1, 1},
  {&__pyx_n_s_max_output_size, __pyx_k_max_output_size, sizeof(__pyx_k_max_output_size), 0, 0, 1, 1},
  {&__pyx_n_s_memory_map, __pyx_k_memory_map, sizeof(__pyx_k_memory_map), 0, 0, 1, 1},
  {&__pyx_n_s_memory_pool, __pyx_k_memory_pool, sizeof(__pyx_k_memory_pool), 0, 0, 1, 1},
  {&__pyx_n_s_memoryview, __pyx_k_memoryview, sizeof(__pyx_k_memoryview), 0, 0, 1, 1},
  {&__pyx_n_s_message, __pyx_k_message, sizeof(__pyx_k_message), 0, 0, 1, 1},
  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  {&__pyx_n_s_metadata, __pyx_k_metadata, sizeof(__pyx_k_metadata), 0, 0, 1, 1},
  {&__pyx_kp_u_metadata_2, __pyx_k_metadata_2, sizeof(__pyx_k_metadata_2), 0, 1, 0, 0},
  {&__pyx_n_s_metadata_length, __pyx_k_metadata_length, sizeof(__pyx_k_metadata_length), 0, 0, 1, 1},
  {&__pyx_n_s_micros, __pyx_k_micros, sizeof(__pyx_k_micros), 0, 0, 1, 1},
  {&__pyx_n_s_microsecond, __pyx_k_microsecond, sizeof(__pyx_k_microsecond), 0, 0, 1, 1},
  {&__pyx_n_s_microseconds, __pyx_k_microseconds, sizeof(__pyx_k_microseconds), 0, 0, 1, 1},
  {&__pyx_n_s_microseconds_to_datetime, __pyx_k_microseconds_to_datetime, sizeof(__pyx_k_microseconds_to_datetime), 0, 0, 1, 1},
  {&__pyx_n_s_millis, __pyx_k_millis, sizeof(__pyx_k_millis), 0, 0, 1, 1},
  {&__pyx_n_s_millis_to_datetime, __pyx_k_millis_to_datetime, sizeof(__pyx_k_millis_to_datetime), 0, 0, 1, 1},
  {&__pyx_n_s_milliseconds, __pyx_k_milliseconds, sizeof(__pyx_k_milliseconds), 0, 0, 1, 1},
  {&__pyx_n_s_minutes, __pyx_k_minutes, sizeof(__pyx_k_minutes), 0, 0, 1, 1},
  {&__pyx_n_s_missing, __pyx_k_missing, sizeof(__pyx_k_missing), 0, 0, 1, 1},
  {&__pyx_n_s_mmap, __pyx_k_mmap, sizeof(__pyx_k_mmap), 0, 0, 1, 1},
  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
  {&__pyx_n_s_mro, __pyx_k_mro, sizeof(__pyx_k_mro), 0, 0, 1, 1},
  {&__pyx_n_u_ms, __pyx_k_ms, sizeof(__pyx_k_ms), 0, 1, 0, 1},
  {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  {&__pyx_n_u_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 1, 0, 1},
  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
  {&__pyx_n_s_name_3, __pyx_k_name_3, sizeof(__pyx_k_name_3), 0, 0, 1, 1},
  {&__pyx_n_s_names, __pyx_k_names, sizeof(__pyx_k_names), 0, 0, 1, 1},
  {&__pyx_n_s_nan, __pyx_k_nan, sizeof(__pyx_k_nan), 0, 0, 1, 1},
  {&__pyx_n_s_nanoseconds_to_datetime_safe, __pyx_k_nanoseconds_to_datetime_safe, sizeof(__pyx_k_nanoseconds_to_datetime_safe), 0, 0, 1, 1},
  {&__pyx_n_s_nanoseconds_to_timedelta_safe, __pyx_k_nanoseconds_to_timedelta_safe, sizeof(__pyx_k_nanoseconds_to_timedelta_safe), 0, 0, 1, 1},
  {&__pyx_n_s_nbytes, __pyx_k_nbytes, sizeof(__pyx_k_nbytes), 0, 0, 1, 1},
  {&__pyx_n_s_ndarray, __pyx_k_ndarray, sizeof(__pyx_k_ndarray), 0, 0, 1, 1},
  {&__pyx_n_s_ndarray_to_arrow_type, __pyx_k_ndarray_to_arrow_type, sizeof(__pyx_k_ndarray_to_arrow_type), 0, 0, 1, 1},
  {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
  {&__pyx_n_s_new_path, __pyx_k_new_path, sizeof(__pyx_k_new_path), 0, 0, 1, 1},
  {&__pyx_n_s_new_size, __pyx_k_new_size, sizeof(__pyx_k_new_size), 0, 0, 1, 1},
  {&__pyx_n_s_nf, __pyx_k_nf, sizeof(__pyx_k_nf), 0, 0, 1, 1},
  {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
  {&__pyx_n_s_normalize_slice, __pyx_k_normalize_slice, sizeof(__pyx_k_normalize_slice), 0, 0, 1, 1},
  {&__pyx_kp_u_not_registered_in_deserializati, __pyx_k_not_registered_in_deserializati, sizeof(__pyx_k_not_registered_in_deserializati), 0, 1, 0, 0},
  {&__pyx_kp_u_not_supported_for_buffer_protoc, __pyx_k_not_supported_for_buffer_protoc, sizeof(__pyx_k_not_supported_for_buffer_protoc), 0, 1, 0, 0},
  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
  {&__pyx_n_u_ns, __pyx_k_ns, sizeof(__pyx_k_ns), 0, 1, 0, 1},
  {&__pyx_n_s_nthreads, __pyx_k_nthreads, sizeof(__pyx_k_nthreads), 0, 0, 1, 1},
  {&__pyx_n_s_null, __pyx_k_null, sizeof(__pyx_k_null), 0, 0, 1, 1},
  {&__pyx_n_u_null, __pyx_k_null, sizeof(__pyx_k_null), 0, 1, 0, 1},
  {&__pyx_n_s_null_bitmap, __pyx_k_null_bitmap, sizeof(__pyx_k_null_bitmap), 0, 0, 1, 1},
  {&__pyx_n_s_null_count, __pyx_k_null_count, sizeof(__pyx_k_null_count), 0, 0, 1, 1},
  {&__pyx_n_s_nullable, __pyx_k_nullable, sizeof(__pyx_k_nullable), 0, 0, 1, 1},
  {&__pyx_n_s_num_arrays, __pyx_k_num_arrays, sizeof(__pyx_k_num_arrays), 0, 0, 1, 1},
  {&__pyx_n_s_num_buffers, __pyx_k_num_buffers, sizeof(__pyx_k_num_buffers), 0, 0, 1, 1},
  {&__pyx_n_u_num_buffers, __pyx_k_num_buffers, sizeof(__pyx_k_num_buffers), 0, 1, 0, 1},
  {&__pyx_n_s_num_children, __pyx_k_num_children, sizeof(__pyx_k_num_children), 0, 0, 1, 1},
  {&__pyx_n_s_num_chunks, __pyx_k_num_chunks, sizeof(__pyx_k_num_chunks), 0, 0, 1, 1},
  {&__pyx_n_s_num_columns, __pyx_k_num_columns, sizeof(__pyx_k_num_columns), 0, 0, 1, 1},
  {&__pyx_n_s_num_ndarrays, __pyx_k_num_ndarrays, sizeof(__pyx_k_num_ndarrays), 0, 0, 1, 1},
  {&__pyx_n_u_num_ndarrays, __pyx_k_num_ndarrays, sizeof(__pyx_k_num_ndarrays), 0, 1, 0, 1},
  {&__pyx_n_s_num_record_batches, __pyx_k_num_record_batches, sizeof(__pyx_k_num_record_batches), 0, 0, 1, 1},
  {&__pyx_n_s_num_rows, __pyx_k_num_rows, sizeof(__pyx_k_num_rows), 0, 0, 1, 1},
  {&__pyx_n_s_num_sparse_tensors, __pyx_k_num_sparse_tensors, sizeof(__pyx_k_num_sparse_tensors), 0, 0, 1, 1},
  {&__pyx_n_u_num_sparse_tensors, __pyx_k_num_sparse_tensors, sizeof(__pyx_k_num_sparse_tensors), 0, 1, 0, 1},
  {&__pyx_n_s_num_tensors, __pyx_k_num_tensors, sizeof(__pyx_k_num_tensors), 0, 0, 1, 1},
  {&__pyx_n_u_num_tensors, __pyx_k_num_tensors, sizeof(__pyx_k_num_tensors), 0, 1, 0, 1},
  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
  {&__pyx_n_s_o, __pyx_k_o, sizeof(__pyx_k_o), 0, 0, 1, 1},
  {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
  {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
  {&__pyx_n_s_object_2, __pyx_k_object_2, sizeof(__pyx_k_object_2), 0, 0, 1, 1},
  {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1},
  {&__pyx_n_s_offsets, __pyx_k_offsets, sizeof(__pyx_k_offsets), 0, 0, 1, 1},
  {&__pyx_n_s_offsets_2, __pyx_k_offsets_2, sizeof(__pyx_k_offsets_2), 0, 0, 1, 1},
  {&__pyx_kp_u_only_slices_with_step_1_supporte, __pyx_k_only_slices_with_step_1_supporte, sizeof(__pyx_k_only_slices_with_step_1_supporte), 0, 1, 0, 0},
  {&__pyx_kp_u_only_valid_on_readonly_files, __pyx_k_only_valid_on_readonly_files, sizeof(__pyx_k_only_valid_on_readonly_files), 0, 1, 0, 0},
  {&__pyx_kp_u_only_valid_on_seekable_files, __pyx_k_only_valid_on_seekable_files, sizeof(__pyx_k_only_valid_on_seekable_files), 0, 1, 0, 0},
  {&__pyx_kp_u_only_valid_on_writable_files, __pyx_k_only_valid_on_writable_files, sizeof(__pyx_k_only_valid_on_writable_files), 0, 1, 0, 0},
  {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1},
  {&__pyx_n_s_open_2, __pyx_k_open_2, sizeof(__pyx_k_open_2), 0, 0, 1, 1},
  {&__pyx_n_s_open_stream, __pyx_k_open_stream, sizeof(__pyx_k_open_stream), 0, 0, 1, 1},
  {&__pyx_n_s_options, __pyx_k_options, sizeof(__pyx_k_options), 0, 0, 1, 1},
  {&__pyx_n_s_ordered, __pyx_k_ordered, sizeof(__pyx_k_ordered), 0, 0, 1, 1},
  {&__pyx_n_u_ordered, __pyx_k_ordered, sizeof(__pyx_k_ordered), 0, 1, 0, 1},
  {&__pyx_n_s_ordered_dict, __pyx_k_ordered_dict, sizeof(__pyx_k_ordered_dict), 0, 0, 1, 1},
  {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1},
  {&__pyx_n_s_other, __pyx_k_other, sizeof(__pyx_k_other), 0, 0, 1, 1},
  {&__pyx_n_s_out, __pyx_k_out, sizeof(__pyx_k_out), 0, 0, 1, 1},
  {&__pyx_n_s_out_buf, __pyx_k_out_buf, sizeof(__pyx_k_out_buf), 0, 0, 1, 1},
  {&__pyx_n_s_output_buffer, __pyx_k_output_buffer, sizeof(__pyx_k_output_buffer), 0, 0, 1, 1},
  {&__pyx_n_s_output_length, __pyx_k_output_length, sizeof(__pyx_k_output_length), 0, 0, 1, 1},
  {&__pyx_n_s_output_size, __pyx_k_output_size, sizeof(__pyx_k_output_size), 0, 0, 1, 1},
  {&__pyx_n_s_output_stream, __pyx_k_output_stream, sizeof(__pyx_k_output_stream), 0, 0, 1, 1},
  {&__pyx_n_s_owned_buf, __pyx_k_owned_buf, sizeof(__pyx_k_owned_buf), 0, 0, 1, 1},
  {&__pyx_n_s_owner, __pyx_k_owner, sizeof(__pyx_k_owner), 0, 0, 1, 1},
  {&__pyx_n_u_owner, __pyx_k_owner, sizeof(__pyx_k_owner), 0, 1, 0, 1},
  {&__pyx_n_u_pa_getnewargs, __pyx_k_pa_getnewargs, sizeof(__pyx_k_pa_getnewargs), 0, 1, 0, 1},
  {&__pyx_kp_u_pa_input_stream_called_with_inst, __pyx_k_pa_input_stream_called_with_inst, sizeof(__pyx_k_pa_input_stream_called_with_inst), 0, 1, 0, 0},
  {&__pyx_kp_u_pa_output_stream_called_with_ins, __pyx_k_pa_output_stream_called_with_ins, sizeof(__pyx_k_pa_output_stream_called_with_ins), 0, 1, 0, 0},
  {&__pyx_n_b_pandas, __pyx_k_pandas, sizeof(__pyx_k_pandas), 0, 0, 0, 1},
  {&__pyx_n_s_pandas, __pyx_k_pandas, sizeof(__pyx_k_pandas), 0, 0, 1, 1},
  {&__pyx_n_s_pandas_api, __pyx_k_pandas_api, sizeof(__pyx_k_pandas_api), 0, 0, 1, 1},
  {&__pyx_n_s_pandas_api_types, __pyx_k_pandas_api_types, sizeof(__pyx_k_pandas_api_types), 0, 0, 1, 1},
  {&__pyx_n_s_pandas_dtype, __pyx_k_pandas_dtype, sizeof(__pyx_k_pandas_dtype), 0, 0, 1, 1},
  {&__pyx_n_s_pandas_types_dtypes, __pyx_k_pandas_types_dtypes, sizeof(__pyx_k_pandas_types_dtypes), 0, 0, 1, 1},
  {&__pyx_n_s_parent, __pyx_k_parent, sizeof(__pyx_k_parent), 0, 0, 1, 1},
  {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1},
  {&__pyx_n_u_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 1, 0, 1},
  {&__pyx_n_s_pd, __pyx_k_pd, sizeof(__pyx_k_pd), 0, 0, 1, 1},
  {&__pyx_n_u_permissions, __pyx_k_permissions, sizeof(__pyx_k_permissions), 0, 1, 0, 1},
  {&__pyx_n_s_pformat, __pyx_k_pformat, sizeof(__pyx_k_pformat), 0, 0, 1, 1},
  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
  {&__pyx_n_u_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 1, 0, 1},
  {&__pyx_kp_u_please_pass_it_explicitly, __pyx_k_please_pass_it_explicitly, sizeof(__pyx_k_please_pass_it_explicitly), 0, 1, 0, 0},
  {&__pyx_n_s_pool, __pyx_k_pool, sizeof(__pyx_k_pool), 0, 0, 1, 1},
  {&__pyx_n_u_pool, __pyx_k_pool, sizeof(__pyx_k_pool), 0, 1, 0, 1},
  {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1},
  {&__pyx_n_s_port, __pyx_k_port, sizeof(__pyx_k_port), 0, 0, 1, 1},
  {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1},
  {&__pyx_n_s_position, __pyx_k_position, sizeof(__pyx_k_position), 0, 0, 1, 1},
  {&__pyx_n_s_pprint, __pyx_k_pprint, sizeof(__pyx_k_pprint), 0, 0, 1, 1},
  {&__pyx_n_s_precision, __pyx_k_precision, sizeof(__pyx_k_precision), 0, 0, 1, 1},
  {&__pyx_kp_u_precision_should_be_between_1_an, __pyx_k_precision_should_be_between_1_an, sizeof(__pyx_k_precision_should_be_between_1_an), 0, 1, 0, 0},
  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
  {&__pyx_n_s_present, __pyx_k_present, sizeof(__pyx_k_present), 0, 0, 1, 1},
  {&__pyx_n_s_preserve_index, __pyx_k_preserve_index, sizeof(__pyx_k_preserve_index), 0, 0, 1, 1},
  {&__pyx_kp_u_prior_column_had_a_different_num, __pyx_k_prior_column_had_a_different_num, sizeof(__pyx_k_prior_column_had_a_different_num), 0, 1, 0, 0},
  {&__pyx_n_s_promote, __pyx_k_promote, sizeof(__pyx_k_promote), 0, 0, 1, 1},
  {&__pyx_n_s_proxy_memory_pool, __pyx_k_proxy_memory_pool, sizeof(__pyx_k_proxy_memory_pool), 0, 0, 1, 1},
  {&__pyx_n_s_put_nowait, __pyx_k_put_nowait, sizeof(__pyx_k_put_nowait), 0, 0, 1, 1},
  {&__pyx_n_s_py_buffer, __pyx_k_py_buffer, sizeof(__pyx_k_py_buffer), 0, 0, 1, 1},
  {&__pyx_n_s_py_field, __pyx_k_py_field, sizeof(__pyx_k_py_field), 0, 0, 1, 1},
  {&__pyx_kp_u_pyarrow, __pyx_k_pyarrow, sizeof(__pyx_k_pyarrow), 0, 1, 0, 0},
  {&__pyx_n_s_pyarrow_2, __pyx_k_pyarrow_2, sizeof(__pyx_k_pyarrow_2), 0, 0, 1, 1},
  {&__pyx_kp_u_pyarrow_Field_0, __pyx_k_pyarrow_Field_0, sizeof(__pyx_k_pyarrow_Field_0), 0, 1, 0, 0},
  {&__pyx_kp_u_pyarrow_Message_type_0_metadata, __pyx_k_pyarrow_Message_type_0_metadata, sizeof(__pyx_k_pyarrow_Message_type_0_metadata), 0, 1, 0, 0},
  {&__pyx_kp_u_pyarrow_Message_unitialized, __pyx_k_pyarrow_Message_unitialized, sizeof(__pyx_k_pyarrow_Message_unitialized), 0, 1, 0, 0},
  {&__pyx_kp_u_pyarrow_SparseCOOTensor_type_0, __pyx_k_pyarrow_SparseCOOTensor_type_0, sizeof(__pyx_k_pyarrow_SparseCOOTensor_type_0), 0, 1, 0, 0},
  {&__pyx_kp_u_pyarrow_SparseCSRMatrix_type_0, __pyx_k_pyarrow_SparseCSRMatrix_type_0, sizeof(__pyx_k_pyarrow_SparseCSRMatrix_type_0), 0, 1, 0, 0},
  {&__pyx_kp_u_pyarrow_Tensor_type_0_type_shap, __pyx_k_pyarrow_Tensor_type_0_type_shap, sizeof(__pyx_k_pyarrow_Tensor_type_0_type_shap), 0, 1, 0, 0},
  {&__pyx_kp_s_pyarrow_array_pxi, __pyx_k_pyarrow_array_pxi, sizeof(__pyx_k_pyarrow_array_pxi), 0, 0, 1, 0},
  {&__pyx_kp_s_pyarrow_benchmark_pxi, __pyx_k_pyarrow_benchmark_pxi, sizeof(__pyx_k_pyarrow_benchmark_pxi), 0, 0, 1, 0},
  {&__pyx_n_s_pyarrow_compat, __pyx_k_pyarrow_compat, sizeof(__pyx_k_pyarrow_compat), 0, 0, 1, 1},
  {&__pyx_kp_s_pyarrow_compute_pxi, __pyx_k_pyarrow_compute_pxi, sizeof(__pyx_k_pyarrow_compute_pxi), 0, 0, 1, 0},
  {&__pyx_kp_u_pyarrow_does_not_know_how_to_ser, __pyx_k_pyarrow_does_not_know_how_to_ser, sizeof(__pyx_k_pyarrow_does_not_know_how_to_ser), 0, 1, 0, 0},
  {&__pyx_kp_s_pyarrow_error_pxi, __pyx_k_pyarrow_error_pxi, sizeof(__pyx_k_pyarrow_error_pxi), 0, 0, 1, 0},
  {&__pyx_kp_s_pyarrow_io_hdfs_pxi, __pyx_k_pyarrow_io_hdfs_pxi, sizeof(__pyx_k_pyarrow_io_hdfs_pxi), 0, 0, 1, 0},
  {&__pyx_kp_s_pyarrow_io_pxi, __pyx_k_pyarrow_io_pxi, sizeof(__pyx_k_pyarrow_io_pxi), 0, 0, 1, 0},
  {&__pyx_kp_s_pyarrow_ipc_pxi, __pyx_k_pyarrow_ipc_pxi, sizeof(__pyx_k_pyarrow_ipc_pxi), 0, 0, 1, 0},
  {&__pyx_n_s_pyarrow_lib, __pyx_k_pyarrow_lib, sizeof(__pyx_k_pyarrow_lib), 0, 0, 1, 1},
  {&__pyx_kp_s_pyarrow_lib_pyx, __pyx_k_pyarrow_lib_pyx, sizeof(__pyx_k_pyarrow_lib_pyx), 0, 0, 1, 0},
  {&__pyx_kp_s_pyarrow_memory_pxi, __pyx_k_pyarrow_memory_pxi, sizeof(__pyx_k_pyarrow_memory_pxi), 0, 0, 1, 0},
  {&__pyx_n_s_pyarrow_pandas_compat, __pyx_k_pyarrow_pandas_compat, sizeof(__pyx_k_pyarrow_pandas_compat), 0, 0, 1, 1},
  {&__pyx_kp_s_pyarrow_scalar_pxi, __pyx_k_pyarrow_scalar_pxi, sizeof(__pyx_k_pyarrow_scalar_pxi), 0, 0, 1, 0},
  {&__pyx_n_s_pyarrow_serialization, __pyx_k_pyarrow_serialization, sizeof(__pyx_k_pyarrow_serialization), 0, 0, 1, 1},
  {&__pyx_kp_s_pyarrow_serialization_pxi, __pyx_k_pyarrow_serialization_pxi, sizeof(__pyx_k_pyarrow_serialization_pxi), 0, 0, 1, 0},
  {&__pyx_kp_s_pyarrow_table_pxi, __pyx_k_pyarrow_table_pxi, sizeof(__pyx_k_pyarrow_table_pxi), 0, 0, 1, 0},
  {&__pyx_kp_s_pyarrow_tensor_pxi, __pyx_k_pyarrow_tensor_pxi, sizeof(__pyx_k_pyarrow_tensor_pxi), 0, 0, 1, 0},
  {&__pyx_kp_s_pyarrow_types_pxi, __pyx_k_pyarrow_types_pxi, sizeof(__pyx_k_pyarrow_types_pxi), 0, 0, 1, 0},
  {&__pyx_n_s_pyarrow_util, __pyx_k_pyarrow_util, sizeof(__pyx_k_pyarrow_util), 0, 0, 1, 1},
  {&__pyx_n_s_pybuf, __pyx_k_pybuf, sizeof(__pyx_k_pybuf), 0, 0, 1, 1},
  {&__pyx_n_s_pydecimal, __pyx_k_pydecimal, sizeof(__pyx_k_pydecimal), 0, 0, 1, 1},
  {&__pyx_n_s_pyobj, __pyx_k_pyobj, sizeof(__pyx_k_pyobj), 0, 0, 1, 1},
  {&__pyx_n_s_python_extension_types_registry, __pyx_k_python_extension_types_registry, sizeof(__pyx_k_python_extension_types_registry), 0, 0, 1, 1},
  {&__pyx_n_u_pytype, __pyx_k_pytype, sizeof(__pyx_k_pytype), 0, 1, 0, 1},
  {&__pyx_n_s_pytz, __pyx_k_pytz, sizeof(__pyx_k_pytz), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_unpickle_Scalar, __pyx_k_pyx_unpickle_Scalar, sizeof(__pyx_k_pyx_unpickle_Scalar), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_unpickle_SerializationCont, __pyx_k_pyx_unpickle_SerializationCont, sizeof(__pyx_k_pyx_unpickle_SerializationCont), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_unpickle__PandasAPIShim, __pyx_k_pyx_unpickle__PandasAPIShim, sizeof(__pyx_k_pyx_unpickle__PandasAPIShim), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_unpickle__PandasConvertibl, __pyx_k_pyx_unpickle__PandasConvertibl, sizeof(__pyx_k_pyx_unpickle__PandasConvertibl), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
  {&__pyx_n_b_q, __pyx_k_q, sizeof(__pyx_k_q), 0, 0, 0, 1},
  {&__pyx_n_s_qsize, __pyx_k_qsize, sizeof(__pyx_k_qsize), 0, 0, 1, 1},
  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
  {&__pyx_n_s_queue, __pyx_k_queue, sizeof(__pyx_k_queue), 0, 0, 1, 1},
  {&__pyx_n_u_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 1, 0, 1},
  {&__pyx_kp_u_r_2, __pyx_k_r_2, sizeof(__pyx_k_r_2), 0, 1, 0, 0},
  {&__pyx_kp_u_r_b, __pyx_k_r_b, sizeof(__pyx_k_r_b), 0, 1, 0, 0},
  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {&__pyx_kp_u_rb, __pyx_k_rb, sizeof(__pyx_k_rb), 0, 1, 0, 0},
  {&__pyx_n_u_rb_2, __pyx_k_rb_2, sizeof(__pyx_k_rb_2), 0, 1, 0, 1},
  {&__pyx_n_s_re, __pyx_k_re, sizeof(__pyx_k_re), 0, 0, 1, 1},
  {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1},
  {&__pyx_n_u_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 1, 0, 1},
  {&__pyx_n_s_read_message, __pyx_k_read_message, sizeof(__pyx_k_read_message), 0, 0, 1, 1},
  {&__pyx_n_s_read_next_batch, __pyx_k_read_next_batch, sizeof(__pyx_k_read_next_batch), 0, 0, 1, 1},
  {&__pyx_n_s_read_next_message, __pyx_k_read_next_message, sizeof(__pyx_k_read_next_message), 0, 0, 1, 1},
  {&__pyx_n_s_read_record_batch, __pyx_k_read_record_batch, sizeof(__pyx_k_read_record_batch), 0, 0, 1, 1},
  {&__pyx_n_s_read_schema, __pyx_k_read_schema, sizeof(__pyx_k_read_schema), 0, 0, 1, 1},
  {&__pyx_n_s_read_serialized, __pyx_k_read_serialized, sizeof(__pyx_k_read_serialized), 0, 0, 1, 1},
  {&__pyx_n_s_read_tensor, __pyx_k_read_tensor, sizeof(__pyx_k_read_tensor), 0, 0, 1, 1},
  {&__pyx_n_s_readable, __pyx_k_readable, sizeof(__pyx_k_readable), 0, 0, 1, 1},
  {&__pyx_kp_u_readable_file_expected, __pyx_k_readable_file_expected, sizeof(__pyx_k_readable_file_expected), 0, 1, 0, 0},
  {&__pyx_n_s_reader, __pyx_k_reader, sizeof(__pyx_k_reader), 0, 0, 1, 1},
  {&__pyx_n_s_readline, __pyx_k_readline, sizeof(__pyx_k_readline), 0, 0, 1, 1},
  {&__pyx_n_s_readlines, __pyx_k_readlines, sizeof(__pyx_k_readlines), 0, 0, 1, 1},
  {&__pyx_n_s_reconstruct_record_batch, __pyx_k_reconstruct_record_batch, sizeof(__pyx_k_reconstruct_record_batch), 0, 0, 1, 1},
  {&__pyx_n_s_reconstruct_table, __pyx_k_reconstruct_table, sizeof(__pyx_k_reconstruct_table), 0, 0, 1, 1},
  {&__pyx_n_s_record_batch, __pyx_k_record_batch, sizeof(__pyx_k_record_batch), 0, 0, 1, 1},
  {&__pyx_n_s_recursive, __pyx_k_recursive, sizeof(__pyx_k_recursive), 0, 0, 1, 1},
  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
  {&__pyx_n_s_ref, __pyx_k_ref, sizeof(__pyx_k_ref), 0, 0, 1, 1},
  {&__pyx_n_s_register, __pyx_k_register, sizeof(__pyx_k_register), 0, 0, 1, 1},
  {&__pyx_n_s_register_default_serialization_h, __pyx_k_register_default_serialization_h, sizeof(__pyx_k_register_default_serialization_h), 0, 0, 1, 1},
  {&__pyx_n_s_register_extension_type, __pyx_k_register_extension_type, sizeof(__pyx_k_register_extension_type), 0, 0, 1, 1},
  {&__pyx_n_s_register_py_extension_type, __pyx_k_register_py_extension_type, sizeof(__pyx_k_register_py_extension_type), 0, 0, 1, 1},
  {&__pyx_n_s_registry_nanny, __pyx_k_registry_nanny, sizeof(__pyx_k_registry_nanny), 0, 0, 1, 1},
  {&__pyx_n_s_release_registry, __pyx_k_release_registry, sizeof(__pyx_k_release_registry), 0, 0, 1, 1},
  {&__pyx_n_s_remove_column, __pyx_k_remove_column, sizeof(__pyx_k_remove_column), 0, 0, 1, 1},
  {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1},
  {&__pyx_n_s_replication, __pyx_k_replication, sizeof(__pyx_k_replication), 0, 0, 1, 1},
  {&__pyx_n_u_replication, __pyx_k_replication, sizeof(__pyx_k_replication), 0, 1, 0, 1},
  {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1},
  {&__pyx_n_s_require, __pyx_k_require, sizeof(__pyx_k_require), 0, 0, 1, 1},
  {&__pyx_n_s_requirements, __pyx_k_requirements, sizeof(__pyx_k_requirements), 0, 0, 1, 1},
  {&__pyx_n_s_res, __pyx_k_res, sizeof(__pyx_k_res), 0, 0, 1, 1},
  {&__pyx_n_s_resizable, __pyx_k_resizable, sizeof(__pyx_k_resizable), 0, 0, 1, 1},
  {&__pyx_n_s_resize, __pyx_k_resize, sizeof(__pyx_k_resize), 0, 0, 1, 1},
  {&__pyx_n_s_restore_array, __pyx_k_restore_array, sizeof(__pyx_k_restore_array), 0, 0, 1, 1},
  {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1},
  {&__pyx_n_s_result_obj, __pyx_k_result_obj, sizeof(__pyx_k_result_obj), 0, 0, 1, 1},
  {&__pyx_n_s_row, __pyx_k_row, sizeof(__pyx_k_row), 0, 0, 1, 1},
  {&__pyx_n_s_rz_buffer, __pyx_k_rz_buffer, sizeof(__pyx_k_rz_buffer), 0, 0, 1, 1},
  {&__pyx_n_u_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 1, 0, 1},
  {&__pyx_n_s_safe, __pyx_k_safe, sizeof(__pyx_k_safe), 0, 0, 1, 1},
  {&__pyx_n_s_scale, __pyx_k_scale, sizeof(__pyx_k_scale), 0, 0, 1, 1},
  {&__pyx_n_s_schema, __pyx_k_schema, sizeof(__pyx_k_schema), 0, 0, 1, 1},
  {&__pyx_n_s_scipy, __pyx_k_scipy, sizeof(__pyx_k_scipy), 0, 0, 1, 1},
  {&__pyx_n_s_scipy_sparse, __pyx_k_scipy_sparse, sizeof(__pyx_k_scipy_sparse), 0, 0, 1, 1},
  {&__pyx_n_s_seconds, __pyx_k_seconds, sizeof(__pyx_k_seconds), 0, 0, 1, 1},
  {&__pyx_n_s_seconds_to_datetime, __pyx_k_seconds_to_datetime, sizeof(__pyx_k_seconds_to_datetime), 0, 0, 1, 1},
  {&__pyx_n_s_seek, __pyx_k_seek, sizeof(__pyx_k_seek), 0, 0, 1, 1},
  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
  {&__pyx_kp_s_self_ap_self_sp_array_cannot_be, __pyx_k_self_ap_self_sp_array_cannot_be, sizeof(__pyx_k_self_ap_self_sp_array_cannot_be), 0, 0, 1, 0},
  {&__pyx_kp_s_self_client_cannot_be_converted, __pyx_k_self_client_cannot_be_converted, sizeof(__pyx_k_self_client_cannot_be_converted), 0, 0, 1, 0},
  {&__pyx_kp_s_self_data_cannot_be_converted_to, __pyx_k_self_data_cannot_be_converted_to, sizeof(__pyx_k_self_data_cannot_be_converted_to), 0, 0, 1, 0},
  {&__pyx_n_s_self_destruct, __pyx_k_self_destruct, sizeof(__pyx_k_self_destruct), 0, 0, 1, 1},
  {&__pyx_n_u_self_destruct, __pyx_k_self_destruct, sizeof(__pyx_k_self_destruct), 0, 1, 0, 1},
  {&__pyx_kp_s_self_logging_pool_self_pool_cann, __pyx_k_self_logging_pool_self_pool_cann, sizeof(__pyx_k_self_logging_pool_self_pool_cann), 0, 0, 1, 0},
  {&__pyx_kp_s_self_options_cannot_be_converted, __pyx_k_self_options_cannot_be_converted, sizeof(__pyx_k_self_options_cannot_be_converted), 0, 0, 1, 0},
  {&__pyx_kp_s_self_pool_cannot_be_converted_to, __pyx_k_self_pool_cannot_be_converted_to, sizeof(__pyx_k_self_pool_cannot_be_converted_to), 0, 0, 1, 0},
  {&__pyx_kp_s_self_pool_self_proxy_pool_cannot, __pyx_k_self_pool_self_proxy_pool_cannot, sizeof(__pyx_k_self_pool_self_proxy_pool_cannot), 0, 0, 1, 0},
  {&__pyx_kp_s_self_reader_cannot_be_converted, __pyx_k_self_reader_cannot_be_converted, sizeof(__pyx_k_self_reader_cannot_be_converted), 0, 0, 1, 0},
  {&__pyx_kp_s_self_sp_array_cannot_be_converte, __pyx_k_self_sp_array_cannot_be_converte, sizeof(__pyx_k_self_sp_array_cannot_be_converte), 0, 0, 1, 0},
  {&__pyx_kp_s_self_sp_scalar_cannot_be_convert, __pyx_k_self_sp_scalar_cannot_be_convert, sizeof(__pyx_k_self_sp_scalar_cannot_be_convert), 0, 0, 1, 0},
  {&__pyx_kp_s_self_sp_sparse_tensor_self_stp_c, __pyx_k_self_sp_sparse_tensor_self_stp_c, sizeof(__pyx_k_self_sp_sparse_tensor_self_stp_c), 0, 0, 1, 0},
  {&__pyx_kp_s_self_sp_tensor_self_tp_cannot_be, __pyx_k_self_sp_tensor_self_tp_cannot_be, sizeof(__pyx_k_self_sp_tensor_self_tp_cannot_be), 0, 0, 1, 0},
  {&__pyx_kp_s_self_writer_cannot_be_converted, __pyx_k_self_writer_cannot_be_converted, sizeof(__pyx_k_self_writer_cannot_be_converted), 0, 0, 1, 0},
  {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
  {&__pyx_n_s_serialize, __pyx_k_serialize, sizeof(__pyx_k_serialize), 0, 0, 1, 1},
  {&__pyx_n_s_serialize_to, __pyx_k_serialize_to, sizeof(__pyx_k_serialize_to), 0, 0, 1, 1},
  {&__pyx_n_s_serialized, __pyx_k_serialized, sizeof(__pyx_k_serialized), 0, 0, 1, 1},
  {&__pyx_n_s_serializer, __pyx_k_serializer, sizeof(__pyx_k_serializer), 0, 0, 1, 1},
  {&__pyx_n_s_series, __pyx_k_series, sizeof(__pyx_k_series), 0, 0, 1, 1},
  {&__pyx_n_s_set_cpu_count, __pyx_k_set_cpu_count, sizeof(__pyx_k_set_cpu_count), 0, 0, 1, 1},
  {&__pyx_n_s_set_memcopy_threads, __pyx_k_set_memcopy_threads, sizeof(__pyx_k_set_memcopy_threads), 0, 0, 1, 1},
  {&__pyx_n_s_set_memory_pool, __pyx_k_set_memory_pool, sizeof(__pyx_k_set_memory_pool), 0, 0, 1, 1},
  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
  {&__pyx_n_s_shrink_to_fit, __pyx_k_shrink_to_fit, sizeof(__pyx_k_shrink_to_fit), 0, 0, 1, 1},
  {&__pyx_n_s_sign, __pyx_k_sign, sizeof(__pyx_k_sign), 0, 0, 1, 1},
  {&__pyx_n_s_sink, __pyx_k_sink, sizeof(__pyx_k_sink), 0, 0, 1, 1},
  {&__pyx_n_s_six, __pyx_k_six, sizeof(__pyx_k_six), 0, 0, 1, 1},
  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
  {&__pyx_n_u_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 1, 0, 1},
  {&__pyx_n_s_sizeof, __pyx_k_sizeof, sizeof(__pyx_k_sizeof), 0, 0, 1, 1},
  {&__pyx_n_s_skipna, __pyx_k_skipna, sizeof(__pyx_k_skipna), 0, 0, 1, 1},
  {&__pyx_n_s_sleep, __pyx_k_sleep, sizeof(__pyx_k_sleep), 0, 0, 1, 1},
  {&__pyx_n_s_slice, __pyx_k_slice, sizeof(__pyx_k_slice), 0, 0, 1, 1},
  {&__pyx_n_s_slots, __pyx_k_slots, sizeof(__pyx_k_slots), 0, 0, 1, 1},
  {&__pyx_n_u_snappy, __pyx_k_snappy, sizeof(__pyx_k_snappy), 0, 1, 0, 1},
  {&__pyx_n_s_source, __pyx_k_source, sizeof(__pyx_k_source), 0, 0, 1, 1},
  {&__pyx_n_s_source_path, __pyx_k_source_path, sizeof(__pyx_k_source_path), 0, 0, 1, 1},
  {&__pyx_n_s_sp_chunked_array, __pyx_k_sp_chunked_array, sizeof(__pyx_k_sp_chunked_array), 0, 0, 1, 1},
  {&__pyx_n_s_sp_data_type, __pyx_k_sp_data_type, sizeof(__pyx_k_sp_data_type), 0, 0, 1, 1},
  {&__pyx_n_s_sp_tensor, __pyx_k_sp_tensor, sizeof(__pyx_k_sp_tensor), 0, 0, 1, 1},
  {&__pyx_n_s_sparse, __pyx_k_sparse, sizeof(__pyx_k_sparse), 0, 0, 1, 1},
  {&__pyx_n_u_sparse, __pyx_k_sparse, sizeof(__pyx_k_sparse), 0, 1, 0, 1},
  {&__pyx_n_s_split_blocks, __pyx_k_split_blocks, sizeof(__pyx_k_split_blocks), 0, 0, 1, 1},
  {&__pyx_n_u_split_blocks, __pyx_k_split_blocks, sizeof(__pyx_k_split_blocks), 0, 1, 0, 1},
  {&__pyx_n_s_stacklevel, __pyx_k_stacklevel, sizeof(__pyx_k_stacklevel), 0, 0, 1, 1},
  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
  {&__pyx_n_s_startswith, __pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 0, 1, 1},
  {&__pyx_n_s_staticmethod, __pyx_k_staticmethod, sizeof(__pyx_k_staticmethod), 0, 0, 1, 1},
  {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
  {&__pyx_n_s_storage, __pyx_k_storage, sizeof(__pyx_k_storage), 0, 0, 1, 1},
  {&__pyx_n_s_storage_type, __pyx_k_storage_type, sizeof(__pyx_k_storage_type), 0, 0, 1, 1},
  {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1},
  {&__pyx_n_u_str_2, __pyx_k_str_2, sizeof(__pyx_k_str_2), 0, 1, 0, 1},
  {&__pyx_n_s_stream, __pyx_k_stream, sizeof(__pyx_k_stream), 0, 0, 1, 1},
  {&__pyx_n_s_stream_or_path, __pyx_k_stream_or_path, sizeof(__pyx_k_stream_or_path), 0, 0, 1, 1},
  {&__pyx_n_s_string, __pyx_k_string, sizeof(__pyx_k_string), 0, 0, 1, 1},
  {&__pyx_n_u_string, __pyx_k_string, sizeof(__pyx_k_string), 0, 1, 0, 1},
  {&__pyx_n_s_string_to_tzinfo, __pyx_k_string_to_tzinfo, sizeof(__pyx_k_string_to_tzinfo), 0, 0, 1, 1},
  {&__pyx_n_s_string_types, __pyx_k_string_types, sizeof(__pyx_k_string_types), 0, 0, 1, 1},
  {&__pyx_n_s_stringify_path, __pyx_k_stringify_path, sizeof(__pyx_k_stringify_path), 0, 0, 1, 1},
  {&__pyx_n_s_strings_to_categorical, __pyx_k_strings_to_categorical, sizeof(__pyx_k_strings_to_categorical), 0, 0, 1, 1},
  {&__pyx_n_u_strings_to_categorical, __pyx_k_strings_to_categorical, sizeof(__pyx_k_strings_to_categorical), 0, 1, 0, 1},
  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
  {&__pyx_n_s_strip_hdfs_abspath, __pyx_k_strip_hdfs_abspath, sizeof(__pyx_k_strip_hdfs_abspath), 0, 0, 1, 1},
  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
  {&__pyx_n_s_struct_array, __pyx_k_struct_array, sizeof(__pyx_k_struct_array), 0, 0, 1, 1},
  {&__pyx_n_s_struct_type, __pyx_k_struct_type, sizeof(__pyx_k_struct_type), 0, 0, 1, 1},
  {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1},
  {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
  {&__pyx_n_s_table, __pyx_k_table, sizeof(__pyx_k_table), 0, 0, 1, 1},
  {&__pyx_n_s_table_to_blockmanager, __pyx_k_table_to_blockmanager, sizeof(__pyx_k_table_to_blockmanager), 0, 0, 1, 1},
  {&__pyx_n_s_table_to_blocks, __pyx_k_table_to_blocks, sizeof(__pyx_k_table_to_blocks), 0, 0, 1, 1},
  {&__pyx_n_s_tables, __pyx_k_tables, sizeof(__pyx_k_tables), 0, 0, 1, 1},
  {&__pyx_n_s_take, __pyx_k_take, sizeof(__pyx_k_take), 0, 0, 1, 1},
  {&__pyx_n_s_target, __pyx_k_target, sizeof(__pyx_k_target), 0, 0, 1, 1},
  {&__pyx_n_s_target_schema, __pyx_k_target_schema, sizeof(__pyx_k_target_schema), 0, 0, 1, 1},
  {&__pyx_n_s_target_type, __pyx_k_target_type, sizeof(__pyx_k_target_type), 0, 0, 1, 1},
  {&__pyx_n_s_tb, __pyx_k_tb, sizeof(__pyx_k_tb), 0, 0, 1, 1},
  {&__pyx_n_s_tell, __pyx_k_tell, sizeof(__pyx_k_tell), 0, 0, 1, 1},
  {&__pyx_n_s_temp_memo, __pyx_k_temp_memo, sizeof(__pyx_k_temp_memo), 0, 0, 1, 1},
  {&__pyx_n_s_tensor, __pyx_k_tensor, sizeof(__pyx_k_tensor), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_testing, __pyx_k_testing, sizeof(__pyx_k_testing), 0, 0, 1, 1},
  {&__pyx_n_s_threading, __pyx_k_threading, sizeof(__pyx_k_threading), 0, 0, 1, 1},
  {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
  {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1},
  {&__pyx_n_s_time32, __pyx_k_time32, sizeof(__pyx_k_time32), 0, 0, 1, 1},
  {&__pyx_kp_u_time32_ms, __pyx_k_time32_ms, sizeof(__pyx_k_time32_ms), 0, 1, 0, 0},
  {&__pyx_kp_u_time32_s, __pyx_k_time32_s, sizeof(__pyx_k_time32_s), 0, 1, 0, 0},
  {&__pyx_n_s_time64, __pyx_k_time64, sizeof(__pyx_k_time64), 0, 0, 1, 1},
  {&__pyx_kp_u_time64_ns, __pyx_k_time64_ns, sizeof(__pyx_k_time64_ns), 0, 1, 0, 0},
  {&__pyx_kp_u_time64_us, __pyx_k_time64_us, sizeof(__pyx_k_time64_us), 0, 1, 0, 0},
  {&__pyx_n_s_timedelta, __pyx_k_timedelta, sizeof(__pyx_k_timedelta), 0, 0, 1, 1},
  {&__pyx_kp_u_timedelta64_ns, __pyx_k_timedelta64_ns, sizeof(__pyx_k_timedelta64_ns), 0, 1, 0, 0},
  {&__pyx_n_s_timedelta_conversion_functions, __pyx_k_timedelta_conversion_functions, sizeof(__pyx_k_timedelta_conversion_functions), 0, 0, 1, 1},
  {&__pyx_n_s_timedelta_conversion_functions_2, __pyx_k_timedelta_conversion_functions_2, sizeof(__pyx_k_timedelta_conversion_functions_2), 0, 0, 1, 1},
  {&__pyx_n_s_timeout, __pyx_k_timeout, sizeof(__pyx_k_timeout), 0, 0, 1, 1},
  {&__pyx_n_s_timestamp, __pyx_k_timestamp, sizeof(__pyx_k_timestamp), 0, 0, 1, 1},
  {&__pyx_kp_u_timestamp_ms, __pyx_k_timestamp_ms, sizeof(__pyx_k_timestamp_ms), 0, 1, 0, 0},
  {&__pyx_kp_u_timestamp_ns, __pyx_k_timestamp_ns, sizeof(__pyx_k_timestamp_ns), 0, 1, 0, 0},
  {&__pyx_kp_u_timestamp_s, __pyx_k_timestamp_s, sizeof(__pyx_k_timestamp_s), 0, 1, 0, 0},
  {&__pyx_kp_u_timestamp_us, __pyx_k_timestamp_us, sizeof(__pyx_k_timestamp_us), 0, 1, 0, 0},
  {&__pyx_n_s_timezone, __pyx_k_timezone, sizeof(__pyx_k_timezone), 0, 0, 1, 1},
  {&__pyx_n_s_to_numpy, __pyx_k_to_numpy, sizeof(__pyx_k_to_numpy), 0, 0, 1, 1},
  {&__pyx_n_s_to_pandas, __pyx_k_to_pandas, sizeof(__pyx_k_to_pandas), 0, 0, 1, 1},
  {&__pyx_n_s_to_pandas_2, __pyx_k_to_pandas_2, sizeof(__pyx_k_to_pandas_2), 0, 0, 1, 1},
  {&__pyx_n_s_to_pybytes, __pyx_k_to_pybytes, sizeof(__pyx_k_to_pybytes), 0, 0, 1, 1},
  {&__pyx_n_s_to_pylist, __pyx_k_to_pylist, sizeof(__pyx_k_to_pylist), 0, 0, 1, 1},
  {&__pyx_n_s_tobytes, __pyx_k_tobytes, sizeof(__pyx_k_tobytes), 0, 0, 1, 1},
  {&__pyx_n_s_total_allocated_bytes, __pyx_k_total_allocated_bytes, sizeof(__pyx_k_total_allocated_bytes), 0, 0, 1, 1},
  {&__pyx_n_s_total_bytes, __pyx_k_total_bytes, sizeof(__pyx_k_total_bytes), 0, 0, 1, 1},
  {&__pyx_n_s_total_seconds, __pyx_k_total_seconds, sizeof(__pyx_k_total_seconds), 0, 0, 1, 1},
  {&__pyx_n_s_traceback, __pyx_k_traceback, sizeof(__pyx_k_traceback), 0, 0, 1, 1},
  {&__pyx_n_s_truncate, __pyx_k_truncate, sizeof(__pyx_k_truncate), 0, 0, 1, 1},
  {&__pyx_kp_u_trying_to_write_an_immutable_buf, __pyx_k_trying_to_write_an_immutable_buf, sizeof(__pyx_k_trying_to_write_an_immutable_buf), 0, 1, 0, 0},
  {&__pyx_n_s_typ, __pyx_k_typ, sizeof(__pyx_k_typ), 0, 0, 1, 1},
  {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1},
  {&__pyx_kp_u_type_2, __pyx_k_type_2, sizeof(__pyx_k_type_2), 0, 1, 0, 0},
  {&__pyx_n_s_type_3, __pyx_k_type_3, sizeof(__pyx_k_type_3), 0, 0, 1, 1},
  {&__pyx_n_s_type_4, __pyx_k_type_4, sizeof(__pyx_k_type_4), 0, 0, 1, 1},
  {&__pyx_n_s_type_codes, __pyx_k_type_codes, sizeof(__pyx_k_type_codes), 0, 0, 1, 1},
  {&__pyx_kp_u_type_codes_should_have_the_same, __pyx_k_type_codes_should_have_the_same, sizeof(__pyx_k_type_codes_should_have_the_same), 0, 1, 0, 0},
  {&__pyx_n_s_type_for_alias, __pyx_k_type_for_alias, sizeof(__pyx_k_type_for_alias), 0, 0, 1, 1},
  {&__pyx_n_s_type_id, __pyx_k_type_id, sizeof(__pyx_k_type_id), 0, 0, 1, 1},
  {&__pyx_n_s_type_name, __pyx_k_type_name, sizeof(__pyx_k_type_name), 0, 0, 1, 1},
  {&__pyx_n_s_types, __pyx_k_types, sizeof(__pyx_k_types), 0, 0, 1, 1},
  {&__pyx_n_s_types_mapper, __pyx_k_types_mapper, sizeof(__pyx_k_types_mapper), 0, 0, 1, 1},
  {&__pyx_n_s_tz, __pyx_k_tz, sizeof(__pyx_k_tz), 0, 0, 1, 1},
  {&__pyx_n_s_tzinfo, __pyx_k_tzinfo, sizeof(__pyx_k_tzinfo), 0, 0, 1, 1},
  {&__pyx_n_s_tzinfo_to_string, __pyx_k_tzinfo_to_string, sizeof(__pyx_k_tzinfo_to_string), 0, 0, 1, 1},
  {&__pyx_n_s_tzinfo_to_string_locals_fixed_of, __pyx_k_tzinfo_to_string_locals_fixed_of, sizeof(__pyx_k_tzinfo_to_string_locals_fixed_of), 0, 0, 1, 1},
  {&__pyx_n_u_u1, __pyx_k_u1, sizeof(__pyx_k_u1), 0, 1, 0, 1},
  {&__pyx_n_u_u2, __pyx_k_u2, sizeof(__pyx_k_u2), 0, 1, 0, 1},
  {&__pyx_n_u_u4, __pyx_k_u4, sizeof(__pyx_k_u4), 0, 1, 0, 1},
  {&__pyx_n_u_u8, __pyx_k_u8, sizeof(__pyx_k_u8), 0, 1, 0, 1},
  {&__pyx_n_s_uint16, __pyx_k_uint16, sizeof(__pyx_k_uint16), 0, 0, 1, 1},
  {&__pyx_n_u_uint16, __pyx_k_uint16, sizeof(__pyx_k_uint16), 0, 1, 0, 1},
  {&__pyx_n_s_uint32, __pyx_k_uint32, sizeof(__pyx_k_uint32), 0, 0, 1, 1},
  {&__pyx_n_u_uint32, __pyx_k_uint32, sizeof(__pyx_k_uint32), 0, 1, 0, 1},
  {&__pyx_n_s_uint64, __pyx_k_uint64, sizeof(__pyx_k_uint64), 0, 0, 1, 1},
  {&__pyx_n_u_uint64, __pyx_k_uint64, sizeof(__pyx_k_uint64), 0, 1, 0, 1},
  {&__pyx_n_s_uint8, __pyx_k_uint8, sizeof(__pyx_k_uint8), 0, 0, 1, 1},
  {&__pyx_n_u_uint8, __pyx_k_uint8, sizeof(__pyx_k_uint8), 0, 1, 0, 1},
  {&__pyx_n_u_uncompressed, __pyx_k_uncompressed, sizeof(__pyx_k_uncompressed), 0, 1, 0, 1},
  {&__pyx_n_s_union, __pyx_k_union, sizeof(__pyx_k_union), 0, 0, 1, 1},
  {&__pyx_n_s_union_type, __pyx_k_union_type, sizeof(__pyx_k_union_type), 0, 0, 1, 1},
  {&__pyx_n_s_unit, __pyx_k_unit, sizeof(__pyx_k_unit), 0, 0, 1, 1},
  {&__pyx_n_s_unit_code, __pyx_k_unit_code, sizeof(__pyx_k_unit_code), 0, 0, 1, 1},
  {&__pyx_kp_u_unknown_driver_r, __pyx_k_unknown_driver_r, sizeof(__pyx_k_unknown_driver_r), 0, 1, 0, 0},
  {&__pyx_n_s_unregister_extension_type, __pyx_k_unregister_extension_type, sizeof(__pyx_k_unregister_extension_type), 0, 0, 1, 1},
  {&__pyx_n_s_unregister_py_extension_types, __pyx_k_unregister_py_extension_types, sizeof(__pyx_k_unregister_py_extension_types), 0, 0, 1, 1},
  {&__pyx_n_s_unsafe, __pyx_k_unsafe, sizeof(__pyx_k_unsafe), 0, 0, 1, 1},
  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
  {&__pyx_n_s_upload, __pyx_k_upload, sizeof(__pyx_k_upload), 0, 0, 1, 1},
  {&__pyx_n_s_upload_locals_bg_write, __pyx_k_upload_locals_bg_write, sizeof(__pyx_k_upload_locals_bg_write), 0, 0, 1, 1},
  {&__pyx_n_u_us, __pyx_k_us, sizeof(__pyx_k_us), 0, 1, 0, 1},
  {&__pyx_n_s_use_legacy_format, __pyx_k_use_legacy_format, sizeof(__pyx_k_use_legacy_format), 0, 0, 1, 1},
  {&__pyx_n_s_use_memory_map, __pyx_k_use_memory_map, sizeof(__pyx_k_use_memory_map), 0, 0, 1, 1},
  {&__pyx_n_s_use_pandas_sentinels, __pyx_k_use_pandas_sentinels, sizeof(__pyx_k_use_pandas_sentinels), 0, 0, 1, 1},
  {&__pyx_n_s_use_threads, __pyx_k_use_threads, sizeof(__pyx_k_use_threads), 0, 0, 1, 1},
  {&__pyx_n_u_use_threads, __pyx_k_use_threads, sizeof(__pyx_k_use_threads), 0, 1, 0, 1},
  {&__pyx_n_s_user, __pyx_k_user, sizeof(__pyx_k_user), 0, 0, 1, 1},
  {&__pyx_n_s_utc, __pyx_k_utc, sizeof(__pyx_k_utc), 0, 0, 1, 1},
  {&__pyx_n_s_utcoffset, __pyx_k_utcoffset, sizeof(__pyx_k_utcoffset), 0, 0, 1, 1},
  {&__pyx_n_s_utf8, __pyx_k_utf8, sizeof(__pyx_k_utf8), 0, 0, 1, 1},
  {&__pyx_n_u_utf8, __pyx_k_utf8, sizeof(__pyx_k_utf8), 0, 1, 0, 1},
  {&__pyx_n_s_util, __pyx_k_util, sizeof(__pyx_k_util), 0, 0, 1, 1},
  {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1},
  {&__pyx_n_s_validate, __pyx_k_validate, sizeof(__pyx_k_validate), 0, 0, 1, 1},
  {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
  {&__pyx_n_s_value_offsets, __pyx_k_value_offsets, sizeof(__pyx_k_value_offsets), 0, 0, 1, 1},
  {&__pyx_n_s_value_type, __pyx_k_value_type, sizeof(__pyx_k_value_type), 0, 0, 1, 1},
  {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1},
  {&__pyx_n_s_values_2, __pyx_k_values_2, sizeof(__pyx_k_values_2), 0, 0, 1, 1},
  {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1},
  {&__pyx_n_s_vstack, __pyx_k_vstack, sizeof(__pyx_k_vstack), 0, 0, 1, 1},
  {&__pyx_n_u_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 1, 0, 1},
  {&__pyx_n_s_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 0, 0, 1, 1},
  {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1},
  {&__pyx_n_u_wb, __pyx_k_wb, sizeof(__pyx_k_wb), 0, 1, 0, 1},
  {&__pyx_n_s_weakref, __pyx_k_weakref, sizeof(__pyx_k_weakref), 0, 0, 1, 1},
  {&__pyx_n_s_whence, __pyx_k_whence, sizeof(__pyx_k_whence), 0, 0, 1, 1},
  {&__pyx_n_s_window, __pyx_k_window, sizeof(__pyx_k_window), 0, 0, 1, 1},
  {&__pyx_n_s_with_metadata, __pyx_k_with_metadata, sizeof(__pyx_k_with_metadata), 0, 0, 1, 1},
  {&__pyx_n_s_wrapped_value, __pyx_k_wrapped_value, sizeof(__pyx_k_wrapped_value), 0, 0, 1, 1},
  {&__pyx_n_s_writable, __pyx_k_writable, sizeof(__pyx_k_writable), 0, 0, 1, 1},
  {&__pyx_kp_u_writable_file_expected, __pyx_k_writable_file_expected, sizeof(__pyx_k_writable_file_expected), 0, 1, 0, 0},
  {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1},
  {&__pyx_n_u_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 1, 0, 1},
  {&__pyx_n_s_write_batch, __pyx_k_write_batch, sizeof(__pyx_k_write_batch), 0, 0, 1, 1},
  {&__pyx_n_s_write_table, __pyx_k_write_table, sizeof(__pyx_k_write_table), 0, 0, 1, 1},
  {&__pyx_n_s_write_tensor, __pyx_k_write_tensor, sizeof(__pyx_k_write_tensor), 0, 0, 1, 1},
  {&__pyx_n_s_write_to, __pyx_k_write_to, sizeof(__pyx_k_write_to), 0, 0, 1, 1},
  {&__pyx_n_s_writeable, __pyx_k_writeable, sizeof(__pyx_k_writeable), 0, 0, 1, 1},
  {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
  {&__pyx_n_s_zero_copy_only, __pyx_k_zero_copy_only, sizeof(__pyx_k_zero_copy_only), 0, 0, 1, 1},
  {&__pyx_n_u_zero_copy_only, __pyx_k_zero_copy_only, sizeof(__pyx_k_zero_copy_only), 0, 1, 0, 1},
  {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1},
  {&__pyx_n_s_zone, __pyx_k_zone, sizeof(__pyx_k_zone), 0, 0, 1, 1},
  {&__pyx_kp_u_zst, __pyx_k_zst, sizeof(__pyx_k_zst), 0, 1, 0, 0},
  {&__pyx_n_u_zstd, __pyx_k_zstd, sizeof(__pyx_k_zstd), 0, 1, 0, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 27, __pyx_L1_error)
  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 31, __pyx_L1_error)
  __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 35, __pyx_L1_error)
  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 41, __pyx_L1_error)
  __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 45, __pyx_L1_error)
  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 53, __pyx_L1_error)
  __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) __PYX_ERR(0, 62, __pyx_L1_error)
  __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_n_s_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(1, 722, __pyx_L1_error)
  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 26, __pyx_L1_error)
  __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(3, 135, __pyx_L1_error)
  __pyx_builtin_NotImplemented = __Pyx_GetBuiltinName(__pyx_n_s_NotImplemented); if (!__pyx_builtin_NotImplemented) __PYX_ERR(4, 163, __pyx_L1_error)
  __pyx_builtin_UserWarning = __Pyx_GetBuiltinName(__pyx_n_s_UserWarning); if (!__pyx_builtin_UserWarning) __PYX_ERR(4, 365, __pyx_L1_error)
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(4, 380, __pyx_L1_error)
  __pyx_builtin_FutureWarning = __Pyx_GetBuiltinName(__pyx_n_s_FutureWarning); if (!__pyx_builtin_FutureWarning) __PYX_ERR(4, 858, __pyx_L1_error)
  __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(4, 956, __pyx_L1_error)
  __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(4, 1083, __pyx_L1_error)
  __pyx_builtin_map = __Pyx_GetBuiltinName(__pyx_n_s_map); if (!__pyx_builtin_map) __PYX_ERR(4, 1558, __pyx_L1_error)
  __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(5, 655, __pyx_L1_error)
  __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(1, 62, __pyx_L1_error)
  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(6, 488, __pyx_L1_error)
  __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) __PYX_ERR(7, 493, __pyx_L1_error)
  __pyx_builtin_BufferError = __Pyx_GetBuiltinName(__pyx_n_s_BufferError); if (!__pyx_builtin_BufferError) __PYX_ERR(7, 1027, __pyx_L1_error)
  __pyx_builtin_SystemError = __Pyx_GetBuiltinName(__pyx_n_s_SystemError); if (!__pyx_builtin_SystemError) __PYX_ERR(7, 1048, __pyx_L1_error)
  __pyx_builtin_EOFError = __Pyx_GetBuiltinName(__pyx_n_s_EOFError); if (!__pyx_builtin_EOFError) __PYX_ERR(8, 559, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "pyarrow/lib.pyx":65
 *     """
 *     if count < 1:
 *         raise ValueError("CPU count must be strictly positive")             # <<<<<<<<<<<<<<
 *     check_status(SetCpuThreadPoolCapacity(count))
 * 
 */
  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_CPU_count_must_be_strictly_posit); if (unlikely(!__pyx_tuple_)) __PYX_ERR(9, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple_);
  __Pyx_GIVEREF(__pyx_tuple_);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.pool cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.pool cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_self_pool_cannot_be_converted_to); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);

  /* "(tree fragment)":4
 *     raise TypeError("self.pool cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.pool cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_self_pool_cannot_be_converted_to); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.logging_pool,self.pool cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.logging_pool,self.pool cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_self_logging_pool_self_pool_cann); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);

  /* "(tree fragment)":4
 *     raise TypeError("self.logging_pool,self.pool cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.logging_pool,self.pool cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_self_logging_pool_self_pool_cann); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__7);
  __Pyx_GIVEREF(__pyx_tuple__7);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.pool,self.proxy_pool cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.pool,self.proxy_pool cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_self_pool_self_proxy_pool_cannot); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__8);
  __Pyx_GIVEREF(__pyx_tuple__8);

  /* "(tree fragment)":4
 *     raise TypeError("self.pool,self.proxy_pool cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.pool,self.proxy_pool cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_self_pool_self_proxy_pool_cannot); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__9);
  __Pyx_GIVEREF(__pyx_tuple__9);

  /* "pyarrow/types.pxi":129
 *         ty = dynamic_cast[_CFixedWidthTypePtr](self.type)
 *         if ty == nullptr:
 *             raise ValueError("Non-fixed width type")             # <<<<<<<<<<<<<<
 *         return ty.bit_width()
 * 
 */
  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_Non_fixed_width_type); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(4, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__12);
  __Pyx_GIVEREF(__pyx_tuple__12);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);

  /* "pyarrow/types.pxi":364
 *             raise KeyError(name)
 *         elif fields.size() > 1:
 *             warnings.warn("Struct field name corresponds to more "             # <<<<<<<<<<<<<<
 *                           "than one field", UserWarning)
 *             raise KeyError(name)
 */
  __pyx_tuple__14 = PyTuple_Pack(2, __pyx_kp_u_Struct_field_name_corresponds_to, __pyx_builtin_UserWarning); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(4, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__14);
  __Pyx_GIVEREF(__pyx_tuple__14);

  /* "pyarrow/types.pxi":392
 *             return self.child(i)
 *         else:
 *             raise TypeError('Expected integer or string index')             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_u_Expected_integer_or_string_index); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(4, 392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);

  /* "pyarrow/types.pxi":621
 *     def __cinit__(self):
 *         if type(self) is ExtensionType:
 *             raise TypeError("Can only instantiate subclasses of "             # <<<<<<<<<<<<<<
 *                             "ExtensionType")
 * 
 */
  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_u_Can_only_instantiate_subclasses); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(4, 621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);

  /* "pyarrow/types.pxi":697
 *     def __cinit__(self):
 *         if type(self) is PyExtensionType:
 *             raise TypeError("Can only instantiate subclasses of "             # <<<<<<<<<<<<<<
 *                             "PyExtensionType")
 * 
 */
  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_u_Can_only_instantiate_subclasses_2); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(4, 697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__17);
  __Pyx_GIVEREF(__pyx_tuple__17);

  /* "pyarrow/types.pxi":767
 * 
 *     if not isinstance(_type, BaseExtensionType):
 *         raise TypeError("Only extension types can be registered")             # <<<<<<<<<<<<<<
 * 
 *     # register on the C++ side
 */
  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_u_Only_extension_types_can_be_regi); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(4, 767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__18);
  __Pyx_GIVEREF(__pyx_tuple__18);

  /* "pyarrow/types.pxi":804
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call Field's constructor directly, use "             # <<<<<<<<<<<<<<
 *                         "`pyarrow.field` instead.")
 * 
 */
  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_u_Do_not_call_Field_s_constructor); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(4, 804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__19);
  __Pyx_GIVEREF(__pyx_tuple__19);

  /* "pyarrow/types.pxi":857
 * 
 *     def add_metadata(self, metadata):
 *         warnings.warn("The 'add_metadata' method is deprecated, use "             # <<<<<<<<<<<<<<
 *                       "'with_metadata' instead", FutureWarning, stacklevel=2)
 *         return self.with_metadata(metadata)
 */
  __pyx_tuple__20 = PyTuple_Pack(2, __pyx_kp_u_The_add_metadata_method_is_depre, __pyx_builtin_FutureWarning); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(4, 857, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__20);
  __Pyx_GIVEREF(__pyx_tuple__20);

  /* "pyarrow/types.pxi":879
 * 
 *         if not isinstance(metadata, dict):
 *             raise TypeError('Metadata must be an instance of dict')             # <<<<<<<<<<<<<<
 * 
 *         c_meta = pyarrow_unwrap_metadata(metadata)
 */
  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_u_Metadata_must_be_an_instance_of); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(4, 879, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__21);
  __Pyx_GIVEREF(__pyx_tuple__21);

  /* "pyarrow/types.pxi":921
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call Schema's constructor directly, use "             # <<<<<<<<<<<<<<
 *                         "`pyarrow.schema` instead.")
 * 
 */
  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_u_Do_not_call_Schema_s_constructor); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(4, 921, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__22);
  __Pyx_GIVEREF(__pyx_tuple__22);

  /* "pyarrow/types.pxi":1108
 *             return self._field(i)
 *         else:
 *             raise TypeError("Index must either be string or integer")             # <<<<<<<<<<<<<<
 * 
 *     def _field(self, int i):
 */
  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_u_Index_must_either_be_string_or_i); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(4, 1108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__23);
  __Pyx_GIVEREF(__pyx_tuple__23);

  /* "pyarrow/types.pxi":1130
 *             vector[shared_ptr[CField]] results
 * 
 *         warnings.warn(             # <<<<<<<<<<<<<<
 *             "The 'field_by_name' method is deprecated, use 'field' instead",
 *             FutureWarning, stacklevel=2)
 */
  __pyx_tuple__24 = PyTuple_Pack(2, __pyx_kp_u_The_field_by_name_method_is_depr, __pyx_builtin_FutureWarning); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(4, 1130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__24);
  __Pyx_GIVEREF(__pyx_tuple__24);

  /* "pyarrow/types.pxi":1138
 *             return None
 *         elif results.size() > 1:
 *             warnings.warn("Schema field name corresponds to more "             # <<<<<<<<<<<<<<
 *                           "than one field", UserWarning)
 *             return None
 */
  __pyx_tuple__25 = PyTuple_Pack(2, __pyx_kp_u_Schema_field_name_corresponds_to, __pyx_builtin_UserWarning); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(4, 1138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__25);
  __Pyx_GIVEREF(__pyx_tuple__25);

  /* "pyarrow/types.pxi":1233
 * 
 *     def add_metadata(self, metadata):
 *         warnings.warn("The 'add_metadata' method is deprecated, use "             # <<<<<<<<<<<<<<
 *                       "'with_metadata' instead", FutureWarning, stacklevel=2)
 *         return self.with_metadata(metadata)
 */
  __pyx_tuple__26 = PyTuple_Pack(2, __pyx_kp_u_The_add_metadata_method_is_depre, __pyx_builtin_FutureWarning); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(4, 1233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__26);
  __Pyx_GIVEREF(__pyx_tuple__26);

  /* "pyarrow/types.pxi":1517
 *         hours, minutes = divmod(minutes, 60)
 *         if seconds > 0:
 *             raise ValueError('Offset must represent whole number of minutes')             # <<<<<<<<<<<<<<
 *         return '{}{:02d}:{:02d}'.format(sign, hours, minutes)
 * 
 */
  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_u_Offset_must_represent_whole_numb); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(4, 1517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__29);
  __Pyx_GIVEREF(__pyx_tuple__29);

  /* "pyarrow/types.pxi":1511
 *     import datetime
 * 
 *     def fixed_offset_to_string(offset):             # <<<<<<<<<<<<<<
 *         seconds = int(offset.utcoffset(None).total_seconds())
 *         sign = '+' if seconds >= 0 else '-'
 */
  __pyx_tuple__30 = PyTuple_Pack(5, __pyx_n_s_offset, __pyx_n_s_seconds, __pyx_n_s_sign, __pyx_n_s_minutes, __pyx_n_s_hours); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(4, 1511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__30);
  __Pyx_GIVEREF(__pyx_tuple__30);
  __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_fixed_offset_to_string, 1511, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(4, 1511, __pyx_L1_error)

  /* "pyarrow/types.pxi":1533
 *                              .format(tz))
 *     else:
 *         raise TypeError('Must be an instance of `datetime.tzinfo`')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_u_Must_be_an_instance_of_datetime); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(4, 1533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__32);
  __Pyx_GIVEREF(__pyx_tuple__32);

  /* "pyarrow/types.pxi":1558
 *     if m:
 *         sign = 1 if m.group(1) == '+' else -1
 *         hours, minutes = map(int, m.group(2, 3))             # <<<<<<<<<<<<<<
 *         return pytz.FixedOffset(sign * (hours * 60 + minutes))
 *     else:
 */
  __pyx_tuple__33 = PyTuple_Pack(2, __pyx_int_2, __pyx_int_3); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(4, 1558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__33);
  __Pyx_GIVEREF(__pyx_tuple__33);

  /* "pyarrow/types.pxi":1600
 *         unit_code = TimeUnit_NANO
 *     else:
 *         raise ValueError('Invalid TimeUnit string')             # <<<<<<<<<<<<<<
 * 
 *     cdef TimestampType out = TimestampType.__new__(TimestampType)
 */
  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_u_Invalid_TimeUnit_string); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(4, 1600, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__34);
  __Pyx_GIVEREF(__pyx_tuple__34);

  /* "pyarrow/types.pxi":1787
 *     cdef shared_ptr[CDataType] decimal_type
 *     if precision < 1 or precision > 38:
 *         raise ValueError("precision should be between 1 and 38")             # <<<<<<<<<<<<<<
 *     decimal_type.reset(new CDecimal128Type(precision, scale))
 *     return pyarrow_wrap_data_type(decimal_type)
 */
  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_u_precision_should_be_between_1_an); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(4, 1787, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__35);
  __Pyx_GIVEREF(__pyx_tuple__35);

  /* "pyarrow/types.pxi":1876
 *         _field = value_type
 *     else:
 *         raise TypeError('List requires DataType or Field')             # <<<<<<<<<<<<<<
 * 
 *     if list_size == -1:
 */
  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_u_List_requires_DataType_or_Field); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(4, 1876, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__36);
  __Pyx_GIVEREF(__pyx_tuple__36);

  /* "pyarrow/types.pxi":1882
 *     else:
 *         if list_size < 0:
 *             raise ValueError("list_size should be a positive integer")             # <<<<<<<<<<<<<<
 *         list_type.reset(new CFixedSizeListType(_field.sp_field, list_size))
 * 
 */
  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_u_list_size_should_be_a_positive_i); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(4, 1882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__37);
  __Pyx_GIVEREF(__pyx_tuple__37);

  /* "pyarrow/types.pxi":1969
 * 
 *     if _index_type.id not in {Type_INT8, Type_INT16, Type_INT32, Type_INT64}:
 *         raise TypeError("The dictionary index type should be signed integer.")             # <<<<<<<<<<<<<<
 * 
 *     dict_type.reset(new CDictionaryType(_index_type.sp_type,
 */
  __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_u_The_dictionary_index_type_should); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(4, 1969, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__38);
  __Pyx_GIVEREF(__pyx_tuple__38);

  /* "pyarrow/types.pxi":2063
 *     if type_codes is not None:
 *         if len(type_codes) != <Py_ssize_t>(c_fields.size()):
 *             raise ValueError("type_codes should have the same length "             # <<<<<<<<<<<<<<
 *                              "as fields")
 *         for code in type_codes:
 */
  __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_u_type_codes_should_have_the_same); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(4, 2063, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__39);
  __Pyx_GIVEREF(__pyx_tuple__39);

  /* "pyarrow/types.pxi":2207
 *             py_field = item
 *         if py_field is None:
 *             raise TypeError("field or tuple expected, got None")             # <<<<<<<<<<<<<<
 *         c_fields.push_back(py_field.sp_field)
 * 
 */
  __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_u_field_or_tuple_expected_got_None); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(4, 2207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__40);
  __Pyx_GIVEREF(__pyx_tuple__40);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__41);
  __Pyx_GIVEREF(__pyx_tuple__41);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);

  /* "pyarrow/scalar.pxi":36
 *         global NA
 *         if NA is not None:
 *             raise Exception('Cannot create multiple NAType instances')             # <<<<<<<<<<<<<<
 * 
 *         self.type = null()
 */
  __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_u_Cannot_create_multiple_NAType_in); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(5, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__43);
  __Pyx_GIVEREF(__pyx_tuple__43);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__44);
  __Pyx_GIVEREF(__pyx_tuple__44);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__45);
  __Pyx_GIVEREF(__pyx_tuple__45);

  /* "pyarrow/scalar.pxi":93
 *             return self.as_py() == other
 *         else:
 *             raise NotImplementedError(             # <<<<<<<<<<<<<<
 *                 "Cannot compare Arrow values that don't support as_py()")
 * 
 */
  __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_u_Cannot_compare_Arrow_values_that); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(5, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__46);
  __Pyx_GIVEREF(__pyx_tuple__46);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__47);
  __Pyx_GIVEREF(__pyx_tuple__47);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__48);
  __Pyx_GIVEREF(__pyx_tuple__48);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__49);
  __Pyx_GIVEREF(__pyx_tuple__49);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__50);
  __Pyx_GIVEREF(__pyx_tuple__50);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__51);
  __Pyx_GIVEREF(__pyx_tuple__51);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__52);
  __Pyx_GIVEREF(__pyx_tuple__52);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__53);
  __Pyx_GIVEREF(__pyx_tuple__53);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__54);
  __Pyx_GIVEREF(__pyx_tuple__54);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__55);
  __Pyx_GIVEREF(__pyx_tuple__55);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__56);
  __Pyx_GIVEREF(__pyx_tuple__56);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__57);
  __Pyx_GIVEREF(__pyx_tuple__57);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__58);
  __Pyx_GIVEREF(__pyx_tuple__58);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__59);
  __Pyx_GIVEREF(__pyx_tuple__59);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__60);
  __Pyx_GIVEREF(__pyx_tuple__60);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__61);
  __Pyx_GIVEREF(__pyx_tuple__61);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__62);
  __Pyx_GIVEREF(__pyx_tuple__62);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__63);
  __Pyx_GIVEREF(__pyx_tuple__63);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__64);
  __Pyx_GIVEREF(__pyx_tuple__64);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__65 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__65);
  __Pyx_GIVEREF(__pyx_tuple__65);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__66 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__66);
  __Pyx_GIVEREF(__pyx_tuple__66);

  /* "pyarrow/scalar.pxi":229
 * 
 *         # Shift to seconds since epoch
 *         return (datetime.date(1970, 1, 1) +             # <<<<<<<<<<<<<<
 *                 datetime.timedelta(days=ap.Value(self.index)))
 * 
 */
  __pyx_tuple__67 = PyTuple_Pack(3, __pyx_int_1970, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(5, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__67);
  __Pyx_GIVEREF(__pyx_tuple__67);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__68 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__68);
  __Pyx_GIVEREF(__pyx_tuple__68);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__69 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__69);
  __Pyx_GIVEREF(__pyx_tuple__69);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__70 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__70);
  __Pyx_GIVEREF(__pyx_tuple__70);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__71 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__71);
  __Pyx_GIVEREF(__pyx_tuple__71);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__72 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__72);
  __Pyx_GIVEREF(__pyx_tuple__72);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__73 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__73);
  __Pyx_GIVEREF(__pyx_tuple__73);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__74 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__74);
  __Pyx_GIVEREF(__pyx_tuple__74);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__75 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__75);
  __Pyx_GIVEREF(__pyx_tuple__75);

  /* "pyarrow/scalar.pxi":319
 * def _nanoseconds_to_datetime_safe(v, tzinfo):
 *     if v % 1000 != 0:
 *         raise ValueError("Nanosecond timestamp {} is not safely convertible "             # <<<<<<<<<<<<<<
 *                          " to microseconds to convert to datetime.datetime."
 *                          " Install pandas to return as Timestamp with "
 */
  __pyx_tuple__76 = PyTuple_Pack(1, __pyx_kp_u_Nanosecond_timestamp_is_not_safe); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(5, 319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__76);
  __Pyx_GIVEREF(__pyx_tuple__76);

  /* "pyarrow/scalar.pxi":402
 *             converter = _datetime_conversion_functions()[dtype.unit()]
 *         except KeyError:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 'Cannot convert nanosecond timestamps without pandas'
 *             )
 */
  __pyx_tuple__77 = PyTuple_Pack(1, __pyx_kp_u_Cannot_convert_nanosecond_timest); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(5, 402, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__77);
  __Pyx_GIVEREF(__pyx_tuple__77);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__78 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__78);
  __Pyx_GIVEREF(__pyx_tuple__78);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__79 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__79);
  __Pyx_GIVEREF(__pyx_tuple__79);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__80 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__80);
  __Pyx_GIVEREF(__pyx_tuple__80);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__81 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__81);
  __Pyx_GIVEREF(__pyx_tuple__81);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__82 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__82);
  __Pyx_GIVEREF(__pyx_tuple__82);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__83 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__83);
  __Pyx_GIVEREF(__pyx_tuple__83);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__84 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__84);
  __Pyx_GIVEREF(__pyx_tuple__84);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__85 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__85);
  __Pyx_GIVEREF(__pyx_tuple__85);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__86 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__86);
  __Pyx_GIVEREF(__pyx_tuple__86);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__87 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__87);
  __Pyx_GIVEREF(__pyx_tuple__87);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__88 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__88);
  __Pyx_GIVEREF(__pyx_tuple__88);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__89 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__89);
  __Pyx_GIVEREF(__pyx_tuple__89);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__90 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__90);
  __Pyx_GIVEREF(__pyx_tuple__90);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__91 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__91);
  __Pyx_GIVEREF(__pyx_tuple__91);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__92 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__92);
  __Pyx_GIVEREF(__pyx_tuple__92);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__93 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__93);
  __Pyx_GIVEREF(__pyx_tuple__93);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__94 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__94);
  __Pyx_GIVEREF(__pyx_tuple__94);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__95 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__95);
  __Pyx_GIVEREF(__pyx_tuple__95);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__96 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__96);
  __Pyx_GIVEREF(__pyx_tuple__96);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__97 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__97);
  __Pyx_GIVEREF(__pyx_tuple__97);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__98 = PyTuple_Pack(1, __pyx_kp_s_self_ap_self_sp_array_cannot_be); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__98);
  __Pyx_GIVEREF(__pyx_tuple__98);

  /* "(tree fragment)":4
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__99 = PyTuple_Pack(1, __pyx_kp_s_self_ap_self_sp_array_cannot_be); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__99);
  __Pyx_GIVEREF(__pyx_tuple__99);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__100 = PyTuple_Pack(1, __pyx_kp_s_self_ap_self_sp_array_cannot_be); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__100);
  __Pyx_GIVEREF(__pyx_tuple__100);

  /* "(tree fragment)":4
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__101 = PyTuple_Pack(1, __pyx_kp_s_self_ap_self_sp_array_cannot_be); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__101);
  __Pyx_GIVEREF(__pyx_tuple__101);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__102 = PyTuple_Pack(1, __pyx_kp_s_self_ap_self_sp_array_cannot_be); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__102);
  __Pyx_GIVEREF(__pyx_tuple__102);

  /* "(tree fragment)":4
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__103 = PyTuple_Pack(1, __pyx_kp_s_self_ap_self_sp_array_cannot_be); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__103);
  __Pyx_GIVEREF(__pyx_tuple__103);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__104 = PyTuple_Pack(1, __pyx_kp_s_self_ap_self_sp_array_cannot_be); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__104);
  __Pyx_GIVEREF(__pyx_tuple__104);

  /* "(tree fragment)":4
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__105 = PyTuple_Pack(1, __pyx_kp_s_self_ap_self_sp_array_cannot_be); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__105);
  __Pyx_GIVEREF(__pyx_tuple__105);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__106 = PyTuple_Pack(1, __pyx_kp_s_self_ap_self_sp_array_cannot_be); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__106);
  __Pyx_GIVEREF(__pyx_tuple__106);

  /* "(tree fragment)":4
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__107 = PyTuple_Pack(1, __pyx_kp_s_self_ap_self_sp_array_cannot_be); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__107);
  __Pyx_GIVEREF(__pyx_tuple__107);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__108 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__108);
  __Pyx_GIVEREF(__pyx_tuple__108);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__109 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__109)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__109);
  __Pyx_GIVEREF(__pyx_tuple__109);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__110 = PyTuple_Pack(1, __pyx_kp_s_self_ap_self_sp_array_cannot_be); if (unlikely(!__pyx_tuple__110)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__110);
  __Pyx_GIVEREF(__pyx_tuple__110);

  /* "(tree fragment)":4
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.ap,self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__111 = PyTuple_Pack(1, __pyx_kp_s_self_ap_self_sp_array_cannot_be); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__111);
  __Pyx_GIVEREF(__pyx_tuple__111);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__112 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__112)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__112);
  __Pyx_GIVEREF(__pyx_tuple__112);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_array cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__113 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__113);
  __Pyx_GIVEREF(__pyx_tuple__113);

  /* "pyarrow/scalar.pxi":1028
 *             return self.as_py() == other
 *         else:
 *             raise NotImplemented(             # <<<<<<<<<<<<<<
 *                 "Cannot compare scalars that don't support as_py()")
 * 
 */
  __pyx_tuple__114 = PyTuple_Pack(1, __pyx_kp_u_Cannot_compare_scalars_that_don); if (unlikely(!__pyx_tuple__114)) __PYX_ERR(5, 1028, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__114);
  __Pyx_GIVEREF(__pyx_tuple__114);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__115 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__115)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__115);
  __Pyx_GIVEREF(__pyx_tuple__115);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__116 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__116)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__116);
  __Pyx_GIVEREF(__pyx_tuple__116);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__117 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__117)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__117);
  __Pyx_GIVEREF(__pyx_tuple__117);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__118 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__118);
  __Pyx_GIVEREF(__pyx_tuple__118);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__119 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__119)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__119);
  __Pyx_GIVEREF(__pyx_tuple__119);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__120 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__120)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__120);
  __Pyx_GIVEREF(__pyx_tuple__120);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__121 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__121)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__121);
  __Pyx_GIVEREF(__pyx_tuple__121);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__122 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__122)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__122);
  __Pyx_GIVEREF(__pyx_tuple__122);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__123 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__123)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__123);
  __Pyx_GIVEREF(__pyx_tuple__123);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__124 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__124);
  __Pyx_GIVEREF(__pyx_tuple__124);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__125 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__125)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__125);
  __Pyx_GIVEREF(__pyx_tuple__125);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__126 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__126)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__126);
  __Pyx_GIVEREF(__pyx_tuple__126);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__127 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__127)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__127);
  __Pyx_GIVEREF(__pyx_tuple__127);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__128 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__128)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__128);
  __Pyx_GIVEREF(__pyx_tuple__128);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__129 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__129);
  __Pyx_GIVEREF(__pyx_tuple__129);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__130 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__130)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__130);
  __Pyx_GIVEREF(__pyx_tuple__130);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__131 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__131)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__131);
  __Pyx_GIVEREF(__pyx_tuple__131);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__132 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__132)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__132);
  __Pyx_GIVEREF(__pyx_tuple__132);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__133 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__133)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__133);
  __Pyx_GIVEREF(__pyx_tuple__133);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__134 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__134)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__134);
  __Pyx_GIVEREF(__pyx_tuple__134);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__135 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__135)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__135);
  __Pyx_GIVEREF(__pyx_tuple__135);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_scalar cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__136 = PyTuple_Pack(1, __pyx_kp_s_self_sp_scalar_cannot_be_convert); if (unlikely(!__pyx_tuple__136)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__136);
  __Pyx_GIVEREF(__pyx_tuple__136);

  /* "pyarrow/array.pxi":104
 * def _handle_arrow_array_protocol(obj, type, mask, size):
 *     if mask is not None or size is not None:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "Cannot specify a mask or a size when passing an object that is "
 *             "converted with the __arrow_array__ protocol.")
 */
  __pyx_tuple__137 = PyTuple_Pack(1, __pyx_kp_u_Cannot_specify_a_mask_or_a_size); if (unlikely(!__pyx_tuple__137)) __PYX_ERR(1, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__137);
  __Pyx_GIVEREF(__pyx_tuple__137);

  /* "pyarrow/array.pxi":109
 *     res = obj.__arrow_array__(type=type)
 *     if not isinstance(res, (Array, ChunkedArray)):
 *         raise TypeError("The object's __arrow_array__ method does not "             # <<<<<<<<<<<<<<
 *                         "return a pyarrow Array or ChunkedArray.")
 *     return res
 */
  __pyx_tuple__138 = PyTuple_Pack(1, __pyx_kp_u_The_object_s___arrow_array___met); if (unlikely(!__pyx_tuple__138)) __PYX_ERR(1, 109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__138);
  __Pyx_GIVEREF(__pyx_tuple__138);

  /* "pyarrow/array.pxi":208
 *         if isinstance(values, np.ma.MaskedArray):
 *             if mask is not None:
 *                 raise ValueError("Cannot pass a numpy masked array and "             # <<<<<<<<<<<<<<
 *                                  "specify a mask at the same time")
 *             else:
 */
  __pyx_tuple__139 = PyTuple_Pack(1, __pyx_kp_u_Cannot_pass_a_numpy_masked_array); if (unlikely(!__pyx_tuple__139)) __PYX_ERR(1, 208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__139);
  __Pyx_GIVEREF(__pyx_tuple__139);

  /* "pyarrow/array.pxi":225
 *                 value_type = type.value_type
 *                 if values.ordered != type.ordered:
 *                     warnings.warn(             # <<<<<<<<<<<<<<
 *                         "The 'ordered' flag of the passed categorical values "
 *                         "does not match the 'ordered' of the specified type. "
 */
  __pyx_tuple__140 = PyTuple_Pack(2, __pyx_kp_u_The_ordered_flag_of_the_passed_c, __pyx_builtin_FutureWarning); if (unlikely(!__pyx_tuple__140)) __PYX_ERR(1, 225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__140);
  __Pyx_GIVEREF(__pyx_tuple__140);

  /* "pyarrow/array.pxi":350
 *     step = key.step or 1
 *     if step != 1:
 *         raise IndexError('only slices with step 1 supported')             # <<<<<<<<<<<<<<
 *     else:
 *         return arrow_obj.slice(start, stop - start)
 */
  __pyx_tuple__141 = PyTuple_Pack(1, __pyx_kp_u_only_slices_with_step_1_supporte); if (unlikely(!__pyx_tuple__141)) __PYX_ERR(1, 350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__141);
  __Pyx_GIVEREF(__pyx_tuple__141);

  /* "pyarrow/array.pxi":360
 *         index += length
 *         if index < 0:
 *             raise IndexError("index out of bounds")             # <<<<<<<<<<<<<<
 *     elif index >= length:
 *         raise IndexError("index out of bounds")
 */
  __pyx_tuple__142 = PyTuple_Pack(1, __pyx_kp_u_index_out_of_bounds); if (unlikely(!__pyx_tuple__142)) __PYX_ERR(1, 360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__142);
  __Pyx_GIVEREF(__pyx_tuple__142);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__143 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__143)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__143);
  __Pyx_GIVEREF(__pyx_tuple__143);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__144 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__144)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__144);
  __Pyx_GIVEREF(__pyx_tuple__144);

  /* "pyarrow/array.pxi":387
 *         return pyarrow_wrap_scalar(datum.scalar())
 *     else:
 *         raise ValueError("Unable to wrap Datum in a Python object")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__145 = PyTuple_Pack(1, __pyx_kp_u_Unable_to_wrap_Datum_in_a_Python); if (unlikely(!__pyx_tuple__145)) __PYX_ERR(1, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__145);
  __Pyx_GIVEREF(__pyx_tuple__145);

  /* "pyarrow/array.pxi":594
 * 
 *     def __eq__(self, other):
 *         raise NotImplementedError('Comparisons with pyarrow.Array are not '             # <<<<<<<<<<<<<<
 *                                   'implemented')
 * 
 */
  __pyx_tuple__146 = PyTuple_Pack(1, __pyx_kp_u_Comparisons_with_pyarrow_Array_a); if (unlikely(!__pyx_tuple__146)) __PYX_ERR(1, 594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__146);
  __Pyx_GIVEREF(__pyx_tuple__146);

  /* "pyarrow/array.pxi":914
 * 
 *         if offset < 0:
 *             raise IndexError('Offset must be non-negative')             # <<<<<<<<<<<<<<
 * 
 *         if length is None:
 */
  __pyx_tuple__147 = PyTuple_Pack(1, __pyx_kp_u_Offset_must_be_non_negative); if (unlikely(!__pyx_tuple__147)) __PYX_ERR(1, 914, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__147);
  __Pyx_GIVEREF(__pyx_tuple__147);

  /* "pyarrow/array.pxi":1041
 * 
 *         if zero_copy_only and writable:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 "Cannot return a writable array if asking for zero-copy")
 * 
 */
  __pyx_tuple__148 = PyTuple_Pack(1, __pyx_kp_u_Cannot_return_a_writable_array_i); if (unlikely(!__pyx_tuple__148)) __PYX_ERR(1, 1041, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__148);
  __Pyx_GIVEREF(__pyx_tuple__148);

  /* "pyarrow/array.pxi":1791
 *         if isinstance(indices, Array):
 *             if mask is not None:
 *                 raise NotImplementedError(             # <<<<<<<<<<<<<<
 *                     "mask not implemented with Arrow array inputs yet")
 *             _indices = indices
 */
  __pyx_tuple__149 = PyTuple_Pack(1, __pyx_kp_u_mask_not_implemented_with_Arrow); if (unlikely(!__pyx_tuple__149)) __PYX_ERR(1, 1791, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__149);
  __Pyx_GIVEREF(__pyx_tuple__149);

  /* "pyarrow/array.pxi":1806
 * 
 *         if not isinstance(_indices, IntegerArray):
 *             raise ValueError('Indices must be integer type')             # <<<<<<<<<<<<<<
 * 
 *         cdef c_bool c_ordered = ordered
 */
  __pyx_tuple__150 = PyTuple_Pack(1, __pyx_kp_u_Indices_must_be_integer_type); if (unlikely(!__pyx_tuple__150)) __PYX_ERR(1, 1806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__150);
  __Pyx_GIVEREF(__pyx_tuple__150);

  /* "pyarrow/array.pxi":1920
 * 
 *         if names is None and fields is None:
 *             raise ValueError('Must pass either names or fields')             # <<<<<<<<<<<<<<
 *         if names is not None and fields is not None:
 *             raise ValueError('Must pass either names or fields, not both')
 */
  __pyx_tuple__151 = PyTuple_Pack(1, __pyx_kp_u_Must_pass_either_names_or_fields); if (unlikely(!__pyx_tuple__151)) __PYX_ERR(1, 1920, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__151);
  __Pyx_GIVEREF(__pyx_tuple__151);

  /* "pyarrow/array.pxi":1922
 *             raise ValueError('Must pass either names or fields')
 *         if names is not None and fields is not None:
 *             raise ValueError('Must pass either names or fields, not both')             # <<<<<<<<<<<<<<
 * 
 *         arrays = [asarray(x) for x in arrays]
 */
  __pyx_tuple__152 = PyTuple_Pack(1, __pyx_kp_u_Must_pass_either_names_or_fields_2); if (unlikely(!__pyx_tuple__152)) __PYX_ERR(1, 1922, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__152);
  __Pyx_GIVEREF(__pyx_tuple__152);

  /* "pyarrow/builder.pxi":51
 *             self.builder.get().Append(tobytes(value))
 *         else:
 *             raise TypeError('StringBuilder only accepts string objects')             # <<<<<<<<<<<<<<
 * 
 *     def append_values(self, values):
 */
  __pyx_tuple__153 = PyTuple_Pack(1, __pyx_kp_u_StringBuilder_only_accepts_strin); if (unlikely(!__pyx_tuple__153)) __PYX_ERR(12, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__153);
  __Pyx_GIVEREF(__pyx_tuple__153);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__154 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__154)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__154);
  __Pyx_GIVEREF(__pyx_tuple__154);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__155 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__155)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__155);
  __Pyx_GIVEREF(__pyx_tuple__155);

  /* "pyarrow/table.pxi":34
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call ChunkedArray's constructor directly, use "             # <<<<<<<<<<<<<<
 *                         "`chunked_array` function instead.")
 * 
 */
  __pyx_tuple__156 = PyTuple_Pack(1, __pyx_kp_u_Do_not_call_ChunkedArray_s_const); if (unlikely(!__pyx_tuple__156)) __PYX_ERR(6, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__156);
  __Pyx_GIVEREF(__pyx_tuple__156);

  /* "pyarrow/table.pxi":47
 *     def data(self):
 *         import warnings
 *         warnings.warn("Calling .data on ChunkedArray is provided for "             # <<<<<<<<<<<<<<
 *                       "compatibility after Column was removed, simply drop "
 *                       "this attribute", FutureWarning)
 */
  __pyx_tuple__157 = PyTuple_Pack(2, __pyx_kp_u_Calling_data_on_ChunkedArray_is, __pyx_builtin_FutureWarning); if (unlikely(!__pyx_tuple__157)) __PYX_ERR(6, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__157);
  __Pyx_GIVEREF(__pyx_tuple__157);

  /* "pyarrow/table.pxi":142
 *             return self.getitem(key)
 *         else:
 *             raise TypeError("key must either be a slice or integer")             # <<<<<<<<<<<<<<
 * 
 *     cdef getitem(self, int64_t i):
 */
  __pyx_tuple__158 = PyTuple_Pack(1, __pyx_kp_u_key_must_either_be_a_slice_or_in); if (unlikely(!__pyx_tuple__158)) __PYX_ERR(6, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__158);
  __Pyx_GIVEREF(__pyx_tuple__158);

  /* "pyarrow/table.pxi":354
 *         """
 *         if i >= self.num_chunks or i < 0:
 *             raise IndexError('Chunk index out of range.')             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_array(self.chunked_array.chunk(i))
 */
  __pyx_tuple__159 = PyTuple_Pack(1, __pyx_kp_u_Chunk_index_out_of_range); if (unlikely(!__pyx_tuple__159)) __PYX_ERR(6, 354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__159);
  __Pyx_GIVEREF(__pyx_tuple__159);

  /* "pyarrow/table.pxi":415
 *     else:
 *         if c_arrays.size() == 0:
 *             raise ValueError("Cannot construct a chunked array with neither "             # <<<<<<<<<<<<<<
 *                              "arrays nor type")
 *         sp_chunked_array.reset(new CChunkedArray(c_arrays))
 */
  __pyx_tuple__160 = PyTuple_Pack(1, __pyx_kp_u_Cannot_construct_a_chunked_array); if (unlikely(!__pyx_tuple__160)) __PYX_ERR(6, 415, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__160);
  __Pyx_GIVEREF(__pyx_tuple__160);

  /* "pyarrow/table.pxi":445
 * 
 *     if names is None:
 *         raise ValueError('Must pass names or schema to Table.from_arrays')             # <<<<<<<<<<<<<<
 * 
 *     if len(names) != K:
 */
  __pyx_tuple__161 = PyTuple_Pack(1, __pyx_kp_u_Must_pass_names_or_schema_to_Tab); if (unlikely(!__pyx_tuple__161)) __PYX_ERR(6, 445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__161);
  __Pyx_GIVEREF(__pyx_tuple__161);

  /* "pyarrow/table.pxi":478
 *     else:
 *         if names is not None:
 *             raise ValueError('Cannot pass both schema and names')             # <<<<<<<<<<<<<<
 *         if metadata is not None:
 *             raise ValueError('Cannot pass both schema and metadata')
 */
  __pyx_tuple__162 = PyTuple_Pack(1, __pyx_kp_u_Cannot_pass_both_schema_and_name); if (unlikely(!__pyx_tuple__162)) __PYX_ERR(6, 478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__162);
  __Pyx_GIVEREF(__pyx_tuple__162);

  /* "pyarrow/table.pxi":480
 *             raise ValueError('Cannot pass both schema and names')
 *         if metadata is not None:
 *             raise ValueError('Cannot pass both schema and metadata')             # <<<<<<<<<<<<<<
 *         cy_schema = schema
 * 
 */
  __pyx_tuple__163 = PyTuple_Pack(1, __pyx_kp_u_Cannot_pass_both_schema_and_meta); if (unlikely(!__pyx_tuple__163)) __PYX_ERR(6, 480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__163);
  __Pyx_GIVEREF(__pyx_tuple__163);

  /* "pyarrow/table.pxi":484
 * 
 *         if len(schema) != len(arrays):
 *             raise ValueError('Schema and number of arrays unequal')             # <<<<<<<<<<<<<<
 * 
 *         c_schema[0] = cy_schema.sp_schema
 */
  __pyx_tuple__164 = PyTuple_Pack(1, __pyx_kp_u_Schema_and_number_of_arrays_uneq); if (unlikely(!__pyx_tuple__164)) __PYX_ERR(6, 484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__164);
  __Pyx_GIVEREF(__pyx_tuple__164);

  /* "pyarrow/table.pxi":509
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call RecordBatch's constructor directly, use "             # <<<<<<<<<<<<<<
 *                         "one of the `RecordBatch.from_*` functions instead.")
 * 
 */
  __pyx_tuple__165 = PyTuple_Pack(1, __pyx_kp_u_Do_not_call_RecordBatch_s_constr); if (unlikely(!__pyx_tuple__165)) __PYX_ERR(6, 509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__165);
  __Pyx_GIVEREF(__pyx_tuple__165);

  /* "pyarrow/table.pxi":805
 *         if isinstance(names, Schema):
 *             import warnings
 *             warnings.warn("Schema passed to names= option, please "             # <<<<<<<<<<<<<<
 *                           "pass schema= explicitly. "
 *                           "Will raise exception in future", FutureWarning)
 */
  __pyx_tuple__166 = PyTuple_Pack(2, __pyx_kp_u_Schema_passed_to_names_option_pl, __pyx_builtin_FutureWarning); if (unlikely(!__pyx_tuple__166)) __PYX_ERR(6, 805, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__166);
  __Pyx_GIVEREF(__pyx_tuple__166);

  /* "pyarrow/table.pxi":903
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call Table's constructor directly, use one of "             # <<<<<<<<<<<<<<
 *                         "the `Table.from_*` functions instead.")
 * 
 */
  __pyx_tuple__167 = PyTuple_Pack(1, __pyx_kp_u_Do_not_call_Table_s_constructor); if (unlikely(!__pyx_tuple__167)) __PYX_ERR(6, 903, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__167);
  __Pyx_GIVEREF(__pyx_tuple__167);

  /* "pyarrow/table.pxi":908
 *     def __repr__(self):
 *         if self.table == NULL:
 *             raise ValueError("Table's internal pointer is NULL, do not use "             # <<<<<<<<<<<<<<
 *                              "any methods or attributes on this object")
 *         return 'pyarrow.{}\n{}'.format(type(self).__name__, str(self.schema))
 */
  __pyx_tuple__168 = PyTuple_Pack(1, __pyx_kp_u_Table_s_internal_pointer_is_NULL); if (unlikely(!__pyx_tuple__168)) __PYX_ERR(6, 908, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__168);
  __Pyx_GIVEREF(__pyx_tuple__168);

  /* "pyarrow/table.pxi":1278
 *             return Table.from_arrays(arrays, schema=schema, metadata=metadata)
 *         else:
 *             raise TypeError('Schema must be an instance of pyarrow.Schema')             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __pyx_tuple__170 = PyTuple_Pack(1, __pyx_kp_u_Schema_must_be_an_instance_of_py); if (unlikely(!__pyx_tuple__170)) __PYX_ERR(6, 1278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__170);
  __Pyx_GIVEREF(__pyx_tuple__170);

  /* "pyarrow/table.pxi":1307
 *         if schema is None:
 *             if c_batches.size() == 0:
 *                 raise ValueError('Must pass schema, or at least '             # <<<<<<<<<<<<<<
 *                                  'one RecordBatch')
 *             c_schema = c_batches[0].get().schema()
 */
  __pyx_tuple__171 = PyTuple_Pack(1, __pyx_kp_u_Must_pass_schema_or_at_least_one); if (unlikely(!__pyx_tuple__171)) __PYX_ERR(6, 1307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__171);
  __Pyx_GIVEREF(__pyx_tuple__171);

  /* "pyarrow/table.pxi":1691
 *         return RecordBatch.from_pandas(data, schema=schema)
 *     else:
 *         raise TypeError("Expected pandas DataFrame or list of arrays")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__172 = PyTuple_Pack(1, __pyx_kp_u_Expected_pandas_DataFrame_or_lis); if (unlikely(!__pyx_tuple__172)) __PYX_ERR(6, 1691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__172);
  __Pyx_GIVEREF(__pyx_tuple__172);

  /* "pyarrow/table.pxi":1734
 *     elif isinstance(data, dict):
 *         if names is not None:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 "The 'names' argument is not valid when passing a dictionary")
 *         return Table.from_pydict(data, schema=schema, metadata=metadata)
 */
  __pyx_tuple__173 = PyTuple_Pack(1, __pyx_kp_u_The_names_argument_is_not_valid); if (unlikely(!__pyx_tuple__173)) __PYX_ERR(6, 1734, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__173);
  __Pyx_GIVEREF(__pyx_tuple__173);

  /* "pyarrow/table.pxi":1739
 *     elif _pandas_api.is_data_frame(data):
 *         if names is not None or metadata is not None:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 "The 'names' and 'metadata' arguments are not valid when "
 *                 "passing a pandas DataFrame")
 */
  __pyx_tuple__174 = PyTuple_Pack(1, __pyx_kp_u_The_names_and_metadata_arguments); if (unlikely(!__pyx_tuple__174)) __PYX_ERR(6, 1739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__174);
  __Pyx_GIVEREF(__pyx_tuple__174);

  /* "pyarrow/table.pxi":1744
 *         return Table.from_pandas(data, schema=schema)
 *     else:
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             "Expected pandas DataFrame, python dictionary or list of arrays")
 * 
 */
  __pyx_tuple__175 = PyTuple_Pack(1, __pyx_kp_u_Expected_pandas_DataFrame_python); if (unlikely(!__pyx_tuple__175)) __PYX_ERR(6, 1744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__175);
  __Pyx_GIVEREF(__pyx_tuple__175);

  /* "pyarrow/tensor.pxi":25
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call Tensor's constructor directly, use one "             # <<<<<<<<<<<<<<
 *                         "of the `pyarrow.Tensor.from_*` functions instead.")
 * 
 */
  __pyx_tuple__176 = PyTuple_Pack(1, __pyx_kp_u_Do_not_call_Tensor_s_constructor); if (unlikely(!__pyx_tuple__176)) __PYX_ERR(13, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__176);
  __Pyx_GIVEREF(__pyx_tuple__176);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_tensor,self.tp cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_tensor,self.tp cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__177 = PyTuple_Pack(1, __pyx_kp_s_self_sp_tensor_self_tp_cannot_be); if (unlikely(!__pyx_tuple__177)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__177);
  __Pyx_GIVEREF(__pyx_tuple__177);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_tensor,self.tp cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_tensor,self.tp cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__178 = PyTuple_Pack(1, __pyx_kp_s_self_sp_tensor_self_tp_cannot_be); if (unlikely(!__pyx_tuple__178)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__178);
  __Pyx_GIVEREF(__pyx_tuple__178);

  /* "pyarrow/tensor.pxi":135
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call SparseCOOTensor's constructor directly, "             # <<<<<<<<<<<<<<
 *                         "use one of the `pyarrow.SparseCOOTensor.from_*` "
 *                         "functions instead.")
 */
  __pyx_tuple__179 = PyTuple_Pack(1, __pyx_kp_u_Do_not_call_SparseCOOTensor_s_co); if (unlikely(!__pyx_tuple__179)) __PYX_ERR(13, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__179);
  __Pyx_GIVEREF(__pyx_tuple__179);

  /* "pyarrow/tensor.pxi":174
 *         coords = np.require(coords, dtype='i8', requirements='C')
 *         if coords.ndim != 2:
 *             raise ValueError("Expected 2-dimensional array for "             # <<<<<<<<<<<<<<
 *                              "SparseCOOTensor indices")
 * 
 */
  __pyx_tuple__180 = PyTuple_Pack(1, __pyx_kp_u_Expected_2_dimensional_array_for); if (unlikely(!__pyx_tuple__180)) __PYX_ERR(13, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__180);
  __Pyx_GIVEREF(__pyx_tuple__180);

  /* "pyarrow/tensor.pxi":273
 *         data = PyObject_to_object(out_data)
 *         coords = PyObject_to_object(out_coords)
 *         result = coo_matrix((data[:, 0], (coords[:, 0], coords[:, 1])),             # <<<<<<<<<<<<<<
 *                             shape=self.shape)
 *         return result
 */
  __pyx_slice__181 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__181)) __PYX_ERR(13, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__181);
  __Pyx_GIVEREF(__pyx_slice__181);
  __pyx_tuple__182 = PyTuple_Pack(2, __pyx_slice__181, __pyx_int_0); if (unlikely(!__pyx_tuple__182)) __PYX_ERR(13, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__182);
  __Pyx_GIVEREF(__pyx_tuple__182);
  __pyx_tuple__183 = PyTuple_Pack(2, __pyx_slice__181, __pyx_int_1); if (unlikely(!__pyx_tuple__183)) __PYX_ERR(13, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__183);
  __Pyx_GIVEREF(__pyx_tuple__183);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__184 = PyTuple_Pack(1, __pyx_kp_s_self_sp_sparse_tensor_self_stp_c); if (unlikely(!__pyx_tuple__184)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__184);
  __Pyx_GIVEREF(__pyx_tuple__184);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__185 = PyTuple_Pack(1, __pyx_kp_s_self_sp_sparse_tensor_self_stp_c); if (unlikely(!__pyx_tuple__185)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__185);
  __Pyx_GIVEREF(__pyx_tuple__185);

  /* "pyarrow/tensor.pxi":349
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call SparseCSRMatrix's constructor directly, "             # <<<<<<<<<<<<<<
 *                         "use one of the `pyarrow.SparseCSRMatrix.from_*` "
 *                         "functions instead.")
 */
  __pyx_tuple__186 = PyTuple_Pack(1, __pyx_kp_u_Do_not_call_SparseCSRMatrix_s_co); if (unlikely(!__pyx_tuple__186)) __PYX_ERR(13, 349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__186);
  __Pyx_GIVEREF(__pyx_tuple__186);

  /* "pyarrow/tensor.pxi":389
 *         indices = np.require(indices, dtype='i8')
 *         if indptr.ndim != 1:
 *             raise ValueError("Expected 1-dimensional array for "             # <<<<<<<<<<<<<<
 *                              "SparseCSRMatrix indptr")
 *         if indices.ndim != 1:
 */
  __pyx_tuple__187 = PyTuple_Pack(1, __pyx_kp_u_Expected_1_dimensional_array_for); if (unlikely(!__pyx_tuple__187)) __PYX_ERR(13, 389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__187);
  __Pyx_GIVEREF(__pyx_tuple__187);

  /* "pyarrow/tensor.pxi":392
 *                              "SparseCSRMatrix indptr")
 *         if indices.ndim != 1:
 *             raise ValueError("Expected 1-dimensional array for "             # <<<<<<<<<<<<<<
 *                              "SparseCSRMatrix indices")
 * 
 */
  __pyx_tuple__188 = PyTuple_Pack(1, __pyx_kp_u_Expected_1_dimensional_array_for_2); if (unlikely(!__pyx_tuple__188)) __PYX_ERR(13, 392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__188);
  __Pyx_GIVEREF(__pyx_tuple__188);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__189 = PyTuple_Pack(1, __pyx_kp_s_self_sp_sparse_tensor_self_stp_c); if (unlikely(!__pyx_tuple__189)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__189);
  __Pyx_GIVEREF(__pyx_tuple__189);

  /* "(tree fragment)":4
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.sp_sparse_tensor,self.stp cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__190 = PyTuple_Pack(1, __pyx_kp_s_self_sp_sparse_tensor_self_stp_c); if (unlikely(!__pyx_tuple__190)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__190);
  __Pyx_GIVEREF(__pyx_tuple__190);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.options cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.options cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__191 = PyTuple_Pack(1, __pyx_kp_s_self_options_cannot_be_converted); if (unlikely(!__pyx_tuple__191)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__191);
  __Pyx_GIVEREF(__pyx_tuple__191);

  /* "(tree fragment)":4
 *     raise TypeError("self.options cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.options cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__192 = PyTuple_Pack(1, __pyx_kp_s_self_options_cannot_be_converted); if (unlikely(!__pyx_tuple__192)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__192);
  __Pyx_GIVEREF(__pyx_tuple__192);

  /* "pyarrow/io.pxi":95
 *             return 'wb'
 *         else:
 *             raise ValueError('File object is malformed, has no mode')             # <<<<<<<<<<<<<<
 * 
 *     def readable(self):
 */
  __pyx_tuple__193 = PyTuple_Pack(1, __pyx_kp_u_File_object_is_malformed_has_no); if (unlikely(!__pyx_tuple__193)) __PYX_ERR(7, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__193);
  __Pyx_GIVEREF(__pyx_tuple__193);

  /* "pyarrow/io.pxi":164
 *     def _assert_open(self):
 *         if self.closed:
 *             raise ValueError("I/O operation on closed file")             # <<<<<<<<<<<<<<
 * 
 *     def _assert_readable(self):
 */
  __pyx_tuple__194 = PyTuple_Pack(1, __pyx_kp_u_I_O_operation_on_closed_file); if (unlikely(!__pyx_tuple__194)) __PYX_ERR(7, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__194);
  __Pyx_GIVEREF(__pyx_tuple__194);

  /* "pyarrow/io.pxi":170
 *         if not self.is_readable:
 *             # XXX UnsupportedOperation
 *             raise IOError("only valid on readonly files")             # <<<<<<<<<<<<<<
 * 
 *     def _assert_writable(self):
 */
  __pyx_tuple__195 = PyTuple_Pack(1, __pyx_kp_u_only_valid_on_readonly_files); if (unlikely(!__pyx_tuple__195)) __PYX_ERR(7, 170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__195);
  __Pyx_GIVEREF(__pyx_tuple__195);

  /* "pyarrow/io.pxi":175
 *         self._assert_open()
 *         if not self.is_writable:
 *             raise IOError("only valid on writable files")             # <<<<<<<<<<<<<<
 * 
 *     def _assert_seekable(self):
 */
  __pyx_tuple__196 = PyTuple_Pack(1, __pyx_kp_u_only_valid_on_writable_files); if (unlikely(!__pyx_tuple__196)) __PYX_ERR(7, 175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__196);
  __Pyx_GIVEREF(__pyx_tuple__196);

  /* "pyarrow/io.pxi":180
 *         self._assert_open()
 *         if not self.is_seekable:
 *             raise IOError("only valid on seekable files")             # <<<<<<<<<<<<<<
 * 
 *     def size(self):
 */
  __pyx_tuple__197 = PyTuple_Pack(1, __pyx_kp_u_only_valid_on_seekable_files); if (unlikely(!__pyx_tuple__197)) __PYX_ERR(7, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__197);
  __Pyx_GIVEREF(__pyx_tuple__197);

  /* "pyarrow/io.pxi":495
 *             stream = open(stream_or_path, 'wb')
 * 
 *             def cleanup():             # <<<<<<<<<<<<<<
 *                 stream.close()
 *         else:
 */
  __pyx_codeobj__199 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_cleanup, 495, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__199)) __PYX_ERR(7, 495, __pyx_L1_error)

  /* "pyarrow/io.pxi":500
 *             stream = stream_or_path
 * 
 *             def cleanup():             # <<<<<<<<<<<<<<
 *                 pass
 * 
 */
  __pyx_codeobj__200 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_cleanup, 500, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__200)) __PYX_ERR(7, 500, __pyx_L1_error)

  /* "pyarrow/io.pxi":506
 *         exc_info = None
 * 
 *         def bg_write():             # <<<<<<<<<<<<<<
 *             try:
 *                 while not done or write_queue.qsize() > 0:
 */
  __pyx_tuple__201 = PyTuple_Pack(3, __pyx_n_s_buf, __pyx_n_s_e, __pyx_n_s_exc_info); if (unlikely(!__pyx_tuple__201)) __PYX_ERR(7, 506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__201);
  __Pyx_GIVEREF(__pyx_tuple__201);
  __pyx_codeobj__202 = (PyObject*)__Pyx_PyCode_New(0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__201, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_bg_write, 506, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__202)) __PYX_ERR(7, 506, __pyx_L1_error)

  /* "pyarrow/io.pxi":577
 *         exc_info = None
 * 
 *         def bg_write():             # <<<<<<<<<<<<<<
 *             try:
 *                 while not done or write_queue.qsize() > 0:
 */
  __pyx_tuple__203 = PyTuple_Pack(3, __pyx_n_s_buf, __pyx_n_s_e, __pyx_n_s_exc_info); if (unlikely(!__pyx_tuple__203)) __PYX_ERR(7, 577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__203);
  __Pyx_GIVEREF(__pyx_tuple__203);
  __pyx_codeobj__204 = (PyObject*)__Pyx_PyCode_New(0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__203, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_bg_write, 577, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__204)) __PYX_ERR(7, 577, __pyx_L1_error)

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__205 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__205)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__205);
  __Pyx_GIVEREF(__pyx_tuple__205);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__206 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__206)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__206);
  __Pyx_GIVEREF(__pyx_tuple__206);

  /* "pyarrow/io.pxi":664
 *                 if kind == 'r':
 *                     if not handle.readable():
 *                         raise TypeError("readable file expected")             # <<<<<<<<<<<<<<
 *                 else:
 *                     if not handle.writable():
 */
  __pyx_tuple__207 = PyTuple_Pack(1, __pyx_kp_u_readable_file_expected); if (unlikely(!__pyx_tuple__207)) __PYX_ERR(7, 664, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__207);
  __Pyx_GIVEREF(__pyx_tuple__207);

  /* "pyarrow/io.pxi":667
 *                 else:
 *                     if not handle.writable():
 *                         raise TypeError("writable file expected")             # <<<<<<<<<<<<<<
 *             elif file_type is not None and isinstance(handle, file_type):
 *                 # Python 2 file type
 */
  __pyx_tuple__208 = PyTuple_Pack(1, __pyx_kp_u_writable_file_expected); if (unlikely(!__pyx_tuple__208)) __PYX_ERR(7, 667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__208);
  __Pyx_GIVEREF(__pyx_tuple__208);

  /* "pyarrow/io.pxi":680
 *         # If possible, check the file is a binary file
 *         if isinstance(handle, TextIOBase):
 *             raise TypeError("binary file expected, got text file")             # <<<<<<<<<<<<<<
 * 
 *         if kind == 'r':
 */
  __pyx_tuple__209 = PyTuple_Pack(1, __pyx_kp_u_binary_file_expected_got_text_fi); if (unlikely(!__pyx_tuple__209)) __PYX_ERR(7, 680, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__209);
  __Pyx_GIVEREF(__pyx_tuple__209);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__210 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__210)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__210);
  __Pyx_GIVEREF(__pyx_tuple__210);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__211 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__211)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__211);
  __Pyx_GIVEREF(__pyx_tuple__211);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__212 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__212)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__212);
  __Pyx_GIVEREF(__pyx_tuple__212);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__213 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__213)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__213);
  __Pyx_GIVEREF(__pyx_tuple__213);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__214 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__214)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__214);
  __Pyx_GIVEREF(__pyx_tuple__214);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__215 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__215)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__215);
  __Pyx_GIVEREF(__pyx_tuple__215);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__216 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__216)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__216);
  __Pyx_GIVEREF(__pyx_tuple__216);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__217 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__217)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__217);
  __Pyx_GIVEREF(__pyx_tuple__217);

  /* "pyarrow/io.pxi":894
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call Buffer's constructor directly, use "             # <<<<<<<<<<<<<<
 *                         "`pyarrow.py_buffer` function instead.")
 * 
 */
  __pyx_tuple__218 = PyTuple_Pack(1, __pyx_kp_u_Do_not_call_Buffer_s_constructor); if (unlikely(!__pyx_tuple__218)) __PYX_ERR(7, 894, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__218);
  __Pyx_GIVEREF(__pyx_tuple__218);

  /* "pyarrow/io.pxi":1027
 *         else:
 *             if flags & cp.PyBUF_WRITABLE:
 *                 raise BufferError("Writable buffer requested but Arrow "             # <<<<<<<<<<<<<<
 *                                   "buffer was not mutable")
 *             buffer.readonly = 1
 */
  __pyx_tuple__219 = PyTuple_Pack(1, __pyx_kp_u_Writable_buffer_requested_but_Ar); if (unlikely(!__pyx_tuple__219)) __PYX_ERR(7, 1027, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__219);
  __Pyx_GIVEREF(__pyx_tuple__219);

  /* "pyarrow/io.pxi":1048
 *     def __getreadbuffer__(self, Py_ssize_t idx, void **p):
 *         if idx != 0:
 *             raise SystemError("accessing non-existent buffer segment")             # <<<<<<<<<<<<<<
 *         if p != NULL:
 *             p[0] = <void*> self.buffer.get().data()
 */
  __pyx_tuple__220 = PyTuple_Pack(1, __pyx_kp_u_accessing_non_existent_buffer_se); if (unlikely(!__pyx_tuple__220)) __PYX_ERR(7, 1048, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__220);
  __Pyx_GIVEREF(__pyx_tuple__220);

  /* "pyarrow/io.pxi":1055
 *     def __getwritebuffer__(self, Py_ssize_t idx, void **p):
 *         if not self.buffer.get().is_mutable():
 *             raise SystemError("trying to write an immutable buffer")             # <<<<<<<<<<<<<<
 *         if idx != 0:
 *             raise SystemError("accessing non-existent buffer segment")
 */
  __pyx_tuple__221 = PyTuple_Pack(1, __pyx_kp_u_trying_to_write_an_immutable_buf); if (unlikely(!__pyx_tuple__221)) __PYX_ERR(7, 1055, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__221);
  __Pyx_GIVEREF(__pyx_tuple__221);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__222 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__222)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__222);
  __Pyx_GIVEREF(__pyx_tuple__222);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__223 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__223)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__223);
  __Pyx_GIVEREF(__pyx_tuple__223);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__224 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__224)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__224);
  __Pyx_GIVEREF(__pyx_tuple__224);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__225 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__225)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__225);
  __Pyx_GIVEREF(__pyx_tuple__225);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__226 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__226)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__226);
  __Pyx_GIVEREF(__pyx_tuple__226);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__227 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__227)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__227);
  __Pyx_GIVEREF(__pyx_tuple__227);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__228 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__228)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__228);
  __Pyx_GIVEREF(__pyx_tuple__228);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__229 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__229)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__229);
  __Pyx_GIVEREF(__pyx_tuple__229);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__230 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__230)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__230);
  __Pyx_GIVEREF(__pyx_tuple__230);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__231 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__231)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__231);
  __Pyx_GIVEREF(__pyx_tuple__231);

  /* "pyarrow/io.pxi":1255
 * 
 *         if buffer_size <= 0:
 *             raise ValueError('Buffer size must be larger than zero')             # <<<<<<<<<<<<<<
 *         buffered_stream = GetResultValue(CBufferedInputStream.Create(
 *             buffer_size, maybe_unbox_memory_pool(memory_pool),
 */
  __pyx_tuple__232 = PyTuple_Pack(1, __pyx_kp_u_Buffer_size_must_be_larger_than); if (unlikely(!__pyx_tuple__232)) __PYX_ERR(7, 1255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__232);
  __Pyx_GIVEREF(__pyx_tuple__232);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__233 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__233)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__233);
  __Pyx_GIVEREF(__pyx_tuple__233);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__234 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__234)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__234);
  __Pyx_GIVEREF(__pyx_tuple__234);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__235 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__235)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__235);
  __Pyx_GIVEREF(__pyx_tuple__235);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__236 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__236)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__236);
  __Pyx_GIVEREF(__pyx_tuple__236);

  /* "pyarrow/io.pxi":1380
 *         buf = (<Buffer> o).buffer
 *         if buf == nullptr:
 *             raise ValueError("got null buffer")             # <<<<<<<<<<<<<<
 *     else:
 *         buf = GetResultValue(PyBuffer.FromPyObject(o))
 */
  __pyx_tuple__237 = PyTuple_Pack(1, __pyx_kp_u_got_null_buffer); if (unlikely(!__pyx_tuple__237)) __PYX_ERR(7, 1380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__237);
  __Pyx_GIVEREF(__pyx_tuple__237);

  /* "pyarrow/io-hdfs.pxi":127
 *     cdef _ensure_client(self):
 *         if self.client.get() == NULL:
 *             raise IOError('HDFS client improperly initialized')             # <<<<<<<<<<<<<<
 *         elif not self.is_open:
 *             raise IOError('HDFS client is closed')
 */
  __pyx_tuple__238 = PyTuple_Pack(1, __pyx_kp_u_HDFS_client_improperly_initializ); if (unlikely(!__pyx_tuple__238)) __PYX_ERR(2, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__238);
  __Pyx_GIVEREF(__pyx_tuple__238);

  /* "pyarrow/io-hdfs.pxi":129
 *             raise IOError('HDFS client improperly initialized')
 *         elif not self.is_open:
 *             raise IOError('HDFS client is closed')             # <<<<<<<<<<<<<<
 * 
 *     def exists(self, path):
 */
  __pyx_tuple__239 = PyTuple_Pack(1, __pyx_kp_u_HDFS_client_is_closed); if (unlikely(!__pyx_tuple__239)) __PYX_ERR(2, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__239);
  __Pyx_GIVEREF(__pyx_tuple__239);

  /* "pyarrow/io-hdfs.pxi":402
 * 
 *         if mode not in ('rb', 'wb', 'ab'):
 *             raise Exception("Mode must be 'rb' (read), "             # <<<<<<<<<<<<<<
 *                             "'wb' (write, new file), or 'ab' (append)")
 * 
 */
  __pyx_tuple__240 = PyTuple_Pack(1, __pyx_kp_u_Mode_must_be_rb_read_wb_write_ne); if (unlikely(!__pyx_tuple__240)) __PYX_ERR(2, 402, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__240);
  __Pyx_GIVEREF(__pyx_tuple__240);

  /* "pyarrow/io-hdfs.pxi":451
 * 
 *     def download(self, path, stream, buffer_size=None):
 *         with self.open(path, 'rb') as f:             # <<<<<<<<<<<<<<
 *             f.download(stream, buffer_size=buffer_size)
 * 
 */
  __pyx_tuple__241 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__241)) __PYX_ERR(2, 451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__241);
  __Pyx_GIVEREF(__pyx_tuple__241);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.client cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.client cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__242 = PyTuple_Pack(1, __pyx_kp_s_self_client_cannot_be_converted); if (unlikely(!__pyx_tuple__242)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__242);
  __Pyx_GIVEREF(__pyx_tuple__242);

  /* "(tree fragment)":4
 *     raise TypeError("self.client cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.client cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__243 = PyTuple_Pack(1, __pyx_kp_s_self_client_cannot_be_converted); if (unlikely(!__pyx_tuple__243)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__243);
  __Pyx_GIVEREF(__pyx_tuple__243);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__244 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__244)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__244);
  __Pyx_GIVEREF(__pyx_tuple__244);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__245 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__245)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__245);
  __Pyx_GIVEREF(__pyx_tuple__245);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__246 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__246)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__246);
  __Pyx_GIVEREF(__pyx_tuple__246);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__247 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__247)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__247);
  __Pyx_GIVEREF(__pyx_tuple__247);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__248 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__248)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__248);
  __Pyx_GIVEREF(__pyx_tuple__248);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__249 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__249)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__249);
  __Pyx_GIVEREF(__pyx_tuple__249);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__250 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__250)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__250);
  __Pyx_GIVEREF(__pyx_tuple__250);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__251 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__251)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__251);
  __Pyx_GIVEREF(__pyx_tuple__251);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.writer cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.writer cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__252 = PyTuple_Pack(1, __pyx_kp_s_self_writer_cannot_be_converted); if (unlikely(!__pyx_tuple__252)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__252);
  __Pyx_GIVEREF(__pyx_tuple__252);

  /* "(tree fragment)":4
 *     raise TypeError("self.writer cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.writer cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__253 = PyTuple_Pack(1, __pyx_kp_s_self_writer_cannot_be_converted); if (unlikely(!__pyx_tuple__253)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__253);
  __Pyx_GIVEREF(__pyx_tuple__253);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__254 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__254)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__254);
  __Pyx_GIVEREF(__pyx_tuple__254);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__255 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__255)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__255);
  __Pyx_GIVEREF(__pyx_tuple__255);

  /* "pyarrow/ipc.pxi":304
 *     def get_next_batch(self):
 *         import warnings
 *         warnings.warn('Please use read_next_batch instead of '             # <<<<<<<<<<<<<<
 *                       'get_next_batch', FutureWarning)
 *         return self.read_next_batch()
 */
  __pyx_tuple__256 = PyTuple_Pack(2, __pyx_kp_u_Please_use_read_next_batch_inste, __pyx_builtin_FutureWarning); if (unlikely(!__pyx_tuple__256)) __PYX_ERR(8, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__256);
  __Pyx_GIVEREF(__pyx_tuple__256);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.reader cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.reader cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__257 = PyTuple_Pack(1, __pyx_kp_s_self_reader_cannot_be_converted); if (unlikely(!__pyx_tuple__257)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__257);
  __Pyx_GIVEREF(__pyx_tuple__257);

  /* "(tree fragment)":4
 *     raise TypeError("self.reader cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.reader cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__258 = PyTuple_Pack(1, __pyx_kp_s_self_reader_cannot_be_converted); if (unlikely(!__pyx_tuple__258)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__258);
  __Pyx_GIVEREF(__pyx_tuple__258);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__259 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__259)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__259);
  __Pyx_GIVEREF(__pyx_tuple__259);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__260 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__260)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__260);
  __Pyx_GIVEREF(__pyx_tuple__260);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__261 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__261)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__261);
  __Pyx_GIVEREF(__pyx_tuple__261);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__262 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__262)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__262);
  __Pyx_GIVEREF(__pyx_tuple__262);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__263 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__263)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__263);
  __Pyx_GIVEREF(__pyx_tuple__263);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__264 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__264)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__264);
  __Pyx_GIVEREF(__pyx_tuple__264);

  /* "pyarrow/ipc.pxi":559
 * 
 *     if result.message == nullptr:
 *         raise EOFError("End of Arrow stream")             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_tuple__265 = PyTuple_Pack(1, __pyx_kp_u_End_of_Arrow_stream); if (unlikely(!__pyx_tuple__265)) __PYX_ERR(8, 559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__265);
  __Pyx_GIVEREF(__pyx_tuple__265);

  /* "pyarrow/feather.pxi":55
 *         if self.num_rows >= 0:
 *             if len(col) != self.num_rows:
 *                 raise ValueError('prior column had a different number of rows')             # <<<<<<<<<<<<<<
 *         else:
 *             self.num_rows = len(col)
 */
  __pyx_tuple__266 = PyTuple_Pack(1, __pyx_kp_u_prior_column_had_a_different_num); if (unlikely(!__pyx_tuple__266)) __PYX_ERR(15, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__266);
  __Pyx_GIVEREF(__pyx_tuple__266);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__267 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__267)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__267);
  __Pyx_GIVEREF(__pyx_tuple__267);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__268 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__268)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__268);
  __Pyx_GIVEREF(__pyx_tuple__268);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__269 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__269)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__269);
  __Pyx_GIVEREF(__pyx_tuple__269);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__270 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__270)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__270);
  __Pyx_GIVEREF(__pyx_tuple__270);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("self.data cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.data cannot be converted to a Python object for pickling")
 */
  __pyx_tuple__271 = PyTuple_Pack(1, __pyx_kp_s_self_data_cannot_be_converted_to); if (unlikely(!__pyx_tuple__271)) __PYX_ERR(10, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__271);
  __Pyx_GIVEREF(__pyx_tuple__271);

  /* "(tree fragment)":4
 *     raise TypeError("self.data cannot be converted to a Python object for pickling")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("self.data cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__272 = PyTuple_Pack(1, __pyx_kp_s_self_data_cannot_be_converted_to); if (unlikely(!__pyx_tuple__272)) __PYX_ERR(10, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__272);
  __Pyx_GIVEREF(__pyx_tuple__272);

  /* "pyarrow/public-api.pxi":199
 * cdef api object pyarrow_wrap_array(const shared_ptr[CArray]& sp_array):
 *     if sp_array.get() == NULL:
 *         raise ValueError('Array was NULL')             # <<<<<<<<<<<<<<
 * 
 *     cdef CDataType* data_type = sp_array.get().type().get()
 */
  __pyx_tuple__273 = PyTuple_Pack(1, __pyx_kp_u_Array_was_NULL); if (unlikely(!__pyx_tuple__273)) __PYX_ERR(18, 199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__273);
  __Pyx_GIVEREF(__pyx_tuple__273);

  /* "pyarrow/public-api.pxi":204
 * 
 *     if data_type == NULL:
 *         raise ValueError('Array data type was NULL')             # <<<<<<<<<<<<<<
 * 
 *     klass = _array_classes[data_type.id()]
 */
  __pyx_tuple__274 = PyTuple_Pack(1, __pyx_kp_u_Array_data_type_was_NULL); if (unlikely(!__pyx_tuple__274)) __PYX_ERR(18, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__274);
  __Pyx_GIVEREF(__pyx_tuple__274);

  /* "pyarrow/public-api.pxi":216
 *         const shared_ptr[CChunkedArray]& sp_array):
 *     if sp_array.get() == NULL:
 *         raise ValueError('ChunkedArray was NULL')             # <<<<<<<<<<<<<<
 * 
 *     cdef CDataType* data_type = sp_array.get().type().get()
 */
  __pyx_tuple__275 = PyTuple_Pack(1, __pyx_kp_u_ChunkedArray_was_NULL); if (unlikely(!__pyx_tuple__275)) __PYX_ERR(18, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__275);
  __Pyx_GIVEREF(__pyx_tuple__275);

  /* "pyarrow/public-api.pxi":221
 * 
 *     if data_type == NULL:
 *         raise ValueError('ChunkedArray data type was NULL')             # <<<<<<<<<<<<<<
 * 
 *     cdef ChunkedArray arr = ChunkedArray.__new__(ChunkedArray)
 */
  __pyx_tuple__276 = PyTuple_Pack(1, __pyx_kp_u_ChunkedArray_data_type_was_NULL); if (unlikely(!__pyx_tuple__276)) __PYX_ERR(18, 221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__276);
  __Pyx_GIVEREF(__pyx_tuple__276);

  /* "pyarrow/public-api.pxi":243
 * cdef api object pyarrow_wrap_scalar(const shared_ptr[CScalar]& sp_scalar):
 *     if sp_scalar.get() == NULL:
 *         raise ValueError('Scalar was NULL')             # <<<<<<<<<<<<<<
 * 
 *     cdef CDataType* data_type = sp_scalar.get().type.get()
 */
  __pyx_tuple__277 = PyTuple_Pack(1, __pyx_kp_u_Scalar_was_NULL); if (unlikely(!__pyx_tuple__277)) __PYX_ERR(18, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__277);
  __Pyx_GIVEREF(__pyx_tuple__277);

  /* "pyarrow/public-api.pxi":248
 * 
 *     if data_type == NULL:
 *         raise ValueError('Scalar data type was NULL')             # <<<<<<<<<<<<<<
 * 
 *     klass = _scalar_classes[data_type.id()]
 */
  __pyx_tuple__278 = PyTuple_Pack(1, __pyx_kp_u_Scalar_data_type_was_NULL); if (unlikely(!__pyx_tuple__278)) __PYX_ERR(18, 248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__278);
  __Pyx_GIVEREF(__pyx_tuple__278);

  /* "pyarrow/public-api.pxi":273
 *         const shared_ptr[CTensor]& sp_tensor):
 *     if sp_tensor.get() == NULL:
 *         raise ValueError('Tensor was NULL')             # <<<<<<<<<<<<<<
 * 
 *     cdef Tensor tensor = Tensor.__new__(Tensor)
 */
  __pyx_tuple__279 = PyTuple_Pack(1, __pyx_kp_u_Tensor_was_NULL); if (unlikely(!__pyx_tuple__279)) __PYX_ERR(18, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__279);
  __Pyx_GIVEREF(__pyx_tuple__279);

  /* "pyarrow/public-api.pxi":295
 *         const shared_ptr[CSparseCOOTensor]& sp_sparse_tensor):
 *     if sp_sparse_tensor.get() == NULL:
 *         raise ValueError('SparseCOOTensor was NULL')             # <<<<<<<<<<<<<<
 * 
 *     cdef SparseCOOTensor sparse_tensor = SparseCOOTensor.__new__(
 */
  __pyx_tuple__280 = PyTuple_Pack(1, __pyx_kp_u_SparseCOOTensor_was_NULL); if (unlikely(!__pyx_tuple__280)) __PYX_ERR(18, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__280);
  __Pyx_GIVEREF(__pyx_tuple__280);

  /* "pyarrow/public-api.pxi":318
 *         const shared_ptr[CSparseCSRMatrix]& sp_sparse_tensor):
 *     if sp_sparse_tensor.get() == NULL:
 *         raise ValueError('SparseCSRMatrix was NULL')             # <<<<<<<<<<<<<<
 * 
 *     cdef SparseCSRMatrix sparse_tensor = SparseCSRMatrix.__new__(
 */
  __pyx_tuple__281 = PyTuple_Pack(1, __pyx_kp_u_SparseCSRMatrix_was_NULL); if (unlikely(!__pyx_tuple__281)) __PYX_ERR(18, 318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__281);
  __Pyx_GIVEREF(__pyx_tuple__281);

  /* "pyarrow/lib.pyx":47
 * 
 * 
 * def cpu_count():             # <<<<<<<<<<<<<<
 *     """
 *     Return the number of threads to use in parallel operations.
 */
  __pyx_codeobj__282 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_lib_pyx, __pyx_n_s_cpu_count, 47, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__282)) __PYX_ERR(9, 47, __pyx_L1_error)

  /* "pyarrow/lib.pyx":60
 * 
 * 
 * def set_cpu_count(int count):             # <<<<<<<<<<<<<<
 *     """
 *     Set the number of threads to use in parallel operations.
 */
  __pyx_tuple__283 = PyTuple_Pack(2, __pyx_n_s_count, __pyx_n_s_count); if (unlikely(!__pyx_tuple__283)) __PYX_ERR(9, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__283);
  __Pyx_GIVEREF(__pyx_tuple__283);
  __pyx_codeobj__284 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__283, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_lib_pyx, __pyx_n_s_set_cpu_count, 60, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__284)) __PYX_ERR(9, 60, __pyx_L1_error)

  /* "pyarrow/error.pxi":36
 * 
 * class ArrowKeyError(KeyError, ArrowException):
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         # Override KeyError.__str__, as it uses the repr() of the key
 *         return ArrowException.__str__(self)
 */
  __pyx_tuple__285 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__285)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__285);
  __Pyx_GIVEREF(__pyx_tuple__285);
  __pyx_codeobj__286 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__285, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_error_pxi, __pyx_n_s_str, 36, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__286)) __PYX_ERR(0, 36, __pyx_L1_error)

  /* "pyarrow/memory.pxi":90
 * 
 * 
 * def default_memory_pool():             # <<<<<<<<<<<<<<
 *     """
 *     Return the process-global memory pool.
 */
  __pyx_tuple__287 = PyTuple_Pack(1, __pyx_n_s_pool); if (unlikely(!__pyx_tuple__287)) __PYX_ERR(11, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__287);
  __Pyx_GIVEREF(__pyx_tuple__287);
  __pyx_codeobj__288 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__287, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_memory_pxi, __pyx_n_s_default_memory_pool, 90, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__288)) __PYX_ERR(11, 90, __pyx_L1_error)

  /* "pyarrow/memory.pxi":100
 * 
 * 
 * def proxy_memory_pool(MemoryPool parent):             # <<<<<<<<<<<<<<
 *     """
 *     Create and return a MemoryPool instance that redirects to the
 */
  __pyx_tuple__289 = PyTuple_Pack(2, __pyx_n_s_parent, __pyx_n_s_out); if (unlikely(!__pyx_tuple__289)) __PYX_ERR(11, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__289);
  __Pyx_GIVEREF(__pyx_tuple__289);
  __pyx_codeobj__290 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__289, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_memory_pxi, __pyx_n_s_proxy_memory_pool, 100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__290)) __PYX_ERR(11, 100, __pyx_L1_error)

  /* "pyarrow/memory.pxi":111
 * 
 * 
 * def logging_memory_pool(MemoryPool parent):             # <<<<<<<<<<<<<<
 *     """
 *     Create and return a MemoryPool instance that redirects to the
 */
  __pyx_tuple__291 = PyTuple_Pack(2, __pyx_n_s_parent, __pyx_n_s_out); if (unlikely(!__pyx_tuple__291)) __PYX_ERR(11, 111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__291);
  __Pyx_GIVEREF(__pyx_tuple__291);
  __pyx_codeobj__292 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__291, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_memory_pxi, __pyx_n_s_logging_memory_pool, 111, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__292)) __PYX_ERR(11, 111, __pyx_L1_error)

  /* "pyarrow/memory.pxi":123
 * 
 * 
 * def set_memory_pool(MemoryPool pool):             # <<<<<<<<<<<<<<
 *     c_set_default_memory_pool(pool.pool)
 * 
 */
  __pyx_tuple__293 = PyTuple_Pack(1, __pyx_n_s_pool); if (unlikely(!__pyx_tuple__293)) __PYX_ERR(11, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__293);
  __Pyx_GIVEREF(__pyx_tuple__293);
  __pyx_codeobj__294 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__293, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_memory_pxi, __pyx_n_s_set_memory_pool, 123, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__294)) __PYX_ERR(11, 123, __pyx_L1_error)

  /* "pyarrow/memory.pxi":132
 * 
 * 
 * def log_memory_allocations(enable=True):             # <<<<<<<<<<<<<<
 *     """
 *     Enable or disable memory allocator logging for debugging purposes
 */
  __pyx_tuple__295 = PyTuple_Pack(1, __pyx_n_s_enable); if (unlikely(!__pyx_tuple__295)) __PYX_ERR(11, 132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__295);
  __Pyx_GIVEREF(__pyx_tuple__295);
  __pyx_codeobj__296 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__295, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_memory_pxi, __pyx_n_s_log_memory_allocations, 132, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__296)) __PYX_ERR(11, 132, __pyx_L1_error)

  /* "pyarrow/memory.pxi":147
 * 
 * 
 * def total_allocated_bytes():             # <<<<<<<<<<<<<<
 *     """
 *     Return the currently allocated bytes from the default memory pool.
 */
  __pyx_tuple__297 = PyTuple_Pack(1, __pyx_n_s_pool); if (unlikely(!__pyx_tuple__297)) __PYX_ERR(11, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__297);
  __Pyx_GIVEREF(__pyx_tuple__297);
  __pyx_codeobj__298 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__297, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_memory_pxi, __pyx_n_s_total_allocated_bytes, 147, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__298)) __PYX_ERR(11, 147, __pyx_L1_error)

  /* "pyarrow/memory.pxi":156
 * 
 * 
 * def jemalloc_set_decay_ms(decay_ms):             # <<<<<<<<<<<<<<
 *     """
 *     Set arenas.dirty_decay_ms and arenas.muzzy_decay_ms to indicated number of
 */
  __pyx_tuple__299 = PyTuple_Pack(1, __pyx_n_s_decay_ms); if (unlikely(!__pyx_tuple__299)) __PYX_ERR(11, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__299);
  __Pyx_GIVEREF(__pyx_tuple__299);
  __pyx_codeobj__300 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__299, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_memory_pxi, __pyx_n_s_jemalloc_set_decay_ms, 156, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__300)) __PYX_ERR(11, 156, __pyx_L1_error)

  /* "pyarrow/types.pxi":43
 *     _Type_FLOAT: np.float32,
 *     _Type_DOUBLE: np.float64,
 *     _Type_DATE32: np.dtype('datetime64[ns]'),             # <<<<<<<<<<<<<<
 *     _Type_DATE64: np.dtype('datetime64[ns]'),
 *     _Type_TIMESTAMP: np.dtype('datetime64[ns]'),
 */
  __pyx_tuple__301 = PyTuple_Pack(1, __pyx_kp_u_datetime64_ns); if (unlikely(!__pyx_tuple__301)) __PYX_ERR(4, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__301);
  __Pyx_GIVEREF(__pyx_tuple__301);

  /* "pyarrow/types.pxi":46
 *     _Type_DATE64: np.dtype('datetime64[ns]'),
 *     _Type_TIMESTAMP: np.dtype('datetime64[ns]'),
 *     _Type_DURATION: np.dtype('timedelta64[ns]'),             # <<<<<<<<<<<<<<
 *     _Type_BINARY: np.object_,
 *     _Type_FIXED_SIZE_BINARY: np.object_,
 */
  __pyx_tuple__302 = PyTuple_Pack(1, __pyx_kp_u_timedelta64_ns); if (unlikely(!__pyx_tuple__302)) __PYX_ERR(4, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__302);
  __Pyx_GIVEREF(__pyx_tuple__302);

  /* "pyarrow/types.pxi":86
 * 
 * 
 * def _is_primitive(Type type):             # <<<<<<<<<<<<<<
 *     # This is simply a redirect, the official API is in pyarrow.types.
 *     return is_primitive(type)
 */
  __pyx_tuple__303 = PyTuple_Pack(2, __pyx_n_s_type, __pyx_n_s_type); if (unlikely(!__pyx_tuple__303)) __PYX_ERR(4, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__303);
  __Pyx_GIVEREF(__pyx_tuple__303);
  __pyx_codeobj__304 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__303, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_is_primitive, 86, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__304)) __PYX_ERR(4, 86, __pyx_L1_error)

  /* "pyarrow/types.pxi":748
 * 
 * 
 * def register_extension_type(ext_type):             # <<<<<<<<<<<<<<
 *     """
 *     Register a Python extension type.
 */
  __pyx_tuple__305 = PyTuple_Pack(2, __pyx_n_s_ext_type, __pyx_n_s_type_4); if (unlikely(!__pyx_tuple__305)) __PYX_ERR(4, 748, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__305);
  __Pyx_GIVEREF(__pyx_tuple__305);
  __pyx_codeobj__306 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__305, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_register_extension_type, 748, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__306)) __PYX_ERR(4, 748, __pyx_L1_error)

  /* "pyarrow/types.pxi":777
 * 
 * 
 * def unregister_extension_type(type_name):             # <<<<<<<<<<<<<<
 *     """
 *     Unregister a Python extension type.
 */
  __pyx_tuple__307 = PyTuple_Pack(2, __pyx_n_s_type_name, __pyx_n_s_c_type_name); if (unlikely(!__pyx_tuple__307)) __PYX_ERR(4, 777, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__307);
  __Pyx_GIVEREF(__pyx_tuple__307);
  __pyx_codeobj__308 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__307, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_unregister_extension_type, 777, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__308)) __PYX_ERR(4, 777, __pyx_L1_error)

  /* "pyarrow/types.pxi":1352
 * 
 * 
 * def field(name, type, bint nullable=True, metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create a pyarrow.Field instance
 */
  __pyx_tuple__309 = PyTuple_Pack(7, __pyx_n_s_name, __pyx_n_s_type, __pyx_n_s_nullable, __pyx_n_s_metadata, __pyx_n_s_result, __pyx_n_s_type_4, __pyx_n_s_c_meta); if (unlikely(!__pyx_tuple__309)) __PYX_ERR(4, 1352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__309);
  __Pyx_GIVEREF(__pyx_tuple__309);
  __pyx_codeobj__310 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__309, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_field, 1352, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__310)) __PYX_ERR(4, 1352, __pyx_L1_error)

  /* "pyarrow/types.pxi":1401
 * 
 * 
 * def null():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of null type
 */
  __pyx_codeobj__311 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_null, 1401, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__311)) __PYX_ERR(4, 1401, __pyx_L1_error)

  /* "pyarrow/types.pxi":1408
 * 
 * 
 * def bool_():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of boolean type
 */
  __pyx_codeobj__312 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_bool, 1408, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__312)) __PYX_ERR(4, 1408, __pyx_L1_error)

  /* "pyarrow/types.pxi":1415
 * 
 * 
 * def uint8():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned int8 type
 */
  __pyx_codeobj__313 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_uint8, 1415, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__313)) __PYX_ERR(4, 1415, __pyx_L1_error)

  /* "pyarrow/types.pxi":1422
 * 
 * 
 * def int8():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int8 type
 */
  __pyx_codeobj__314 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_int8, 1422, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__314)) __PYX_ERR(4, 1422, __pyx_L1_error)

  /* "pyarrow/types.pxi":1429
 * 
 * 
 * def uint16():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned uint16 type
 */
  __pyx_codeobj__315 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_uint16, 1429, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__315)) __PYX_ERR(4, 1429, __pyx_L1_error)

  /* "pyarrow/types.pxi":1436
 * 
 * 
 * def int16():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int16 type
 */
  __pyx_codeobj__316 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_int16, 1436, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__316)) __PYX_ERR(4, 1436, __pyx_L1_error)

  /* "pyarrow/types.pxi":1443
 * 
 * 
 * def uint32():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned uint32 type
 */
  __pyx_codeobj__317 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_uint32, 1443, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__317)) __PYX_ERR(4, 1443, __pyx_L1_error)

  /* "pyarrow/types.pxi":1450
 * 
 * 
 * def int32():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int32 type
 */
  __pyx_codeobj__318 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_int32, 1450, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__318)) __PYX_ERR(4, 1450, __pyx_L1_error)

  /* "pyarrow/types.pxi":1457
 * 
 * 
 * def uint64():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned uint64 type
 */
  __pyx_codeobj__319 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_uint64, 1457, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__319)) __PYX_ERR(4, 1457, __pyx_L1_error)

  /* "pyarrow/types.pxi":1464
 * 
 * 
 * def int64():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int64 type
 */
  __pyx_codeobj__320 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_int64, 1464, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__320)) __PYX_ERR(4, 1464, __pyx_L1_error)

  /* "pyarrow/types.pxi":1487
 * 
 * 
 * _FIXED_OFFSET_RE = re.compile(r'([+-])(0[0-9]|1[0-9]|2[0-3]):([0-5][0-9])$')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__321 = PyTuple_Pack(1, __pyx_kp_u_0_0_9_1_0_9_2_0_3_0_5_0_9); if (unlikely(!__pyx_tuple__321)) __PYX_ERR(4, 1487, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__321);
  __Pyx_GIVEREF(__pyx_tuple__321);

  /* "pyarrow/types.pxi":1490
 * 
 * 
 * def tzinfo_to_string(tz):             # <<<<<<<<<<<<<<
 *     """
 *     Converts a time zone object into a string indicating the name of a time
 */
  __pyx_tuple__322 = PyTuple_Pack(5, __pyx_n_s_tz, __pyx_n_s_pytz, __pyx_n_s_datetime, __pyx_n_s_fixed_offset_to_string, __pyx_n_s_fixed_offset_to_string); if (unlikely(!__pyx_tuple__322)) __PYX_ERR(4, 1490, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__322);
  __Pyx_GIVEREF(__pyx_tuple__322);
  __pyx_codeobj__323 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__322, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_tzinfo_to_string, 1490, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__323)) __PYX_ERR(4, 1490, __pyx_L1_error)

  /* "pyarrow/types.pxi":1536
 * 
 * 
 * def string_to_tzinfo(name):             # <<<<<<<<<<<<<<
 *     """
 *     Converts a string indicating the name of a time zone into a time zone
 */
  __pyx_tuple__324 = PyTuple_Pack(6, __pyx_n_s_name, __pyx_n_s_pytz, __pyx_n_s_m, __pyx_n_s_sign, __pyx_n_s_hours, __pyx_n_s_minutes); if (unlikely(!__pyx_tuple__324)) __PYX_ERR(4, 1536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__324);
  __Pyx_GIVEREF(__pyx_tuple__324);
  __pyx_codeobj__325 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__324, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_string_to_tzinfo, 1536, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__325)) __PYX_ERR(4, 1536, __pyx_L1_error)

  /* "pyarrow/types.pxi":1564
 * 
 * 
 * def timestamp(unit, tz=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of timestamp type with resolution and optional time zone
 */
  __pyx_tuple__326 = PyTuple_Pack(5, __pyx_n_s_unit, __pyx_n_s_tz, __pyx_n_s_unit_code, __pyx_n_s_c_timezone, __pyx_n_s_out); if (unlikely(!__pyx_tuple__326)) __PYX_ERR(4, 1564, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__326);
  __Pyx_GIVEREF(__pyx_tuple__326);
  __pyx_codeobj__327 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__326, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_timestamp, 1564, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__327)) __PYX_ERR(4, 1564, __pyx_L1_error)

  /* "pyarrow/types.pxi":1619
 * 
 * 
 * def time32(unit):             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 32-bit time (time of day) type with unit resolution
 */
  __pyx_tuple__328 = PyTuple_Pack(4, __pyx_n_s_unit, __pyx_n_s_unit_code, __pyx_n_s_c_timezone, __pyx_n_s_out); if (unlikely(!__pyx_tuple__328)) __PYX_ERR(4, 1619, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__328);
  __Pyx_GIVEREF(__pyx_tuple__328);
  __pyx_codeobj__329 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__328, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_time32, 1619, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__329)) __PYX_ERR(4, 1619, __pyx_L1_error)

  /* "pyarrow/types.pxi":1657
 * 
 * 
 * def time64(unit):             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 64-bit time (time of day) type with unit resolution
 */
  __pyx_tuple__330 = PyTuple_Pack(4, __pyx_n_s_unit, __pyx_n_s_unit_code, __pyx_n_s_c_timezone, __pyx_n_s_out); if (unlikely(!__pyx_tuple__330)) __PYX_ERR(4, 1657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__330);
  __Pyx_GIVEREF(__pyx_tuple__330);
  __pyx_codeobj__331 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__330, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_time64, 1657, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__331)) __PYX_ERR(4, 1657, __pyx_L1_error)

  /* "pyarrow/types.pxi":1695
 * 
 * 
 * def duration(unit):             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of a duration type with unit resolution.
 */
  __pyx_tuple__332 = PyTuple_Pack(3, __pyx_n_s_unit, __pyx_n_s_unit_code, __pyx_n_s_out); if (unlikely(!__pyx_tuple__332)) __PYX_ERR(4, 1695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__332);
  __Pyx_GIVEREF(__pyx_tuple__332);
  __pyx_codeobj__333 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__332, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_duration, 1695, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__333)) __PYX_ERR(4, 1695, __pyx_L1_error)

  /* "pyarrow/types.pxi":1737
 * 
 * 
 * def date32():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 32-bit date (days since UNIX epoch 1970-01-01)
 */
  __pyx_codeobj__334 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_date32, 1737, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__334)) __PYX_ERR(4, 1737, __pyx_L1_error)

  /* "pyarrow/types.pxi":1744
 * 
 * 
 * def date64():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 64-bit date (milliseconds since UNIX epoch 1970-01-01)
 */
  __pyx_codeobj__335 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_date64, 1744, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__335)) __PYX_ERR(4, 1744, __pyx_L1_error)

  /* "pyarrow/types.pxi":1751
 * 
 * 
 * def float16():             # <<<<<<<<<<<<<<
 *     """
 *     Create half-precision floating point type
 */
  __pyx_codeobj__336 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_float16, 1751, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__336)) __PYX_ERR(4, 1751, __pyx_L1_error)

  /* "pyarrow/types.pxi":1758
 * 
 * 
 * def float32():             # <<<<<<<<<<<<<<
 *     """
 *     Create single-precision floating point type
 */
  __pyx_codeobj__337 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_float32, 1758, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__337)) __PYX_ERR(4, 1758, __pyx_L1_error)

  /* "pyarrow/types.pxi":1765
 * 
 * 
 * def float64():             # <<<<<<<<<<<<<<
 *     """
 *     Create double-precision floating point type
 */
  __pyx_codeobj__338 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_float64, 1765, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__338)) __PYX_ERR(4, 1765, __pyx_L1_error)

  /* "pyarrow/types.pxi":1792
 * 
 * 
 * def string():             # <<<<<<<<<<<<<<
 *     """
 *     Create UTF8 variable-length string type
 */
  __pyx_codeobj__339 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_string, 1792, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__339)) __PYX_ERR(4, 1792, __pyx_L1_error)

  /* "pyarrow/types.pxi":1799
 * 
 * 
 * def utf8():             # <<<<<<<<<<<<<<
 *     """
 *     Alias for string()
 */
  __pyx_codeobj__340 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_utf8, 1799, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__340)) __PYX_ERR(4, 1799, __pyx_L1_error)

  /* "pyarrow/types.pxi":1806
 * 
 * 
 * def binary(int length=-1):             # <<<<<<<<<<<<<<
 *     """
 *     Create variable-length binary type
 */
  __pyx_tuple__341 = PyTuple_Pack(2, __pyx_n_s_length, __pyx_n_s_fixed_size_binary_type); if (unlikely(!__pyx_tuple__341)) __PYX_ERR(4, 1806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__341);
  __Pyx_GIVEREF(__pyx_tuple__341);
  __pyx_codeobj__342 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__341, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_binary, 1806, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__342)) __PYX_ERR(4, 1806, __pyx_L1_error)

  /* "pyarrow/types.pxi":1825
 * 
 * 
 * def large_binary():             # <<<<<<<<<<<<<<
 *     """
 *     Create large variable-length binary type
 */
  __pyx_codeobj__343 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_large_binary, 1825, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__343)) __PYX_ERR(4, 1825, __pyx_L1_error)

  /* "pyarrow/types.pxi":1835
 * 
 * 
 * def large_string():             # <<<<<<<<<<<<<<
 *     """
 *     Create large UTF8 variable-length string type
 */
  __pyx_codeobj__344 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_large_string, 1835, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__344)) __PYX_ERR(4, 1835, __pyx_L1_error)

  /* "pyarrow/types.pxi":1845
 * 
 * 
 * def large_utf8():             # <<<<<<<<<<<<<<
 *     """
 *     Alias for large_string()
 */
  __pyx_codeobj__345 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_large_utf8, 1845, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__345)) __PYX_ERR(4, 1845, __pyx_L1_error)

  /* "pyarrow/types.pxi":1852
 * 
 * 
 * def list_(value_type, int list_size=-1):             # <<<<<<<<<<<<<<
 *     """
 *     Create ListType instance from child data type or field
 */
  __pyx_tuple__346 = PyTuple_Pack(4, __pyx_n_s_value_type, __pyx_n_s_list_size, __pyx_n_s_field_2, __pyx_n_s_list_type); if (unlikely(!__pyx_tuple__346)) __PYX_ERR(4, 1852, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__346);
  __Pyx_GIVEREF(__pyx_tuple__346);
  __pyx_codeobj__347 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__346, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_list, 1852, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__347)) __PYX_ERR(4, 1852, __pyx_L1_error)

  /* "pyarrow/types.pxi":1977
 * 
 * 
 * def struct(fields):             # <<<<<<<<<<<<<<
 *     """
 *     Create StructType instance from fields
 */
  __pyx_tuple__348 = PyTuple_Pack(5, __pyx_n_s_fields, __pyx_n_s_py_field, __pyx_n_s_c_fields, __pyx_n_s_struct_type, __pyx_n_s_item); if (unlikely(!__pyx_tuple__348)) __PYX_ERR(4, 1977, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__348);
  __Pyx_GIVEREF(__pyx_tuple__348);
  __pyx_codeobj__349 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__348, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_struct, 1977, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__349)) __PYX_ERR(4, 1977, __pyx_L1_error)

  /* "pyarrow/types.pxi":2025
 * 
 * 
 * def union(children_fields, mode, type_codes=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create UnionType from children fields.
 */
  __pyx_tuple__350 = PyTuple_Pack(9, __pyx_n_s_children_fields, __pyx_n_s_mode, __pyx_n_s_type_codes, __pyx_n_s_child_field, __pyx_n_s_c_fields, __pyx_n_s_c_type_codes, __pyx_n_s_union_type, __pyx_n_s_i, __pyx_n_s_code); if (unlikely(!__pyx_tuple__350)) __PYX_ERR(4, 2025, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__350);
  __Pyx_GIVEREF(__pyx_tuple__350);
  __pyx_codeobj__351 = (PyObject*)__Pyx_PyCode_New(3, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__350, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_union, 2025, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__351)) __PYX_ERR(4, 2025, __pyx_L1_error)

  /* "pyarrow/types.pxi":2121
 *     'date32[day]': date32,
 *     'date64[ms]': date64,
 *     'time32[s]': time32('s'),             # <<<<<<<<<<<<<<
 *     'time32[ms]': time32('ms'),
 *     'time64[us]': time64('us'),
 */
  __pyx_tuple__352 = PyTuple_Pack(1, __pyx_n_u_s); if (unlikely(!__pyx_tuple__352)) __PYX_ERR(4, 2121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__352);
  __Pyx_GIVEREF(__pyx_tuple__352);

  /* "pyarrow/types.pxi":2122
 *     'date64[ms]': date64,
 *     'time32[s]': time32('s'),
 *     'time32[ms]': time32('ms'),             # <<<<<<<<<<<<<<
 *     'time64[us]': time64('us'),
 *     'time64[ns]': time64('ns'),
 */
  __pyx_tuple__353 = PyTuple_Pack(1, __pyx_n_u_ms); if (unlikely(!__pyx_tuple__353)) __PYX_ERR(4, 2122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__353);
  __Pyx_GIVEREF(__pyx_tuple__353);

  /* "pyarrow/types.pxi":2123
 *     'time32[s]': time32('s'),
 *     'time32[ms]': time32('ms'),
 *     'time64[us]': time64('us'),             # <<<<<<<<<<<<<<
 *     'time64[ns]': time64('ns'),
 *     'timestamp[s]': timestamp('s'),
 */
  __pyx_tuple__354 = PyTuple_Pack(1, __pyx_n_u_us); if (unlikely(!__pyx_tuple__354)) __PYX_ERR(4, 2123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__354);
  __Pyx_GIVEREF(__pyx_tuple__354);

  /* "pyarrow/types.pxi":2124
 *     'time32[ms]': time32('ms'),
 *     'time64[us]': time64('us'),
 *     'time64[ns]': time64('ns'),             # <<<<<<<<<<<<<<
 *     'timestamp[s]': timestamp('s'),
 *     'timestamp[ms]': timestamp('ms'),
 */
  __pyx_tuple__355 = PyTuple_Pack(1, __pyx_n_u_ns); if (unlikely(!__pyx_tuple__355)) __PYX_ERR(4, 2124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__355);
  __Pyx_GIVEREF(__pyx_tuple__355);

  /* "pyarrow/types.pxi":2136
 * 
 * 
 * def type_for_alias(name):             # <<<<<<<<<<<<<<
 *     """
 *     Return DataType given a string alias if one exists
 */
  __pyx_tuple__356 = PyTuple_Pack(2, __pyx_n_s_name, __pyx_n_s_alias); if (unlikely(!__pyx_tuple__356)) __PYX_ERR(4, 2136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__356);
  __Pyx_GIVEREF(__pyx_tuple__356);
  __pyx_codeobj__357 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__356, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_type_for_alias, 2136, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__357)) __PYX_ERR(4, 2136, __pyx_L1_error)

  /* "pyarrow/types.pxi":2166
 * 
 * 
 * def schema(fields, metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Construct pyarrow.Schema from collection of fields
 */
  __pyx_tuple__358 = PyTuple_Pack(8, __pyx_n_s_fields, __pyx_n_s_metadata, __pyx_n_s_c_meta, __pyx_n_s_c_schema, __pyx_n_s_result, __pyx_n_s_py_field, __pyx_n_s_c_fields, __pyx_n_s_item); if (unlikely(!__pyx_tuple__358)) __PYX_ERR(4, 2166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__358);
  __Pyx_GIVEREF(__pyx_tuple__358);
  __pyx_codeobj__359 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__358, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_schema, 2166, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__359)) __PYX_ERR(4, 2166, __pyx_L1_error)

  /* "pyarrow/types.pxi":2222
 * 
 * 
 * def from_numpy_dtype(object dtype):             # <<<<<<<<<<<<<<
 *     """
 *     Convert NumPy dtype to pyarrow.DataType
 */
  __pyx_tuple__360 = PyTuple_Pack(2, __pyx_n_s_dtype, __pyx_n_s_c_type); if (unlikely(!__pyx_tuple__360)) __PYX_ERR(4, 2222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__360);
  __Pyx_GIVEREF(__pyx_tuple__360);
  __pyx_codeobj__361 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__360, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_from_numpy_dtype, 2222, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__361)) __PYX_ERR(4, 2222, __pyx_L1_error)

  /* "pyarrow/types.pxi":2234
 * 
 * 
 * def is_boolean_value(object obj):             # <<<<<<<<<<<<<<
 *     return IsPyBool(obj)
 * 
 */
  __pyx_tuple__362 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__362)) __PYX_ERR(4, 2234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__362);
  __Pyx_GIVEREF(__pyx_tuple__362);
  __pyx_codeobj__363 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__362, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_is_boolean_value, 2234, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__363)) __PYX_ERR(4, 2234, __pyx_L1_error)

  /* "pyarrow/types.pxi":2238
 * 
 * 
 * def is_integer_value(object obj):             # <<<<<<<<<<<<<<
 *     return IsPyInt(obj)
 * 
 */
  __pyx_tuple__364 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__364)) __PYX_ERR(4, 2238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__364);
  __Pyx_GIVEREF(__pyx_tuple__364);
  __pyx_codeobj__365 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__364, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_is_integer_value, 2238, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__365)) __PYX_ERR(4, 2238, __pyx_L1_error)

  /* "pyarrow/types.pxi":2242
 * 
 * 
 * def is_float_value(object obj):             # <<<<<<<<<<<<<<
 *     return IsPyFloat(obj)
 * 
 */
  __pyx_tuple__366 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__366)) __PYX_ERR(4, 2242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__366);
  __Pyx_GIVEREF(__pyx_tuple__366);
  __pyx_codeobj__367 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__366, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_is_float_value, 2242, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__367)) __PYX_ERR(4, 2242, __pyx_L1_error)

  /* "pyarrow/types.pxi":2261
 * 
 * 
 * def _register_py_extension_type():             # <<<<<<<<<<<<<<
 *     cdef:
 *         DataType storage_type
 */
  __pyx_tuple__368 = PyTuple_Pack(3, __pyx_n_s_storage_type, __pyx_n_s_cpy_ext_type, __pyx_n_s_c_extension_name); if (unlikely(!__pyx_tuple__368)) __PYX_ERR(4, 2261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__368);
  __Pyx_GIVEREF(__pyx_tuple__368);
  __pyx_codeobj__369 = (PyObject*)__Pyx_PyCode_New(0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__368, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_register_py_extension_type, 2261, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__369)) __PYX_ERR(4, 2261, __pyx_L1_error)

  /* "pyarrow/types.pxi":2276
 * 
 * 
 * def _unregister_py_extension_types():             # <<<<<<<<<<<<<<
 *     # This needs to be done explicitly before the Python interpreter is
 *     # finalized.  If the C++ type is destroyed later in the process
 */
  __pyx_tuple__370 = PyTuple_Pack(1, __pyx_n_s_ext_type); if (unlikely(!__pyx_tuple__370)) __PYX_ERR(4, 2276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__370);
  __Pyx_GIVEREF(__pyx_tuple__370);
  __pyx_codeobj__371 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__370, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_unregister_py_extension_types, 2276, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__371)) __PYX_ERR(4, 2276, __pyx_L1_error)

  /* "pyarrow/scalar.pxi":317
 * 
 * 
 * def _nanoseconds_to_datetime_safe(v, tzinfo):             # <<<<<<<<<<<<<<
 *     if v % 1000 != 0:
 *         raise ValueError("Nanosecond timestamp {} is not safely convertible "
 */
  __pyx_tuple__372 = PyTuple_Pack(4, __pyx_n_s_v, __pyx_n_s_tzinfo, __pyx_n_s_micros, __pyx_n_s_dt); if (unlikely(!__pyx_tuple__372)) __PYX_ERR(5, 317, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__372);
  __Pyx_GIVEREF(__pyx_tuple__372);
  __pyx_codeobj__373 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__372, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_scalar_pxi, __pyx_n_s_nanoseconds_to_datetime_safe, 317, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__373)) __PYX_ERR(5, 317, __pyx_L1_error)

  /* "pyarrow/scalar.pxi":330
 * 
 * 
 * def _microseconds_to_datetime(v, tzinfo):             # <<<<<<<<<<<<<<
 *     micros = v % 1_000_000
 *     dt = _datetime_from_seconds(v // 1_000_000)
 */
  __pyx_tuple__374 = PyTuple_Pack(4, __pyx_n_s_v, __pyx_n_s_tzinfo, __pyx_n_s_micros, __pyx_n_s_dt); if (unlikely(!__pyx_tuple__374)) __PYX_ERR(5, 330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__374);
  __Pyx_GIVEREF(__pyx_tuple__374);
  __pyx_codeobj__375 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__374, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_scalar_pxi, __pyx_n_s_microseconds_to_datetime, 330, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__375)) __PYX_ERR(5, 330, __pyx_L1_error)

  /* "pyarrow/scalar.pxi":336
 * 
 * 
 * def _millis_to_datetime(v, tzinfo):             # <<<<<<<<<<<<<<
 *     millis = v % 1_000
 *     dt = _datetime_from_seconds(v // 1000)
 */
  __pyx_tuple__376 = PyTuple_Pack(4, __pyx_n_s_v, __pyx_n_s_tzinfo, __pyx_n_s_millis, __pyx_n_s_dt); if (unlikely(!__pyx_tuple__376)) __PYX_ERR(5, 336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__376);
  __Pyx_GIVEREF(__pyx_tuple__376);
  __pyx_codeobj__377 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__376, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_scalar_pxi, __pyx_n_s_millis_to_datetime, 336, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__377)) __PYX_ERR(5, 336, __pyx_L1_error)

  /* "pyarrow/scalar.pxi":342
 * 
 * 
 * def _seconds_to_datetime(v, tzinfo):             # <<<<<<<<<<<<<<
 *     dt = _datetime_from_seconds(v)
 *     return _add_micros_maybe_localize(dt, 0, tzinfo)
 */
  __pyx_tuple__378 = PyTuple_Pack(3, __pyx_n_s_v, __pyx_n_s_tzinfo, __pyx_n_s_dt); if (unlikely(!__pyx_tuple__378)) __PYX_ERR(5, 342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__378);
  __Pyx_GIVEREF(__pyx_tuple__378);
  __pyx_codeobj__379 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__378, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_scalar_pxi, __pyx_n_s_seconds_to_datetime, 342, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__379)) __PYX_ERR(5, 342, __pyx_L1_error)

  /* "pyarrow/scalar.pxi":347
 * 
 * 
 * def _datetime_conversion_functions():             # <<<<<<<<<<<<<<
 *     global _datetime_conversion_initialized
 *     if _datetime_conversion_initialized:
 */
  __pyx_tuple__380 = PyTuple_Pack(1, __pyx_n_s_pd); if (unlikely(!__pyx_tuple__380)) __PYX_ERR(5, 347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__380);
  __Pyx_GIVEREF(__pyx_tuple__380);
  __pyx_codeobj__381 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__380, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_scalar_pxi, __pyx_n_s_datetime_conversion_functions, 347, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__381)) __PYX_ERR(5, 347, __pyx_L1_error)

  /* "pyarrow/scalar.pxi":411
 * 
 * 
 * def _nanoseconds_to_timedelta_safe(v):             # <<<<<<<<<<<<<<
 *     if v % 1000 != 0:
 *         raise ValueError(
 */
  __pyx_tuple__382 = PyTuple_Pack(2, __pyx_n_s_v, __pyx_n_s_micros); if (unlikely(!__pyx_tuple__382)) __PYX_ERR(5, 411, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__382);
  __Pyx_GIVEREF(__pyx_tuple__382);
  __pyx_codeobj__383 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__382, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_scalar_pxi, __pyx_n_s_nanoseconds_to_timedelta_safe, 411, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__383)) __PYX_ERR(5, 411, __pyx_L1_error)

  /* "pyarrow/scalar.pxi":423
 * 
 * 
 * def _timedelta_conversion_functions():             # <<<<<<<<<<<<<<
 *     if _TIMEDELTA_CONVERSION_FUNCTIONS:
 *         return _TIMEDELTA_CONVERSION_FUNCTIONS
 */
  __pyx_tuple__384 = PyTuple_Pack(1, __pyx_n_s_pd); if (unlikely(!__pyx_tuple__384)) __PYX_ERR(5, 423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__384);
  __Pyx_GIVEREF(__pyx_tuple__384);
  __pyx_codeobj__385 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__384, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_scalar_pxi, __pyx_n_s_timedelta_conversion_functions_2, 423, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__385)) __PYX_ERR(5, 423, __pyx_L1_error)

  /* "pyarrow/array.pxi":52
 * 
 * 
 * def _ndarray_to_arrow_type(object values, DataType type):             # <<<<<<<<<<<<<<
 *     return pyarrow_wrap_data_type(_ndarray_to_type(values, type))
 * 
 */
  __pyx_tuple__386 = PyTuple_Pack(2, __pyx_n_s_values, __pyx_n_s_type); if (unlikely(!__pyx_tuple__386)) __PYX_ERR(1, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__386);
  __Pyx_GIVEREF(__pyx_tuple__386);
  __pyx_codeobj__387 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__386, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_ndarray_to_arrow_type, 52, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__387)) __PYX_ERR(1, 52, __pyx_L1_error)

  /* "pyarrow/array.pxi":102
 * 
 * 
 * def _handle_arrow_array_protocol(obj, type, mask, size):             # <<<<<<<<<<<<<<
 *     if mask is not None or size is not None:
 *         raise ValueError(
 */
  __pyx_tuple__388 = PyTuple_Pack(5, __pyx_n_s_obj, __pyx_n_s_type, __pyx_n_s_mask, __pyx_n_s_size, __pyx_n_s_res); if (unlikely(!__pyx_tuple__388)) __PYX_ERR(1, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__388);
  __Pyx_GIVEREF(__pyx_tuple__388);
  __pyx_codeobj__389 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__388, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_handle_arrow_array_protocol, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__389)) __PYX_ERR(1, 102, __pyx_L1_error)

  /* "pyarrow/array.pxi":114
 * 
 * 
 * def array(object obj, type=None, mask=None, size=None, from_pandas=None,             # <<<<<<<<<<<<<<
 *           bint safe=True, MemoryPool memory_pool=None):
 *     """
 */
  __pyx_tuple__390 = PyTuple_Pack(15, __pyx_n_s_obj, __pyx_n_s_type, __pyx_n_s_mask, __pyx_n_s_size, __pyx_n_s_from_pandas, __pyx_n_s_safe, __pyx_n_s_memory_pool, __pyx_n_s_pool, __pyx_n_s_is_pandas_object, __pyx_n_s_c_from_pandas, __pyx_n_s_values, __pyx_n_s_index_type, __pyx_n_s_value_type, __pyx_n_s_indices, __pyx_n_s_dictionary); if (unlikely(!__pyx_tuple__390)) __PYX_ERR(1, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__390);
  __Pyx_GIVEREF(__pyx_tuple__390);
  __pyx_codeobj__391 = (PyObject*)__Pyx_PyCode_New(7, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__390, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_array, 114, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__391)) __PYX_ERR(1, 114, __pyx_L1_error)

  /* "pyarrow/array.pxi":272
 * 
 * 
 * def asarray(values, type=None):             # <<<<<<<<<<<<<<
 *     """
 *     Convert to pyarrow.Array, inferring type if not provided. Attempt to cast
 */
  __pyx_tuple__392 = PyTuple_Pack(2, __pyx_n_s_values, __pyx_n_s_type); if (unlikely(!__pyx_tuple__392)) __PYX_ERR(1, 272, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__392);
  __Pyx_GIVEREF(__pyx_tuple__392);
  __pyx_codeobj__393 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__392, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_asarray, 272, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__393)) __PYX_ERR(1, 272, __pyx_L1_error)

  /* "pyarrow/array.pxi":298
 * 
 * 
 * def infer_type(values, mask=None, from_pandas=False):             # <<<<<<<<<<<<<<
 *     """
 *     Attempt to infer Arrow data type that can hold the passed Python
 */
  __pyx_tuple__394 = PyTuple_Pack(5, __pyx_n_s_values, __pyx_n_s_mask, __pyx_n_s_from_pandas, __pyx_n_s_out, __pyx_n_s_use_pandas_sentinels); if (unlikely(!__pyx_tuple__394)) __PYX_ERR(1, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__394);
  __Pyx_GIVEREF(__pyx_tuple__394);
  __pyx_codeobj__395 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__394, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_infer_type, 298, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__395)) __PYX_ERR(1, 298, __pyx_L1_error)

  /* "pyarrow/array.pxi":327
 * 
 * 
 * def _normalize_slice(object arrow_obj, slice key):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t start, stop, step
 */
  __pyx_tuple__396 = PyTuple_Pack(6, __pyx_n_s_arrow_obj, __pyx_n_s_key, __pyx_n_s_start, __pyx_n_s_stop, __pyx_n_s_step, __pyx_n_s_n); if (unlikely(!__pyx_tuple__396)) __PYX_ERR(1, 327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__396);
  __Pyx_GIVEREF(__pyx_tuple__396);
  __pyx_codeobj__397 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__396, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_normalize_slice, 327, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__397)) __PYX_ERR(1, 327, __pyx_L1_error)

  /* "pyarrow/array.pxi":472
 * 
 * 
 * def _restore_array(data):             # <<<<<<<<<<<<<<
 *     """
 *     Reconstruct an Array from pickled ArrayData.
 */
  __pyx_tuple__398 = PyTuple_Pack(2, __pyx_n_s_data, __pyx_n_s_ad); if (unlikely(!__pyx_tuple__398)) __PYX_ERR(1, 472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__398);
  __Pyx_GIVEREF(__pyx_tuple__398);
  __pyx_codeobj__399 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__398, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_restore_array, 472, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__399)) __PYX_ERR(1, 472, __pyx_L1_error)

  /* "pyarrow/array.pxi":723
 * 
 *     @staticmethod
 *     def from_pandas(obj, mask=None, type=None, bint safe=True,             # <<<<<<<<<<<<<<
 *                     MemoryPool memory_pool=None):
 *         """
 */
  __pyx_tuple__400 = PyTuple_Pack(5, __pyx_n_s_obj, __pyx_n_s_mask, __pyx_n_s_type, __pyx_n_s_safe, __pyx_n_s_memory_pool); if (unlikely(!__pyx_tuple__400)) __PYX_ERR(1, 723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__400);
  __Pyx_GIVEREF(__pyx_tuple__400);
  __pyx_codeobj__401 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__400, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_from_pandas, 723, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__401)) __PYX_ERR(1, 723, __pyx_L1_error)

  /* "pyarrow/array.pxi":763
 * 
 *     @staticmethod
 *     def from_buffers(DataType type, length, buffers, null_count=-1, offset=0,             # <<<<<<<<<<<<<<
 *                      children=None):
 *         """
 */
  __pyx_tuple__402 = PyTuple_Pack(12, __pyx_n_s_type, __pyx_n_s_length, __pyx_n_s_buffers, __pyx_n_s_null_count, __pyx_n_s_offset, __pyx_n_s_children, __pyx_n_s_buf, __pyx_n_s_child, __pyx_n_s_c_buffers, __pyx_n_s_c_child_data, __pyx_n_s_array_data, __pyx_n_s_result); if (unlikely(!__pyx_tuple__402)) __PYX_ERR(1, 763, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__402);
  __Pyx_GIVEREF(__pyx_tuple__402);
  __pyx_codeobj__403 = (PyObject*)__Pyx_PyCode_New(6, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__402, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_from_buffers, 763, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__403)) __PYX_ERR(1, 763, __pyx_L1_error)

  /* "pyarrow/array.pxi":1317
 * 
 *     @staticmethod
 *     def from_arrays(offsets, values, MemoryPool pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct ListArray from arrays of int32 offsets and values
 */
  __pyx_tuple__404 = PyTuple_Pack(8, __pyx_n_s_offsets, __pyx_n_s_values, __pyx_n_s_pool, __pyx_n_s_offsets_2, __pyx_n_s_values_2, __pyx_n_s_out, __pyx_n_s_cpool, __pyx_n_s_result); if (unlikely(!__pyx_tuple__404)) __PYX_ERR(1, 1317, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__404);
  __Pyx_GIVEREF(__pyx_tuple__404);
  __pyx_codeobj__405 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__404, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_from_arrays, 1317, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__405)) __PYX_ERR(1, 1317, __pyx_L1_error)

  /* "pyarrow/array.pxi":1398
 * 
 *     @staticmethod
 *     def from_arrays(offsets, values, MemoryPool pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct LargeListArray from arrays of int64 offsets and values
 */
  __pyx_tuple__406 = PyTuple_Pack(8, __pyx_n_s_offsets, __pyx_n_s_values, __pyx_n_s_pool, __pyx_n_s_offsets_2, __pyx_n_s_values_2, __pyx_n_s_out, __pyx_n_s_cpool, __pyx_n_s_result); if (unlikely(!__pyx_tuple__406)) __PYX_ERR(1, 1398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__406);
  __Pyx_GIVEREF(__pyx_tuple__406);
  __pyx_codeobj__407 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__406, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_from_arrays, 1398, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__407)) __PYX_ERR(1, 1398, __pyx_L1_error)

  /* "pyarrow/array.pxi":1479
 * 
 *     @staticmethod
 *     def from_arrays(offsets, keys, items, MemoryPool pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct MapArray from arrays of int32 offsets and key, item arrays
 */
  __pyx_tuple__408 = PyTuple_Pack(10, __pyx_n_s_offsets, __pyx_n_s_keys, __pyx_n_s_items, __pyx_n_s_pool, __pyx_n_s_offsets_2, __pyx_n_s_keys_2, __pyx_n_s_items_2, __pyx_n_s_out, __pyx_n_s_cpool, __pyx_n_s_result); if (unlikely(!__pyx_tuple__408)) __PYX_ERR(1, 1479, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__408);
  __Pyx_GIVEREF(__pyx_tuple__408);
  __pyx_codeobj__409 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__408, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_from_arrays, 1479, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__409)) __PYX_ERR(1, 1479, __pyx_L1_error)

  /* "pyarrow/array.pxi":1525
 * 
 *     @staticmethod
 *     def from_arrays(values, int32_t list_size):             # <<<<<<<<<<<<<<
 *         """
 *         Construct FixedSizeListArray from array of values and a list length.
 */
  __pyx_tuple__410 = PyTuple_Pack(5, __pyx_n_s_values, __pyx_n_s_list_size, __pyx_n_s_values_2, __pyx_n_s_c_result, __pyx_n_s_result); if (unlikely(!__pyx_tuple__410)) __PYX_ERR(1, 1525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__410);
  __Pyx_GIVEREF(__pyx_tuple__410);
  __pyx_codeobj__411 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__410, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_from_arrays, 1525, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__411)) __PYX_ERR(1, 1525, __pyx_L1_error)

  /* "pyarrow/array.pxi":1574
 * 
 *     @staticmethod
 *     def from_dense(Array types, Array value_offsets, list children,             # <<<<<<<<<<<<<<
 *                    list field_names=None, list type_codes=None):
 *         """
 */
  __pyx_tuple__412 = PyTuple_Pack(12, __pyx_n_s_types, __pyx_n_s_value_offsets, __pyx_n_s_children, __pyx_n_s_field_names, __pyx_n_s_type_codes, __pyx_n_s_out, __pyx_n_s_c, __pyx_n_s_child, __pyx_n_s_c_field_names, __pyx_n_s_c_type_codes, __pyx_n_s_x, __pyx_n_s_result); if (unlikely(!__pyx_tuple__412)) __PYX_ERR(1, 1574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__412);
  __Pyx_GIVEREF(__pyx_tuple__412);
  __pyx_codeobj__413 = (PyObject*)__Pyx_PyCode_New(5, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__412, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_from_dense, 1574, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__413)) __PYX_ERR(1, 1574, __pyx_L1_error)

  /* "pyarrow/array.pxi":1614
 * 
 *     @staticmethod
 *     def from_sparse(Array types, list children, list field_names=None,             # <<<<<<<<<<<<<<
 *                     list type_codes=None):
 *         """
 */
  __pyx_tuple__414 = PyTuple_Pack(11, __pyx_n_s_types, __pyx_n_s_children, __pyx_n_s_field_names, __pyx_n_s_type_codes, __pyx_n_s_out, __pyx_n_s_c, __pyx_n_s_child, __pyx_n_s_c_field_names, __pyx_n_s_c_type_codes, __pyx_n_s_x, __pyx_n_s_result); if (unlikely(!__pyx_tuple__414)) __PYX_ERR(1, 1614, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__414);
  __Pyx_GIVEREF(__pyx_tuple__414);
  __pyx_codeobj__415 = (PyObject*)__Pyx_PyCode_New(4, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__414, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_from_sparse, 1614, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__415)) __PYX_ERR(1, 1614, __pyx_L1_error)

  /* "pyarrow/array.pxi":1660
 * 
 *     @staticmethod
 *     def from_buffers(int length, Buffer value_offsets, Buffer data,             # <<<<<<<<<<<<<<
 *                      Buffer null_bitmap=None, int null_count=-1,
 *                      int offset=0):
 */
  __pyx_tuple__416 = PyTuple_Pack(6, __pyx_n_s_length, __pyx_n_s_value_offsets, __pyx_n_s_data, __pyx_n_s_null_bitmap, __pyx_n_s_null_count, __pyx_n_s_offset); if (unlikely(!__pyx_tuple__416)) __PYX_ERR(1, 1660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__416);
  __Pyx_GIVEREF(__pyx_tuple__416);
  __pyx_codeobj__417 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__416, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_from_buffers, 1660, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__417)) __PYX_ERR(1, 1660, __pyx_L1_error)

  /* "pyarrow/array.pxi":1692
 * 
 *     @staticmethod
 *     def from_buffers(int length, Buffer value_offsets, Buffer data,             # <<<<<<<<<<<<<<
 *                      Buffer null_bitmap=None, int null_count=-1,
 *                      int offset=0):
 */
  __pyx_tuple__418 = PyTuple_Pack(6, __pyx_n_s_length, __pyx_n_s_value_offsets, __pyx_n_s_data, __pyx_n_s_null_bitmap, __pyx_n_s_null_count, __pyx_n_s_offset); if (unlikely(!__pyx_tuple__418)) __PYX_ERR(1, 1692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__418);
  __Pyx_GIVEREF(__pyx_tuple__418);
  __pyx_codeobj__419 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__418, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_from_buffers, 1692, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__419)) __PYX_ERR(1, 1692, __pyx_L1_error)

  /* "pyarrow/array.pxi":1757
 * 
 *     @staticmethod
 *     def from_arrays(indices, dictionary, mask=None, bint ordered=False,             # <<<<<<<<<<<<<<
 *                     bint from_pandas=False, bint safe=True,
 *                     MemoryPool memory_pool=None):
 */
  __pyx_tuple__420 = PyTuple_Pack(13, __pyx_n_s_indices, __pyx_n_s_dictionary, __pyx_n_s_mask, __pyx_n_s_ordered, __pyx_n_s_from_pandas, __pyx_n_s_safe, __pyx_n_s_memory_pool, __pyx_n_s_indices_2, __pyx_n_s_dictionary_2, __pyx_n_s_c_type, __pyx_n_s_c_result, __pyx_n_s_c_ordered, __pyx_n_s_result); if (unlikely(!__pyx_tuple__420)) __PYX_ERR(1, 1757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__420);
  __Pyx_GIVEREF(__pyx_tuple__420);
  __pyx_codeobj__421 = (PyObject*)__Pyx_PyCode_New(7, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__420, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_from_arrays, 1757, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__421)) __PYX_ERR(1, 1757, __pyx_L1_error)

  /* "pyarrow/array.pxi":1888
 * 
 *     @staticmethod
 *     def from_arrays(arrays, names=None, fields=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct StructArray from collection of arrays representing
 */
  __pyx_tuple__422 = PyTuple_Pack(18, __pyx_n_s_arrays, __pyx_n_s_names, __pyx_n_s_fields, __pyx_n_s_c_array, __pyx_n_s_c_arrays, __pyx_n_s_c_names, __pyx_n_s_c_fields, __pyx_n_s_c_result, __pyx_n_s_num_arrays, __pyx_n_s_length, __pyx_n_s_i, __pyx_n_s_py_field, __pyx_n_s_struct_type, __pyx_n_s_arr, __pyx_n_s_name, __pyx_n_s_item, __pyx_n_s_result, __pyx_n_s_x); if (unlikely(!__pyx_tuple__422)) __PYX_ERR(1, 1888, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__422);
  __Pyx_GIVEREF(__pyx_tuple__422);
  __pyx_codeobj__423 = (PyObject*)__Pyx_PyCode_New(3, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__422, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_from_arrays, 1888, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__423)) __PYX_ERR(1, 1888, __pyx_L1_error)

  /* "pyarrow/array.pxi":1969
 * 
 *     @staticmethod
 *     def from_storage(BaseExtensionType typ, Array storage):             # <<<<<<<<<<<<<<
 *         """
 *         Construct ExtensionArray from type and storage array.
 */
  __pyx_tuple__424 = PyTuple_Pack(4, __pyx_n_s_typ, __pyx_n_s_storage, __pyx_n_s_ext_array, __pyx_n_s_result); if (unlikely(!__pyx_tuple__424)) __PYX_ERR(1, 1969, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__424);
  __Pyx_GIVEREF(__pyx_tuple__424);
  __pyx_codeobj__425 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__424, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_from_storage, 1969, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__425)) __PYX_ERR(1, 1969, __pyx_L1_error)

  /* "pyarrow/array.pxi":2060
 * 
 * 
 * def concat_arrays(arrays, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *     """
 *     Returns a concatenation of the given arrays. The contents of those arrays
 */
  __pyx_tuple__426 = PyTuple_Pack(6, __pyx_n_s_arrays, __pyx_n_s_memory_pool, __pyx_n_s_c_arrays, __pyx_n_s_c_result, __pyx_n_s_array, __pyx_n_s_pool); if (unlikely(!__pyx_tuple__426)) __PYX_ERR(1, 2060, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__426);
  __Pyx_GIVEREF(__pyx_tuple__426);
  __pyx_codeobj__427 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__426, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_concat_arrays, 2060, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__427)) __PYX_ERR(1, 2060, __pyx_L1_error)

  /* "pyarrow/table.pxi":376
 * 
 * 
 * def chunked_array(arrays, type=None):             # <<<<<<<<<<<<<<
 *     """
 *     Construct chunked array from list of array-like objects
 */
  __pyx_tuple__428 = PyTuple_Pack(7, __pyx_n_s_arrays, __pyx_n_s_type, __pyx_n_s_arr, __pyx_n_s_c_arrays, __pyx_n_s_sp_chunked_array, __pyx_n_s_sp_data_type, __pyx_n_s_x); if (unlikely(!__pyx_tuple__428)) __PYX_ERR(6, 376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__428);
  __Pyx_GIVEREF(__pyx_tuple__428);
  __pyx_codeobj__429 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__428, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_table_pxi, __pyx_n_s_chunked_array, 376, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__429)) __PYX_ERR(6, 376, __pyx_L1_error)

  /* "pyarrow/table.pxi":773
 * 
 *     @staticmethod
 *     def from_arrays(list arrays, names=None, schema=None, metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a RecordBatch from multiple pyarrow.Arrays
 */
  __pyx_tuple__430 = PyTuple_Pack(11, __pyx_n_s_arrays, __pyx_n_s_names, __pyx_n_s_schema, __pyx_n_s_metadata, __pyx_n_s_arr, __pyx_n_s_c_schema, __pyx_n_s_c_arrays, __pyx_n_s_num_rows, __pyx_n_s_warnings, __pyx_n_s_converted_arrays, __pyx_n_s_result); if (unlikely(!__pyx_tuple__430)) __PYX_ERR(6, 773, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__430);
  __Pyx_GIVEREF(__pyx_tuple__430);
  __pyx_codeobj__431 = (PyObject*)__Pyx_PyCode_New(4, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__430, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_table_pxi, __pyx_n_s_from_arrays, 773, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__431)) __PYX_ERR(6, 773, __pyx_L1_error)

  /* "pyarrow/table.pxi":827
 * 
 *     @staticmethod
 *     def from_struct_array(StructArray struct_array):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a RecordBatch from a StructArray.
 */
  __pyx_tuple__432 = PyTuple_Pack(2, __pyx_n_s_struct_array, __pyx_n_s_c_record_batch); if (unlikely(!__pyx_tuple__432)) __PYX_ERR(6, 827, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__432);
  __Pyx_GIVEREF(__pyx_tuple__432);
  __pyx_codeobj__433 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__432, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_table_pxi, __pyx_n_s_from_struct_array, 827, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__433)) __PYX_ERR(6, 827, __pyx_L1_error)

  /* "pyarrow/table.pxi":850
 * 
 * 
 * def _reconstruct_record_batch(columns, schema):             # <<<<<<<<<<<<<<
 *     """
 *     Internal: reconstruct RecordBatch from pickled components.
 */
  __pyx_tuple__434 = PyTuple_Pack(2, __pyx_n_s_columns, __pyx_n_s_schema); if (unlikely(!__pyx_tuple__434)) __PYX_ERR(6, 850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__434);
  __Pyx_GIVEREF(__pyx_tuple__434);
  __pyx_codeobj__435 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__434, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_table_pxi, __pyx_n_s_reconstruct_record_batch, 850, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__435)) __PYX_ERR(6, 850, __pyx_L1_error)

  /* "pyarrow/table.pxi":857
 * 
 * 
 * def table_to_blocks(options, Table table, categories, extension_columns):             # <<<<<<<<<<<<<<
 *     cdef:
 *         PyObject* result_obj
 */
  __pyx_tuple__436 = PyTuple_Pack(10, __pyx_n_s_options, __pyx_n_s_table, __pyx_n_s_categories, __pyx_n_s_extension_columns, __pyx_n_s_result_obj, __pyx_n_s_c_table, __pyx_n_s_pool, __pyx_n_s_c_options, __pyx_n_s_cat, __pyx_n_s_col); if (unlikely(!__pyx_tuple__436)) __PYX_ERR(6, 857, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__436);
  __Pyx_GIVEREF(__pyx_tuple__436);
  __pyx_codeobj__437 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__436, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_table_pxi, __pyx_n_s_table_to_blocks, 857, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__437)) __PYX_ERR(6, 857, __pyx_L1_error)

  /* "pyarrow/table.pxi":1188
 * 
 *     @staticmethod
 *     def from_arrays(arrays, names=None, schema=None, metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a Table from Arrow arrays
 */
  __pyx_tuple__438 = PyTuple_Pack(11, __pyx_n_s_arrays, __pyx_n_s_names, __pyx_n_s_schema, __pyx_n_s_metadata, __pyx_n_s_columns, __pyx_n_s_c_schema, __pyx_n_s_i, __pyx_n_s_K, __pyx_n_s_converted_arrays, __pyx_n_s_item, __pyx_n_s_result); if (unlikely(!__pyx_tuple__438)) __PYX_ERR(6, 1188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__438);
  __Pyx_GIVEREF(__pyx_tuple__438);
  __pyx_codeobj__439 = (PyObject*)__Pyx_PyCode_New(4, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__438, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_table_pxi, __pyx_n_s_from_arrays, 1188, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__439)) __PYX_ERR(6, 1188, __pyx_L1_error)

  /* "pyarrow/table.pxi":1234
 * 
 *     @staticmethod
 *     def from_pydict(mapping, schema=None, metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a Table from Arrow arrays or columns
 */
  __pyx_tuple__440 = PyTuple_Pack(11, __pyx_n_s_mapping, __pyx_n_s_schema, __pyx_n_s_metadata, __pyx_n_s_arrays, __pyx_n_s_names, __pyx_n_s_k, __pyx_n_s_v, __pyx_n_s_field, __pyx_n_s_present, __pyx_n_s_missing, __pyx_n_s_n); if (unlikely(!__pyx_tuple__440)) __PYX_ERR(6, 1234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__440);
  __Pyx_GIVEREF(__pyx_tuple__440);
  __pyx_codeobj__441 = (PyObject*)__Pyx_PyCode_New(3, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__440, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_table_pxi, __pyx_n_s_from_pydict, 1234, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__441)) __PYX_ERR(6, 1234, __pyx_L1_error)

  /* "pyarrow/table.pxi":1281
 * 
 *     @staticmethod
 *     def from_batches(batches, Schema schema=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a Table from a sequence or iterator of Arrow RecordBatches
 */
  __pyx_tuple__442 = PyTuple_Pack(6, __pyx_n_s_batches, __pyx_n_s_schema, __pyx_n_s_c_batches, __pyx_n_s_c_table, __pyx_n_s_c_schema, __pyx_n_s_batch); if (unlikely(!__pyx_tuple__442)) __PYX_ERR(6, 1281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__442);
  __Pyx_GIVEREF(__pyx_tuple__442);
  __pyx_codeobj__443 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__442, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_table_pxi, __pyx_n_s_from_batches, 1281, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__443)) __PYX_ERR(6, 1281, __pyx_L1_error)

  /* "pyarrow/table.pxi":1647
 * 
 * 
 * def _reconstruct_table(arrays, schema):             # <<<<<<<<<<<<<<
 *     """
 *     Internal: reconstruct pa.Table from pickled components.
 */
  __pyx_tuple__444 = PyTuple_Pack(2, __pyx_n_s_arrays, __pyx_n_s_schema); if (unlikely(!__pyx_tuple__444)) __PYX_ERR(6, 1647, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__444);
  __Pyx_GIVEREF(__pyx_tuple__444);
  __pyx_codeobj__445 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__444, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_table_pxi, __pyx_n_s_reconstruct_table, 1647, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__445)) __PYX_ERR(6, 1647, __pyx_L1_error)

  /* "pyarrow/table.pxi":1654
 * 
 * 
 * def record_batch(data, names=None, schema=None, metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create a pyarrow.RecordBatch from another Python data structure or sequence
 */
  __pyx_tuple__446 = PyTuple_Pack(4, __pyx_n_s_data, __pyx_n_s_names, __pyx_n_s_schema, __pyx_n_s_metadata); if (unlikely(!__pyx_tuple__446)) __PYX_ERR(6, 1654, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__446);
  __Pyx_GIVEREF(__pyx_tuple__446);
  __pyx_codeobj__447 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__446, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_table_pxi, __pyx_n_s_record_batch, 1654, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__447)) __PYX_ERR(6, 1654, __pyx_L1_error)

  /* "pyarrow/table.pxi":1694
 * 
 * 
 * def table(data, names=None, schema=None, metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create a pyarrow.Table from another Python data structure or sequence of
 */
  __pyx_tuple__448 = PyTuple_Pack(4, __pyx_n_s_data, __pyx_n_s_names, __pyx_n_s_schema, __pyx_n_s_metadata); if (unlikely(!__pyx_tuple__448)) __PYX_ERR(6, 1694, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__448);
  __Pyx_GIVEREF(__pyx_tuple__448);
  __pyx_codeobj__449 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__448, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_table_pxi, __pyx_n_s_table, 1694, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__449)) __PYX_ERR(6, 1694, __pyx_L1_error)

  /* "pyarrow/table.pxi":1748
 * 
 * 
 * def concat_tables(tables, c_bool promote=False, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *     """
 *     Concatenate pyarrow.Table objects.
 */
  __pyx_tuple__450 = PyTuple_Pack(8, __pyx_n_s_tables, __pyx_n_s_promote, __pyx_n_s_memory_pool, __pyx_n_s_c_tables, __pyx_n_s_c_result_table, __pyx_n_s_pool, __pyx_n_s_table, __pyx_n_s_options); if (unlikely(!__pyx_tuple__450)) __PYX_ERR(6, 1748, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__450);
  __Pyx_GIVEREF(__pyx_tuple__450);
  __pyx_codeobj__451 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__450, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_table_pxi, __pyx_n_s_concat_tables, 1748, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__451)) __PYX_ERR(6, 1748, __pyx_L1_error)

  /* "pyarrow/tensor.pxi":40
 * 
 *     @staticmethod
 *     def from_numpy(obj, dim_names=None):             # <<<<<<<<<<<<<<
 *         cdef:
 *             vector[c_string] c_dim_names
 */
  __pyx_tuple__452 = PyTuple_Pack(5, __pyx_n_s_obj, __pyx_n_s_dim_names, __pyx_n_s_c_dim_names, __pyx_n_s_ctensor, __pyx_n_s_x); if (unlikely(!__pyx_tuple__452)) __PYX_ERR(13, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__452);
  __Pyx_GIVEREF(__pyx_tuple__452);
  __pyx_codeobj__453 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__452, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_tensor_pxi, __pyx_n_s_from_numpy, 40, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__453)) __PYX_ERR(13, 40, __pyx_L1_error)

  /* "pyarrow/tensor.pxi":157
 * 
 *     @staticmethod
 *     def from_numpy(data, coords, shape, dim_names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Create arrow::SparseCOOTensor from numpy.ndarrays
 */
  __pyx_tuple__454 = PyTuple_Pack(8, __pyx_n_s_data, __pyx_n_s_coords, __pyx_n_s_shape, __pyx_n_s_dim_names, __pyx_n_s_csparse_tensor, __pyx_n_s_c_shape, __pyx_n_s_c_dim_names, __pyx_n_s_x); if (unlikely(!__pyx_tuple__454)) __PYX_ERR(13, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__454);
  __Pyx_GIVEREF(__pyx_tuple__454);
  __pyx_codeobj__455 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__454, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_tensor_pxi, __pyx_n_s_from_numpy, 157, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__455)) __PYX_ERR(13, 157, __pyx_L1_error)

  /* "pyarrow/tensor.pxi":183
 * 
 *     @staticmethod
 *     def from_scipy(obj, dim_names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Convert scipy.sparse.coo_matrix to arrow::SparseCOOTensor
 */
  __pyx_tuple__456 = PyTuple_Pack(8, __pyx_n_s_obj, __pyx_n_s_dim_names, __pyx_n_s_scipy, __pyx_n_s_csparse_tensor, __pyx_n_s_c_shape, __pyx_n_s_c_dim_names, __pyx_n_s_x, __pyx_n_s_coords); if (unlikely(!__pyx_tuple__456)) __PYX_ERR(13, 183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__456);
  __Pyx_GIVEREF(__pyx_tuple__456);
  __pyx_codeobj__457 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__456, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_tensor_pxi, __pyx_n_s_from_scipy, 183, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__457)) __PYX_ERR(13, 183, __pyx_L1_error)

  /* "pyarrow/tensor.pxi":211
 * 
 *     @staticmethod
 *     def from_pydata_sparse(obj, dim_names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Convert pydata/sparse.COO to arrow::SparseCOOTensor
 */
  __pyx_tuple__458 = PyTuple_Pack(8, __pyx_n_s_obj, __pyx_n_s_dim_names, __pyx_n_s_sparse, __pyx_n_s_csparse_tensor, __pyx_n_s_c_shape, __pyx_n_s_c_dim_names, __pyx_n_s_x, __pyx_n_s_coords); if (unlikely(!__pyx_tuple__458)) __PYX_ERR(13, 211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__458);
  __Pyx_GIVEREF(__pyx_tuple__458);
  __pyx_codeobj__459 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__458, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_tensor_pxi, __pyx_n_s_from_pydata_sparse, 211, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__459)) __PYX_ERR(13, 211, __pyx_L1_error)

  /* "pyarrow/tensor.pxi":238
 * 
 *     @staticmethod
 *     def from_tensor(obj):             # <<<<<<<<<<<<<<
 *         """
 *         Convert arrow::Tensor to arrow::SparseCOOTensor
 */
  __pyx_tuple__460 = PyTuple_Pack(3, __pyx_n_s_obj, __pyx_n_s_csparse_tensor, __pyx_n_s_ctensor); if (unlikely(!__pyx_tuple__460)) __PYX_ERR(13, 238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__460);
  __Pyx_GIVEREF(__pyx_tuple__460);
  __pyx_codeobj__461 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__460, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_tensor_pxi, __pyx_n_s_from_tensor, 238, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__461)) __PYX_ERR(13, 238, __pyx_L1_error)

  /* "pyarrow/tensor.pxi":371
 * 
 *     @staticmethod
 *     def from_numpy(data, indptr, indices, shape, dim_names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Create arrow::SparseCSRMatrix from numpy.ndarrays
 */
  __pyx_tuple__462 = PyTuple_Pack(9, __pyx_n_s_data, __pyx_n_s_indptr, __pyx_n_s_indices, __pyx_n_s_shape, __pyx_n_s_dim_names, __pyx_n_s_csparse_tensor, __pyx_n_s_c_shape, __pyx_n_s_c_dim_names, __pyx_n_s_x); if (unlikely(!__pyx_tuple__462)) __PYX_ERR(13, 371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__462);
  __Pyx_GIVEREF(__pyx_tuple__462);
  __pyx_codeobj__463 = (PyObject*)__Pyx_PyCode_New(5, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__462, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_tensor_pxi, __pyx_n_s_from_numpy, 371, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__463)) __PYX_ERR(13, 371, __pyx_L1_error)

  /* "pyarrow/tensor.pxi":401
 * 
 *     @staticmethod
 *     def from_scipy(obj, dim_names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Convert scipy.sparse.csr_matrix to arrow::SparseCSRMatrix
 */
  __pyx_tuple__464 = PyTuple_Pack(9, __pyx_n_s_obj, __pyx_n_s_dim_names, __pyx_n_s_scipy, __pyx_n_s_csparse_tensor, __pyx_n_s_c_shape, __pyx_n_s_c_dim_names, __pyx_n_s_x, __pyx_n_s_indptr, __pyx_n_s_indices); if (unlikely(!__pyx_tuple__464)) __PYX_ERR(13, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__464);
  __Pyx_GIVEREF(__pyx_tuple__464);
  __pyx_codeobj__465 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__464, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_tensor_pxi, __pyx_n_s_from_scipy, 401, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__465)) __PYX_ERR(13, 401, __pyx_L1_error)

  /* "pyarrow/tensor.pxi":430
 * 
 *     @staticmethod
 *     def from_tensor(obj):             # <<<<<<<<<<<<<<
 *         """
 *         Convert arrow::Tensor to arrow::SparseCSRMatrix
 */
  __pyx_tuple__466 = PyTuple_Pack(3, __pyx_n_s_obj, __pyx_n_s_csparse_tensor, __pyx_n_s_ctensor); if (unlikely(!__pyx_tuple__466)) __PYX_ERR(13, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__466);
  __Pyx_GIVEREF(__pyx_tuple__466);
  __pyx_codeobj__467 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__466, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_tensor_pxi, __pyx_n_s_from_tensor, 430, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__467)) __PYX_ERR(13, 430, __pyx_L1_error)

  /* "pyarrow/compute.pxi":44
 * 
 *     @staticmethod
 *     def safe():             # <<<<<<<<<<<<<<
 *         return CastOptions.wrap(CCastOptions.Safe())
 * 
 */
  __pyx_codeobj__468 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_compute_pxi, __pyx_n_s_safe, 44, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__468)) __PYX_ERR(14, 44, __pyx_L1_error)

  /* "pyarrow/compute.pxi":48
 * 
 *     @staticmethod
 *     def unsafe():             # <<<<<<<<<<<<<<
 *         return CastOptions.wrap(CCastOptions.Unsafe())
 * 
 */
  __pyx_codeobj__469 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_compute_pxi, __pyx_n_s_unsafe, 48, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__469)) __PYX_ERR(14, 48, __pyx_L1_error)

  /* "pyarrow/io.pxi":712
 * 
 *     @staticmethod
 *     def create(path, size):             # <<<<<<<<<<<<<<
 *         cdef:
 *             shared_ptr[CMemoryMappedFile] handle
 */
  __pyx_tuple__470 = PyTuple_Pack(6, __pyx_n_s_path, __pyx_n_s_size, __pyx_n_s_handle, __pyx_n_s_c_path, __pyx_n_s_c_size, __pyx_n_s_result); if (unlikely(!__pyx_tuple__470)) __PYX_ERR(7, 712, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__470);
  __Pyx_GIVEREF(__pyx_tuple__470);
  __pyx_codeobj__471 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__470, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_create, 712, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__471)) __PYX_ERR(7, 712, __pyx_L1_error)

  /* "pyarrow/io.pxi":774
 * 
 * 
 * def memory_map(path, mode='r'):             # <<<<<<<<<<<<<<
 *     """
 *     Open memory map at file path. Size of the memory map cannot change
 */
  __pyx_tuple__472 = PyTuple_Pack(3, __pyx_n_s_path, __pyx_n_s_mode, __pyx_n_s_mmap); if (unlikely(!__pyx_tuple__472)) __PYX_ERR(7, 774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__472);
  __Pyx_GIVEREF(__pyx_tuple__472);
  __pyx_codeobj__473 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__472, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_memory_map, 774, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__473)) __PYX_ERR(7, 774, __pyx_L1_error)

  /* "pyarrow/io.pxi":794
 * 
 * 
 * def create_memory_map(path, size):             # <<<<<<<<<<<<<<
 *     """
 *     Create a file of the given size and memory-map it.
 */
  __pyx_tuple__474 = PyTuple_Pack(2, __pyx_n_s_path, __pyx_n_s_size); if (unlikely(!__pyx_tuple__474)) __PYX_ERR(7, 794, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__474);
  __Pyx_GIVEREF(__pyx_tuple__474);
  __pyx_codeobj__475 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__474, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_create_memory_map, 794, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__475)) __PYX_ERR(7, 794, __pyx_L1_error)

  /* "pyarrow/io.pxi":1097
 * 
 * 
 * def allocate_buffer(int64_t size, MemoryPool memory_pool=None,             # <<<<<<<<<<<<<<
 *                     resizable=False):
 *     """
 */
  __pyx_tuple__476 = PyTuple_Pack(6, __pyx_n_s_size, __pyx_n_s_memory_pool, __pyx_n_s_resizable, __pyx_n_s_buffer, __pyx_n_s_rz_buffer, __pyx_n_s_cpool); if (unlikely(!__pyx_tuple__476)) __PYX_ERR(7, 1097, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__476);
  __Pyx_GIVEREF(__pyx_tuple__476);
  __pyx_codeobj__477 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__476, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_allocate_buffer, 1097, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__477)) __PYX_ERR(7, 1097, __pyx_L1_error)

  /* "pyarrow/io.pxi":1341
 * 
 * 
 * def py_buffer(object obj):             # <<<<<<<<<<<<<<
 *     """
 *     Construct an Arrow buffer from a Python bytes-like or buffer-like object
 */
  __pyx_tuple__478 = PyTuple_Pack(2, __pyx_n_s_obj, __pyx_n_s_buf); if (unlikely(!__pyx_tuple__478)) __PYX_ERR(7, 1341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__478);
  __Pyx_GIVEREF(__pyx_tuple__478);
  __pyx_codeobj__479 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__478, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_py_buffer, 1341, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__479)) __PYX_ERR(7, 1341, __pyx_L1_error)

  /* "pyarrow/io.pxi":1350
 * 
 * 
 * def foreign_buffer(address, size, base=None):             # <<<<<<<<<<<<<<
 *     """
 *     Construct an Arrow buffer with the given *address* and *size*,
 */
  __pyx_tuple__480 = PyTuple_Pack(6, __pyx_n_s_address, __pyx_n_s_size, __pyx_n_s_base, __pyx_n_s_c_addr, __pyx_n_s_c_size, __pyx_n_s_buf); if (unlikely(!__pyx_tuple__480)) __PYX_ERR(7, 1350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__480);
  __Pyx_GIVEREF(__pyx_tuple__480);
  __pyx_codeobj__481 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__480, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_foreign_buffer, 1350, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__481)) __PYX_ERR(7, 1350, __pyx_L1_error)

  /* "pyarrow/io.pxi":1369
 * 
 * 
 * def as_buffer(object o):             # <<<<<<<<<<<<<<
 *     if isinstance(o, Buffer):
 *         return o
 */
  __pyx_tuple__482 = PyTuple_Pack(1, __pyx_n_s_o); if (unlikely(!__pyx_tuple__482)) __PYX_ERR(7, 1369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__482);
  __Pyx_GIVEREF(__pyx_tuple__482);
  __pyx_codeobj__483 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__482, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_as_buffer, 1369, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__483)) __PYX_ERR(7, 1369, __pyx_L1_error)

  /* "pyarrow/io.pxi":1484
 * 
 * 
 * def _detect_compression(path):             # <<<<<<<<<<<<<<
 *     if isinstance(path, six.string_types):
 *         if path.endswith('.bz2'):
 */
  __pyx_tuple__484 = PyTuple_Pack(1, __pyx_n_s_path); if (unlikely(!__pyx_tuple__484)) __PYX_ERR(7, 1484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__484);
  __Pyx_GIVEREF(__pyx_tuple__484);
  __pyx_codeobj__485 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__484, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_detect_compression, 1484, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__485)) __PYX_ERR(7, 1484, __pyx_L1_error)

  /* "pyarrow/io.pxi":1496
 * 
 * 
 * def compress(object buf, codec='lz4', asbytes=False, memory_pool=None):             # <<<<<<<<<<<<<<
 *     """
 *     Compress data from buffer-like object.
 */
  __pyx_tuple__486 = PyTuple_Pack(13, __pyx_n_s_buf, __pyx_n_s_codec, __pyx_n_s_asbytes, __pyx_n_s_memory_pool, __pyx_n_s_compression_type, __pyx_n_s_c_codec, __pyx_n_s_owned_buf, __pyx_n_s_c_buf, __pyx_n_s_pyobj, __pyx_n_s_out_buf, __pyx_n_s_max_output_size, __pyx_n_s_output_buffer, __pyx_n_s_output_length); if (unlikely(!__pyx_tuple__486)) __PYX_ERR(7, 1496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__486);
  __Pyx_GIVEREF(__pyx_tuple__486);
  __pyx_codeobj__487 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__486, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_compress, 1496, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__487)) __PYX_ERR(7, 1496, __pyx_L1_error)

  /* "pyarrow/io.pxi":1556
 * 
 * 
 * def decompress(object buf, decompressed_size=None, codec='lz4',             # <<<<<<<<<<<<<<
 *                asbytes=False, memory_pool=None):
 *     """
 */
  __pyx_tuple__488 = PyTuple_Pack(13, __pyx_n_s_buf, __pyx_n_s_decompressed_size, __pyx_n_s_codec, __pyx_n_s_asbytes, __pyx_n_s_memory_pool, __pyx_n_s_compression_type, __pyx_n_s_c_codec, __pyx_n_s_owned_buf, __pyx_n_s_c_buf, __pyx_n_s_out_buf, __pyx_n_s_output_size, __pyx_n_s_output_buffer, __pyx_n_s_pybuf); if (unlikely(!__pyx_tuple__488)) __PYX_ERR(7, 1556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__488);
  __Pyx_GIVEREF(__pyx_tuple__488);
  __pyx_codeobj__489 = (PyObject*)__Pyx_PyCode_New(5, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__488, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_decompress, 1556, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__489)) __PYX_ERR(7, 1556, __pyx_L1_error)

  /* "pyarrow/io.pxi":1614
 * 
 * 
 * def input_stream(source, compression='detect', buffer_size=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create an Arrow input stream.
 */
  __pyx_tuple__490 = PyTuple_Pack(5, __pyx_n_s_source, __pyx_n_s_compression, __pyx_n_s_buffer_size, __pyx_n_s_stream, __pyx_n_s_source_path); if (unlikely(!__pyx_tuple__490)) __PYX_ERR(7, 1614, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__490);
  __Pyx_GIVEREF(__pyx_tuple__490);
  __pyx_codeobj__491 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__490, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_input_stream, 1614, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__491)) __PYX_ERR(7, 1614, __pyx_L1_error)

  /* "pyarrow/io.pxi":1666
 * 
 * 
 * def output_stream(source, compression='detect', buffer_size=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create an Arrow output stream.
 */
  __pyx_tuple__492 = PyTuple_Pack(5, __pyx_n_s_source, __pyx_n_s_compression, __pyx_n_s_buffer_size, __pyx_n_s_stream, __pyx_n_s_source_path); if (unlikely(!__pyx_tuple__492)) __PYX_ERR(7, 1666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__492);
  __Pyx_GIVEREF(__pyx_tuple__492);
  __pyx_codeobj__493 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__492, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_output_stream, 1666, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__493)) __PYX_ERR(7, 1666, __pyx_L1_error)

  /* "pyarrow/io-hdfs.pxi":21
 * # HDFS IO implementation
 * 
 * _HDFS_PATH_RE = re.compile(r'hdfs://(.*):(\d+)(.*)')             # <<<<<<<<<<<<<<
 * 
 * try:
 */
  __pyx_tuple__494 = PyTuple_Pack(1, __pyx_kp_u_hdfs_d); if (unlikely(!__pyx_tuple__494)) __PYX_ERR(2, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__494);
  __Pyx_GIVEREF(__pyx_tuple__494);

  /* "pyarrow/io-hdfs.pxi":30
 * 
 * 
 * def have_libhdfs():             # <<<<<<<<<<<<<<
 *     try:
 *         with nogil:
 */
  __pyx_codeobj__495 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_hdfs_pxi, __pyx_n_s_have_libhdfs, 30, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__495)) __PYX_ERR(2, 30, __pyx_L1_error)

  /* "pyarrow/io-hdfs.pxi":39
 * 
 * 
 * def have_libhdfs3():             # <<<<<<<<<<<<<<
 *     try:
 *         with nogil:
 */
  __pyx_codeobj__496 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_hdfs_pxi, __pyx_n_s_have_libhdfs3, 39, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__496)) __PYX_ERR(2, 39, __pyx_L1_error)

  /* "pyarrow/io-hdfs.pxi":48
 * 
 * 
 * def strip_hdfs_abspath(path):             # <<<<<<<<<<<<<<
 *     m = _HDFS_PATH_RE.match(path)
 *     if m:
 */
  __pyx_tuple__497 = PyTuple_Pack(2, __pyx_n_s_path, __pyx_n_s_m); if (unlikely(!__pyx_tuple__497)) __PYX_ERR(2, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__497);
  __Pyx_GIVEREF(__pyx_tuple__497);
  __pyx_codeobj__498 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__497, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_hdfs_pxi, __pyx_n_s_strip_hdfs_abspath, 48, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__498)) __PYX_ERR(2, 48, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":139
 * 
 *     @staticmethod
 *     def open_stream(source):             # <<<<<<<<<<<<<<
 *         cdef:
 *             MessageReader result = MessageReader.__new__(MessageReader)
 */
  __pyx_tuple__499 = PyTuple_Pack(4, __pyx_n_s_source, __pyx_n_s_result, __pyx_n_s_in_stream, __pyx_n_s_reader); if (unlikely(!__pyx_tuple__499)) __PYX_ERR(8, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__499);
  __Pyx_GIVEREF(__pyx_tuple__499);
  __pyx_codeobj__500 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__499, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_ipc_pxi, __pyx_n_s_open_stream, 139, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__500)) __PYX_ERR(8, 139, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":449
 * 
 * 
 * def get_tensor_size(Tensor tensor):             # <<<<<<<<<<<<<<
 *     """
 *     Return total size of serialized Tensor including metadata and padding
 */
  __pyx_tuple__501 = PyTuple_Pack(2, __pyx_n_s_tensor, __pyx_n_s_size); if (unlikely(!__pyx_tuple__501)) __PYX_ERR(8, 449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__501);
  __Pyx_GIVEREF(__pyx_tuple__501);
  __pyx_codeobj__502 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__501, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_ipc_pxi, __pyx_n_s_get_tensor_size, 449, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__502)) __PYX_ERR(8, 449, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":459
 * 
 * 
 * def get_record_batch_size(RecordBatch batch):             # <<<<<<<<<<<<<<
 *     """
 *     Return total size of serialized RecordBatch including metadata and padding
 */
  __pyx_tuple__503 = PyTuple_Pack(2, __pyx_n_s_batch, __pyx_n_s_size); if (unlikely(!__pyx_tuple__503)) __PYX_ERR(8, 459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__503);
  __Pyx_GIVEREF(__pyx_tuple__503);
  __pyx_codeobj__504 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__503, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_ipc_pxi, __pyx_n_s_get_record_batch_size, 459, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__504)) __PYX_ERR(8, 459, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":469
 * 
 * 
 * def write_tensor(Tensor tensor, NativeFile dest):             # <<<<<<<<<<<<<<
 *     """
 *     Write pyarrow.Tensor to pyarrow.NativeFile object its current position
 */
  __pyx_tuple__505 = PyTuple_Pack(5, __pyx_n_s_tensor, __pyx_n_s_dest, __pyx_n_s_metadata_length, __pyx_n_s_body_length, __pyx_n_s_handle); if (unlikely(!__pyx_tuple__505)) __PYX_ERR(8, 469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__505);
  __Pyx_GIVEREF(__pyx_tuple__505);
  __pyx_codeobj__506 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__505, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_ipc_pxi, __pyx_n_s_write_tensor, 469, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__506)) __PYX_ERR(8, 469, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":510
 * 
 * 
 * def read_tensor(source):             # <<<<<<<<<<<<<<
 *     """Read pyarrow.Tensor from pyarrow.NativeFile object from current
 *     position. If the file source supports zero copy (e.g. a memory map), then
 */
  __pyx_tuple__507 = PyTuple_Pack(4, __pyx_n_s_source, __pyx_n_s_sp_tensor, __pyx_n_s_c_stream, __pyx_n_s_nf); if (unlikely(!__pyx_tuple__507)) __PYX_ERR(8, 510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__507);
  __Pyx_GIVEREF(__pyx_tuple__507);
  __pyx_codeobj__508 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__507, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_ipc_pxi, __pyx_n_s_read_tensor, 510, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__508)) __PYX_ERR(8, 510, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":536
 * 
 * 
 * def read_message(source):             # <<<<<<<<<<<<<<
 *     """
 *     Read length-prefixed message from file or buffer-like object
 */
  __pyx_tuple__509 = PyTuple_Pack(4, __pyx_n_s_source, __pyx_n_s_result, __pyx_n_s_c_stream, __pyx_n_s_nf); if (unlikely(!__pyx_tuple__509)) __PYX_ERR(8, 536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__509);
  __Pyx_GIVEREF(__pyx_tuple__509);
  __pyx_codeobj__510 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__509, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_ipc_pxi, __pyx_n_s_read_message, 536, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__510)) __PYX_ERR(8, 536, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":564
 * 
 * 
 * def read_schema(obj, DictionaryMemo dictionary_memo=None):             # <<<<<<<<<<<<<<
 *     """
 *     Read Schema from message or buffer
 */
  __pyx_tuple__511 = PyTuple_Pack(6, __pyx_n_s_obj, __pyx_n_s_dictionary_memo, __pyx_n_s_result, __pyx_n_s_cpp_file, __pyx_n_s_temp_memo, __pyx_n_s_arg_dict_memo); if (unlikely(!__pyx_tuple__511)) __PYX_ERR(8, 564, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__511);
  __Pyx_GIVEREF(__pyx_tuple__511);
  __pyx_codeobj__512 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__511, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_ipc_pxi, __pyx_n_s_read_schema, 564, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__512)) __PYX_ERR(8, 564, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":601
 * 
 * 
 * def read_record_batch(obj, Schema schema,             # <<<<<<<<<<<<<<
 *                       DictionaryMemo dictionary_memo=None):
 *     """
 */
  __pyx_tuple__513 = PyTuple_Pack(7, __pyx_n_s_obj, __pyx_n_s_schema, __pyx_n_s_dictionary_memo, __pyx_n_s_result, __pyx_n_s_message, __pyx_n_s_temp_memo, __pyx_n_s_arg_dict_memo); if (unlikely(!__pyx_tuple__513)) __PYX_ERR(8, 601, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__513);
  __Pyx_GIVEREF(__pyx_tuple__513);
  __pyx_codeobj__514 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__513, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_ipc_pxi, __pyx_n_s_read_record_batch, 601, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__514)) __PYX_ERR(8, 601, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":25
 * 
 * 
 * def is_named_tuple(cls):             # <<<<<<<<<<<<<<
 *     """Return True if cls is a namedtuple and False otherwise."""
 *     b = cls.__bases__
 */
  __pyx_tuple__515 = PyTuple_Pack(5, __pyx_n_s_cls, __pyx_n_s_b, __pyx_n_s_f, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__515)) __PYX_ERR(16, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__515);
  __Pyx_GIVEREF(__pyx_tuple__515);
  __pyx_codeobj__516 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__515, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_serialization_pxi, __pyx_n_s_is_named_tuple, 25, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__516)) __PYX_ERR(16, 25, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":37
 * 
 * class SerializationCallbackError(ArrowSerializationError):
 *     def __init__(self, message, example_object):             # <<<<<<<<<<<<<<
 *         ArrowSerializationError.__init__(self, message)
 *         self.example_object = example_object
 */
  __pyx_tuple__517 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_message, __pyx_n_s_example_object); if (unlikely(!__pyx_tuple__517)) __PYX_ERR(16, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__517);
  __Pyx_GIVEREF(__pyx_tuple__517);
  __pyx_codeobj__518 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__517, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_serialization_pxi, __pyx_n_s_init, 37, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__518)) __PYX_ERR(16, 37, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":43
 * 
 * class DeserializationCallbackError(ArrowSerializationError):
 *     def __init__(self, message, type_id):             # <<<<<<<<<<<<<<
 *         ArrowSerializationError.__init__(self, message)
 *         self.type_id = type_id
 */
  __pyx_tuple__519 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_message, __pyx_n_s_type_id); if (unlikely(!__pyx_tuple__519)) __PYX_ERR(16, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__519);
  __Pyx_GIVEREF(__pyx_tuple__519);
  __pyx_codeobj__520 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__519, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_serialization_pxi, __pyx_n_s_init, 43, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__520)) __PYX_ERR(16, 43, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":226
 * 
 * 
 * def _get_default_context():             # <<<<<<<<<<<<<<
 *     global _default_context_initialized
 *     from pyarrow.serialization import register_default_serialization_handlers
 */
  __pyx_tuple__521 = PyTuple_Pack(1, __pyx_n_s_register_default_serialization_h); if (unlikely(!__pyx_tuple__521)) __PYX_ERR(16, 226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__521);
  __Pyx_GIVEREF(__pyx_tuple__521);
  __pyx_codeobj__522 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__521, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_serialization_pxi, __pyx_n_s_get_default_context, 226, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__522)) __PYX_ERR(16, 226, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":294
 * 
 *     @staticmethod
 *     def from_components(components):             # <<<<<<<<<<<<<<
 *         """
 *         Reconstruct SerializedPyObject from output of
 */
  __pyx_tuple__523 = PyTuple_Pack(7, __pyx_n_s_components, __pyx_n_s_num_tensors, __pyx_n_s_num_ndarrays, __pyx_n_s_num_buffers, __pyx_n_s_buffers, __pyx_n_s_num_sparse_tensors, __pyx_n_s_result); if (unlikely(!__pyx_tuple__523)) __PYX_ERR(16, 294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__523);
  __Pyx_GIVEREF(__pyx_tuple__523);
  __pyx_codeobj__524 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__523, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_serialization_pxi, __pyx_n_s_from_components, 294, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__524)) __PYX_ERR(16, 294, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":342
 * 
 * 
 * def serialize(object value, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Serialize a general Python sequence for transient storage
 *     and transport. This may have better performance and memory efficiency than
 */
  __pyx_tuple__525 = PyTuple_Pack(4, __pyx_n_s_value, __pyx_n_s_context, __pyx_n_s_serialized, __pyx_n_s_wrapped_value); if (unlikely(!__pyx_tuple__525)) __PYX_ERR(16, 342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__525);
  __Pyx_GIVEREF(__pyx_tuple__525);
  __pyx_codeobj__526 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__525, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_serialization_pxi, __pyx_n_s_serialize, 342, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__526)) __PYX_ERR(16, 342, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":376
 * 
 * 
 * def serialize_to(object value, sink, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Serialize a Python sequence to a file.
 * 
 */
  __pyx_tuple__527 = PyTuple_Pack(4, __pyx_n_s_value, __pyx_n_s_sink, __pyx_n_s_context, __pyx_n_s_serialized); if (unlikely(!__pyx_tuple__527)) __PYX_ERR(16, 376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__527);
  __Pyx_GIVEREF(__pyx_tuple__527);
  __pyx_codeobj__528 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__527, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_serialization_pxi, __pyx_n_s_serialize_to, 376, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__528)) __PYX_ERR(16, 376, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":393
 * 
 * 
 * def read_serialized(source, base=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Read serialized Python sequence from file-like object
 * 
 */
  __pyx_tuple__529 = PyTuple_Pack(4, __pyx_n_s_source, __pyx_n_s_base, __pyx_n_s_stream, __pyx_n_s_serialized); if (unlikely(!__pyx_tuple__529)) __PYX_ERR(16, 393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__529);
  __Pyx_GIVEREF(__pyx_tuple__529);
  __pyx_codeobj__530 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__529, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_serialization_pxi, __pyx_n_s_read_serialized, 393, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__530)) __PYX_ERR(16, 393, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":419
 * 
 * 
 * def deserialize_from(source, object base, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Deserialize a Python sequence from a file. This only can
 *     interact with data produced by pyarrow.serialize or pyarrow.serialize_to
 */
  __pyx_tuple__531 = PyTuple_Pack(4, __pyx_n_s_source, __pyx_n_s_base, __pyx_n_s_context, __pyx_n_s_serialized); if (unlikely(!__pyx_tuple__531)) __PYX_ERR(16, 419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__531);
  __Pyx_GIVEREF(__pyx_tuple__531);
  __pyx_codeobj__532 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__531, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_serialization_pxi, __pyx_n_s_deserialize_from, 419, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__532)) __PYX_ERR(16, 419, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":442
 * 
 * 
 * def deserialize_components(components, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """
 *     Reconstruct Python object from output of SerializedPyObject.to_components
 */
  __pyx_tuple__533 = PyTuple_Pack(3, __pyx_n_s_components, __pyx_n_s_context, __pyx_n_s_serialized); if (unlikely(!__pyx_tuple__533)) __PYX_ERR(16, 442, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__533);
  __Pyx_GIVEREF(__pyx_tuple__533);
  __pyx_codeobj__534 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__533, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_serialization_pxi, __pyx_n_s_deserialize_components, 442, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__534)) __PYX_ERR(16, 442, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":460
 * 
 * 
 * def deserialize(obj, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Deserialize Python object from Buffer or other Python
 *     object supporting the buffer protocol. This only can interact with data
 */
  __pyx_tuple__535 = PyTuple_Pack(3, __pyx_n_s_obj, __pyx_n_s_context, __pyx_n_s_source); if (unlikely(!__pyx_tuple__535)) __PYX_ERR(16, 460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__535);
  __Pyx_GIVEREF(__pyx_tuple__535);
  __pyx_codeobj__536 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__535, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_serialization_pxi, __pyx_n_s_deserialize, 460, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__536)) __PYX_ERR(16, 460, __pyx_L1_error)

  /* "pyarrow/benchmark.pxi":19
 * 
 * 
 * def benchmark_PandasObjectIsNull(list obj):             # <<<<<<<<<<<<<<
 *     Benchmark_PandasObjectIsNull(obj)
 */
  __pyx_tuple__537 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__537)) __PYX_ERR(17, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__537);
  __Pyx_GIVEREF(__pyx_tuple__537);
  __pyx_codeobj__538 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__537, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_benchmark_pxi, __pyx_n_s_benchmark_PandasObjectIsNull, 19, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__538)) __PYX_ERR(17, 19, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __pyx_unpickle__PandasAPIShim(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_tuple__539 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__539)) __PYX_ERR(10, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__539);
  __Pyx_GIVEREF(__pyx_tuple__539);
  __pyx_codeobj__540 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__539, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle__PandasAPIShim, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__540)) __PYX_ERR(10, 1, __pyx_L1_error)
  __pyx_tuple__541 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__541)) __PYX_ERR(10, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__541);
  __Pyx_GIVEREF(__pyx_tuple__541);
  __pyx_codeobj__542 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__541, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Scalar, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__542)) __PYX_ERR(10, 1, __pyx_L1_error)
  __pyx_tuple__543 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__543)) __PYX_ERR(10, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__543);
  __Pyx_GIVEREF(__pyx_tuple__543);
  __pyx_codeobj__544 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__543, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle__PandasConvertibl, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__544)) __PYX_ERR(10, 1, __pyx_L1_error)
  __pyx_tuple__545 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__545)) __PYX_ERR(10, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__545);
  __Pyx_GIVEREF(__pyx_tuple__545);
  __pyx_codeobj__546 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__545, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_SerializationCont, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__546)) __PYX_ERR(10, 1, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
  __pyx_umethod_PyDict_Type_update.type = (PyObject*)&PyDict_Type;
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(9, 1, __pyx_L1_error);
  __pyx_float_0_01 = PyFloat_FromDouble(0.01); if (unlikely(!__pyx_float_0_01)) __PYX_ERR(9, 1, __pyx_L1_error)
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(9, 1, __pyx_L1_error)
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(9, 1, __pyx_L1_error)
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(9, 1, __pyx_L1_error)
  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(9, 1, __pyx_L1_error)
  __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(9, 1, __pyx_L1_error)
  __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __PYX_ERR(9, 1, __pyx_L1_error)
  __pyx_int_50 = PyInt_FromLong(50); if (unlikely(!__pyx_int_50)) __PYX_ERR(9, 1, __pyx_L1_error)
  __pyx_int_60 = PyInt_FromLong(60); if (unlikely(!__pyx_int_60)) __PYX_ERR(9, 1, __pyx_L1_error)
  __pyx_int_1000 = PyInt_FromLong(1000); if (unlikely(!__pyx_int_1000)) __PYX_ERR(9, 1, __pyx_L1_error)
  __pyx_int_1970 = PyInt_FromLong(1970); if (unlikely(!__pyx_int_1970)) __PYX_ERR(9, 1, __pyx_L1_error)
  __pyx_int_65536 = PyInt_FromLong(65536L); if (unlikely(!__pyx_int_65536)) __PYX_ERR(9, 1, __pyx_L1_error)
  __pyx_int_1000000 = PyInt_FromLong(1000000L); if (unlikely(!__pyx_int_1000000)) __PYX_ERR(9, 1, __pyx_L1_error)
  __pyx_int_66417547 = PyInt_FromLong(66417547L); if (unlikely(!__pyx_int_66417547)) __PYX_ERR(9, 1, __pyx_L1_error)
  __pyx_int_93969614 = PyInt_FromLong(93969614L); if (unlikely(!__pyx_int_93969614)) __PYX_ERR(9, 1, __pyx_L1_error)
  __pyx_int_162458991 = PyInt_FromLong(162458991L); if (unlikely(!__pyx_int_162458991)) __PYX_ERR(9, 1, __pyx_L1_error)
  __pyx_int_222419149 = PyInt_FromLong(222419149L); if (unlikely(!__pyx_int_222419149)) __PYX_ERR(9, 1, __pyx_L1_error)
  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(9, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/

static int __Pyx_modinit_global_init_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  /*--- Global init code ---*/
  __pyx_v_7pyarrow_3lib_pandas_api = ((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)Py_None); Py_INCREF(Py_None);
  __pyx_v_7pyarrow_3lib__default_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None); Py_INCREF(Py_None);
  __pyx_v_7pyarrow_3lib__logging_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *)Py_None); Py_INCREF(Py_None);
  __pyx_v_7pyarrow_3lib__pandas_type_map = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_7pyarrow_3lib__pep3118_type_map = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_7pyarrow_3lib__type_cache = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_7pyarrow_3lib_PRIMITIVE_TYPES = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_7pyarrow_3lib__timestamp_type_cache = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_7pyarrow_3lib__time_type_cache = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_7pyarrow_3lib__duration_type_cache = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_7pyarrow_3lib__type_aliases = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_7pyarrow_3lib__DATETIME_CONVERSION_FUNCTIONS = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_7pyarrow_3lib__TIMEDELTA_CONVERSION_FUNCTIONS = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_7pyarrow_3lib__array_value_classes = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_7pyarrow_3lib__scalar_classes = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_7pyarrow_3lib__global_ctx = ((struct __pyx_obj_7pyarrow_3lib__FunctionContext *)Py_None); Py_INCREF(Py_None);
  __pyx_v_7pyarrow_3lib__array_classes = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  /*--- Variable export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  /*--- Function export code ---*/
  if (__Pyx_ExportFunction("_context", (void (*)(void))__pyx_f_7pyarrow_3lib__context, " arrow::compute::FunctionContext *(void)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("check_status", (void (*)(void))__pyx_f_7pyarrow_3lib_check_status, "int (arrow::Status const &)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("maybe_unbox_memory_pool", (void (*)(void))__pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool, " arrow::MemoryPool *(struct __pyx_obj_7pyarrow_3lib_MemoryPool *)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("wrap_array_output", (void (*)(void))__pyx_f_7pyarrow_3lib_wrap_array_output, "PyObject *(PyObject *)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("wrap_datum", (void (*)(void))__pyx_f_7pyarrow_3lib_wrap_datum, "PyObject *( arrow::compute::Datum const &)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("box_scalar", (void (*)(void))__pyx_f_7pyarrow_3lib_box_scalar, "PyObject *(struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::Array>  const &, int64_t)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_get_compression_type", (void (*)(void))__pyx_f_7pyarrow_3lib__get_compression_type, "enum  arrow::Compression::type (PyObject *)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("get_input_stream", (void (*)(void))__pyx_f_7pyarrow_3lib_get_input_stream, "PyObject *(PyObject *, bool, std::shared_ptr< arrow::io::InputStream>  *)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("get_reader", (void (*)(void))__pyx_f_7pyarrow_3lib_get_reader, "PyObject *(PyObject *, bool, std::shared_ptr< arrow::io::RandomAccessFile>  *)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("get_writer", (void (*)(void))__pyx_f_7pyarrow_3lib_get_writer, "PyObject *(PyObject *, std::shared_ptr< arrow::io::OutputStream>  *)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("ensure_type", (void (*)(void))__pyx_f_7pyarrow_3lib_ensure_type, "struct __pyx_obj_7pyarrow_3lib_DataType *(PyObject *, struct __pyx_opt_args_7pyarrow_3lib_ensure_type *__pyx_optional_args)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_unwrap_metadata", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_unwrap_metadata, "std::shared_ptr< arrow::KeyValueMetadata>  (PyObject *)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_wrap_metadata", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_wrap_metadata, "PyObject *(std::shared_ptr< arrow::KeyValueMetadata const >  const &)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_wrap_scalar", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_wrap_scalar, "PyObject *(std::shared_ptr< arrow::Scalar>  const &)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_wrap_array", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_wrap_array, "PyObject *(std::shared_ptr< arrow::Array>  const &)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_wrap_chunked_array", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_wrap_chunked_array, "PyObject *(std::shared_ptr< arrow::ChunkedArray>  const &)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_wrap_batch", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_wrap_batch, "PyObject *(std::shared_ptr< arrow::RecordBatch>  const &)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_wrap_buffer", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer, "PyObject *(std::shared_ptr< arrow::Buffer>  const &)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_wrap_data_type", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type, "PyObject *(std::shared_ptr< arrow::DataType>  const &)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_wrap_field", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_wrap_field, "PyObject *(std::shared_ptr< arrow::Field>  const &)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_wrap_resizable_buffer", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_wrap_resizable_buffer, "PyObject *(std::shared_ptr< arrow::ResizableBuffer>  const &)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_wrap_schema", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_wrap_schema, "PyObject *(std::shared_ptr< arrow::Schema>  const &)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_wrap_table", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_wrap_table, "PyObject *(std::shared_ptr< arrow::Table>  const &)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_wrap_tensor", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_wrap_tensor, "PyObject *(std::shared_ptr< arrow::Tensor>  const &)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_wrap_sparse_coo_tensor", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_wrap_sparse_coo_tensor, "PyObject *(std::shared_ptr< arrow::SparseCOOTensor>  const &)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_wrap_sparse_csr_matrix", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_wrap_sparse_csr_matrix, "PyObject *(std::shared_ptr< arrow::SparseCSRMatrix>  const &)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_unwrap_scalar", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_unwrap_scalar, "std::shared_ptr< arrow::Scalar>  (PyObject *)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_unwrap_array", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_unwrap_array, "std::shared_ptr< arrow::Array>  (PyObject *)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_unwrap_batch", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_unwrap_batch, "std::shared_ptr< arrow::RecordBatch>  (PyObject *)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_unwrap_buffer", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_unwrap_buffer, "std::shared_ptr< arrow::Buffer>  (PyObject *)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_unwrap_data_type", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_unwrap_data_type, "std::shared_ptr< arrow::DataType>  (PyObject *)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_unwrap_field", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_unwrap_field, "std::shared_ptr< arrow::Field>  (PyObject *)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_unwrap_schema", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_unwrap_schema, "std::shared_ptr< arrow::Schema>  (PyObject *)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_unwrap_table", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_unwrap_table, "std::shared_ptr< arrow::Table>  (PyObject *)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_unwrap_tensor", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_unwrap_tensor, "std::shared_ptr< arrow::Tensor>  (PyObject *)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_unwrap_sparse_coo_tensor", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_unwrap_sparse_coo_tensor, "std::shared_ptr< arrow::SparseCOOTensor>  (PyObject *)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_unwrap_sparse_csr_matrix", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_unwrap_sparse_csr_matrix, "std::shared_ptr< arrow::SparseCSRMatrix>  (PyObject *)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_internal_check_status", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_internal_check_status, "int (arrow::Status const &)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_is_buffer", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_is_buffer, "int (PyObject *)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_is_data_type", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_is_data_type, "int (PyObject *)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_is_field", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_is_field, "int (PyObject *)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_is_schema", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_is_schema, "int (PyObject *)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_is_array", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_is_array, "int (PyObject *)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_is_scalar", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_is_scalar, "int (PyObject *)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_is_tensor", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_is_tensor, "int (PyObject *)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_is_sparse_coo_tensor", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_is_sparse_coo_tensor, "int (PyObject *)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_is_sparse_csr_matrix", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_is_sparse_csr_matrix, "int (PyObject *)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_is_table", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_is_table, "int (PyObject *)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_is_batch", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_is_batch, "int (PyObject *)") < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_init_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  /*--- Type init code ---*/
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Message) < 0) __PYX_ERR(8, 21, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Message.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Message.tp_dictoffset && __pyx_type_7pyarrow_3lib_Message.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Message.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Message, (PyObject *)&__pyx_type_7pyarrow_3lib_Message) < 0) __PYX_ERR(8, 21, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Message) < 0) __PYX_ERR(8, 21, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Message = &__pyx_type_7pyarrow_3lib_Message;
  __pyx_vtabptr_7pyarrow_3lib_MemoryPool = &__pyx_vtable_7pyarrow_3lib_MemoryPool;
  __pyx_vtable_7pyarrow_3lib_MemoryPool.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_MemoryPool *,  arrow::MemoryPool *))__pyx_f_7pyarrow_3lib_10MemoryPool_init;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_MemoryPool) < 0) __PYX_ERR(11, 23, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_MemoryPool.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_MemoryPool.tp_dictoffset && __pyx_type_7pyarrow_3lib_MemoryPool.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_MemoryPool.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_MemoryPool.tp_dict, __pyx_vtabptr_7pyarrow_3lib_MemoryPool) < 0) __PYX_ERR(11, 23, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MemoryPool, (PyObject *)&__pyx_type_7pyarrow_3lib_MemoryPool) < 0) __PYX_ERR(11, 23, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_MemoryPool) < 0) __PYX_ERR(11, 23, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_MemoryPool = &__pyx_type_7pyarrow_3lib_MemoryPool;
  __pyx_vtabptr_7pyarrow_3lib_DataType = &__pyx_vtable_7pyarrow_3lib_DataType;
  __pyx_vtable_7pyarrow_3lib_DataType.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::DataType>  const &))__pyx_f_7pyarrow_3lib_8DataType_init;
  __pyx_vtable_7pyarrow_3lib_DataType.child = (struct __pyx_obj_7pyarrow_3lib_Field *(*)(struct __pyx_obj_7pyarrow_3lib_DataType *, int))__pyx_f_7pyarrow_3lib_8DataType_child;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_DataType) < 0) __PYX_ERR(4, 96, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_DataType.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_DataType.tp_dictoffset && __pyx_type_7pyarrow_3lib_DataType.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_DataType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_DataType.tp_dict, __pyx_vtabptr_7pyarrow_3lib_DataType) < 0) __PYX_ERR(4, 96, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DataType, (PyObject *)&__pyx_type_7pyarrow_3lib_DataType) < 0) __PYX_ERR(4, 96, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_DataType.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_DataType.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_DataType, __weakref__);
  __pyx_ptype_7pyarrow_3lib_DataType = &__pyx_type_7pyarrow_3lib_DataType;
  __pyx_vtabptr_7pyarrow_3lib_ListType = &__pyx_vtable_7pyarrow_3lib_ListType;
  __pyx_vtable_7pyarrow_3lib_ListType.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_DataType;
  __pyx_vtable_7pyarrow_3lib_ListType.__pyx_base.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::DataType>  const &))__pyx_f_7pyarrow_3lib_8ListType_init;
  __pyx_type_7pyarrow_3lib_ListType.tp_base = __pyx_ptype_7pyarrow_3lib_DataType;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_ListType) < 0) __PYX_ERR(4, 244, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_ListType.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_ListType.tp_dictoffset && __pyx_type_7pyarrow_3lib_ListType.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_ListType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_ListType.tp_dict, __pyx_vtabptr_7pyarrow_3lib_ListType) < 0) __PYX_ERR(4, 244, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ListType, (PyObject *)&__pyx_type_7pyarrow_3lib_ListType) < 0) __PYX_ERR(4, 244, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_ListType.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_ListType.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_ListType, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_ListType = &__pyx_type_7pyarrow_3lib_ListType;
  __pyx_vtabptr_7pyarrow_3lib_LargeListType = &__pyx_vtable_7pyarrow_3lib_LargeListType;
  __pyx_vtable_7pyarrow_3lib_LargeListType.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_DataType;
  __pyx_vtable_7pyarrow_3lib_LargeListType.__pyx_base.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::DataType>  const &))__pyx_f_7pyarrow_3lib_13LargeListType_init;
  __pyx_type_7pyarrow_3lib_LargeListType.tp_base = __pyx_ptype_7pyarrow_3lib_DataType;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_LargeListType) < 0) __PYX_ERR(4, 264, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_LargeListType.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_LargeListType.tp_dictoffset && __pyx_type_7pyarrow_3lib_LargeListType.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_LargeListType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_LargeListType.tp_dict, __pyx_vtabptr_7pyarrow_3lib_LargeListType) < 0) __PYX_ERR(4, 264, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_LargeListType, (PyObject *)&__pyx_type_7pyarrow_3lib_LargeListType) < 0) __PYX_ERR(4, 264, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_LargeListType.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_LargeListType.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_LargeListType, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_LargeListType = &__pyx_type_7pyarrow_3lib_LargeListType;
  __pyx_vtabptr_7pyarrow_3lib_MapType = &__pyx_vtable_7pyarrow_3lib_MapType;
  __pyx_vtable_7pyarrow_3lib_MapType.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_DataType;
  __pyx_vtable_7pyarrow_3lib_MapType.__pyx_base.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::DataType>  const &))__pyx_f_7pyarrow_3lib_7MapType_init;
  __pyx_type_7pyarrow_3lib_MapType.tp_base = __pyx_ptype_7pyarrow_3lib_DataType;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_MapType) < 0) __PYX_ERR(4, 285, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_MapType.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_MapType.tp_dictoffset && __pyx_type_7pyarrow_3lib_MapType.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_MapType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_MapType.tp_dict, __pyx_vtabptr_7pyarrow_3lib_MapType) < 0) __PYX_ERR(4, 285, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MapType, (PyObject *)&__pyx_type_7pyarrow_3lib_MapType) < 0) __PYX_ERR(4, 285, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_MapType.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_MapType.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_MapType, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_MapType = &__pyx_type_7pyarrow_3lib_MapType;
  __pyx_vtabptr_7pyarrow_3lib_FixedSizeListType = &__pyx_vtable_7pyarrow_3lib_FixedSizeListType;
  __pyx_vtable_7pyarrow_3lib_FixedSizeListType.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_DataType;
  __pyx_vtable_7pyarrow_3lib_FixedSizeListType.__pyx_base.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::DataType>  const &))__pyx_f_7pyarrow_3lib_17FixedSizeListType_init;
  __pyx_type_7pyarrow_3lib_FixedSizeListType.tp_base = __pyx_ptype_7pyarrow_3lib_DataType;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_FixedSizeListType) < 0) __PYX_ERR(4, 312, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_FixedSizeListType.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_FixedSizeListType.tp_dictoffset && __pyx_type_7pyarrow_3lib_FixedSizeListType.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_FixedSizeListType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_FixedSizeListType.tp_dict, __pyx_vtabptr_7pyarrow_3lib_FixedSizeListType) < 0) __PYX_ERR(4, 312, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FixedSizeListType, (PyObject *)&__pyx_type_7pyarrow_3lib_FixedSizeListType) < 0) __PYX_ERR(4, 312, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_FixedSizeListType.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_FixedSizeListType.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_FixedSizeListType, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_FixedSizeListType = &__pyx_type_7pyarrow_3lib_FixedSizeListType;
  __pyx_vtabptr_7pyarrow_3lib_StructType = &__pyx_vtable_7pyarrow_3lib_StructType;
  __pyx_vtable_7pyarrow_3lib_StructType.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_DataType;
  __pyx_vtable_7pyarrow_3lib_StructType.__pyx_base.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::DataType>  const &))__pyx_f_7pyarrow_3lib_10StructType_init;
  __pyx_vtable_7pyarrow_3lib_StructType.field = (struct __pyx_obj_7pyarrow_3lib_Field *(*)(struct __pyx_obj_7pyarrow_3lib_StructType *, int))__pyx_f_7pyarrow_3lib_10StructType_field;
  __pyx_vtable_7pyarrow_3lib_StructType.field_by_name = (struct __pyx_obj_7pyarrow_3lib_Field *(*)(struct __pyx_obj_7pyarrow_3lib_StructType *, PyObject *))__pyx_f_7pyarrow_3lib_10StructType_field_by_name;
  __pyx_type_7pyarrow_3lib_StructType.tp_base = __pyx_ptype_7pyarrow_3lib_DataType;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_StructType) < 0) __PYX_ERR(4, 339, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_StructType.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_StructType.tp_dictoffset && __pyx_type_7pyarrow_3lib_StructType.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_StructType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_StructType, "__len__"); if (unlikely(!wrapper)) __PYX_ERR(4, 339, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_10StructType___len__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_10StructType___len__.doc = __pyx_doc_7pyarrow_3lib_10StructType___len__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_10StructType___len__;
    }
  }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_StructType, "__iter__"); if (unlikely(!wrapper)) __PYX_ERR(4, 339, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_10StructType_2__iter__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_10StructType_2__iter__.doc = __pyx_doc_7pyarrow_3lib_10StructType_2__iter__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_10StructType_2__iter__;
    }
  }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_StructType, "__getitem__"); if (unlikely(!wrapper)) __PYX_ERR(4, 339, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_10StructType_5__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_10StructType_5__getitem__.doc = __pyx_doc_7pyarrow_3lib_10StructType_5__getitem__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_10StructType_5__getitem__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_StructType.tp_dict, __pyx_vtabptr_7pyarrow_3lib_StructType) < 0) __PYX_ERR(4, 339, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_StructType, (PyObject *)&__pyx_type_7pyarrow_3lib_StructType) < 0) __PYX_ERR(4, 339, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_StructType.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_StructType.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_StructType, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_StructType = &__pyx_type_7pyarrow_3lib_StructType;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_DictionaryMemo) < 0) __PYX_ERR(4, 199, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_DictionaryMemo.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_DictionaryMemo.tp_dictoffset && __pyx_type_7pyarrow_3lib_DictionaryMemo.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_DictionaryMemo.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DictionaryMemo, (PyObject *)&__pyx_type_7pyarrow_3lib_DictionaryMemo) < 0) __PYX_ERR(4, 199, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_DictionaryMemo) < 0) __PYX_ERR(4, 199, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_DictionaryMemo = &__pyx_type_7pyarrow_3lib_DictionaryMemo;
  __pyx_vtabptr_7pyarrow_3lib_DictionaryType = &__pyx_vtable_7pyarrow_3lib_DictionaryType;
  __pyx_vtable_7pyarrow_3lib_DictionaryType.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_DataType;
  __pyx_vtable_7pyarrow_3lib_DictionaryType.__pyx_base.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::DataType>  const &))__pyx_f_7pyarrow_3lib_14DictionaryType_init;
  __pyx_type_7pyarrow_3lib_DictionaryType.tp_base = __pyx_ptype_7pyarrow_3lib_DataType;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_DictionaryType) < 0) __PYX_ERR(4, 208, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_DictionaryType.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_DictionaryType.tp_dictoffset && __pyx_type_7pyarrow_3lib_DictionaryType.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_DictionaryType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_DictionaryType.tp_dict, __pyx_vtabptr_7pyarrow_3lib_DictionaryType) < 0) __PYX_ERR(4, 208, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DictionaryType, (PyObject *)&__pyx_type_7pyarrow_3lib_DictionaryType) < 0) __PYX_ERR(4, 208, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_DictionaryType.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_DictionaryType.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_DictionaryType, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_DictionaryType = &__pyx_type_7pyarrow_3lib_DictionaryType;
  __pyx_vtabptr_7pyarrow_3lib_TimestampType = &__pyx_vtable_7pyarrow_3lib_TimestampType;
  __pyx_vtable_7pyarrow_3lib_TimestampType.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_DataType;
  __pyx_vtable_7pyarrow_3lib_TimestampType.__pyx_base.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::DataType>  const &))__pyx_f_7pyarrow_3lib_13TimestampType_init;
  __pyx_type_7pyarrow_3lib_TimestampType.tp_base = __pyx_ptype_7pyarrow_3lib_DataType;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_TimestampType) < 0) __PYX_ERR(4, 450, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_TimestampType.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_TimestampType.tp_dictoffset && __pyx_type_7pyarrow_3lib_TimestampType.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_TimestampType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_TimestampType.tp_dict, __pyx_vtabptr_7pyarrow_3lib_TimestampType) < 0) __PYX_ERR(4, 450, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TimestampType, (PyObject *)&__pyx_type_7pyarrow_3lib_TimestampType) < 0) __PYX_ERR(4, 450, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_TimestampType.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_TimestampType.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_TimestampType, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_TimestampType = &__pyx_type_7pyarrow_3lib_TimestampType;
  __pyx_vtabptr_7pyarrow_3lib_Time32Type = &__pyx_vtable_7pyarrow_3lib_Time32Type;
  __pyx_vtable_7pyarrow_3lib_Time32Type.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_DataType;
  __pyx_vtable_7pyarrow_3lib_Time32Type.__pyx_base.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::DataType>  const &))__pyx_f_7pyarrow_3lib_10Time32Type_init;
  __pyx_type_7pyarrow_3lib_Time32Type.tp_base = __pyx_ptype_7pyarrow_3lib_DataType;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Time32Type) < 0) __PYX_ERR(4, 491, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Time32Type.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Time32Type.tp_dictoffset && __pyx_type_7pyarrow_3lib_Time32Type.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Time32Type.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Time32Type.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Time32Type) < 0) __PYX_ERR(4, 491, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Time32Type, (PyObject *)&__pyx_type_7pyarrow_3lib_Time32Type) < 0) __PYX_ERR(4, 491, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_Time32Type.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_Time32Type.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_Time32Type, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_Time32Type = &__pyx_type_7pyarrow_3lib_Time32Type;
  __pyx_vtabptr_7pyarrow_3lib_Time64Type = &__pyx_vtable_7pyarrow_3lib_Time64Type;
  __pyx_vtable_7pyarrow_3lib_Time64Type.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_DataType;
  __pyx_vtable_7pyarrow_3lib_Time64Type.__pyx_base.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::DataType>  const &))__pyx_f_7pyarrow_3lib_10Time64Type_init;
  __pyx_type_7pyarrow_3lib_Time64Type.tp_base = __pyx_ptype_7pyarrow_3lib_DataType;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Time64Type) < 0) __PYX_ERR(4, 508, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Time64Type.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Time64Type.tp_dictoffset && __pyx_type_7pyarrow_3lib_Time64Type.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Time64Type.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Time64Type.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Time64Type) < 0) __PYX_ERR(4, 508, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Time64Type, (PyObject *)&__pyx_type_7pyarrow_3lib_Time64Type) < 0) __PYX_ERR(4, 508, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_Time64Type.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_Time64Type.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_Time64Type, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_Time64Type = &__pyx_type_7pyarrow_3lib_Time64Type;
  __pyx_vtabptr_7pyarrow_3lib_DurationType = &__pyx_vtable_7pyarrow_3lib_DurationType;
  __pyx_vtable_7pyarrow_3lib_DurationType.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_DataType;
  __pyx_vtable_7pyarrow_3lib_DurationType.__pyx_base.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::DataType>  const &))__pyx_f_7pyarrow_3lib_12DurationType_init;
  __pyx_type_7pyarrow_3lib_DurationType.tp_base = __pyx_ptype_7pyarrow_3lib_DataType;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_DurationType) < 0) __PYX_ERR(4, 525, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_DurationType.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_DurationType.tp_dictoffset && __pyx_type_7pyarrow_3lib_DurationType.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_DurationType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_DurationType.tp_dict, __pyx_vtabptr_7pyarrow_3lib_DurationType) < 0) __PYX_ERR(4, 525, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DurationType, (PyObject *)&__pyx_type_7pyarrow_3lib_DurationType) < 0) __PYX_ERR(4, 525, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_DurationType.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_DurationType.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_DurationType, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_DurationType = &__pyx_type_7pyarrow_3lib_DurationType;
  __pyx_vtabptr_7pyarrow_3lib_FixedSizeBinaryType = &__pyx_vtable_7pyarrow_3lib_FixedSizeBinaryType;
  __pyx_vtable_7pyarrow_3lib_FixedSizeBinaryType.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_DataType;
  __pyx_vtable_7pyarrow_3lib_FixedSizeBinaryType.__pyx_base.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::DataType>  const &))__pyx_f_7pyarrow_3lib_19FixedSizeBinaryType_init;
  __pyx_type_7pyarrow_3lib_FixedSizeBinaryType.tp_base = __pyx_ptype_7pyarrow_3lib_DataType;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_FixedSizeBinaryType) < 0) __PYX_ERR(4, 542, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_FixedSizeBinaryType.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_FixedSizeBinaryType.tp_dictoffset && __pyx_type_7pyarrow_3lib_FixedSizeBinaryType.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_FixedSizeBinaryType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_FixedSizeBinaryType.tp_dict, __pyx_vtabptr_7pyarrow_3lib_FixedSizeBinaryType) < 0) __PYX_ERR(4, 542, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FixedSizeBinaryType, (PyObject *)&__pyx_type_7pyarrow_3lib_FixedSizeBinaryType) < 0) __PYX_ERR(4, 542, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_FixedSizeBinaryType.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_FixedSizeBinaryType.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_FixedSizeBinaryType = &__pyx_type_7pyarrow_3lib_FixedSizeBinaryType;
  __pyx_vtabptr_7pyarrow_3lib_Decimal128Type = &__pyx_vtable_7pyarrow_3lib_Decimal128Type;
  __pyx_vtable_7pyarrow_3lib_Decimal128Type.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_FixedSizeBinaryType;
  __pyx_vtable_7pyarrow_3lib_Decimal128Type.__pyx_base.__pyx_base.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::DataType>  const &))__pyx_f_7pyarrow_3lib_14Decimal128Type_init;
  __pyx_type_7pyarrow_3lib_Decimal128Type.tp_base = __pyx_ptype_7pyarrow_3lib_FixedSizeBinaryType;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Decimal128Type) < 0) __PYX_ERR(4, 563, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Decimal128Type.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Decimal128Type.tp_dictoffset && __pyx_type_7pyarrow_3lib_Decimal128Type.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Decimal128Type.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Decimal128Type.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Decimal128Type) < 0) __PYX_ERR(4, 563, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Decimal128Type, (PyObject *)&__pyx_type_7pyarrow_3lib_Decimal128Type) < 0) __PYX_ERR(4, 563, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_Decimal128Type.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_Decimal128Type.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_Decimal128Type, __pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_Decimal128Type = &__pyx_type_7pyarrow_3lib_Decimal128Type;
  __pyx_vtabptr_7pyarrow_3lib_BaseExtensionType = &__pyx_vtable_7pyarrow_3lib_BaseExtensionType;
  __pyx_vtable_7pyarrow_3lib_BaseExtensionType.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_DataType;
  __pyx_vtable_7pyarrow_3lib_BaseExtensionType.__pyx_base.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::DataType>  const &))__pyx_f_7pyarrow_3lib_17BaseExtensionType_init;
  __pyx_type_7pyarrow_3lib_BaseExtensionType.tp_base = __pyx_ptype_7pyarrow_3lib_DataType;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_BaseExtensionType) < 0) __PYX_ERR(4, 590, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_BaseExtensionType.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_BaseExtensionType.tp_dictoffset && __pyx_type_7pyarrow_3lib_BaseExtensionType.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_BaseExtensionType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_BaseExtensionType.tp_dict, __pyx_vtabptr_7pyarrow_3lib_BaseExtensionType) < 0) __PYX_ERR(4, 590, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BaseExtensionType, (PyObject *)&__pyx_type_7pyarrow_3lib_BaseExtensionType) < 0) __PYX_ERR(4, 590, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_BaseExtensionType.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_BaseExtensionType.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_BaseExtensionType, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_BaseExtensionType = &__pyx_type_7pyarrow_3lib_BaseExtensionType;
  __pyx_vtabptr_7pyarrow_3lib_ExtensionType = &__pyx_vtable_7pyarrow_3lib_ExtensionType;
  __pyx_vtable_7pyarrow_3lib_ExtensionType.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_BaseExtensionType;
  __pyx_vtable_7pyarrow_3lib_ExtensionType.__pyx_base.__pyx_base.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::DataType>  const &))__pyx_f_7pyarrow_3lib_13ExtensionType_init;
  __pyx_type_7pyarrow_3lib_ExtensionType.tp_base = __pyx_ptype_7pyarrow_3lib_BaseExtensionType;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_ExtensionType) < 0) __PYX_ERR(4, 614, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_ExtensionType.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_ExtensionType.tp_dictoffset && __pyx_type_7pyarrow_3lib_ExtensionType.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_ExtensionType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_ExtensionType, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(4, 614, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_13ExtensionType_2__init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_13ExtensionType_2__init__.doc = __pyx_doc_7pyarrow_3lib_13ExtensionType_2__init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_13ExtensionType_2__init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_ExtensionType.tp_dict, __pyx_vtabptr_7pyarrow_3lib_ExtensionType) < 0) __PYX_ERR(4, 614, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ExtensionType, (PyObject *)&__pyx_type_7pyarrow_3lib_ExtensionType) < 0) __PYX_ERR(4, 614, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_ExtensionType.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_ExtensionType.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_ExtensionType, __pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_ExtensionType = &__pyx_type_7pyarrow_3lib_ExtensionType;
  __pyx_vtabptr_7pyarrow_3lib_PyExtensionType = &__pyx_vtable_7pyarrow_3lib_PyExtensionType;
  __pyx_vtable_7pyarrow_3lib_PyExtensionType.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ExtensionType;
  __pyx_type_7pyarrow_3lib_PyExtensionType.tp_base = __pyx_ptype_7pyarrow_3lib_ExtensionType;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_PyExtensionType) < 0) __PYX_ERR(4, 689, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_PyExtensionType.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_PyExtensionType.tp_dictoffset && __pyx_type_7pyarrow_3lib_PyExtensionType.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_PyExtensionType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_PyExtensionType.tp_dict, __pyx_vtabptr_7pyarrow_3lib_PyExtensionType) < 0) __PYX_ERR(4, 689, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_PyExtensionType, (PyObject *)&__pyx_type_7pyarrow_3lib_PyExtensionType) < 0) __PYX_ERR(4, 689, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_PyExtensionType.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_PyExtensionType.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_PyExtensionType, __pyx_base.__pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_PyExtensionType = &__pyx_type_7pyarrow_3lib_PyExtensionType;
  __pyx_vtabptr_7pyarrow_3lib_Field = &__pyx_vtable_7pyarrow_3lib_Field;
  __pyx_vtable_7pyarrow_3lib_Field.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_Field *, std::shared_ptr< arrow::Field>  const &))__pyx_f_7pyarrow_3lib_5Field_init;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Field) < 0) __PYX_ERR(4, 792, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Field.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Field.tp_dictoffset && __pyx_type_7pyarrow_3lib_Field.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Field.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Field.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Field) < 0) __PYX_ERR(4, 792, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Field, (PyObject *)&__pyx_type_7pyarrow_3lib_Field) < 0) __PYX_ERR(4, 792, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Field = &__pyx_type_7pyarrow_3lib_Field;
  __pyx_vtabptr_7pyarrow_3lib_Schema = &__pyx_vtable_7pyarrow_3lib_Schema;
  __pyx_vtable_7pyarrow_3lib_Schema.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_Schema *, std::vector<std::shared_ptr< arrow::Field> >  const &))__pyx_f_7pyarrow_3lib_6Schema_init;
  __pyx_vtable_7pyarrow_3lib_Schema.init_schema = (void (*)(struct __pyx_obj_7pyarrow_3lib_Schema *, std::shared_ptr< arrow::Schema>  const &))__pyx_f_7pyarrow_3lib_6Schema_init_schema;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Schema) < 0) __PYX_ERR(4, 915, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Schema.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Schema.tp_dictoffset && __pyx_type_7pyarrow_3lib_Schema.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Schema.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Schema.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Schema) < 0) __PYX_ERR(4, 915, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Schema, (PyObject *)&__pyx_type_7pyarrow_3lib_Schema) < 0) __PYX_ERR(4, 915, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Schema = &__pyx_type_7pyarrow_3lib_Schema;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Scalar) < 0) __PYX_ERR(5, 22, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Scalar.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Scalar.tp_dictoffset && __pyx_type_7pyarrow_3lib_Scalar.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Scalar.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Scalar, (PyObject *)&__pyx_type_7pyarrow_3lib_Scalar) < 0) __PYX_ERR(5, 22, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Scalar) < 0) __PYX_ERR(5, 22, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Scalar = &__pyx_type_7pyarrow_3lib_Scalar;
  __pyx_type_7pyarrow_3lib_NAType.tp_base = __pyx_ptype_7pyarrow_3lib_Scalar;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_NAType) < 0) __PYX_ERR(20, 172, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_NAType.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_NAType.tp_dictoffset && __pyx_type_7pyarrow_3lib_NAType.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_NAType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_NAType, (PyObject *)&__pyx_type_7pyarrow_3lib_NAType) < 0) __PYX_ERR(20, 172, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_NAType = &__pyx_type_7pyarrow_3lib_NAType;
  __pyx_vtabptr_7pyarrow_3lib_ArrayValue = &__pyx_vtable_7pyarrow_3lib_ArrayValue;
  __pyx_vtable_7pyarrow_3lib_ArrayValue.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_ArrayValue *, struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::Array>  const &, int64_t))__pyx_f_7pyarrow_3lib_10ArrayValue_init;
  __pyx_vtable_7pyarrow_3lib_ArrayValue._set_array = (void (*)(struct __pyx_obj_7pyarrow_3lib_ArrayValue *, std::shared_ptr< arrow::Array>  const &))__pyx_f_7pyarrow_3lib_10ArrayValue__set_array;
  __pyx_type_7pyarrow_3lib_ArrayValue.tp_base = __pyx_ptype_7pyarrow_3lib_Scalar;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_ArrayValue) < 0) __PYX_ERR(5, 56, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_ArrayValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_ArrayValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_ArrayValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_ArrayValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_ArrayValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_ArrayValue) < 0) __PYX_ERR(5, 56, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ArrayValue, (PyObject *)&__pyx_type_7pyarrow_3lib_ArrayValue) < 0) __PYX_ERR(5, 56, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_ArrayValue) < 0) __PYX_ERR(5, 56, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_ArrayValue = &__pyx_type_7pyarrow_3lib_ArrayValue;
  __pyx_vtabptr_7pyarrow_3lib_ScalarValue = &__pyx_vtable_7pyarrow_3lib_ScalarValue;
  __pyx_vtable_7pyarrow_3lib_ScalarValue.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_ScalarValue *, std::shared_ptr< arrow::Scalar>  const &))__pyx_f_7pyarrow_3lib_11ScalarValue_init;
  __pyx_type_7pyarrow_3lib_ScalarValue.tp_base = __pyx_ptype_7pyarrow_3lib_Scalar;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_ScalarValue) < 0) __PYX_ERR(5, 998, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_ScalarValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_ScalarValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_ScalarValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_ScalarValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_ScalarValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_ScalarValue) < 0) __PYX_ERR(5, 998, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ScalarValue, (PyObject *)&__pyx_type_7pyarrow_3lib_ScalarValue) < 0) __PYX_ERR(5, 998, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_ScalarValue) < 0) __PYX_ERR(5, 998, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_ScalarValue = &__pyx_type_7pyarrow_3lib_ScalarValue;
  __pyx_vtabptr_7pyarrow_3lib_Int8Value = &__pyx_vtable_7pyarrow_3lib_Int8Value;
  __pyx_vtable_7pyarrow_3lib_Int8Value.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_Int8Value.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Int8Value) < 0) __PYX_ERR(5, 113, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Int8Value.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Int8Value.tp_dictoffset && __pyx_type_7pyarrow_3lib_Int8Value.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Int8Value.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Int8Value.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Int8Value) < 0) __PYX_ERR(5, 113, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int8Value, (PyObject *)&__pyx_type_7pyarrow_3lib_Int8Value) < 0) __PYX_ERR(5, 113, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Int8Value) < 0) __PYX_ERR(5, 113, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Int8Value = &__pyx_type_7pyarrow_3lib_Int8Value;
  __pyx_vtabptr_7pyarrow_3lib_Int64Value = &__pyx_vtable_7pyarrow_3lib_Int64Value;
  __pyx_vtable_7pyarrow_3lib_Int64Value.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_Int64Value.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Int64Value) < 0) __PYX_ERR(5, 191, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Int64Value.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Int64Value.tp_dictoffset && __pyx_type_7pyarrow_3lib_Int64Value.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Int64Value.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Int64Value.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Int64Value) < 0) __PYX_ERR(5, 191, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int64Value, (PyObject *)&__pyx_type_7pyarrow_3lib_Int64Value) < 0) __PYX_ERR(5, 191, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Int64Value) < 0) __PYX_ERR(5, 191, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Int64Value = &__pyx_type_7pyarrow_3lib_Int64Value;
  __pyx_vtabptr_7pyarrow_3lib_ListValue = &__pyx_vtable_7pyarrow_3lib_ListValue;
  __pyx_vtable_7pyarrow_3lib_ListValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_vtable_7pyarrow_3lib_ListValue.__pyx_base._set_array = (void (*)(struct __pyx_obj_7pyarrow_3lib_ArrayValue *, std::shared_ptr< arrow::Array>  const &))__pyx_f_7pyarrow_3lib_9ListValue__set_array;
  __pyx_vtable_7pyarrow_3lib_ListValue.getitem = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib_ListValue *, int64_t))__pyx_f_7pyarrow_3lib_9ListValue_getitem;
  __pyx_vtable_7pyarrow_3lib_ListValue.length = (int64_t (*)(struct __pyx_obj_7pyarrow_3lib_ListValue *))__pyx_f_7pyarrow_3lib_9ListValue_length;
  __pyx_type_7pyarrow_3lib_ListValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_ListValue) < 0) __PYX_ERR(5, 632, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_ListValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_ListValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_ListValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_ListValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_ListValue, "__len__"); if (unlikely(!wrapper)) __PYX_ERR(5, 632, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_9ListValue___len__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_9ListValue___len__.doc = __pyx_doc_7pyarrow_3lib_9ListValue___len__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_9ListValue___len__;
    }
  }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_ListValue, "__getitem__"); if (unlikely(!wrapper)) __PYX_ERR(5, 632, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_9ListValue_2__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_9ListValue_2__getitem__.doc = __pyx_doc_7pyarrow_3lib_9ListValue_2__getitem__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_9ListValue_2__getitem__;
    }
  }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_ListValue, "__iter__"); if (unlikely(!wrapper)) __PYX_ERR(5, 632, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_9ListValue_4__iter__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_9ListValue_4__iter__.doc = __pyx_doc_7pyarrow_3lib_9ListValue_4__iter__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_9ListValue_4__iter__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_ListValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_ListValue) < 0) __PYX_ERR(5, 632, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ListValue, (PyObject *)&__pyx_type_7pyarrow_3lib_ListValue) < 0) __PYX_ERR(5, 632, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_ListValue) < 0) __PYX_ERR(5, 632, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_ListValue = &__pyx_type_7pyarrow_3lib_ListValue;
  __pyx_vtabptr_7pyarrow_3lib_LargeListValue = &__pyx_vtable_7pyarrow_3lib_LargeListValue;
  __pyx_vtable_7pyarrow_3lib_LargeListValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_vtable_7pyarrow_3lib_LargeListValue.__pyx_base._set_array = (void (*)(struct __pyx_obj_7pyarrow_3lib_ArrayValue *, std::shared_ptr< arrow::Array>  const &))__pyx_f_7pyarrow_3lib_14LargeListValue__set_array;
  __pyx_vtable_7pyarrow_3lib_LargeListValue.getitem = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib_LargeListValue *, int64_t))__pyx_f_7pyarrow_3lib_14LargeListValue_getitem;
  __pyx_vtable_7pyarrow_3lib_LargeListValue.length = (int64_t (*)(struct __pyx_obj_7pyarrow_3lib_LargeListValue *))__pyx_f_7pyarrow_3lib_14LargeListValue_length;
  __pyx_type_7pyarrow_3lib_LargeListValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_LargeListValue) < 0) __PYX_ERR(5, 683, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_LargeListValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_LargeListValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_LargeListValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_LargeListValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_LargeListValue, "__len__"); if (unlikely(!wrapper)) __PYX_ERR(5, 683, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_14LargeListValue___len__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_14LargeListValue___len__.doc = __pyx_doc_7pyarrow_3lib_14LargeListValue___len__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_14LargeListValue___len__;
    }
  }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_LargeListValue, "__getitem__"); if (unlikely(!wrapper)) __PYX_ERR(5, 683, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_14LargeListValue_2__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_14LargeListValue_2__getitem__.doc = __pyx_doc_7pyarrow_3lib_14LargeListValue_2__getitem__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_14LargeListValue_2__getitem__;
    }
  }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_LargeListValue, "__iter__"); if (unlikely(!wrapper)) __PYX_ERR(5, 683, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_14LargeListValue_4__iter__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_14LargeListValue_4__iter__.doc = __pyx_doc_7pyarrow_3lib_14LargeListValue_4__iter__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_14LargeListValue_4__iter__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_LargeListValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_LargeListValue) < 0) __PYX_ERR(5, 683, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_LargeListValue, (PyObject *)&__pyx_type_7pyarrow_3lib_LargeListValue) < 0) __PYX_ERR(5, 683, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_LargeListValue) < 0) __PYX_ERR(5, 683, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_LargeListValue = &__pyx_type_7pyarrow_3lib_LargeListValue;
  __pyx_vtabptr_7pyarrow_3lib_MapValue = &__pyx_vtable_7pyarrow_3lib_MapValue;
  __pyx_vtable_7pyarrow_3lib_MapValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_vtable_7pyarrow_3lib_MapValue.__pyx_base._set_array = (void (*)(struct __pyx_obj_7pyarrow_3lib_ArrayValue *, std::shared_ptr< arrow::Array>  const &))__pyx_f_7pyarrow_3lib_8MapValue__set_array;
  __pyx_vtable_7pyarrow_3lib_MapValue.getitem = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib_MapValue *, int64_t))__pyx_f_7pyarrow_3lib_8MapValue_getitem;
  __pyx_vtable_7pyarrow_3lib_MapValue.length = (int64_t (*)(struct __pyx_obj_7pyarrow_3lib_MapValue *))__pyx_f_7pyarrow_3lib_8MapValue_length;
  __pyx_type_7pyarrow_3lib_MapValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_MapValue) < 0) __PYX_ERR(5, 734, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_MapValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_MapValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_MapValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_MapValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_MapValue, "__len__"); if (unlikely(!wrapper)) __PYX_ERR(5, 734, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_8MapValue___len__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_8MapValue___len__.doc = __pyx_doc_7pyarrow_3lib_8MapValue___len__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_8MapValue___len__;
    }
  }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_MapValue, "__getitem__"); if (unlikely(!wrapper)) __PYX_ERR(5, 734, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_8MapValue_2__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_8MapValue_2__getitem__.doc = __pyx_doc_7pyarrow_3lib_8MapValue_2__getitem__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_8MapValue_2__getitem__;
    }
  }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_MapValue, "__iter__"); if (unlikely(!wrapper)) __PYX_ERR(5, 734, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_8MapValue_4__iter__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_8MapValue_4__iter__.doc = __pyx_doc_7pyarrow_3lib_8MapValue_4__iter__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_8MapValue_4__iter__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_MapValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_MapValue) < 0) __PYX_ERR(5, 734, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MapValue, (PyObject *)&__pyx_type_7pyarrow_3lib_MapValue) < 0) __PYX_ERR(5, 734, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_MapValue) < 0) __PYX_ERR(5, 734, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_MapValue = &__pyx_type_7pyarrow_3lib_MapValue;
  __pyx_vtabptr_7pyarrow_3lib_FixedSizeListValue = &__pyx_vtable_7pyarrow_3lib_FixedSizeListValue;
  __pyx_vtable_7pyarrow_3lib_FixedSizeListValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_vtable_7pyarrow_3lib_FixedSizeListValue.__pyx_base._set_array = (void (*)(struct __pyx_obj_7pyarrow_3lib_ArrayValue *, std::shared_ptr< arrow::Array>  const &))__pyx_f_7pyarrow_3lib_18FixedSizeListValue__set_array;
  __pyx_vtable_7pyarrow_3lib_FixedSizeListValue.getitem = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib_FixedSizeListValue *, int64_t))__pyx_f_7pyarrow_3lib_18FixedSizeListValue_getitem;
  __pyx_vtable_7pyarrow_3lib_FixedSizeListValue.length = (int64_t (*)(struct __pyx_obj_7pyarrow_3lib_FixedSizeListValue *))__pyx_f_7pyarrow_3lib_18FixedSizeListValue_length;
  __pyx_type_7pyarrow_3lib_FixedSizeListValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_FixedSizeListValue) < 0) __PYX_ERR(5, 789, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_FixedSizeListValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_FixedSizeListValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_FixedSizeListValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_FixedSizeListValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_FixedSizeListValue, "__len__"); if (unlikely(!wrapper)) __PYX_ERR(5, 789, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_18FixedSizeListValue___len__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_18FixedSizeListValue___len__.doc = __pyx_doc_7pyarrow_3lib_18FixedSizeListValue___len__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_18FixedSizeListValue___len__;
    }
  }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_FixedSizeListValue, "__getitem__"); if (unlikely(!wrapper)) __PYX_ERR(5, 789, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_18FixedSizeListValue_2__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_18FixedSizeListValue_2__getitem__.doc = __pyx_doc_7pyarrow_3lib_18FixedSizeListValue_2__getitem__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_18FixedSizeListValue_2__getitem__;
    }
  }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_FixedSizeListValue, "__iter__"); if (unlikely(!wrapper)) __PYX_ERR(5, 789, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_18FixedSizeListValue_4__iter__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_18FixedSizeListValue_4__iter__.doc = __pyx_doc_7pyarrow_3lib_18FixedSizeListValue_4__iter__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_18FixedSizeListValue_4__iter__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_FixedSizeListValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_FixedSizeListValue) < 0) __PYX_ERR(5, 789, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FixedSizeListValue, (PyObject *)&__pyx_type_7pyarrow_3lib_FixedSizeListValue) < 0) __PYX_ERR(5, 789, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_FixedSizeListValue) < 0) __PYX_ERR(5, 789, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_FixedSizeListValue = &__pyx_type_7pyarrow_3lib_FixedSizeListValue;
  __pyx_vtabptr_7pyarrow_3lib_StructValue = &__pyx_vtable_7pyarrow_3lib_StructValue;
  __pyx_vtable_7pyarrow_3lib_StructValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_vtable_7pyarrow_3lib_StructValue.__pyx_base._set_array = (void (*)(struct __pyx_obj_7pyarrow_3lib_ArrayValue *, std::shared_ptr< arrow::Array>  const &))__pyx_f_7pyarrow_3lib_11StructValue__set_array;
  __pyx_type_7pyarrow_3lib_StructValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_StructValue) < 0) __PYX_ERR(5, 888, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_StructValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_StructValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_StructValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_StructValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_StructValue, "__getitem__"); if (unlikely(!wrapper)) __PYX_ERR(5, 888, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_11StructValue___getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_11StructValue___getitem__.doc = __pyx_doc_7pyarrow_3lib_11StructValue___getitem__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_11StructValue___getitem__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_StructValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_StructValue) < 0) __PYX_ERR(5, 888, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_StructValue, (PyObject *)&__pyx_type_7pyarrow_3lib_StructValue) < 0) __PYX_ERR(5, 888, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_StructValue) < 0) __PYX_ERR(5, 888, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_StructValue = &__pyx_type_7pyarrow_3lib_StructValue;
  __pyx_vtabptr_7pyarrow_3lib_UnionValue = &__pyx_vtable_7pyarrow_3lib_UnionValue;
  __pyx_vtable_7pyarrow_3lib_UnionValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_vtable_7pyarrow_3lib_UnionValue.__pyx_base._set_array = (void (*)(struct __pyx_obj_7pyarrow_3lib_ArrayValue *, std::shared_ptr< arrow::Array>  const &))__pyx_f_7pyarrow_3lib_10UnionValue__set_array;
  __pyx_vtable_7pyarrow_3lib_UnionValue.getitem = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib_UnionValue *, int64_t))__pyx_f_7pyarrow_3lib_10UnionValue_getitem;
  __pyx_type_7pyarrow_3lib_UnionValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_UnionValue) < 0) __PYX_ERR(5, 840, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UnionValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UnionValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_UnionValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UnionValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UnionValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UnionValue) < 0) __PYX_ERR(5, 840, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UnionValue, (PyObject *)&__pyx_type_7pyarrow_3lib_UnionValue) < 0) __PYX_ERR(5, 840, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_UnionValue) < 0) __PYX_ERR(5, 840, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_UnionValue = &__pyx_type_7pyarrow_3lib_UnionValue;
  __pyx_vtabptr_7pyarrow_3lib_StringValue = &__pyx_vtable_7pyarrow_3lib_StringValue;
  __pyx_vtable_7pyarrow_3lib_StringValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_StringValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_StringValue) < 0) __PYX_ERR(5, 522, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_StringValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_StringValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_StringValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_StringValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_StringValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_StringValue) < 0) __PYX_ERR(5, 522, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_StringValue, (PyObject *)&__pyx_type_7pyarrow_3lib_StringValue) < 0) __PYX_ERR(5, 522, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_StringValue) < 0) __PYX_ERR(5, 522, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_StringValue = &__pyx_type_7pyarrow_3lib_StringValue;
  __pyx_vtabptr_7pyarrow_3lib_FixedSizeBinaryValue = &__pyx_vtable_7pyarrow_3lib_FixedSizeBinaryValue;
  __pyx_vtable_7pyarrow_3lib_FixedSizeBinaryValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_FixedSizeBinaryValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_FixedSizeBinaryValue) < 0) __PYX_ERR(5, 867, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_FixedSizeBinaryValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_FixedSizeBinaryValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_FixedSizeBinaryValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_FixedSizeBinaryValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_FixedSizeBinaryValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_FixedSizeBinaryValue) < 0) __PYX_ERR(5, 867, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FixedSizeBinaryValue, (PyObject *)&__pyx_type_7pyarrow_3lib_FixedSizeBinaryValue) < 0) __PYX_ERR(5, 867, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_FixedSizeBinaryValue) < 0) __PYX_ERR(5, 867, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_FixedSizeBinaryValue = &__pyx_type_7pyarrow_3lib_FixedSizeBinaryValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib__PandasConvertible) < 0) __PYX_ERR(1, 480, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib__PandasConvertible.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib__PandasConvertible.tp_dictoffset && __pyx_type_7pyarrow_3lib__PandasConvertible.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib__PandasConvertible.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_PandasConvertible, (PyObject *)&__pyx_type_7pyarrow_3lib__PandasConvertible) < 0) __PYX_ERR(1, 480, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib__PandasConvertible) < 0) __PYX_ERR(1, 480, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib__PandasConvertible = &__pyx_type_7pyarrow_3lib__PandasConvertible;
  __pyx_vtabptr_7pyarrow_3lib_Array = &__pyx_vtable_7pyarrow_3lib_Array;
  __pyx_vtable_7pyarrow_3lib_Array.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_Array *, std::shared_ptr< arrow::Array>  const &))__pyx_f_7pyarrow_3lib_5Array_init;
  __pyx_vtable_7pyarrow_3lib_Array.getitem = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib_Array *, int64_t))__pyx_f_7pyarrow_3lib_5Array_getitem;
  __pyx_vtable_7pyarrow_3lib_Array.length = (int64_t (*)(struct __pyx_obj_7pyarrow_3lib_Array *))__pyx_f_7pyarrow_3lib_5Array_length;
  __pyx_type_7pyarrow_3lib_Array.tp_base = __pyx_ptype_7pyarrow_3lib__PandasConvertible;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Array) < 0) __PYX_ERR(1, 578, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Array.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Array.tp_dictoffset && __pyx_type_7pyarrow_3lib_Array.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Array.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_Array, "__getitem__"); if (unlikely(!wrapper)) __PYX_ERR(1, 578, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_5Array_41__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_5Array_41__getitem__.doc = __pyx_doc_7pyarrow_3lib_5Array_41__getitem__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_5Array_41__getitem__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Array.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Array) < 0) __PYX_ERR(1, 578, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Array, (PyObject *)&__pyx_type_7pyarrow_3lib_Array) < 0) __PYX_ERR(1, 578, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_Array.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_Array.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_Array, __weakref__);
  __pyx_ptype_7pyarrow_3lib_Array = &__pyx_type_7pyarrow_3lib_Array;
  __pyx_vtabptr_7pyarrow_3lib_Tensor = &__pyx_vtable_7pyarrow_3lib_Tensor;
  __pyx_vtable_7pyarrow_3lib_Tensor.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_Tensor *, std::shared_ptr< arrow::Tensor>  const &))__pyx_f_7pyarrow_3lib_6Tensor_init;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Tensor) < 0) __PYX_ERR(13, 19, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Tensor.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Tensor.tp_dictoffset && __pyx_type_7pyarrow_3lib_Tensor.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Tensor.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Tensor.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Tensor) < 0) __PYX_ERR(13, 19, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Tensor, (PyObject *)&__pyx_type_7pyarrow_3lib_Tensor) < 0) __PYX_ERR(13, 19, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Tensor) < 0) __PYX_ERR(13, 19, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Tensor = &__pyx_type_7pyarrow_3lib_Tensor;
  __pyx_vtabptr_7pyarrow_3lib_SparseCSRMatrix = &__pyx_vtable_7pyarrow_3lib_SparseCSRMatrix;
  __pyx_vtable_7pyarrow_3lib_SparseCSRMatrix.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *, std::shared_ptr< arrow::SparseCSRMatrix>  const &))__pyx_f_7pyarrow_3lib_15SparseCSRMatrix_init;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_SparseCSRMatrix) < 0) __PYX_ERR(13, 343, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_SparseCSRMatrix.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_SparseCSRMatrix.tp_dictoffset && __pyx_type_7pyarrow_3lib_SparseCSRMatrix.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_SparseCSRMatrix.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_SparseCSRMatrix.tp_dict, __pyx_vtabptr_7pyarrow_3lib_SparseCSRMatrix) < 0) __PYX_ERR(13, 343, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SparseCSRMatrix, (PyObject *)&__pyx_type_7pyarrow_3lib_SparseCSRMatrix) < 0) __PYX_ERR(13, 343, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_SparseCSRMatrix) < 0) __PYX_ERR(13, 343, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_SparseCSRMatrix = &__pyx_type_7pyarrow_3lib_SparseCSRMatrix;
  __pyx_vtabptr_7pyarrow_3lib_SparseCOOTensor = &__pyx_vtable_7pyarrow_3lib_SparseCOOTensor;
  __pyx_vtable_7pyarrow_3lib_SparseCOOTensor.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *, std::shared_ptr< arrow::SparseCOOTensor>  const &))__pyx_f_7pyarrow_3lib_15SparseCOOTensor_init;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_SparseCOOTensor) < 0) __PYX_ERR(13, 129, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_SparseCOOTensor.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_SparseCOOTensor.tp_dictoffset && __pyx_type_7pyarrow_3lib_SparseCOOTensor.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_SparseCOOTensor.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_SparseCOOTensor.tp_dict, __pyx_vtabptr_7pyarrow_3lib_SparseCOOTensor) < 0) __PYX_ERR(13, 129, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SparseCOOTensor, (PyObject *)&__pyx_type_7pyarrow_3lib_SparseCOOTensor) < 0) __PYX_ERR(13, 129, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_SparseCOOTensor) < 0) __PYX_ERR(13, 129, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_SparseCOOTensor = &__pyx_type_7pyarrow_3lib_SparseCOOTensor;
  __pyx_vtabptr_7pyarrow_3lib_NullArray = &__pyx_vtable_7pyarrow_3lib_NullArray;
  __pyx_vtable_7pyarrow_3lib_NullArray.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_Array;
  __pyx_type_7pyarrow_3lib_NullArray.tp_base = __pyx_ptype_7pyarrow_3lib_Array;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_NullArray) < 0) __PYX_ERR(1, 1168, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_NullArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_NullArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_NullArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_NullArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_NullArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_NullArray) < 0) __PYX_ERR(1, 1168, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_NullArray, (PyObject *)&__pyx_type_7pyarrow_3lib_NullArray) < 0) __PYX_ERR(1, 1168, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_NullArray.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_NullArray.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_NullArray, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_NullArray = &__pyx_type_7pyarrow_3lib_NullArray;
  __pyx_vtabptr_7pyarrow_3lib_BooleanArray = &__pyx_vtable_7pyarrow_3lib_BooleanArray;
  __pyx_vtable_7pyarrow_3lib_BooleanArray.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_Array;
  __pyx_type_7pyarrow_3lib_BooleanArray.tp_base = __pyx_ptype_7pyarrow_3lib_Array;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_BooleanArray) < 0) __PYX_ERR(1, 1174, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_BooleanArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_BooleanArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_BooleanArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_BooleanArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_BooleanArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_BooleanArray) < 0) __PYX_ERR(1, 1174, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BooleanArray, (PyObject *)&__pyx_type_7pyarrow_3lib_BooleanArray) < 0) __PYX_ERR(1, 1174, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_BooleanArray.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_BooleanArray.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_BooleanArray, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_BooleanArray = &__pyx_type_7pyarrow_3lib_BooleanArray;
  __pyx_vtabptr_7pyarrow_3lib_NumericArray = &__pyx_vtable_7pyarrow_3lib_NumericArray;
  __pyx_vtable_7pyarrow_3lib_NumericArray.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_Array;
  __pyx_type_7pyarrow_3lib_NumericArray.tp_base = __pyx_ptype_7pyarrow_3lib_Array;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_NumericArray) < 0) __PYX_ERR(1, 1180, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_NumericArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_NumericArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_NumericArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_NumericArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_NumericArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_NumericArray) < 0) __PYX_ERR(1, 1180, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_NumericArray, (PyObject *)&__pyx_type_7pyarrow_3lib_NumericArray) < 0) __PYX_ERR(1, 1180, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_NumericArray.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_NumericArray.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_NumericArray, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_NumericArray = &__pyx_type_7pyarrow_3lib_NumericArray;
  __pyx_vtabptr_7pyarrow_3lib_IntegerArray = &__pyx_vtable_7pyarrow_3lib_IntegerArray;
  __pyx_vtable_7pyarrow_3lib_IntegerArray.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NumericArray;
  __pyx_type_7pyarrow_3lib_IntegerArray.tp_base = __pyx_ptype_7pyarrow_3lib_NumericArray;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_IntegerArray) < 0) __PYX_ERR(1, 1186, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_IntegerArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_IntegerArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_IntegerArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_IntegerArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_IntegerArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_IntegerArray) < 0) __PYX_ERR(1, 1186, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_IntegerArray, (PyObject *)&__pyx_type_7pyarrow_3lib_IntegerArray) < 0) __PYX_ERR(1, 1186, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_IntegerArray.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_IntegerArray.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_IntegerArray, __pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_IntegerArray = &__pyx_type_7pyarrow_3lib_IntegerArray;
  __pyx_vtabptr_7pyarrow_3lib_FloatingPointArray = &__pyx_vtable_7pyarrow_3lib_FloatingPointArray;
  __pyx_vtable_7pyarrow_3lib_FloatingPointArray.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NumericArray;
  __pyx_type_7pyarrow_3lib_FloatingPointArray.tp_base = __pyx_ptype_7pyarrow_3lib_NumericArray;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_FloatingPointArray) < 0) __PYX_ERR(1, 1192, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_FloatingPointArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_FloatingPointArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_FloatingPointArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_FloatingPointArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_FloatingPointArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_FloatingPointArray) < 0) __PYX_ERR(1, 1192, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FloatingPointArray, (PyObject *)&__pyx_type_7pyarrow_3lib_FloatingPointArray) < 0) __PYX_ERR(1, 1192, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_FloatingPointArray.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_FloatingPointArray.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_FloatingPointArray, __pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_FloatingPointArray = &__pyx_type_7pyarrow_3lib_FloatingPointArray;
  __pyx_vtabptr_7pyarrow_3lib_Int8Array = &__pyx_vtable_7pyarrow_3lib_Int8Array;
  __pyx_vtable_7pyarrow_3lib_Int8Array.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_IntegerArray;
  __pyx_type_7pyarrow_3lib_Int8Array.tp_base = __pyx_ptype_7pyarrow_3lib_IntegerArray;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Int8Array) < 0) __PYX_ERR(1, 1198, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Int8Array.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Int8Array.tp_dictoffset && __pyx_type_7pyarrow_3lib_Int8Array.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Int8Array.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Int8Array.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Int8Array) < 0) __PYX_ERR(1, 1198, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int8Array, (PyObject *)&__pyx_type_7pyarrow_3lib_Int8Array) < 0) __PYX_ERR(1, 1198, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_Int8Array.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_Int8Array.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_Int8Array, __pyx_base.__pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_Int8Array = &__pyx_type_7pyarrow_3lib_Int8Array;
  __pyx_vtabptr_7pyarrow_3lib_UInt8Array = &__pyx_vtable_7pyarrow_3lib_UInt8Array;
  __pyx_vtable_7pyarrow_3lib_UInt8Array.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_IntegerArray;
  __pyx_type_7pyarrow_3lib_UInt8Array.tp_base = __pyx_ptype_7pyarrow_3lib_IntegerArray;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_UInt8Array) < 0) __PYX_ERR(1, 1204, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UInt8Array.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UInt8Array.tp_dictoffset && __pyx_type_7pyarrow_3lib_UInt8Array.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UInt8Array.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UInt8Array.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UInt8Array) < 0) __PYX_ERR(1, 1204, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt8Array, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt8Array) < 0) __PYX_ERR(1, 1204, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_UInt8Array.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_UInt8Array.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_UInt8Array, __pyx_base.__pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_UInt8Array = &__pyx_type_7pyarrow_3lib_UInt8Array;
  __pyx_vtabptr_7pyarrow_3lib_Int16Array = &__pyx_vtable_7pyarrow_3lib_Int16Array;
  __pyx_vtable_7pyarrow_3lib_Int16Array.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_IntegerArray;
  __pyx_type_7pyarrow_3lib_Int16Array.tp_base = __pyx_ptype_7pyarrow_3lib_IntegerArray;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Int16Array) < 0) __PYX_ERR(1, 1210, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Int16Array.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Int16Array.tp_dictoffset && __pyx_type_7pyarrow_3lib_Int16Array.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Int16Array.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Int16Array.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Int16Array) < 0) __PYX_ERR(1, 1210, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int16Array, (PyObject *)&__pyx_type_7pyarrow_3lib_Int16Array) < 0) __PYX_ERR(1, 1210, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_Int16Array.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_Int16Array.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_Int16Array, __pyx_base.__pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_Int16Array = &__pyx_type_7pyarrow_3lib_Int16Array;
  __pyx_vtabptr_7pyarrow_3lib_UInt16Array = &__pyx_vtable_7pyarrow_3lib_UInt16Array;
  __pyx_vtable_7pyarrow_3lib_UInt16Array.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_IntegerArray;
  __pyx_type_7pyarrow_3lib_UInt16Array.tp_base = __pyx_ptype_7pyarrow_3lib_IntegerArray;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_UInt16Array) < 0) __PYX_ERR(1, 1216, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UInt16Array.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UInt16Array.tp_dictoffset && __pyx_type_7pyarrow_3lib_UInt16Array.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UInt16Array.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UInt16Array.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UInt16Array) < 0) __PYX_ERR(1, 1216, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt16Array, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt16Array) < 0) __PYX_ERR(1, 1216, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_UInt16Array.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_UInt16Array.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_UInt16Array, __pyx_base.__pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_UInt16Array = &__pyx_type_7pyarrow_3lib_UInt16Array;
  __pyx_vtabptr_7pyarrow_3lib_Int32Array = &__pyx_vtable_7pyarrow_3lib_Int32Array;
  __pyx_vtable_7pyarrow_3lib_Int32Array.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_IntegerArray;
  __pyx_type_7pyarrow_3lib_Int32Array.tp_base = __pyx_ptype_7pyarrow_3lib_IntegerArray;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Int32Array) < 0) __PYX_ERR(1, 1222, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Int32Array.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Int32Array.tp_dictoffset && __pyx_type_7pyarrow_3lib_Int32Array.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Int32Array.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Int32Array.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Int32Array) < 0) __PYX_ERR(1, 1222, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int32Array, (PyObject *)&__pyx_type_7pyarrow_3lib_Int32Array) < 0) __PYX_ERR(1, 1222, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_Int32Array.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_Int32Array.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_Int32Array, __pyx_base.__pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_Int32Array = &__pyx_type_7pyarrow_3lib_Int32Array;
  __pyx_vtabptr_7pyarrow_3lib_UInt32Array = &__pyx_vtable_7pyarrow_3lib_UInt32Array;
  __pyx_vtable_7pyarrow_3lib_UInt32Array.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_IntegerArray;
  __pyx_type_7pyarrow_3lib_UInt32Array.tp_base = __pyx_ptype_7pyarrow_3lib_IntegerArray;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_UInt32Array) < 0) __PYX_ERR(1, 1228, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UInt32Array.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UInt32Array.tp_dictoffset && __pyx_type_7pyarrow_3lib_UInt32Array.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UInt32Array.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UInt32Array.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UInt32Array) < 0) __PYX_ERR(1, 1228, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt32Array, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt32Array) < 0) __PYX_ERR(1, 1228, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_UInt32Array.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_UInt32Array.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_UInt32Array, __pyx_base.__pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_UInt32Array = &__pyx_type_7pyarrow_3lib_UInt32Array;
  __pyx_vtabptr_7pyarrow_3lib_Int64Array = &__pyx_vtable_7pyarrow_3lib_Int64Array;
  __pyx_vtable_7pyarrow_3lib_Int64Array.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_IntegerArray;
  __pyx_type_7pyarrow_3lib_Int64Array.tp_base = __pyx_ptype_7pyarrow_3lib_IntegerArray;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Int64Array) < 0) __PYX_ERR(1, 1234, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Int64Array.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Int64Array.tp_dictoffset && __pyx_type_7pyarrow_3lib_Int64Array.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Int64Array.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Int64Array.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Int64Array) < 0) __PYX_ERR(1, 1234, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int64Array, (PyObject *)&__pyx_type_7pyarrow_3lib_Int64Array) < 0) __PYX_ERR(1, 1234, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_Int64Array.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_Int64Array.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_Int64Array, __pyx_base.__pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_Int64Array = &__pyx_type_7pyarrow_3lib_Int64Array;
  __pyx_vtabptr_7pyarrow_3lib_UInt64Array = &__pyx_vtable_7pyarrow_3lib_UInt64Array;
  __pyx_vtable_7pyarrow_3lib_UInt64Array.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_IntegerArray;
  __pyx_type_7pyarrow_3lib_UInt64Array.tp_base = __pyx_ptype_7pyarrow_3lib_IntegerArray;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_UInt64Array) < 0) __PYX_ERR(1, 1240, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UInt64Array.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UInt64Array.tp_dictoffset && __pyx_type_7pyarrow_3lib_UInt64Array.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UInt64Array.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UInt64Array.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UInt64Array) < 0) __PYX_ERR(1, 1240, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt64Array, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt64Array) < 0) __PYX_ERR(1, 1240, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_UInt64Array.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_UInt64Array.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_UInt64Array, __pyx_base.__pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_UInt64Array = &__pyx_type_7pyarrow_3lib_UInt64Array;
  __pyx_vtabptr_7pyarrow_3lib_HalfFloatArray = &__pyx_vtable_7pyarrow_3lib_HalfFloatArray;
  __pyx_vtable_7pyarrow_3lib_HalfFloatArray.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_FloatingPointArray;
  __pyx_type_7pyarrow_3lib_HalfFloatArray.tp_base = __pyx_ptype_7pyarrow_3lib_FloatingPointArray;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_HalfFloatArray) < 0) __PYX_ERR(1, 1281, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_HalfFloatArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_HalfFloatArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_HalfFloatArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_HalfFloatArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_HalfFloatArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_HalfFloatArray) < 0) __PYX_ERR(1, 1281, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_HalfFloatArray, (PyObject *)&__pyx_type_7pyarrow_3lib_HalfFloatArray) < 0) __PYX_ERR(1, 1281, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_HalfFloatArray.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_HalfFloatArray.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_HalfFloatArray, __pyx_base.__pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_HalfFloatArray = &__pyx_type_7pyarrow_3lib_HalfFloatArray;
  __pyx_vtabptr_7pyarrow_3lib_FloatArray = &__pyx_vtable_7pyarrow_3lib_FloatArray;
  __pyx_vtable_7pyarrow_3lib_FloatArray.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_FloatingPointArray;
  __pyx_type_7pyarrow_3lib_FloatArray.tp_base = __pyx_ptype_7pyarrow_3lib_FloatingPointArray;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_FloatArray) < 0) __PYX_ERR(1, 1287, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_FloatArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_FloatArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_FloatArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_FloatArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_FloatArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_FloatArray) < 0) __PYX_ERR(1, 1287, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FloatArray, (PyObject *)&__pyx_type_7pyarrow_3lib_FloatArray) < 0) __PYX_ERR(1, 1287, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_FloatArray.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_FloatArray.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_FloatArray, __pyx_base.__pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_FloatArray = &__pyx_type_7pyarrow_3lib_FloatArray;
  __pyx_vtabptr_7pyarrow_3lib_DoubleArray = &__pyx_vtable_7pyarrow_3lib_DoubleArray;
  __pyx_vtable_7pyarrow_3lib_DoubleArray.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_FloatingPointArray;
  __pyx_type_7pyarrow_3lib_DoubleArray.tp_base = __pyx_ptype_7pyarrow_3lib_FloatingPointArray;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_DoubleArray) < 0) __PYX_ERR(1, 1293, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_DoubleArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_DoubleArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_DoubleArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_DoubleArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_DoubleArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_DoubleArray) < 0) __PYX_ERR(1, 1293, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DoubleArray, (PyObject *)&__pyx_type_7pyarrow_3lib_DoubleArray) < 0) __PYX_ERR(1, 1293, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_DoubleArray.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_DoubleArray.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_DoubleArray, __pyx_base.__pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_DoubleArray = &__pyx_type_7pyarrow_3lib_DoubleArray;
  __pyx_vtabptr_7pyarrow_3lib_FixedSizeBinaryArray = &__pyx_vtable_7pyarrow_3lib_FixedSizeBinaryArray;
  __pyx_vtable_7pyarrow_3lib_FixedSizeBinaryArray.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_Array;
  __pyx_type_7pyarrow_3lib_FixedSizeBinaryArray.tp_base = __pyx_ptype_7pyarrow_3lib_Array;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_FixedSizeBinaryArray) < 0) __PYX_ERR(1, 1299, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_FixedSizeBinaryArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_FixedSizeBinaryArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_FixedSizeBinaryArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_FixedSizeBinaryArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_FixedSizeBinaryArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_FixedSizeBinaryArray) < 0) __PYX_ERR(1, 1299, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FixedSizeBinaryArray, (PyObject *)&__pyx_type_7pyarrow_3lib_FixedSizeBinaryArray) < 0) __PYX_ERR(1, 1299, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_FixedSizeBinaryArray.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_FixedSizeBinaryArray.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryArray, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_FixedSizeBinaryArray = &__pyx_type_7pyarrow_3lib_FixedSizeBinaryArray;
  __pyx_vtabptr_7pyarrow_3lib_Decimal128Array = &__pyx_vtable_7pyarrow_3lib_Decimal128Array;
  __pyx_vtable_7pyarrow_3lib_Decimal128Array.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_FixedSizeBinaryArray;
  __pyx_type_7pyarrow_3lib_Decimal128Array.tp_base = __pyx_ptype_7pyarrow_3lib_FixedSizeBinaryArray;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Decimal128Array) < 0) __PYX_ERR(1, 1305, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Decimal128Array.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Decimal128Array.tp_dictoffset && __pyx_type_7pyarrow_3lib_Decimal128Array.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Decimal128Array.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Decimal128Array.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Decimal128Array) < 0) __PYX_ERR(1, 1305, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Decimal128Array, (PyObject *)&__pyx_type_7pyarrow_3lib_Decimal128Array) < 0) __PYX_ERR(1, 1305, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_Decimal128Array.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_Decimal128Array.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_Decimal128Array, __pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_Decimal128Array = &__pyx_type_7pyarrow_3lib_Decimal128Array;
  __pyx_vtabptr_7pyarrow_3lib_StructArray = &__pyx_vtable_7pyarrow_3lib_StructArray;
  __pyx_vtable_7pyarrow_3lib_StructArray.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_Array;
  __pyx_type_7pyarrow_3lib_StructArray.tp_base = __pyx_ptype_7pyarrow_3lib_Array;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_StructArray) < 0) __PYX_ERR(1, 1829, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_StructArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_StructArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_StructArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_StructArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_StructArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_StructArray) < 0) __PYX_ERR(1, 1829, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_StructArray, (PyObject *)&__pyx_type_7pyarrow_3lib_StructArray) < 0) __PYX_ERR(1, 1829, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_StructArray.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_StructArray.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_StructArray, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_StructArray = &__pyx_type_7pyarrow_3lib_StructArray;
  __pyx_vtabptr_7pyarrow_3lib_ListArray = &__pyx_vtable_7pyarrow_3lib_ListArray;
  __pyx_vtable_7pyarrow_3lib_ListArray.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_Array;
  __pyx_type_7pyarrow_3lib_ListArray.tp_base = __pyx_ptype_7pyarrow_3lib_Array;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_ListArray) < 0) __PYX_ERR(1, 1311, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_ListArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_ListArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_ListArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_ListArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_ListArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_ListArray) < 0) __PYX_ERR(1, 1311, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ListArray, (PyObject *)&__pyx_type_7pyarrow_3lib_ListArray) < 0) __PYX_ERR(1, 1311, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_ListArray.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_ListArray.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_ListArray, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_ListArray = &__pyx_type_7pyarrow_3lib_ListArray;
  __pyx_vtabptr_7pyarrow_3lib_LargeListArray = &__pyx_vtable_7pyarrow_3lib_LargeListArray;
  __pyx_vtable_7pyarrow_3lib_LargeListArray.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_Array;
  __pyx_type_7pyarrow_3lib_LargeListArray.tp_base = __pyx_ptype_7pyarrow_3lib_Array;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_LargeListArray) < 0) __PYX_ERR(1, 1391, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_LargeListArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_LargeListArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_LargeListArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_LargeListArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_LargeListArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_LargeListArray) < 0) __PYX_ERR(1, 1391, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_LargeListArray, (PyObject *)&__pyx_type_7pyarrow_3lib_LargeListArray) < 0) __PYX_ERR(1, 1391, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_LargeListArray.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_LargeListArray.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_LargeListArray, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_LargeListArray = &__pyx_type_7pyarrow_3lib_LargeListArray;
  __pyx_vtabptr_7pyarrow_3lib_MapArray = &__pyx_vtable_7pyarrow_3lib_MapArray;
  __pyx_vtable_7pyarrow_3lib_MapArray.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_Array;
  __pyx_type_7pyarrow_3lib_MapArray.tp_base = __pyx_ptype_7pyarrow_3lib_Array;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_MapArray) < 0) __PYX_ERR(1, 1473, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_MapArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_MapArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_MapArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_MapArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_MapArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_MapArray) < 0) __PYX_ERR(1, 1473, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MapArray, (PyObject *)&__pyx_type_7pyarrow_3lib_MapArray) < 0) __PYX_ERR(1, 1473, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_MapArray.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_MapArray.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_MapArray, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_MapArray = &__pyx_type_7pyarrow_3lib_MapArray;
  __pyx_vtabptr_7pyarrow_3lib_FixedSizeListArray = &__pyx_vtable_7pyarrow_3lib_FixedSizeListArray;
  __pyx_vtable_7pyarrow_3lib_FixedSizeListArray.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_Array;
  __pyx_type_7pyarrow_3lib_FixedSizeListArray.tp_base = __pyx_ptype_7pyarrow_3lib_Array;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_FixedSizeListArray) < 0) __PYX_ERR(1, 1519, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_FixedSizeListArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_FixedSizeListArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_FixedSizeListArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_FixedSizeListArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_FixedSizeListArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_FixedSizeListArray) < 0) __PYX_ERR(1, 1519, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FixedSizeListArray, (PyObject *)&__pyx_type_7pyarrow_3lib_FixedSizeListArray) < 0) __PYX_ERR(1, 1519, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_FixedSizeListArray.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_FixedSizeListArray.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_FixedSizeListArray, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_FixedSizeListArray = &__pyx_type_7pyarrow_3lib_FixedSizeListArray;
  __pyx_vtabptr_7pyarrow_3lib_UnionArray = &__pyx_vtable_7pyarrow_3lib_UnionArray;
  __pyx_vtable_7pyarrow_3lib_UnionArray.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_Array;
  __pyx_type_7pyarrow_3lib_UnionArray.tp_base = __pyx_ptype_7pyarrow_3lib_Array;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_UnionArray) < 0) __PYX_ERR(1, 1568, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UnionArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UnionArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_UnionArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UnionArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UnionArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UnionArray) < 0) __PYX_ERR(1, 1568, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UnionArray, (PyObject *)&__pyx_type_7pyarrow_3lib_UnionArray) < 0) __PYX_ERR(1, 1568, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_UnionArray.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_UnionArray.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_UnionArray, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_UnionArray = &__pyx_type_7pyarrow_3lib_UnionArray;
  __pyx_vtabptr_7pyarrow_3lib_StringArray = &__pyx_vtable_7pyarrow_3lib_StringArray;
  __pyx_vtable_7pyarrow_3lib_StringArray.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_Array;
  __pyx_type_7pyarrow_3lib_StringArray.tp_base = __pyx_ptype_7pyarrow_3lib_Array;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_StringArray) < 0) __PYX_ERR(1, 1654, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_StringArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_StringArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_StringArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_StringArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_StringArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_StringArray) < 0) __PYX_ERR(1, 1654, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_StringArray, (PyObject *)&__pyx_type_7pyarrow_3lib_StringArray) < 0) __PYX_ERR(1, 1654, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_StringArray.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_StringArray.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_StringArray, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_StringArray = &__pyx_type_7pyarrow_3lib_StringArray;
  __pyx_vtabptr_7pyarrow_3lib_BinaryArray = &__pyx_vtable_7pyarrow_3lib_BinaryArray;
  __pyx_vtable_7pyarrow_3lib_BinaryArray.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_Array;
  __pyx_type_7pyarrow_3lib_BinaryArray.tp_base = __pyx_ptype_7pyarrow_3lib_Array;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_BinaryArray) < 0) __PYX_ERR(1, 1718, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_BinaryArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_BinaryArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_BinaryArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_BinaryArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_BinaryArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_BinaryArray) < 0) __PYX_ERR(1, 1718, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BinaryArray, (PyObject *)&__pyx_type_7pyarrow_3lib_BinaryArray) < 0) __PYX_ERR(1, 1718, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_BinaryArray.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_BinaryArray.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_BinaryArray, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_BinaryArray = &__pyx_type_7pyarrow_3lib_BinaryArray;
  __pyx_vtabptr_7pyarrow_3lib_DictionaryArray = &__pyx_vtable_7pyarrow_3lib_DictionaryArray;
  __pyx_vtable_7pyarrow_3lib_DictionaryArray.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_Array;
  __pyx_type_7pyarrow_3lib_DictionaryArray.tp_base = __pyx_ptype_7pyarrow_3lib_Array;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_DictionaryArray) < 0) __PYX_ERR(1, 1730, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_DictionaryArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_DictionaryArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_DictionaryArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_DictionaryArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_DictionaryArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_DictionaryArray) < 0) __PYX_ERR(1, 1730, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DictionaryArray, (PyObject *)&__pyx_type_7pyarrow_3lib_DictionaryArray) < 0) __PYX_ERR(1, 1730, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_DictionaryArray.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_DictionaryArray.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_DictionaryArray, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_DictionaryArray = &__pyx_type_7pyarrow_3lib_DictionaryArray;
  __pyx_vtabptr_7pyarrow_3lib_ExtensionArray = &__pyx_vtable_7pyarrow_3lib_ExtensionArray;
  __pyx_vtable_7pyarrow_3lib_ExtensionArray.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_Array;
  __pyx_type_7pyarrow_3lib_ExtensionArray.tp_base = __pyx_ptype_7pyarrow_3lib_Array;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_ExtensionArray) < 0) __PYX_ERR(1, 1956, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_ExtensionArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_ExtensionArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_ExtensionArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_ExtensionArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_ExtensionArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_ExtensionArray) < 0) __PYX_ERR(1, 1956, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ExtensionArray, (PyObject *)&__pyx_type_7pyarrow_3lib_ExtensionArray) < 0) __PYX_ERR(1, 1956, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_ExtensionArray.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_ExtensionArray.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_ExtensionArray, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_ExtensionArray = &__pyx_type_7pyarrow_3lib_ExtensionArray;
  __pyx_vtabptr_7pyarrow_3lib_ChunkedArray = &__pyx_vtable_7pyarrow_3lib_ChunkedArray;
  __pyx_vtable_7pyarrow_3lib_ChunkedArray.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *, std::shared_ptr< arrow::ChunkedArray>  const &))__pyx_f_7pyarrow_3lib_12ChunkedArray_init;
  __pyx_vtable_7pyarrow_3lib_ChunkedArray.getitem = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *, int64_t))__pyx_f_7pyarrow_3lib_12ChunkedArray_getitem;
  __pyx_type_7pyarrow_3lib_ChunkedArray.tp_base = __pyx_ptype_7pyarrow_3lib__PandasConvertible;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_ChunkedArray) < 0) __PYX_ERR(6, 21, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_ChunkedArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_ChunkedArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_ChunkedArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_ChunkedArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_ChunkedArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_ChunkedArray) < 0) __PYX_ERR(6, 21, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ChunkedArray, (PyObject *)&__pyx_type_7pyarrow_3lib_ChunkedArray) < 0) __PYX_ERR(6, 21, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_ChunkedArray = &__pyx_type_7pyarrow_3lib_ChunkedArray;
  __pyx_vtabptr_7pyarrow_3lib_Table = &__pyx_vtable_7pyarrow_3lib_Table;
  __pyx_vtable_7pyarrow_3lib_Table.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_Table *, std::shared_ptr< arrow::Table>  const &))__pyx_f_7pyarrow_3lib_5Table_init;
  __pyx_type_7pyarrow_3lib_Table.tp_base = __pyx_ptype_7pyarrow_3lib__PandasConvertible;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Table) < 0) __PYX_ERR(6, 889, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Table.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Table.tp_dictoffset && __pyx_type_7pyarrow_3lib_Table.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Table.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Table.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Table) < 0) __PYX_ERR(6, 889, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Table, (PyObject *)&__pyx_type_7pyarrow_3lib_Table) < 0) __PYX_ERR(6, 889, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Table = &__pyx_type_7pyarrow_3lib_Table;
  __pyx_vtabptr_7pyarrow_3lib_RecordBatch = &__pyx_vtable_7pyarrow_3lib_RecordBatch;
  __pyx_vtable_7pyarrow_3lib_RecordBatch.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_RecordBatch *, std::shared_ptr< arrow::RecordBatch>  const &))__pyx_f_7pyarrow_3lib_11RecordBatch_init;
  __pyx_type_7pyarrow_3lib_RecordBatch.tp_base = __pyx_ptype_7pyarrow_3lib__PandasConvertible;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_RecordBatch) < 0) __PYX_ERR(6, 494, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_RecordBatch.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_RecordBatch.tp_dictoffset && __pyx_type_7pyarrow_3lib_RecordBatch.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_RecordBatch.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_RecordBatch.tp_dict, __pyx_vtabptr_7pyarrow_3lib_RecordBatch) < 0) __PYX_ERR(6, 494, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_RecordBatch, (PyObject *)&__pyx_type_7pyarrow_3lib_RecordBatch) < 0) __PYX_ERR(6, 494, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_RecordBatch = &__pyx_type_7pyarrow_3lib_RecordBatch;
  __pyx_vtabptr_7pyarrow_3lib_Buffer = &__pyx_vtable_7pyarrow_3lib_Buffer;
  __pyx_vtable_7pyarrow_3lib_Buffer.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_Buffer *, std::shared_ptr< arrow::Buffer>  const &))__pyx_f_7pyarrow_3lib_6Buffer_init;
  __pyx_vtable_7pyarrow_3lib_Buffer.getitem = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib_Buffer *, int64_t))__pyx_f_7pyarrow_3lib_6Buffer_getitem;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Buffer) < 0) __PYX_ERR(7, 882, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Buffer.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Buffer.tp_dictoffset && __pyx_type_7pyarrow_3lib_Buffer.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Buffer.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Buffer.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Buffer) < 0) __PYX_ERR(7, 882, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Buffer, (PyObject *)&__pyx_type_7pyarrow_3lib_Buffer) < 0) __PYX_ERR(7, 882, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Buffer = &__pyx_type_7pyarrow_3lib_Buffer;
  __pyx_vtabptr_7pyarrow_3lib_ResizableBuffer = &__pyx_vtable_7pyarrow_3lib_ResizableBuffer;
  __pyx_vtable_7pyarrow_3lib_ResizableBuffer.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_Buffer;
  __pyx_vtable_7pyarrow_3lib_ResizableBuffer.init_rz = (void (*)(struct __pyx_obj_7pyarrow_3lib_ResizableBuffer *, std::shared_ptr< arrow::ResizableBuffer>  const &))__pyx_f_7pyarrow_3lib_15ResizableBuffer_init_rz;
  __pyx_type_7pyarrow_3lib_ResizableBuffer.tp_base = __pyx_ptype_7pyarrow_3lib_Buffer;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_ResizableBuffer) < 0) __PYX_ERR(7, 1063, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_ResizableBuffer.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_ResizableBuffer.tp_dictoffset && __pyx_type_7pyarrow_3lib_ResizableBuffer.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_ResizableBuffer.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_ResizableBuffer.tp_dict, __pyx_vtabptr_7pyarrow_3lib_ResizableBuffer) < 0) __PYX_ERR(7, 1063, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ResizableBuffer, (PyObject *)&__pyx_type_7pyarrow_3lib_ResizableBuffer) < 0) __PYX_ERR(7, 1063, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_ResizableBuffer = &__pyx_type_7pyarrow_3lib_ResizableBuffer;
  __pyx_vtabptr_7pyarrow_3lib_NativeFile = &__pyx_vtable_7pyarrow_3lib_NativeFile;
  __pyx_vtable_7pyarrow_3lib_NativeFile.set_random_access_file = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib_NativeFile *, std::shared_ptr< arrow::io::RandomAccessFile> ))__pyx_f_7pyarrow_3lib_10NativeFile_set_random_access_file;
  __pyx_vtable_7pyarrow_3lib_NativeFile.set_input_stream = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib_NativeFile *, std::shared_ptr< arrow::io::InputStream> ))__pyx_f_7pyarrow_3lib_10NativeFile_set_input_stream;
  __pyx_vtable_7pyarrow_3lib_NativeFile.set_output_stream = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib_NativeFile *, std::shared_ptr< arrow::io::OutputStream> ))__pyx_f_7pyarrow_3lib_10NativeFile_set_output_stream;
  __pyx_vtable_7pyarrow_3lib_NativeFile.get_random_access_file = (std::shared_ptr< arrow::io::RandomAccessFile>  (*)(struct __pyx_obj_7pyarrow_3lib_NativeFile *))__pyx_f_7pyarrow_3lib_10NativeFile_get_random_access_file;
  __pyx_vtable_7pyarrow_3lib_NativeFile.get_input_stream = (std::shared_ptr< arrow::io::InputStream>  (*)(struct __pyx_obj_7pyarrow_3lib_NativeFile *))__pyx_f_7pyarrow_3lib_10NativeFile_get_input_stream;
  __pyx_vtable_7pyarrow_3lib_NativeFile.get_output_stream = (std::shared_ptr< arrow::io::OutputStream>  (*)(struct __pyx_obj_7pyarrow_3lib_NativeFile *))__pyx_f_7pyarrow_3lib_10NativeFile_get_output_stream;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_NativeFile) < 0) __PYX_ERR(7, 46, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_NativeFile.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_NativeFile.tp_dictoffset && __pyx_type_7pyarrow_3lib_NativeFile.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_NativeFile.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_NativeFile.tp_dict, __pyx_vtabptr_7pyarrow_3lib_NativeFile) < 0) __PYX_ERR(7, 46, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_NativeFile, (PyObject *)&__pyx_type_7pyarrow_3lib_NativeFile) < 0) __PYX_ERR(7, 46, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_NativeFile.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_NativeFile.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_NativeFile, __weakref__);
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_NativeFile) < 0) __PYX_ERR(7, 46, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_NativeFile = &__pyx_type_7pyarrow_3lib_NativeFile;
  __pyx_vtabptr_7pyarrow_3lib_BufferedInputStream = &__pyx_vtable_7pyarrow_3lib_BufferedInputStream;
  __pyx_vtable_7pyarrow_3lib_BufferedInputStream.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NativeFile;
  __pyx_type_7pyarrow_3lib_BufferedInputStream.tp_base = __pyx_ptype_7pyarrow_3lib_NativeFile;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_BufferedInputStream) < 0) __PYX_ERR(7, 1248, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_BufferedInputStream.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_BufferedInputStream.tp_dictoffset && __pyx_type_7pyarrow_3lib_BufferedInputStream.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_BufferedInputStream.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_BufferedInputStream.tp_dict, __pyx_vtabptr_7pyarrow_3lib_BufferedInputStream) < 0) __PYX_ERR(7, 1248, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BufferedInputStream, (PyObject *)&__pyx_type_7pyarrow_3lib_BufferedInputStream) < 0) __PYX_ERR(7, 1248, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_BufferedInputStream.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_BufferedInputStream.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_BufferedInputStream, __pyx_base.__weakref__);
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_BufferedInputStream) < 0) __PYX_ERR(7, 1248, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_BufferedInputStream = &__pyx_type_7pyarrow_3lib_BufferedInputStream;
  __pyx_vtabptr_7pyarrow_3lib_BufferedOutputStream = &__pyx_vtable_7pyarrow_3lib_BufferedOutputStream;
  __pyx_vtable_7pyarrow_3lib_BufferedOutputStream.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NativeFile;
  __pyx_type_7pyarrow_3lib_BufferedOutputStream.tp_base = __pyx_ptype_7pyarrow_3lib_NativeFile;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_BufferedOutputStream) < 0) __PYX_ERR(7, 1298, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_BufferedOutputStream.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_BufferedOutputStream.tp_dictoffset && __pyx_type_7pyarrow_3lib_BufferedOutputStream.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_BufferedOutputStream.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_BufferedOutputStream.tp_dict, __pyx_vtabptr_7pyarrow_3lib_BufferedOutputStream) < 0) __PYX_ERR(7, 1298, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BufferedOutputStream, (PyObject *)&__pyx_type_7pyarrow_3lib_BufferedOutputStream) < 0) __PYX_ERR(7, 1298, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_BufferedOutputStream.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_BufferedOutputStream.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream, __pyx_base.__weakref__);
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_BufferedOutputStream) < 0) __PYX_ERR(7, 1298, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_BufferedOutputStream = &__pyx_type_7pyarrow_3lib_BufferedOutputStream;
  __pyx_vtabptr_7pyarrow_3lib_CompressedInputStream = &__pyx_vtable_7pyarrow_3lib_CompressedInputStream;
  __pyx_vtable_7pyarrow_3lib_CompressedInputStream.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NativeFile;
  __pyx_type_7pyarrow_3lib_CompressedInputStream.tp_base = __pyx_ptype_7pyarrow_3lib_NativeFile;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_CompressedInputStream) < 0) __PYX_ERR(7, 1184, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_CompressedInputStream.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_CompressedInputStream.tp_dictoffset && __pyx_type_7pyarrow_3lib_CompressedInputStream.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_CompressedInputStream.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_CompressedInputStream.tp_dict, __pyx_vtabptr_7pyarrow_3lib_CompressedInputStream) < 0) __PYX_ERR(7, 1184, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_CompressedInputStream, (PyObject *)&__pyx_type_7pyarrow_3lib_CompressedInputStream) < 0) __PYX_ERR(7, 1184, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_CompressedInputStream.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_CompressedInputStream.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_CompressedInputStream, __pyx_base.__weakref__);
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_CompressedInputStream) < 0) __PYX_ERR(7, 1184, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_CompressedInputStream = &__pyx_type_7pyarrow_3lib_CompressedInputStream;
  __pyx_vtabptr_7pyarrow_3lib_CompressedOutputStream = &__pyx_vtable_7pyarrow_3lib_CompressedOutputStream;
  __pyx_vtable_7pyarrow_3lib_CompressedOutputStream.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NativeFile;
  __pyx_type_7pyarrow_3lib_CompressedOutputStream.tp_base = __pyx_ptype_7pyarrow_3lib_NativeFile;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_CompressedOutputStream) < 0) __PYX_ERR(7, 1213, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_CompressedOutputStream.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_CompressedOutputStream.tp_dictoffset && __pyx_type_7pyarrow_3lib_CompressedOutputStream.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_CompressedOutputStream.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_CompressedOutputStream.tp_dict, __pyx_vtabptr_7pyarrow_3lib_CompressedOutputStream) < 0) __PYX_ERR(7, 1213, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_CompressedOutputStream, (PyObject *)&__pyx_type_7pyarrow_3lib_CompressedOutputStream) < 0) __PYX_ERR(7, 1213, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_CompressedOutputStream.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_CompressedOutputStream.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream, __pyx_base.__weakref__);
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_CompressedOutputStream) < 0) __PYX_ERR(7, 1213, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_CompressedOutputStream = &__pyx_type_7pyarrow_3lib_CompressedOutputStream;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib__CRecordBatchWriter) < 0) __PYX_ERR(8, 174, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib__CRecordBatchWriter.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib__CRecordBatchWriter.tp_dictoffset && __pyx_type_7pyarrow_3lib__CRecordBatchWriter.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib__CRecordBatchWriter.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_CRecordBatchWriter, (PyObject *)&__pyx_type_7pyarrow_3lib__CRecordBatchWriter) < 0) __PYX_ERR(8, 174, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib__CRecordBatchWriter) < 0) __PYX_ERR(8, 174, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib__CRecordBatchWriter = &__pyx_type_7pyarrow_3lib__CRecordBatchWriter;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib__CRecordBatchReader) < 0) __PYX_ERR(8, 289, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib__CRecordBatchReader.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib__CRecordBatchReader.tp_dictoffset && __pyx_type_7pyarrow_3lib__CRecordBatchReader.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib__CRecordBatchReader.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_CRecordBatchReader, (PyObject *)&__pyx_type_7pyarrow_3lib__CRecordBatchReader) < 0) __PYX_ERR(8, 289, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib__CRecordBatchReader) < 0) __PYX_ERR(8, 289, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib__CRecordBatchReader = &__pyx_type_7pyarrow_3lib__CRecordBatchReader;
  __pyx_vtabptr_7pyarrow_3lib_CastOptions = &__pyx_vtable_7pyarrow_3lib_CastOptions;
  __pyx_vtable_7pyarrow_3lib_CastOptions.wrap = (PyObject *(*)( arrow::compute::CastOptions))__pyx_f_7pyarrow_3lib_11CastOptions_wrap;
  __pyx_vtable_7pyarrow_3lib_CastOptions.unwrap = ( arrow::compute::CastOptions (*)(struct __pyx_obj_7pyarrow_3lib_CastOptions *))__pyx_f_7pyarrow_3lib_11CastOptions_unwrap;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_CastOptions) < 0) __PYX_ERR(14, 19, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_CastOptions.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_CastOptions.tp_dictoffset && __pyx_type_7pyarrow_3lib_CastOptions.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_CastOptions.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_CastOptions.tp_dict, __pyx_vtabptr_7pyarrow_3lib_CastOptions) < 0) __PYX_ERR(14, 19, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_CastOptions, (PyObject *)&__pyx_type_7pyarrow_3lib_CastOptions) < 0) __PYX_ERR(14, 19, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_CastOptions) < 0) __PYX_ERR(14, 19, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_CastOptions = &__pyx_type_7pyarrow_3lib_CastOptions;
  __pyx_vtabptr_7pyarrow_3lib__PandasAPIShim = &__pyx_vtable_7pyarrow_3lib__PandasAPIShim;
  __pyx_vtable_7pyarrow_3lib__PandasAPIShim._import_pandas = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, int))__pyx_f_7pyarrow_3lib_14_PandasAPIShim__import_pandas;
  __pyx_vtable_7pyarrow_3lib__PandasAPIShim._check_import = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, struct __pyx_opt_args_7pyarrow_3lib_14_PandasAPIShim__check_import *__pyx_optional_args))__pyx_f_7pyarrow_3lib_14_PandasAPIShim__check_import;
  __pyx_vtable_7pyarrow_3lib__PandasAPIShim._have_pandas_internal = (int (*)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *))__pyx_f_7pyarrow_3lib_14_PandasAPIShim__have_pandas_internal;
  __pyx_vtable_7pyarrow_3lib__PandasAPIShim.infer_dtype = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, PyObject *, int __pyx_skip_dispatch))__pyx_f_7pyarrow_3lib_14_PandasAPIShim_infer_dtype;
  __pyx_vtable_7pyarrow_3lib__PandasAPIShim.pandas_dtype = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, PyObject *, int __pyx_skip_dispatch))__pyx_f_7pyarrow_3lib_14_PandasAPIShim_pandas_dtype;
  __pyx_vtable_7pyarrow_3lib__PandasAPIShim.is_array_like = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, PyObject *, int __pyx_skip_dispatch))__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_array_like;
  __pyx_vtable_7pyarrow_3lib__PandasAPIShim.is_categorical = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, PyObject *, int __pyx_skip_dispatch))__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_categorical;
  __pyx_vtable_7pyarrow_3lib__PandasAPIShim.is_datetimetz = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, PyObject *, int __pyx_skip_dispatch))__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_datetimetz;
  __pyx_vtable_7pyarrow_3lib__PandasAPIShim.is_sparse = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, PyObject *, int __pyx_skip_dispatch))__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_sparse;
  __pyx_vtable_7pyarrow_3lib__PandasAPIShim.is_data_frame = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, PyObject *, int __pyx_skip_dispatch))__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_data_frame;
  __pyx_vtable_7pyarrow_3lib__PandasAPIShim.is_series = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, PyObject *, int __pyx_skip_dispatch))__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_series;
  __pyx_vtable_7pyarrow_3lib__PandasAPIShim.is_index = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, PyObject *, int __pyx_skip_dispatch))__pyx_f_7pyarrow_3lib_14_PandasAPIShim_is_index;
  __pyx_vtable_7pyarrow_3lib__PandasAPIShim.get_values = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *, PyObject *, int __pyx_skip_dispatch))__pyx_f_7pyarrow_3lib_14_PandasAPIShim_get_values;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib__PandasAPIShim) < 0) __PYX_ERR(3, 20, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib__PandasAPIShim.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib__PandasAPIShim.tp_dictoffset && __pyx_type_7pyarrow_3lib__PandasAPIShim.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib__PandasAPIShim.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib__PandasAPIShim.tp_dict, __pyx_vtabptr_7pyarrow_3lib__PandasAPIShim) < 0) __PYX_ERR(3, 20, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_PandasAPIShim, (PyObject *)&__pyx_type_7pyarrow_3lib__PandasAPIShim) < 0) __PYX_ERR(3, 20, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib__PandasAPIShim) < 0) __PYX_ERR(3, 20, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib__PandasAPIShim = &__pyx_type_7pyarrow_3lib__PandasAPIShim;
  __pyx_vtabptr_7pyarrow_3lib_LoggingMemoryPool = &__pyx_vtable_7pyarrow_3lib_LoggingMemoryPool;
  __pyx_vtable_7pyarrow_3lib_LoggingMemoryPool.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_MemoryPool;
  __pyx_type_7pyarrow_3lib_LoggingMemoryPool.tp_base = __pyx_ptype_7pyarrow_3lib_MemoryPool;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_LoggingMemoryPool) < 0) __PYX_ERR(11, 65, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_LoggingMemoryPool.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_LoggingMemoryPool.tp_dictoffset && __pyx_type_7pyarrow_3lib_LoggingMemoryPool.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_LoggingMemoryPool.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_LoggingMemoryPool.tp_dict, __pyx_vtabptr_7pyarrow_3lib_LoggingMemoryPool) < 0) __PYX_ERR(11, 65, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_LoggingMemoryPool, (PyObject *)&__pyx_type_7pyarrow_3lib_LoggingMemoryPool) < 0) __PYX_ERR(11, 65, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_LoggingMemoryPool) < 0) __PYX_ERR(11, 65, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_LoggingMemoryPool = &__pyx_type_7pyarrow_3lib_LoggingMemoryPool;
  __pyx_vtabptr_7pyarrow_3lib_ProxyMemoryPool = &__pyx_vtable_7pyarrow_3lib_ProxyMemoryPool;
  __pyx_vtable_7pyarrow_3lib_ProxyMemoryPool.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_MemoryPool;
  __pyx_type_7pyarrow_3lib_ProxyMemoryPool.tp_base = __pyx_ptype_7pyarrow_3lib_MemoryPool;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_ProxyMemoryPool) < 0) __PYX_ERR(11, 75, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_ProxyMemoryPool.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_ProxyMemoryPool.tp_dictoffset && __pyx_type_7pyarrow_3lib_ProxyMemoryPool.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_ProxyMemoryPool.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_ProxyMemoryPool.tp_dict, __pyx_vtabptr_7pyarrow_3lib_ProxyMemoryPool) < 0) __PYX_ERR(11, 75, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ProxyMemoryPool, (PyObject *)&__pyx_type_7pyarrow_3lib_ProxyMemoryPool) < 0) __PYX_ERR(11, 75, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_ProxyMemoryPool) < 0) __PYX_ERR(11, 75, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_ProxyMemoryPool = &__pyx_type_7pyarrow_3lib_ProxyMemoryPool;
  __pyx_vtabptr_7pyarrow_3lib_UnionType = &__pyx_vtable_7pyarrow_3lib_UnionType;
  __pyx_vtable_7pyarrow_3lib_UnionType.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_DataType;
  __pyx_vtable_7pyarrow_3lib_UnionType.__pyx_base.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::DataType>  const &))__pyx_f_7pyarrow_3lib_9UnionType_init;
  __pyx_type_7pyarrow_3lib_UnionType.tp_base = __pyx_ptype_7pyarrow_3lib_DataType;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_UnionType) < 0) __PYX_ERR(4, 398, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UnionType.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UnionType.tp_dictoffset && __pyx_type_7pyarrow_3lib_UnionType.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UnionType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_UnionType, "__len__"); if (unlikely(!wrapper)) __PYX_ERR(4, 398, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_9UnionType___len__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_9UnionType___len__.doc = __pyx_doc_7pyarrow_3lib_9UnionType___len__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_9UnionType___len__;
    }
  }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_UnionType, "__iter__"); if (unlikely(!wrapper)) __PYX_ERR(4, 398, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_9UnionType_2__iter__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_9UnionType_2__iter__.doc = __pyx_doc_7pyarrow_3lib_9UnionType_2__iter__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_9UnionType_2__iter__;
    }
  }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7pyarrow_3lib_UnionType, "__getitem__"); if (unlikely(!wrapper)) __PYX_ERR(4, 398, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7pyarrow_3lib_9UnionType_5__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_3lib_9UnionType_5__getitem__.doc = __pyx_doc_7pyarrow_3lib_9UnionType_5__getitem__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_3lib_9UnionType_5__getitem__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UnionType.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UnionType) < 0) __PYX_ERR(4, 398, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UnionType, (PyObject *)&__pyx_type_7pyarrow_3lib_UnionType) < 0) __PYX_ERR(4, 398, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_UnionType.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_UnionType.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_UnionType, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_UnionType = &__pyx_type_7pyarrow_3lib_UnionType;
  __pyx_vtabptr_7pyarrow_3lib_UnknownExtensionType = &__pyx_vtable_7pyarrow_3lib_UnknownExtensionType;
  __pyx_vtable_7pyarrow_3lib_UnknownExtensionType.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_PyExtensionType;
  __pyx_type_7pyarrow_3lib_UnknownExtensionType.tp_base = __pyx_ptype_7pyarrow_3lib_PyExtensionType;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_UnknownExtensionType) < 0) __PYX_ERR(4, 728, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UnknownExtensionType.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UnknownExtensionType.tp_dictoffset && __pyx_type_7pyarrow_3lib_UnknownExtensionType.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UnknownExtensionType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UnknownExtensionType.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UnknownExtensionType) < 0) __PYX_ERR(4, 728, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UnknownExtensionType, (PyObject *)&__pyx_type_7pyarrow_3lib_UnknownExtensionType) < 0) __PYX_ERR(4, 728, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_UnknownExtensionType.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_UnknownExtensionType.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_UnknownExtensionType, __pyx_base.__pyx_base.__pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_UnknownExtensionType = &__pyx_type_7pyarrow_3lib_UnknownExtensionType;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib__ExtensionRegistryNanny) < 0) __PYX_ERR(4, 2246, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib__ExtensionRegistryNanny.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib__ExtensionRegistryNanny.tp_dictoffset && __pyx_type_7pyarrow_3lib__ExtensionRegistryNanny.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib__ExtensionRegistryNanny.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ExtensionRegistryNanny, (PyObject *)&__pyx_type_7pyarrow_3lib__ExtensionRegistryNanny) < 0) __PYX_ERR(4, 2246, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib__ExtensionRegistryNanny) < 0) __PYX_ERR(4, 2246, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib__ExtensionRegistryNanny = &__pyx_type_7pyarrow_3lib__ExtensionRegistryNanny;
  __pyx_type_7pyarrow_3lib_NullType.tp_base = __pyx_ptype_7pyarrow_3lib_Scalar;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_NullType) < 0) __PYX_ERR(5, 28, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_NullType.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_NullType.tp_dictoffset && __pyx_type_7pyarrow_3lib_NullType.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_NullType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_NullType, (PyObject *)&__pyx_type_7pyarrow_3lib_NullType) < 0) __PYX_ERR(5, 28, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_NullType) < 0) __PYX_ERR(5, 28, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_NullType = &__pyx_type_7pyarrow_3lib_NullType;
  __pyx_vtabptr_7pyarrow_3lib_BooleanValue = &__pyx_vtable_7pyarrow_3lib_BooleanValue;
  __pyx_vtable_7pyarrow_3lib_BooleanValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_BooleanValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_BooleanValue) < 0) __PYX_ERR(5, 100, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_BooleanValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_BooleanValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_BooleanValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_BooleanValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_BooleanValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_BooleanValue) < 0) __PYX_ERR(5, 100, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BooleanValue, (PyObject *)&__pyx_type_7pyarrow_3lib_BooleanValue) < 0) __PYX_ERR(5, 100, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_BooleanValue) < 0) __PYX_ERR(5, 100, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_BooleanValue = &__pyx_type_7pyarrow_3lib_BooleanValue;
  __pyx_vtabptr_7pyarrow_3lib_UInt8Value = &__pyx_vtable_7pyarrow_3lib_UInt8Value;
  __pyx_vtable_7pyarrow_3lib_UInt8Value.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_UInt8Value.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_UInt8Value) < 0) __PYX_ERR(5, 126, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UInt8Value.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UInt8Value.tp_dictoffset && __pyx_type_7pyarrow_3lib_UInt8Value.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UInt8Value.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UInt8Value.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UInt8Value) < 0) __PYX_ERR(5, 126, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt8Value, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt8Value) < 0) __PYX_ERR(5, 126, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_UInt8Value) < 0) __PYX_ERR(5, 126, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_UInt8Value = &__pyx_type_7pyarrow_3lib_UInt8Value;
  __pyx_vtabptr_7pyarrow_3lib_Int16Value = &__pyx_vtable_7pyarrow_3lib_Int16Value;
  __pyx_vtable_7pyarrow_3lib_Int16Value.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_Int16Value.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Int16Value) < 0) __PYX_ERR(5, 139, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Int16Value.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Int16Value.tp_dictoffset && __pyx_type_7pyarrow_3lib_Int16Value.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Int16Value.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Int16Value.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Int16Value) < 0) __PYX_ERR(5, 139, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int16Value, (PyObject *)&__pyx_type_7pyarrow_3lib_Int16Value) < 0) __PYX_ERR(5, 139, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Int16Value) < 0) __PYX_ERR(5, 139, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Int16Value = &__pyx_type_7pyarrow_3lib_Int16Value;
  __pyx_vtabptr_7pyarrow_3lib_UInt16Value = &__pyx_vtable_7pyarrow_3lib_UInt16Value;
  __pyx_vtable_7pyarrow_3lib_UInt16Value.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_UInt16Value.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_UInt16Value) < 0) __PYX_ERR(5, 152, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UInt16Value.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UInt16Value.tp_dictoffset && __pyx_type_7pyarrow_3lib_UInt16Value.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UInt16Value.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UInt16Value.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UInt16Value) < 0) __PYX_ERR(5, 152, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt16Value, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt16Value) < 0) __PYX_ERR(5, 152, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_UInt16Value) < 0) __PYX_ERR(5, 152, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_UInt16Value = &__pyx_type_7pyarrow_3lib_UInt16Value;
  __pyx_vtabptr_7pyarrow_3lib_Int32Value = &__pyx_vtable_7pyarrow_3lib_Int32Value;
  __pyx_vtable_7pyarrow_3lib_Int32Value.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_Int32Value.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Int32Value) < 0) __PYX_ERR(5, 165, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Int32Value.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Int32Value.tp_dictoffset && __pyx_type_7pyarrow_3lib_Int32Value.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Int32Value.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Int32Value.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Int32Value) < 0) __PYX_ERR(5, 165, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int32Value, (PyObject *)&__pyx_type_7pyarrow_3lib_Int32Value) < 0) __PYX_ERR(5, 165, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Int32Value) < 0) __PYX_ERR(5, 165, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Int32Value = &__pyx_type_7pyarrow_3lib_Int32Value;
  __pyx_vtabptr_7pyarrow_3lib_UInt32Value = &__pyx_vtable_7pyarrow_3lib_UInt32Value;
  __pyx_vtable_7pyarrow_3lib_UInt32Value.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_UInt32Value.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_UInt32Value) < 0) __PYX_ERR(5, 178, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UInt32Value.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UInt32Value.tp_dictoffset && __pyx_type_7pyarrow_3lib_UInt32Value.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UInt32Value.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UInt32Value.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UInt32Value) < 0) __PYX_ERR(5, 178, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt32Value, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt32Value) < 0) __PYX_ERR(5, 178, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_UInt32Value) < 0) __PYX_ERR(5, 178, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_UInt32Value = &__pyx_type_7pyarrow_3lib_UInt32Value;
  __pyx_vtabptr_7pyarrow_3lib_UInt64Value = &__pyx_vtable_7pyarrow_3lib_UInt64Value;
  __pyx_vtable_7pyarrow_3lib_UInt64Value.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_UInt64Value.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_UInt64Value) < 0) __PYX_ERR(5, 204, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UInt64Value.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UInt64Value.tp_dictoffset && __pyx_type_7pyarrow_3lib_UInt64Value.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UInt64Value.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UInt64Value.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UInt64Value) < 0) __PYX_ERR(5, 204, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt64Value, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt64Value) < 0) __PYX_ERR(5, 204, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_UInt64Value) < 0) __PYX_ERR(5, 204, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_UInt64Value = &__pyx_type_7pyarrow_3lib_UInt64Value;
  __pyx_vtabptr_7pyarrow_3lib_Date32Value = &__pyx_vtable_7pyarrow_3lib_Date32Value;
  __pyx_vtable_7pyarrow_3lib_Date32Value.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_Date32Value.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Date32Value) < 0) __PYX_ERR(5, 217, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Date32Value.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Date32Value.tp_dictoffset && __pyx_type_7pyarrow_3lib_Date32Value.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Date32Value.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Date32Value.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Date32Value) < 0) __PYX_ERR(5, 217, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Date32Value, (PyObject *)&__pyx_type_7pyarrow_3lib_Date32Value) < 0) __PYX_ERR(5, 217, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Date32Value) < 0) __PYX_ERR(5, 217, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Date32Value = &__pyx_type_7pyarrow_3lib_Date32Value;
  __pyx_vtabptr_7pyarrow_3lib_Date64Value = &__pyx_vtable_7pyarrow_3lib_Date64Value;
  __pyx_vtable_7pyarrow_3lib_Date64Value.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_Date64Value.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Date64Value) < 0) __PYX_ERR(5, 233, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Date64Value.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Date64Value.tp_dictoffset && __pyx_type_7pyarrow_3lib_Date64Value.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Date64Value.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Date64Value.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Date64Value) < 0) __PYX_ERR(5, 233, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Date64Value, (PyObject *)&__pyx_type_7pyarrow_3lib_Date64Value) < 0) __PYX_ERR(5, 233, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Date64Value) < 0) __PYX_ERR(5, 233, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Date64Value = &__pyx_type_7pyarrow_3lib_Date64Value;
  __pyx_vtabptr_7pyarrow_3lib_Time32Value = &__pyx_vtable_7pyarrow_3lib_Time32Value;
  __pyx_vtable_7pyarrow_3lib_Time32Value.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_Time32Value.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Time32Value) < 0) __PYX_ERR(5, 248, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Time32Value.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Time32Value.tp_dictoffset && __pyx_type_7pyarrow_3lib_Time32Value.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Time32Value.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Time32Value.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Time32Value) < 0) __PYX_ERR(5, 248, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Time32Value, (PyObject *)&__pyx_type_7pyarrow_3lib_Time32Value) < 0) __PYX_ERR(5, 248, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Time32Value) < 0) __PYX_ERR(5, 248, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Time32Value = &__pyx_type_7pyarrow_3lib_Time32Value;
  __pyx_vtabptr_7pyarrow_3lib_Time64Value = &__pyx_vtable_7pyarrow_3lib_Time64Value;
  __pyx_vtable_7pyarrow_3lib_Time64Value.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_Time64Value.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Time64Value) < 0) __PYX_ERR(5, 268, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Time64Value.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Time64Value.tp_dictoffset && __pyx_type_7pyarrow_3lib_Time64Value.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Time64Value.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Time64Value.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Time64Value) < 0) __PYX_ERR(5, 268, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Time64Value, (PyObject *)&__pyx_type_7pyarrow_3lib_Time64Value) < 0) __PYX_ERR(5, 268, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Time64Value) < 0) __PYX_ERR(5, 268, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Time64Value = &__pyx_type_7pyarrow_3lib_Time64Value;
  __pyx_vtabptr_7pyarrow_3lib_TimestampValue = &__pyx_vtable_7pyarrow_3lib_TimestampValue;
  __pyx_vtable_7pyarrow_3lib_TimestampValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_TimestampValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_TimestampValue) < 0) __PYX_ERR(5, 373, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_TimestampValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_TimestampValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_TimestampValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_TimestampValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_TimestampValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_TimestampValue) < 0) __PYX_ERR(5, 373, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TimestampValue, (PyObject *)&__pyx_type_7pyarrow_3lib_TimestampValue) < 0) __PYX_ERR(5, 373, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_TimestampValue) < 0) __PYX_ERR(5, 373, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_TimestampValue = &__pyx_type_7pyarrow_3lib_TimestampValue;
  __pyx_vtabptr_7pyarrow_3lib_DurationValue = &__pyx_vtable_7pyarrow_3lib_DurationValue;
  __pyx_vtable_7pyarrow_3lib_DurationValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_DurationValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_DurationValue) < 0) __PYX_ERR(5, 445, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_DurationValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_DurationValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_DurationValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_DurationValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_DurationValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_DurationValue) < 0) __PYX_ERR(5, 445, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DurationValue, (PyObject *)&__pyx_type_7pyarrow_3lib_DurationValue) < 0) __PYX_ERR(5, 445, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_DurationValue) < 0) __PYX_ERR(5, 445, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_DurationValue = &__pyx_type_7pyarrow_3lib_DurationValue;
  __pyx_vtabptr_7pyarrow_3lib_HalfFloatValue = &__pyx_vtable_7pyarrow_3lib_HalfFloatValue;
  __pyx_vtable_7pyarrow_3lib_HalfFloatValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_HalfFloatValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_HalfFloatValue) < 0) __PYX_ERR(5, 468, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_HalfFloatValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_HalfFloatValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_HalfFloatValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_HalfFloatValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_HalfFloatValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_HalfFloatValue) < 0) __PYX_ERR(5, 468, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_HalfFloatValue, (PyObject *)&__pyx_type_7pyarrow_3lib_HalfFloatValue) < 0) __PYX_ERR(5, 468, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_HalfFloatValue) < 0) __PYX_ERR(5, 468, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_HalfFloatValue = &__pyx_type_7pyarrow_3lib_HalfFloatValue;
  __pyx_vtabptr_7pyarrow_3lib_FloatValue = &__pyx_vtable_7pyarrow_3lib_FloatValue;
  __pyx_vtable_7pyarrow_3lib_FloatValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_FloatValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_FloatValue) < 0) __PYX_ERR(5, 481, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_FloatValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_FloatValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_FloatValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_FloatValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_FloatValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_FloatValue) < 0) __PYX_ERR(5, 481, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FloatValue, (PyObject *)&__pyx_type_7pyarrow_3lib_FloatValue) < 0) __PYX_ERR(5, 481, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_FloatValue) < 0) __PYX_ERR(5, 481, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_FloatValue = &__pyx_type_7pyarrow_3lib_FloatValue;
  __pyx_vtabptr_7pyarrow_3lib_DoubleValue = &__pyx_vtable_7pyarrow_3lib_DoubleValue;
  __pyx_vtable_7pyarrow_3lib_DoubleValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_DoubleValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_DoubleValue) < 0) __PYX_ERR(5, 494, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_DoubleValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_DoubleValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_DoubleValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_DoubleValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_DoubleValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_DoubleValue) < 0) __PYX_ERR(5, 494, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DoubleValue, (PyObject *)&__pyx_type_7pyarrow_3lib_DoubleValue) < 0) __PYX_ERR(5, 494, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_DoubleValue) < 0) __PYX_ERR(5, 494, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_DoubleValue = &__pyx_type_7pyarrow_3lib_DoubleValue;
  __pyx_vtabptr_7pyarrow_3lib_DecimalValue = &__pyx_vtable_7pyarrow_3lib_DecimalValue;
  __pyx_vtable_7pyarrow_3lib_DecimalValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_DecimalValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_DecimalValue) < 0) __PYX_ERR(5, 507, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_DecimalValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_DecimalValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_DecimalValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_DecimalValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_DecimalValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_DecimalValue) < 0) __PYX_ERR(5, 507, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DecimalValue, (PyObject *)&__pyx_type_7pyarrow_3lib_DecimalValue) < 0) __PYX_ERR(5, 507, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_DecimalValue) < 0) __PYX_ERR(5, 507, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_DecimalValue = &__pyx_type_7pyarrow_3lib_DecimalValue;
  __pyx_vtabptr_7pyarrow_3lib_LargeStringValue = &__pyx_vtable_7pyarrow_3lib_LargeStringValue;
  __pyx_vtable_7pyarrow_3lib_LargeStringValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_LargeStringValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_LargeStringValue) < 0) __PYX_ERR(5, 547, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_LargeStringValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_LargeStringValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_LargeStringValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_LargeStringValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_LargeStringValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_LargeStringValue) < 0) __PYX_ERR(5, 547, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_LargeStringValue, (PyObject *)&__pyx_type_7pyarrow_3lib_LargeStringValue) < 0) __PYX_ERR(5, 547, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_LargeStringValue) < 0) __PYX_ERR(5, 547, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_LargeStringValue = &__pyx_type_7pyarrow_3lib_LargeStringValue;
  __pyx_vtabptr_7pyarrow_3lib_BinaryValue = &__pyx_vtable_7pyarrow_3lib_BinaryValue;
  __pyx_vtable_7pyarrow_3lib_BinaryValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_BinaryValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_BinaryValue) < 0) __PYX_ERR(5, 572, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_BinaryValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_BinaryValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_BinaryValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_BinaryValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_BinaryValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_BinaryValue) < 0) __PYX_ERR(5, 572, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BinaryValue, (PyObject *)&__pyx_type_7pyarrow_3lib_BinaryValue) < 0) __PYX_ERR(5, 572, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_BinaryValue) < 0) __PYX_ERR(5, 572, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_BinaryValue = &__pyx_type_7pyarrow_3lib_BinaryValue;
  __pyx_vtabptr_7pyarrow_3lib_LargeBinaryValue = &__pyx_vtable_7pyarrow_3lib_LargeBinaryValue;
  __pyx_vtable_7pyarrow_3lib_LargeBinaryValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_LargeBinaryValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_LargeBinaryValue) < 0) __PYX_ERR(5, 602, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_LargeBinaryValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_LargeBinaryValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_LargeBinaryValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_LargeBinaryValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_LargeBinaryValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_LargeBinaryValue) < 0) __PYX_ERR(5, 602, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_LargeBinaryValue, (PyObject *)&__pyx_type_7pyarrow_3lib_LargeBinaryValue) < 0) __PYX_ERR(5, 602, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_LargeBinaryValue) < 0) __PYX_ERR(5, 602, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_LargeBinaryValue = &__pyx_type_7pyarrow_3lib_LargeBinaryValue;
  __pyx_vtabptr_7pyarrow_3lib_DictionaryValue = &__pyx_vtable_7pyarrow_3lib_DictionaryValue;
  __pyx_vtable_7pyarrow_3lib_DictionaryValue.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ArrayValue;
  __pyx_type_7pyarrow_3lib_DictionaryValue.tp_base = __pyx_ptype_7pyarrow_3lib_ArrayValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_DictionaryValue) < 0) __PYX_ERR(5, 931, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_DictionaryValue.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_DictionaryValue.tp_dictoffset && __pyx_type_7pyarrow_3lib_DictionaryValue.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_DictionaryValue.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_DictionaryValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_DictionaryValue) < 0) __PYX_ERR(5, 931, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DictionaryValue, (PyObject *)&__pyx_type_7pyarrow_3lib_DictionaryValue) < 0) __PYX_ERR(5, 931, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_DictionaryValue) < 0) __PYX_ERR(5, 931, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_DictionaryValue = &__pyx_type_7pyarrow_3lib_DictionaryValue;
  __pyx_vtabptr_7pyarrow_3lib_UInt8Scalar = &__pyx_vtable_7pyarrow_3lib_UInt8Scalar;
  __pyx_vtable_7pyarrow_3lib_UInt8Scalar.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ScalarValue;
  __pyx_type_7pyarrow_3lib_UInt8Scalar.tp_base = __pyx_ptype_7pyarrow_3lib_ScalarValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_UInt8Scalar) < 0) __PYX_ERR(5, 1035, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UInt8Scalar.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UInt8Scalar.tp_dictoffset && __pyx_type_7pyarrow_3lib_UInt8Scalar.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UInt8Scalar.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UInt8Scalar.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UInt8Scalar) < 0) __PYX_ERR(5, 1035, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt8Scalar, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt8Scalar) < 0) __PYX_ERR(5, 1035, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_UInt8Scalar) < 0) __PYX_ERR(5, 1035, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_UInt8Scalar = &__pyx_type_7pyarrow_3lib_UInt8Scalar;
  __pyx_vtabptr_7pyarrow_3lib_Int8Scalar = &__pyx_vtable_7pyarrow_3lib_Int8Scalar;
  __pyx_vtable_7pyarrow_3lib_Int8Scalar.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ScalarValue;
  __pyx_type_7pyarrow_3lib_Int8Scalar.tp_base = __pyx_ptype_7pyarrow_3lib_ScalarValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Int8Scalar) < 0) __PYX_ERR(5, 1048, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Int8Scalar.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Int8Scalar.tp_dictoffset && __pyx_type_7pyarrow_3lib_Int8Scalar.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Int8Scalar.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Int8Scalar.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Int8Scalar) < 0) __PYX_ERR(5, 1048, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int8Scalar, (PyObject *)&__pyx_type_7pyarrow_3lib_Int8Scalar) < 0) __PYX_ERR(5, 1048, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Int8Scalar) < 0) __PYX_ERR(5, 1048, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Int8Scalar = &__pyx_type_7pyarrow_3lib_Int8Scalar;
  __pyx_vtabptr_7pyarrow_3lib_UInt16Scalar = &__pyx_vtable_7pyarrow_3lib_UInt16Scalar;
  __pyx_vtable_7pyarrow_3lib_UInt16Scalar.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ScalarValue;
  __pyx_type_7pyarrow_3lib_UInt16Scalar.tp_base = __pyx_ptype_7pyarrow_3lib_ScalarValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_UInt16Scalar) < 0) __PYX_ERR(5, 1061, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UInt16Scalar.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UInt16Scalar.tp_dictoffset && __pyx_type_7pyarrow_3lib_UInt16Scalar.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UInt16Scalar.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UInt16Scalar.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UInt16Scalar) < 0) __PYX_ERR(5, 1061, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt16Scalar, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt16Scalar) < 0) __PYX_ERR(5, 1061, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_UInt16Scalar) < 0) __PYX_ERR(5, 1061, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_UInt16Scalar = &__pyx_type_7pyarrow_3lib_UInt16Scalar;
  __pyx_vtabptr_7pyarrow_3lib_Int16Scalar = &__pyx_vtable_7pyarrow_3lib_Int16Scalar;
  __pyx_vtable_7pyarrow_3lib_Int16Scalar.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ScalarValue;
  __pyx_type_7pyarrow_3lib_Int16Scalar.tp_base = __pyx_ptype_7pyarrow_3lib_ScalarValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Int16Scalar) < 0) __PYX_ERR(5, 1074, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Int16Scalar.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Int16Scalar.tp_dictoffset && __pyx_type_7pyarrow_3lib_Int16Scalar.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Int16Scalar.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Int16Scalar.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Int16Scalar) < 0) __PYX_ERR(5, 1074, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int16Scalar, (PyObject *)&__pyx_type_7pyarrow_3lib_Int16Scalar) < 0) __PYX_ERR(5, 1074, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Int16Scalar) < 0) __PYX_ERR(5, 1074, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Int16Scalar = &__pyx_type_7pyarrow_3lib_Int16Scalar;
  __pyx_vtabptr_7pyarrow_3lib_UInt32Scalar = &__pyx_vtable_7pyarrow_3lib_UInt32Scalar;
  __pyx_vtable_7pyarrow_3lib_UInt32Scalar.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ScalarValue;
  __pyx_type_7pyarrow_3lib_UInt32Scalar.tp_base = __pyx_ptype_7pyarrow_3lib_ScalarValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_UInt32Scalar) < 0) __PYX_ERR(5, 1087, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UInt32Scalar.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UInt32Scalar.tp_dictoffset && __pyx_type_7pyarrow_3lib_UInt32Scalar.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UInt32Scalar.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UInt32Scalar.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UInt32Scalar) < 0) __PYX_ERR(5, 1087, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt32Scalar, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt32Scalar) < 0) __PYX_ERR(5, 1087, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_UInt32Scalar) < 0) __PYX_ERR(5, 1087, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_UInt32Scalar = &__pyx_type_7pyarrow_3lib_UInt32Scalar;
  __pyx_vtabptr_7pyarrow_3lib_Int32Scalar = &__pyx_vtable_7pyarrow_3lib_Int32Scalar;
  __pyx_vtable_7pyarrow_3lib_Int32Scalar.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ScalarValue;
  __pyx_type_7pyarrow_3lib_Int32Scalar.tp_base = __pyx_ptype_7pyarrow_3lib_ScalarValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Int32Scalar) < 0) __PYX_ERR(5, 1100, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Int32Scalar.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Int32Scalar.tp_dictoffset && __pyx_type_7pyarrow_3lib_Int32Scalar.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Int32Scalar.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Int32Scalar.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Int32Scalar) < 0) __PYX_ERR(5, 1100, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int32Scalar, (PyObject *)&__pyx_type_7pyarrow_3lib_Int32Scalar) < 0) __PYX_ERR(5, 1100, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Int32Scalar) < 0) __PYX_ERR(5, 1100, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Int32Scalar = &__pyx_type_7pyarrow_3lib_Int32Scalar;
  __pyx_vtabptr_7pyarrow_3lib_UInt64Scalar = &__pyx_vtable_7pyarrow_3lib_UInt64Scalar;
  __pyx_vtable_7pyarrow_3lib_UInt64Scalar.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ScalarValue;
  __pyx_type_7pyarrow_3lib_UInt64Scalar.tp_base = __pyx_ptype_7pyarrow_3lib_ScalarValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_UInt64Scalar) < 0) __PYX_ERR(5, 1113, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_UInt64Scalar.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_UInt64Scalar.tp_dictoffset && __pyx_type_7pyarrow_3lib_UInt64Scalar.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_UInt64Scalar.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UInt64Scalar.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UInt64Scalar) < 0) __PYX_ERR(5, 1113, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt64Scalar, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt64Scalar) < 0) __PYX_ERR(5, 1113, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_UInt64Scalar) < 0) __PYX_ERR(5, 1113, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_UInt64Scalar = &__pyx_type_7pyarrow_3lib_UInt64Scalar;
  __pyx_vtabptr_7pyarrow_3lib_Int64Scalar = &__pyx_vtable_7pyarrow_3lib_Int64Scalar;
  __pyx_vtable_7pyarrow_3lib_Int64Scalar.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ScalarValue;
  __pyx_type_7pyarrow_3lib_Int64Scalar.tp_base = __pyx_ptype_7pyarrow_3lib_ScalarValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Int64Scalar) < 0) __PYX_ERR(5, 1126, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Int64Scalar.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Int64Scalar.tp_dictoffset && __pyx_type_7pyarrow_3lib_Int64Scalar.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Int64Scalar.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Int64Scalar.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Int64Scalar) < 0) __PYX_ERR(5, 1126, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int64Scalar, (PyObject *)&__pyx_type_7pyarrow_3lib_Int64Scalar) < 0) __PYX_ERR(5, 1126, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Int64Scalar) < 0) __PYX_ERR(5, 1126, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Int64Scalar = &__pyx_type_7pyarrow_3lib_Int64Scalar;
  __pyx_vtabptr_7pyarrow_3lib_FloatScalar = &__pyx_vtable_7pyarrow_3lib_FloatScalar;
  __pyx_vtable_7pyarrow_3lib_FloatScalar.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ScalarValue;
  __pyx_type_7pyarrow_3lib_FloatScalar.tp_base = __pyx_ptype_7pyarrow_3lib_ScalarValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_FloatScalar) < 0) __PYX_ERR(5, 1139, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_FloatScalar.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_FloatScalar.tp_dictoffset && __pyx_type_7pyarrow_3lib_FloatScalar.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_FloatScalar.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_FloatScalar.tp_dict, __pyx_vtabptr_7pyarrow_3lib_FloatScalar) < 0) __PYX_ERR(5, 1139, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FloatScalar, (PyObject *)&__pyx_type_7pyarrow_3lib_FloatScalar) < 0) __PYX_ERR(5, 1139, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_FloatScalar) < 0) __PYX_ERR(5, 1139, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_FloatScalar = &__pyx_type_7pyarrow_3lib_FloatScalar;
  __pyx_vtabptr_7pyarrow_3lib_DoubleScalar = &__pyx_vtable_7pyarrow_3lib_DoubleScalar;
  __pyx_vtable_7pyarrow_3lib_DoubleScalar.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_ScalarValue;
  __pyx_type_7pyarrow_3lib_DoubleScalar.tp_base = __pyx_ptype_7pyarrow_3lib_ScalarValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_DoubleScalar) < 0) __PYX_ERR(5, 1152, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_DoubleScalar.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_DoubleScalar.tp_dictoffset && __pyx_type_7pyarrow_3lib_DoubleScalar.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_DoubleScalar.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_DoubleScalar.tp_dict, __pyx_vtabptr_7pyarrow_3lib_DoubleScalar) < 0) __PYX_ERR(5, 1152, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DoubleScalar, (PyObject *)&__pyx_type_7pyarrow_3lib_DoubleScalar) < 0) __PYX_ERR(5, 1152, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_DoubleScalar) < 0) __PYX_ERR(5, 1152, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_DoubleScalar = &__pyx_type_7pyarrow_3lib_DoubleScalar;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib__FunctionContext) < 0) __PYX_ERR(1, 366, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib__FunctionContext.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib__FunctionContext.tp_dictoffset && __pyx_type_7pyarrow_3lib__FunctionContext.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib__FunctionContext.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FunctionContext, (PyObject *)&__pyx_type_7pyarrow_3lib__FunctionContext) < 0) __PYX_ERR(1, 366, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib__FunctionContext) < 0) __PYX_ERR(1, 366, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib__FunctionContext = &__pyx_type_7pyarrow_3lib__FunctionContext;
  __pyx_vtabptr_7pyarrow_3lib_Date32Array = &__pyx_vtable_7pyarrow_3lib_Date32Array;
  __pyx_vtable_7pyarrow_3lib_Date32Array.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NumericArray;
  __pyx_type_7pyarrow_3lib_Date32Array.tp_base = __pyx_ptype_7pyarrow_3lib_NumericArray;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Date32Array) < 0) __PYX_ERR(1, 1246, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Date32Array.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Date32Array.tp_dictoffset && __pyx_type_7pyarrow_3lib_Date32Array.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Date32Array.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Date32Array.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Date32Array) < 0) __PYX_ERR(1, 1246, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Date32Array, (PyObject *)&__pyx_type_7pyarrow_3lib_Date32Array) < 0) __PYX_ERR(1, 1246, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_Date32Array.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_Date32Array.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_Date32Array, __pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_Date32Array = &__pyx_type_7pyarrow_3lib_Date32Array;
  __pyx_vtabptr_7pyarrow_3lib_Date64Array = &__pyx_vtable_7pyarrow_3lib_Date64Array;
  __pyx_vtable_7pyarrow_3lib_Date64Array.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NumericArray;
  __pyx_type_7pyarrow_3lib_Date64Array.tp_base = __pyx_ptype_7pyarrow_3lib_NumericArray;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Date64Array) < 0) __PYX_ERR(1, 1252, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Date64Array.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Date64Array.tp_dictoffset && __pyx_type_7pyarrow_3lib_Date64Array.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Date64Array.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Date64Array.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Date64Array) < 0) __PYX_ERR(1, 1252, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Date64Array, (PyObject *)&__pyx_type_7pyarrow_3lib_Date64Array) < 0) __PYX_ERR(1, 1252, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_Date64Array.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_Date64Array.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_Date64Array, __pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_Date64Array = &__pyx_type_7pyarrow_3lib_Date64Array;
  __pyx_vtabptr_7pyarrow_3lib_TimestampArray = &__pyx_vtable_7pyarrow_3lib_TimestampArray;
  __pyx_vtable_7pyarrow_3lib_TimestampArray.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NumericArray;
  __pyx_type_7pyarrow_3lib_TimestampArray.tp_base = __pyx_ptype_7pyarrow_3lib_NumericArray;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_TimestampArray) < 0) __PYX_ERR(1, 1258, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_TimestampArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_TimestampArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_TimestampArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_TimestampArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_TimestampArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_TimestampArray) < 0) __PYX_ERR(1, 1258, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TimestampArray, (PyObject *)&__pyx_type_7pyarrow_3lib_TimestampArray) < 0) __PYX_ERR(1, 1258, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_TimestampArray.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_TimestampArray.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_TimestampArray, __pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_TimestampArray = &__pyx_type_7pyarrow_3lib_TimestampArray;
  __pyx_vtabptr_7pyarrow_3lib_Time32Array = &__pyx_vtable_7pyarrow_3lib_Time32Array;
  __pyx_vtable_7pyarrow_3lib_Time32Array.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NumericArray;
  __pyx_type_7pyarrow_3lib_Time32Array.tp_base = __pyx_ptype_7pyarrow_3lib_NumericArray;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Time32Array) < 0) __PYX_ERR(1, 1264, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Time32Array.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Time32Array.tp_dictoffset && __pyx_type_7pyarrow_3lib_Time32Array.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Time32Array.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Time32Array.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Time32Array) < 0) __PYX_ERR(1, 1264, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Time32Array, (PyObject *)&__pyx_type_7pyarrow_3lib_Time32Array) < 0) __PYX_ERR(1, 1264, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_Time32Array.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_Time32Array.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_Time32Array, __pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_Time32Array = &__pyx_type_7pyarrow_3lib_Time32Array;
  __pyx_vtabptr_7pyarrow_3lib_Time64Array = &__pyx_vtable_7pyarrow_3lib_Time64Array;
  __pyx_vtable_7pyarrow_3lib_Time64Array.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NumericArray;
  __pyx_type_7pyarrow_3lib_Time64Array.tp_base = __pyx_ptype_7pyarrow_3lib_NumericArray;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Time64Array) < 0) __PYX_ERR(1, 1270, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_Time64Array.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Time64Array.tp_dictoffset && __pyx_type_7pyarrow_3lib_Time64Array.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Time64Array.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Time64Array.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Time64Array) < 0) __PYX_ERR(1, 1270, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Time64Array, (PyObject *)&__pyx_type_7pyarrow_3lib_Time64Array) < 0) __PYX_ERR(1, 1270, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_Time64Array.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_Time64Array.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_Time64Array, __pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_Time64Array = &__pyx_type_7pyarrow_3lib_Time64Array;
  __pyx_vtabptr_7pyarrow_3lib_DurationArray = &__pyx_vtable_7pyarrow_3lib_DurationArray;
  __pyx_vtable_7pyarrow_3lib_DurationArray.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NumericArray;
  __pyx_type_7pyarrow_3lib_DurationArray.tp_base = __pyx_ptype_7pyarrow_3lib_NumericArray;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_DurationArray) < 0) __PYX_ERR(1, 1276, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_DurationArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_DurationArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_DurationArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_DurationArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_DurationArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_DurationArray) < 0) __PYX_ERR(1, 1276, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DurationArray, (PyObject *)&__pyx_type_7pyarrow_3lib_DurationArray) < 0) __PYX_ERR(1, 1276, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_DurationArray.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_DurationArray.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_DurationArray, __pyx_base.__pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_DurationArray = &__pyx_type_7pyarrow_3lib_DurationArray;
  __pyx_vtabptr_7pyarrow_3lib_LargeStringArray = &__pyx_vtable_7pyarrow_3lib_LargeStringArray;
  __pyx_vtable_7pyarrow_3lib_LargeStringArray.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_Array;
  __pyx_type_7pyarrow_3lib_LargeStringArray.tp_base = __pyx_ptype_7pyarrow_3lib_Array;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_LargeStringArray) < 0) __PYX_ERR(1, 1686, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_LargeStringArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_LargeStringArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_LargeStringArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_LargeStringArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_LargeStringArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_LargeStringArray) < 0) __PYX_ERR(1, 1686, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_LargeStringArray, (PyObject *)&__pyx_type_7pyarrow_3lib_LargeStringArray) < 0) __PYX_ERR(1, 1686, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_LargeStringArray.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_LargeStringArray.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_LargeStringArray, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_LargeStringArray = &__pyx_type_7pyarrow_3lib_LargeStringArray;
  __pyx_vtabptr_7pyarrow_3lib_LargeBinaryArray = &__pyx_vtable_7pyarrow_3lib_LargeBinaryArray;
  __pyx_vtable_7pyarrow_3lib_LargeBinaryArray.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_Array;
  __pyx_type_7pyarrow_3lib_LargeBinaryArray.tp_base = __pyx_ptype_7pyarrow_3lib_Array;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_LargeBinaryArray) < 0) __PYX_ERR(1, 1724, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_LargeBinaryArray.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_LargeBinaryArray.tp_dictoffset && __pyx_type_7pyarrow_3lib_LargeBinaryArray.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_LargeBinaryArray.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_LargeBinaryArray.tp_dict, __pyx_vtabptr_7pyarrow_3lib_LargeBinaryArray) < 0) __PYX_ERR(1, 1724, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_LargeBinaryArray, (PyObject *)&__pyx_type_7pyarrow_3lib_LargeBinaryArray) < 0) __PYX_ERR(1, 1724, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_LargeBinaryArray.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_LargeBinaryArray.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_LargeBinaryArray, __pyx_base.__weakref__);
  __pyx_ptype_7pyarrow_3lib_LargeBinaryArray = &__pyx_type_7pyarrow_3lib_LargeBinaryArray;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_StringBuilder) < 0) __PYX_ERR(12, 23, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_StringBuilder.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_StringBuilder.tp_dictoffset && __pyx_type_7pyarrow_3lib_StringBuilder.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_StringBuilder.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_StringBuilder, (PyObject *)&__pyx_type_7pyarrow_3lib_StringBuilder) < 0) __PYX_ERR(12, 23, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_StringBuilder) < 0) __PYX_ERR(12, 23, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_StringBuilder = &__pyx_type_7pyarrow_3lib_StringBuilder;
  __pyx_vtabptr_7pyarrow_3lib_PythonFile = &__pyx_vtable_7pyarrow_3lib_PythonFile;
  __pyx_vtable_7pyarrow_3lib_PythonFile.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NativeFile;
  __pyx_type_7pyarrow_3lib_PythonFile.tp_base = __pyx_ptype_7pyarrow_3lib_NativeFile;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_PythonFile) < 0) __PYX_ERR(7, 619, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_PythonFile.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_PythonFile.tp_dictoffset && __pyx_type_7pyarrow_3lib_PythonFile.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_PythonFile.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_PythonFile.tp_dict, __pyx_vtabptr_7pyarrow_3lib_PythonFile) < 0) __PYX_ERR(7, 619, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_PythonFile, (PyObject *)&__pyx_type_7pyarrow_3lib_PythonFile) < 0) __PYX_ERR(7, 619, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_PythonFile.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_PythonFile.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_PythonFile, __pyx_base.__weakref__);
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_PythonFile) < 0) __PYX_ERR(7, 619, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_PythonFile = &__pyx_type_7pyarrow_3lib_PythonFile;
  __pyx_vtabptr_7pyarrow_3lib_MemoryMappedFile = &__pyx_vtable_7pyarrow_3lib_MemoryMappedFile;
  __pyx_vtable_7pyarrow_3lib_MemoryMappedFile.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NativeFile;
  __pyx_type_7pyarrow_3lib_MemoryMappedFile.tp_base = __pyx_ptype_7pyarrow_3lib_NativeFile;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_MemoryMappedFile) < 0) __PYX_ERR(7, 701, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_MemoryMappedFile.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_MemoryMappedFile.tp_dictoffset && __pyx_type_7pyarrow_3lib_MemoryMappedFile.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_MemoryMappedFile.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_MemoryMappedFile.tp_dict, __pyx_vtabptr_7pyarrow_3lib_MemoryMappedFile) < 0) __PYX_ERR(7, 701, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MemoryMappedFile, (PyObject *)&__pyx_type_7pyarrow_3lib_MemoryMappedFile) < 0) __PYX_ERR(7, 701, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_MemoryMappedFile.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_MemoryMappedFile.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_MemoryMappedFile, __pyx_base.__weakref__);
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_MemoryMappedFile) < 0) __PYX_ERR(7, 701, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_MemoryMappedFile = &__pyx_type_7pyarrow_3lib_MemoryMappedFile;
  __pyx_vtabptr_7pyarrow_3lib_OSFile = &__pyx_vtable_7pyarrow_3lib_OSFile;
  __pyx_vtable_7pyarrow_3lib_OSFile.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NativeFile;
  __pyx_vtable_7pyarrow_3lib_OSFile._open_readable = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib_OSFile *, std::string,  arrow::MemoryPool *))__pyx_f_7pyarrow_3lib_6OSFile__open_readable;
  __pyx_vtable_7pyarrow_3lib_OSFile._open_writable = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib_OSFile *, std::string))__pyx_f_7pyarrow_3lib_6OSFile__open_writable;
  __pyx_type_7pyarrow_3lib_OSFile.tp_base = __pyx_ptype_7pyarrow_3lib_NativeFile;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_OSFile) < 0) __PYX_ERR(7, 812, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_OSFile.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_OSFile.tp_dictoffset && __pyx_type_7pyarrow_3lib_OSFile.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_OSFile.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_OSFile.tp_dict, __pyx_vtabptr_7pyarrow_3lib_OSFile) < 0) __PYX_ERR(7, 812, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_OSFile, (PyObject *)&__pyx_type_7pyarrow_3lib_OSFile) < 0) __PYX_ERR(7, 812, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_OSFile.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_OSFile.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_OSFile, __pyx_base.__weakref__);
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_OSFile) < 0) __PYX_ERR(7, 812, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_OSFile = &__pyx_type_7pyarrow_3lib_OSFile;
  __pyx_vtabptr_7pyarrow_3lib_FixedSizeBufferWriter = &__pyx_vtable_7pyarrow_3lib_FixedSizeBufferWriter;
  __pyx_vtable_7pyarrow_3lib_FixedSizeBufferWriter.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NativeFile;
  __pyx_type_7pyarrow_3lib_FixedSizeBufferWriter.tp_base = __pyx_ptype_7pyarrow_3lib_NativeFile;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_FixedSizeBufferWriter) < 0) __PYX_ERR(7, 853, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_FixedSizeBufferWriter.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_FixedSizeBufferWriter.tp_dictoffset && __pyx_type_7pyarrow_3lib_FixedSizeBufferWriter.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_FixedSizeBufferWriter.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_FixedSizeBufferWriter.tp_dict, __pyx_vtabptr_7pyarrow_3lib_FixedSizeBufferWriter) < 0) __PYX_ERR(7, 853, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FixedSizeBufferWriter, (PyObject *)&__pyx_type_7pyarrow_3lib_FixedSizeBufferWriter) < 0) __PYX_ERR(7, 853, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_FixedSizeBufferWriter.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_FixedSizeBufferWriter.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter, __pyx_base.__weakref__);
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_FixedSizeBufferWriter) < 0) __PYX_ERR(7, 853, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_FixedSizeBufferWriter = &__pyx_type_7pyarrow_3lib_FixedSizeBufferWriter;
  __pyx_vtabptr_7pyarrow_3lib_BufferOutputStream = &__pyx_vtable_7pyarrow_3lib_BufferOutputStream;
  __pyx_vtable_7pyarrow_3lib_BufferOutputStream.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NativeFile;
  __pyx_type_7pyarrow_3lib_BufferOutputStream.tp_base = __pyx_ptype_7pyarrow_3lib_NativeFile;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_BufferOutputStream) < 0) __PYX_ERR(7, 1131, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_BufferOutputStream.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_BufferOutputStream.tp_dictoffset && __pyx_type_7pyarrow_3lib_BufferOutputStream.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_BufferOutputStream.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_BufferOutputStream.tp_dict, __pyx_vtabptr_7pyarrow_3lib_BufferOutputStream) < 0) __PYX_ERR(7, 1131, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BufferOutputStream, (PyObject *)&__pyx_type_7pyarrow_3lib_BufferOutputStream) < 0) __PYX_ERR(7, 1131, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_BufferOutputStream.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_BufferOutputStream.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_BufferOutputStream, __pyx_base.__weakref__);
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_BufferOutputStream) < 0) __PYX_ERR(7, 1131, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_BufferOutputStream = &__pyx_type_7pyarrow_3lib_BufferOutputStream;
  __pyx_vtabptr_7pyarrow_3lib_MockOutputStream = &__pyx_vtable_7pyarrow_3lib_MockOutputStream;
  __pyx_vtable_7pyarrow_3lib_MockOutputStream.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NativeFile;
  __pyx_type_7pyarrow_3lib_MockOutputStream.tp_base = __pyx_ptype_7pyarrow_3lib_NativeFile;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_MockOutputStream) < 0) __PYX_ERR(7, 1155, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_MockOutputStream.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_MockOutputStream.tp_dictoffset && __pyx_type_7pyarrow_3lib_MockOutputStream.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_MockOutputStream.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_MockOutputStream.tp_dict, __pyx_vtabptr_7pyarrow_3lib_MockOutputStream) < 0) __PYX_ERR(7, 1155, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MockOutputStream, (PyObject *)&__pyx_type_7pyarrow_3lib_MockOutputStream) < 0) __PYX_ERR(7, 1155, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_MockOutputStream.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_MockOutputStream.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_MockOutputStream, __pyx_base.__weakref__);
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_MockOutputStream) < 0) __PYX_ERR(7, 1155, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_MockOutputStream = &__pyx_type_7pyarrow_3lib_MockOutputStream;
  __pyx_vtabptr_7pyarrow_3lib_BufferReader = &__pyx_vtable_7pyarrow_3lib_BufferReader;
  __pyx_vtable_7pyarrow_3lib_BufferReader.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NativeFile;
  __pyx_type_7pyarrow_3lib_BufferReader.tp_base = __pyx_ptype_7pyarrow_3lib_NativeFile;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_BufferReader) < 0) __PYX_ERR(7, 1166, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_BufferReader.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_BufferReader.tp_dictoffset && __pyx_type_7pyarrow_3lib_BufferReader.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_BufferReader.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_BufferReader.tp_dict, __pyx_vtabptr_7pyarrow_3lib_BufferReader) < 0) __PYX_ERR(7, 1166, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BufferReader, (PyObject *)&__pyx_type_7pyarrow_3lib_BufferReader) < 0) __PYX_ERR(7, 1166, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_BufferReader.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_BufferReader.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_BufferReader, __pyx_base.__weakref__);
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_BufferReader) < 0) __PYX_ERR(7, 1166, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_BufferReader = &__pyx_type_7pyarrow_3lib_BufferReader;
  __pyx_vtabptr_7pyarrow_3lib_HadoopFileSystem = &__pyx_vtable_7pyarrow_3lib_HadoopFileSystem;
  __pyx_vtable_7pyarrow_3lib_HadoopFileSystem._ensure_client = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *))__pyx_f_7pyarrow_3lib_16HadoopFileSystem__ensure_client;
  __pyx_vtable_7pyarrow_3lib_HadoopFileSystem._path_info = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib_HadoopFileSystem *, PyObject *, arrow::io::HdfsPathInfo *))__pyx_f_7pyarrow_3lib_16HadoopFileSystem__path_info;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_HadoopFileSystem) < 0) __PYX_ERR(2, 56, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_HadoopFileSystem.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_HadoopFileSystem.tp_dictoffset && __pyx_type_7pyarrow_3lib_HadoopFileSystem.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_HadoopFileSystem.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_HadoopFileSystem.tp_dict, __pyx_vtabptr_7pyarrow_3lib_HadoopFileSystem) < 0) __PYX_ERR(2, 56, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_HadoopFileSystem, (PyObject *)&__pyx_type_7pyarrow_3lib_HadoopFileSystem) < 0) __PYX_ERR(2, 56, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_HadoopFileSystem) < 0) __PYX_ERR(2, 56, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_HadoopFileSystem = &__pyx_type_7pyarrow_3lib_HadoopFileSystem;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib__HdfsFileNanny) < 0) __PYX_ERR(2, 466, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib__HdfsFileNanny.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib__HdfsFileNanny.tp_dictoffset && __pyx_type_7pyarrow_3lib__HdfsFileNanny.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib__HdfsFileNanny.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_HdfsFileNanny, (PyObject *)&__pyx_type_7pyarrow_3lib__HdfsFileNanny) < 0) __PYX_ERR(2, 466, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib__HdfsFileNanny) < 0) __PYX_ERR(2, 466, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib__HdfsFileNanny = &__pyx_type_7pyarrow_3lib__HdfsFileNanny;
  __pyx_vtabptr_7pyarrow_3lib_HdfsFile = &__pyx_vtable_7pyarrow_3lib_HdfsFile;
  __pyx_vtable_7pyarrow_3lib_HdfsFile.__pyx_base = *__pyx_vtabptr_7pyarrow_3lib_NativeFile;
  __pyx_type_7pyarrow_3lib_HdfsFile.tp_base = __pyx_ptype_7pyarrow_3lib_NativeFile;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_HdfsFile) < 0) __PYX_ERR(2, 485, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_HdfsFile.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_HdfsFile.tp_dictoffset && __pyx_type_7pyarrow_3lib_HdfsFile.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_HdfsFile.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_HdfsFile.tp_dict, __pyx_vtabptr_7pyarrow_3lib_HdfsFile) < 0) __PYX_ERR(2, 485, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_HdfsFile, (PyObject *)&__pyx_type_7pyarrow_3lib_HdfsFile) < 0) __PYX_ERR(2, 485, __pyx_L1_error)
  if (__pyx_type_7pyarrow_3lib_HdfsFile.tp_weaklistoffset == 0) __pyx_type_7pyarrow_3lib_HdfsFile.tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_3lib_HdfsFile, __pyx_base.__weakref__);
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_HdfsFile) < 0) __PYX_ERR(2, 485, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_HdfsFile = &__pyx_type_7pyarrow_3lib_HdfsFile;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_MessageReader) < 0) __PYX_ERR(8, 122, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_MessageReader.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_MessageReader.tp_dictoffset && __pyx_type_7pyarrow_3lib_MessageReader.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_MessageReader.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MessageReader, (PyObject *)&__pyx_type_7pyarrow_3lib_MessageReader) < 0) __PYX_ERR(8, 122, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_MessageReader) < 0) __PYX_ERR(8, 122, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_MessageReader = &__pyx_type_7pyarrow_3lib_MessageReader;
  __pyx_type_7pyarrow_3lib__RecordBatchStreamWriter.tp_base = __pyx_ptype_7pyarrow_3lib__CRecordBatchWriter;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib__RecordBatchStreamWriter) < 0) __PYX_ERR(8, 254, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib__RecordBatchStreamWriter.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib__RecordBatchStreamWriter.tp_dictoffset && __pyx_type_7pyarrow_3lib__RecordBatchStreamWriter.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib__RecordBatchStreamWriter.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_RecordBatchStreamWriter, (PyObject *)&__pyx_type_7pyarrow_3lib__RecordBatchStreamWriter) < 0) __PYX_ERR(8, 254, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib__RecordBatchStreamWriter) < 0) __PYX_ERR(8, 254, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib__RecordBatchStreamWriter = &__pyx_type_7pyarrow_3lib__RecordBatchStreamWriter;
  __pyx_type_7pyarrow_3lib__RecordBatchStreamReader.tp_base = __pyx_ptype_7pyarrow_3lib__CRecordBatchReader;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib__RecordBatchStreamReader) < 0) __PYX_ERR(8, 339, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib__RecordBatchStreamReader.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib__RecordBatchStreamReader.tp_dictoffset && __pyx_type_7pyarrow_3lib__RecordBatchStreamReader.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib__RecordBatchStreamReader.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_RecordBatchStreamReader, (PyObject *)&__pyx_type_7pyarrow_3lib__RecordBatchStreamReader) < 0) __PYX_ERR(8, 339, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib__RecordBatchStreamReader) < 0) __PYX_ERR(8, 339, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib__RecordBatchStreamReader = &__pyx_type_7pyarrow_3lib__RecordBatchStreamReader;
  __pyx_type_7pyarrow_3lib__RecordBatchFileWriter.tp_base = __pyx_ptype_7pyarrow_3lib__RecordBatchStreamWriter;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib__RecordBatchFileWriter) < 0) __PYX_ERR(8, 358, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib__RecordBatchFileWriter.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib__RecordBatchFileWriter.tp_dictoffset && __pyx_type_7pyarrow_3lib__RecordBatchFileWriter.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib__RecordBatchFileWriter.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_RecordBatchFileWriter, (PyObject *)&__pyx_type_7pyarrow_3lib__RecordBatchFileWriter) < 0) __PYX_ERR(8, 358, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib__RecordBatchFileWriter) < 0) __PYX_ERR(8, 358, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib__RecordBatchFileWriter = &__pyx_type_7pyarrow_3lib__RecordBatchFileWriter;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib__RecordBatchFileReader) < 0) __PYX_ERR(8, 369, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib__RecordBatchFileReader.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib__RecordBatchFileReader.tp_dictoffset && __pyx_type_7pyarrow_3lib__RecordBatchFileReader.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib__RecordBatchFileReader.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_RecordBatchFileReader, (PyObject *)&__pyx_type_7pyarrow_3lib__RecordBatchFileReader) < 0) __PYX_ERR(8, 369, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib__RecordBatchFileReader) < 0) __PYX_ERR(8, 369, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib__RecordBatchFileReader = &__pyx_type_7pyarrow_3lib__RecordBatchFileReader;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_FeatherWriter) < 0) __PYX_ERR(15, 26, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_FeatherWriter.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_FeatherWriter.tp_dictoffset && __pyx_type_7pyarrow_3lib_FeatherWriter.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_FeatherWriter.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FeatherWriter, (PyObject *)&__pyx_type_7pyarrow_3lib_FeatherWriter) < 0) __PYX_ERR(15, 26, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_FeatherWriter) < 0) __PYX_ERR(15, 26, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_FeatherWriter = &__pyx_type_7pyarrow_3lib_FeatherWriter;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_FeatherReader) < 0) __PYX_ERR(15, 71, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_FeatherReader.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_FeatherReader.tp_dictoffset && __pyx_type_7pyarrow_3lib_FeatherReader.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_FeatherReader.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FeatherReader, (PyObject *)&__pyx_type_7pyarrow_3lib_FeatherReader) < 0) __PYX_ERR(15, 71, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_FeatherReader) < 0) __PYX_ERR(15, 71, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_FeatherReader = &__pyx_type_7pyarrow_3lib_FeatherReader;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_SerializationContext) < 0) __PYX_ERR(16, 48, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_SerializationContext.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_SerializationContext.tp_dictoffset && __pyx_type_7pyarrow_3lib_SerializationContext.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_SerializationContext.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SerializationContext, (PyObject *)&__pyx_type_7pyarrow_3lib_SerializationContext) < 0) __PYX_ERR(16, 48, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_SerializationContext) < 0) __PYX_ERR(16, 48, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_SerializationContext = &__pyx_type_7pyarrow_3lib_SerializationContext;
  __pyx_vtabptr_7pyarrow_3lib_SerializedPyObject = &__pyx_vtable_7pyarrow_3lib_SerializedPyObject;
  __pyx_vtable_7pyarrow_3lib_SerializedPyObject._write_to = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib_SerializedPyObject *,  arrow::io::OutputStream *))__pyx_f_7pyarrow_3lib_18SerializedPyObject__write_to;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_SerializedPyObject) < 0) __PYX_ERR(16, 235, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib_SerializedPyObject.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_SerializedPyObject.tp_dictoffset && __pyx_type_7pyarrow_3lib_SerializedPyObject.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_SerializedPyObject.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_SerializedPyObject.tp_dict, __pyx_vtabptr_7pyarrow_3lib_SerializedPyObject) < 0) __PYX_ERR(16, 235, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SerializedPyObject, (PyObject *)&__pyx_type_7pyarrow_3lib_SerializedPyObject) < 0) __PYX_ERR(16, 235, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_SerializedPyObject) < 0) __PYX_ERR(16, 235, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_SerializedPyObject = &__pyx_type_7pyarrow_3lib_SerializedPyObject;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct____iter__) < 0) __PYX_ERR(4, 376, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct____iter__.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct____iter__.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct____iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct____iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct____iter__ = &__pyx_type_7pyarrow_3lib___pyx_scope_struct____iter__;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_1___iter__) < 0) __PYX_ERR(4, 433, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_1___iter__.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_1___iter__.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_1___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_1___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_1___iter__ = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_1___iter__;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_2___iter__) < 0) __PYX_ERR(4, 931, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_2___iter__.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_2___iter__.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_2___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_2___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_2___iter__ = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_2___iter__;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions) < 0) __PYX_ERR(5, 347, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_3__datetime_conversion_functions;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions) < 0) __PYX_ERR(5, 423, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_4__timedelta_conversion_functions;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_5___iter__) < 0) __PYX_ERR(5, 649, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_5___iter__.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_5___iter__.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_5___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_5___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_5___iter__ = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_5___iter__;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_6___iter__) < 0) __PYX_ERR(5, 700, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_6___iter__.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_6___iter__.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_6___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_6___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_6___iter__ = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_6___iter__;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_7___iter__) < 0) __PYX_ERR(5, 751, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_7___iter__.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_7___iter__.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_7___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_7___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_7___iter__ = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_7___iter__;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_8___iter__) < 0) __PYX_ERR(5, 806, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_8___iter__.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_8___iter__.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_8___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_8___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_8___iter__ = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_8___iter__;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_9___iter__) < 0) __PYX_ERR(1, 837, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_9___iter__.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_9___iter__.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_9___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_9___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_9___iter__ = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_9___iter__;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_10___iter__) < 0) __PYX_ERR(6, 131, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_10___iter__.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_10___iter__.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_10___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_10___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_10___iter__ = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_10___iter__;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_11_iterchunks) < 0) __PYX_ERR(6, 362, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_11_iterchunks.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_11_iterchunks.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_11_iterchunks.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_11_iterchunks.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_11_iterchunks = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_11_iterchunks;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_12_itercolumns) < 0) __PYX_ERR(6, 1459, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_12_itercolumns.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_12_itercolumns.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_12_itercolumns.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_12_itercolumns.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_12_itercolumns = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_12_itercolumns;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_13___get__) < 0) __PYX_ERR(13, 335, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_13___get__.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_13___get__.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_13___get__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_13___get__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_13___get__ = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_13___get__;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_14_genexpr) < 0) __PYX_ERR(13, 336, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_14_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_14_genexpr.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_14_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_14_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_14_genexpr = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_14_genexpr;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_15___get__) < 0) __PYX_ERR(13, 517, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_15___get__.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_15___get__.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_15___get__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_15___get__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_15___get__ = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_15___get__;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_16_genexpr) < 0) __PYX_ERR(13, 518, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_16_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_16_genexpr.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_16_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_16_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_16_genexpr = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_16_genexpr;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_17_download) < 0) __PYX_ERR(7, 477, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_17_download.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_17_download.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_17_download.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_17_download.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_17_download = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_17_download;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_18_upload) < 0) __PYX_ERR(7, 565, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_18_upload.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_18_upload.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_18_upload.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_18_upload.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_18_upload = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_18_upload;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_19___iter__) < 0) __PYX_ERR(8, 152, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_19___iter__.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_19___iter__.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_19___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_19___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_19___iter__ = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_19___iter__;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_20___iter__) < 0) __PYX_ERR(8, 298, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_20___iter__.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_20___iter__.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_20___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_20___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_20___iter__ = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_20___iter__;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple) < 0) __PYX_ERR(16, 25, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_21_is_named_tuple;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_22_genexpr) < 0) __PYX_ERR(16, 33, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_22_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_22_genexpr.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_22_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_22_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_22_genexpr = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_22_genexpr;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_import_code(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  /*--- Type import code ---*/
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", 
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyTypeObject),
  #else
  sizeof(PyHeapTypeObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(21, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(22, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(23, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("datetime"); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_7cpython_8datetime_date = __Pyx_ImportType(__pyx_t_1, "datetime", "date", sizeof(PyDateTime_Date), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_7cpython_8datetime_date) __PYX_ERR(19, 9, __pyx_L1_error)
  __pyx_ptype_7cpython_8datetime_time = __Pyx_ImportType(__pyx_t_1, "datetime", "time", sizeof(PyDateTime_Time), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_7cpython_8datetime_time) __PYX_ERR(19, 12, __pyx_L1_error)
  __pyx_ptype_7cpython_8datetime_datetime = __Pyx_ImportType(__pyx_t_1, "datetime", "datetime", sizeof(PyDateTime_DateTime), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_7cpython_8datetime_datetime) __PYX_ERR(19, 15, __pyx_L1_error)
  __pyx_ptype_7cpython_8datetime_timedelta = __Pyx_ImportType(__pyx_t_1, "datetime", "timedelta", sizeof(PyDateTime_Delta), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_7cpython_8datetime_timedelta) __PYX_ERR(19, 18, __pyx_L1_error)
  __pyx_ptype_7cpython_8datetime_tzinfo = __Pyx_ImportType(__pyx_t_1, "datetime", "tzinfo", sizeof(PyDateTime_TZInfo), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_7cpython_8datetime_tzinfo) __PYX_ERR(19, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_variable_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  /*--- Variable import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  /*--- Function import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}


#if PY_MAJOR_VERSION < 3
#ifdef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC void
#else
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#endif
#else
#ifdef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC PyObject *
#else
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#endif
#endif


#if PY_MAJOR_VERSION < 3
__Pyx_PyMODINIT_FUNC initlib(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC initlib(void)
#else
__Pyx_PyMODINIT_FUNC PyInit_lib(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit_lib(void)
#if CYTHON_PEP489_MULTI_PHASE_INIT
{
  return PyModuleDef_Init(&__pyx_moduledef);
}
static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
    #if PY_VERSION_HEX >= 0x030700A1
    static PY_INT64_T main_interpreter_id = -1;
    PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
    if (main_interpreter_id == -1) {
        main_interpreter_id = current_id;
        return (unlikely(current_id == -1)) ? -1 : 0;
    } else if (unlikely(main_interpreter_id != current_id))
    #else
    static PyInterpreterState *main_interpreter = NULL;
    PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
    if (!main_interpreter) {
        main_interpreter = current_interpreter;
    } else if (unlikely(main_interpreter != current_interpreter))
    #endif
    {
        PyErr_SetString(
            PyExc_ImportError,
            "Interpreter change detected - this module can only be loaded into one interpreter per process.");
        return -1;
    }
    return 0;
}
static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
    PyObject *value = PyObject_GetAttrString(spec, from_name);
    int result = 0;
    if (likely(value)) {
        if (allow_none || value != Py_None) {
            result = PyDict_SetItemString(moddict, to_name, value);
        }
        Py_DECREF(value);
    } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Clear();
    } else {
        result = -1;
    }
    return result;
}
static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
    PyObject *module = NULL, *moddict, *modname;
    if (__Pyx_check_single_interpreter())
        return NULL;
    if (__pyx_m)
        return __Pyx_NewRef(__pyx_m);
    modname = PyObject_GetAttrString(spec, "name");
    if (unlikely(!modname)) goto bad;
    module = PyModule_NewObject(modname);
    Py_DECREF(modname);
    if (unlikely(!module)) goto bad;
    moddict = PyModule_GetDict(module);
    if (unlikely(!moddict)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
    return module;
bad:
    Py_XDECREF(module);
    return NULL;
}


static CYTHON_SMALL_CODE int __pyx_pymod_exec_lib(PyObject *__pyx_pyinit_module)
#endif
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  __Pyx_RefNannyDeclarations
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  if (__pyx_m) {
    if (__pyx_m == __pyx_pyinit_module) return 0;
    PyErr_SetString(PyExc_RuntimeError, "Module 'lib' has already been imported. Re-initialisation is not supported.");
    return -1;
  }
  #elif PY_MAJOR_VERSION >= 3
  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  #endif
  #if CYTHON_REFNANNY
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
if (!__Pyx_RefNanny) {
  PyErr_Clear();
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
  if (!__Pyx_RefNanny)
      Py_FatalError("failed to import 'refnanny' module");
}
#endif
  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_lib(void)", 0);
  if (__Pyx_check_binary_version() < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  #ifdef __Pxy_PyFrame_Initialize_Offsets
  __Pxy_PyFrame_Initialize_Offsets();
  #endif
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(9, 1, __pyx_L1_error)
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(9, 1, __pyx_L1_error)
  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(9, 1, __pyx_L1_error)
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init() < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init() < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_AsyncGen_USED
  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __pyx_m = __pyx_pyinit_module;
  Py_INCREF(__pyx_m);
  #else
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("lib", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) __PYX_ERR(9, 1, __pyx_L1_error)
  #endif
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(9, 1, __pyx_L1_error)
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(9, 1, __pyx_L1_error)
  Py_INCREF(__pyx_b);
  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(9, 1, __pyx_L1_error)
  Py_INCREF(__pyx_cython_runtime);
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(9, 1, __pyx_L1_error);
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitGlobals() < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  #endif
  if (__pyx_module_is_main_pyarrow__lib) {
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(9, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "pyarrow.lib")) {
      if (unlikely(PyDict_SetItemString(modules, "pyarrow.lib", __pyx_m) < 0)) __PYX_ERR(9, 1, __pyx_L1_error)
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error;
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error;
  /*--- Global type/function init code ---*/
  (void)__Pyx_modinit_global_init_code();
  (void)__Pyx_modinit_variable_export_code();
  if (unlikely(__Pyx_modinit_function_export_code() != 0)) goto __pyx_L1_error;
  if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
  if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
  (void)__Pyx_modinit_variable_import_code();
  (void)__Pyx_modinit_function_import_code();
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  #endif

  /* "pyarrow/lib.pyx":24
 * from __future__ import absolute_import
 * 
 * import datetime             # <<<<<<<<<<<<<<
 * import decimal as _pydecimal
 * import json
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_datetime, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_datetime, __pyx_t_1) < 0) __PYX_ERR(9, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":25
 * 
 * import datetime
 * import decimal as _pydecimal             # <<<<<<<<<<<<<<
 * import json
 * import numpy as np
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_decimal, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pydecimal, __pyx_t_1) < 0) __PYX_ERR(9, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":26
 * import datetime
 * import decimal as _pydecimal
 * import json             # <<<<<<<<<<<<<<
 * import numpy as np
 * import os
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_json, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_json, __pyx_t_1) < 0) __PYX_ERR(9, 26, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":27
 * import decimal as _pydecimal
 * import json
 * import numpy as np             # <<<<<<<<<<<<<<
 * import os
 * import six
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(9, 27, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":28
 * import json
 * import numpy as np
 * import os             # <<<<<<<<<<<<<<
 * import six
 * 
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) __PYX_ERR(9, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":29
 * import numpy as np
 * import os
 * import six             # <<<<<<<<<<<<<<
 * 
 * from pyarrow.compat import frombytes, tobytes, ordered_dict
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_six, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_six, __pyx_t_1) < 0) __PYX_ERR(9, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":31
 * import six
 * 
 * from pyarrow.compat import frombytes, tobytes, ordered_dict             # <<<<<<<<<<<<<<
 * 
 * from cython.operator cimport dereference as deref
 */
  __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_frombytes);
  __Pyx_GIVEREF(__pyx_n_s_frombytes);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_frombytes);
  __Pyx_INCREF(__pyx_n_s_tobytes);
  __Pyx_GIVEREF(__pyx_n_s_tobytes);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_tobytes);
  __Pyx_INCREF(__pyx_n_s_ordered_dict);
  __Pyx_GIVEREF(__pyx_n_s_ordered_dict);
  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_ordered_dict);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_pyarrow_compat, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_frombytes, __pyx_t_1) < 0) __PYX_ERR(9, 31, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tobytes, __pyx_t_1) < 0) __PYX_ERR(9, 31, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ordered_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ordered_dict, __pyx_t_1) < 0) __PYX_ERR(9, 31, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/lib.pyx":40
 * 
 * # Initialize NumPy C API
 * arrow_init_numpy()             # <<<<<<<<<<<<<<
 * # Initialize PyArrow C++ API
 * # (used from some of our C++ code, see e.g. ARROW-5260)
 */
  __pyx_t_3 = arrow_init_numpy(); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(9, 40, __pyx_L1_error)

  /* "pyarrow/lib.pyx":43
 * # Initialize PyArrow C++ API
 * # (used from some of our C++ code, see e.g. ARROW-5260)
 * import_pyarrow()             # <<<<<<<<<<<<<<
 * set_numpy_nan(np.nan)
 * 
 */
  __pyx_t_3 = arrow::py::import_pyarrow(); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(9, 43, __pyx_L1_error)

  /* "pyarrow/lib.pyx":44
 * # (used from some of our C++ code, see e.g. ARROW-5260)
 * import_pyarrow()
 * set_numpy_nan(np.nan)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_nan); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  arrow::py::set_numpy_nan(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":47
 * 
 * 
 * def cpu_count():             # <<<<<<<<<<<<<<
 *     """
 *     Return the number of threads to use in parallel operations.
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_1cpu_count, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_cpu_count, __pyx_t_1) < 0) __PYX_ERR(9, 47, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":60
 * 
 * 
 * def set_cpu_count(int count):             # <<<<<<<<<<<<<<
 *     """
 *     Set the number of threads to use in parallel operations.
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_3set_cpu_count, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_cpu_count, __pyx_t_1) < 0) __PYX_ERR(9, 60, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":69
 * 
 * 
 * Type_NA = _Type_NA             # <<<<<<<<<<<<<<
 * Type_BOOL = _Type_BOOL
 * Type_UINT8 = _Type_UINT8
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::NA); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_NA, __pyx_t_1) < 0) __PYX_ERR(9, 69, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":70
 * 
 * Type_NA = _Type_NA
 * Type_BOOL = _Type_BOOL             # <<<<<<<<<<<<<<
 * Type_UINT8 = _Type_UINT8
 * Type_INT8 = _Type_INT8
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::BOOL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_BOOL, __pyx_t_1) < 0) __PYX_ERR(9, 70, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":71
 * Type_NA = _Type_NA
 * Type_BOOL = _Type_BOOL
 * Type_UINT8 = _Type_UINT8             # <<<<<<<<<<<<<<
 * Type_INT8 = _Type_INT8
 * Type_UINT16 = _Type_UINT16
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT8); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_UINT8, __pyx_t_1) < 0) __PYX_ERR(9, 71, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":72
 * Type_BOOL = _Type_BOOL
 * Type_UINT8 = _Type_UINT8
 * Type_INT8 = _Type_INT8             # <<<<<<<<<<<<<<
 * Type_UINT16 = _Type_UINT16
 * Type_INT16 = _Type_INT16
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT8); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_INT8, __pyx_t_1) < 0) __PYX_ERR(9, 72, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":73
 * Type_UINT8 = _Type_UINT8
 * Type_INT8 = _Type_INT8
 * Type_UINT16 = _Type_UINT16             # <<<<<<<<<<<<<<
 * Type_INT16 = _Type_INT16
 * Type_UINT32 = _Type_UINT32
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT16); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 73, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_UINT16, __pyx_t_1) < 0) __PYX_ERR(9, 73, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":74
 * Type_INT8 = _Type_INT8
 * Type_UINT16 = _Type_UINT16
 * Type_INT16 = _Type_INT16             # <<<<<<<<<<<<<<
 * Type_UINT32 = _Type_UINT32
 * Type_INT32 = _Type_INT32
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT16); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 74, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_INT16, __pyx_t_1) < 0) __PYX_ERR(9, 74, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":75
 * Type_UINT16 = _Type_UINT16
 * Type_INT16 = _Type_INT16
 * Type_UINT32 = _Type_UINT32             # <<<<<<<<<<<<<<
 * Type_INT32 = _Type_INT32
 * Type_UINT64 = _Type_UINT64
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT32); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_UINT32, __pyx_t_1) < 0) __PYX_ERR(9, 75, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":76
 * Type_INT16 = _Type_INT16
 * Type_UINT32 = _Type_UINT32
 * Type_INT32 = _Type_INT32             # <<<<<<<<<<<<<<
 * Type_UINT64 = _Type_UINT64
 * Type_INT64 = _Type_INT64
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT32); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_INT32, __pyx_t_1) < 0) __PYX_ERR(9, 76, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":77
 * Type_UINT32 = _Type_UINT32
 * Type_INT32 = _Type_INT32
 * Type_UINT64 = _Type_UINT64             # <<<<<<<<<<<<<<
 * Type_INT64 = _Type_INT64
 * Type_HALF_FLOAT = _Type_HALF_FLOAT
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT64); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_UINT64, __pyx_t_1) < 0) __PYX_ERR(9, 77, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":78
 * Type_INT32 = _Type_INT32
 * Type_UINT64 = _Type_UINT64
 * Type_INT64 = _Type_INT64             # <<<<<<<<<<<<<<
 * Type_HALF_FLOAT = _Type_HALF_FLOAT
 * Type_FLOAT = _Type_FLOAT
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT64); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_INT64, __pyx_t_1) < 0) __PYX_ERR(9, 78, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":79
 * Type_UINT64 = _Type_UINT64
 * Type_INT64 = _Type_INT64
 * Type_HALF_FLOAT = _Type_HALF_FLOAT             # <<<<<<<<<<<<<<
 * Type_FLOAT = _Type_FLOAT
 * Type_DOUBLE = _Type_DOUBLE
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::HALF_FLOAT); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_HALF_FLOAT, __pyx_t_1) < 0) __PYX_ERR(9, 79, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":80
 * Type_INT64 = _Type_INT64
 * Type_HALF_FLOAT = _Type_HALF_FLOAT
 * Type_FLOAT = _Type_FLOAT             # <<<<<<<<<<<<<<
 * Type_DOUBLE = _Type_DOUBLE
 * Type_DECIMAL = _Type_DECIMAL
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::FLOAT); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_FLOAT, __pyx_t_1) < 0) __PYX_ERR(9, 80, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":81
 * Type_HALF_FLOAT = _Type_HALF_FLOAT
 * Type_FLOAT = _Type_FLOAT
 * Type_DOUBLE = _Type_DOUBLE             # <<<<<<<<<<<<<<
 * Type_DECIMAL = _Type_DECIMAL
 * Type_DATE32 = _Type_DATE32
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DOUBLE); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_DOUBLE, __pyx_t_1) < 0) __PYX_ERR(9, 81, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":82
 * Type_FLOAT = _Type_FLOAT
 * Type_DOUBLE = _Type_DOUBLE
 * Type_DECIMAL = _Type_DECIMAL             # <<<<<<<<<<<<<<
 * Type_DATE32 = _Type_DATE32
 * Type_DATE64 = _Type_DATE64
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DECIMAL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_DECIMAL, __pyx_t_1) < 0) __PYX_ERR(9, 82, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":83
 * Type_DOUBLE = _Type_DOUBLE
 * Type_DECIMAL = _Type_DECIMAL
 * Type_DATE32 = _Type_DATE32             # <<<<<<<<<<<<<<
 * Type_DATE64 = _Type_DATE64
 * Type_TIMESTAMP = _Type_TIMESTAMP
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DATE32); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_DATE32, __pyx_t_1) < 0) __PYX_ERR(9, 83, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":84
 * Type_DECIMAL = _Type_DECIMAL
 * Type_DATE32 = _Type_DATE32
 * Type_DATE64 = _Type_DATE64             # <<<<<<<<<<<<<<
 * Type_TIMESTAMP = _Type_TIMESTAMP
 * Type_TIME32 = _Type_TIME32
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DATE64); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_DATE64, __pyx_t_1) < 0) __PYX_ERR(9, 84, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":85
 * Type_DATE32 = _Type_DATE32
 * Type_DATE64 = _Type_DATE64
 * Type_TIMESTAMP = _Type_TIMESTAMP             # <<<<<<<<<<<<<<
 * Type_TIME32 = _Type_TIME32
 * Type_TIME64 = _Type_TIME64
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIMESTAMP); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_TIMESTAMP, __pyx_t_1) < 0) __PYX_ERR(9, 85, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":86
 * Type_DATE64 = _Type_DATE64
 * Type_TIMESTAMP = _Type_TIMESTAMP
 * Type_TIME32 = _Type_TIME32             # <<<<<<<<<<<<<<
 * Type_TIME64 = _Type_TIME64
 * Type_DURATION = _Type_DURATION
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIME32); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_TIME32, __pyx_t_1) < 0) __PYX_ERR(9, 86, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":87
 * Type_TIMESTAMP = _Type_TIMESTAMP
 * Type_TIME32 = _Type_TIME32
 * Type_TIME64 = _Type_TIME64             # <<<<<<<<<<<<<<
 * Type_DURATION = _Type_DURATION
 * Type_BINARY = _Type_BINARY
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIME64); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_TIME64, __pyx_t_1) < 0) __PYX_ERR(9, 87, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":88
 * Type_TIME32 = _Type_TIME32
 * Type_TIME64 = _Type_TIME64
 * Type_DURATION = _Type_DURATION             # <<<<<<<<<<<<<<
 * Type_BINARY = _Type_BINARY
 * Type_STRING = _Type_STRING
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DURATION); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_DURATION, __pyx_t_1) < 0) __PYX_ERR(9, 88, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":89
 * Type_TIME64 = _Type_TIME64
 * Type_DURATION = _Type_DURATION
 * Type_BINARY = _Type_BINARY             # <<<<<<<<<<<<<<
 * Type_STRING = _Type_STRING
 * Type_LARGE_BINARY = _Type_LARGE_BINARY
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::BINARY); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_BINARY, __pyx_t_1) < 0) __PYX_ERR(9, 89, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":90
 * Type_DURATION = _Type_DURATION
 * Type_BINARY = _Type_BINARY
 * Type_STRING = _Type_STRING             # <<<<<<<<<<<<<<
 * Type_LARGE_BINARY = _Type_LARGE_BINARY
 * Type_LARGE_STRING = _Type_LARGE_STRING
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::STRING); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_STRING, __pyx_t_1) < 0) __PYX_ERR(9, 90, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":91
 * Type_BINARY = _Type_BINARY
 * Type_STRING = _Type_STRING
 * Type_LARGE_BINARY = _Type_LARGE_BINARY             # <<<<<<<<<<<<<<
 * Type_LARGE_STRING = _Type_LARGE_STRING
 * Type_FIXED_SIZE_BINARY = _Type_FIXED_SIZE_BINARY
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::LARGE_BINARY); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_LARGE_BINARY, __pyx_t_1) < 0) __PYX_ERR(9, 91, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":92
 * Type_STRING = _Type_STRING
 * Type_LARGE_BINARY = _Type_LARGE_BINARY
 * Type_LARGE_STRING = _Type_LARGE_STRING             # <<<<<<<<<<<<<<
 * Type_FIXED_SIZE_BINARY = _Type_FIXED_SIZE_BINARY
 * Type_LIST = _Type_LIST
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::LARGE_STRING); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_LARGE_STRING, __pyx_t_1) < 0) __PYX_ERR(9, 92, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":93
 * Type_LARGE_BINARY = _Type_LARGE_BINARY
 * Type_LARGE_STRING = _Type_LARGE_STRING
 * Type_FIXED_SIZE_BINARY = _Type_FIXED_SIZE_BINARY             # <<<<<<<<<<<<<<
 * Type_LIST = _Type_LIST
 * Type_LARGE_LIST = _Type_LARGE_LIST
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::FIXED_SIZE_BINARY); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_FIXED_SIZE_BINARY, __pyx_t_1) < 0) __PYX_ERR(9, 93, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":94
 * Type_LARGE_STRING = _Type_LARGE_STRING
 * Type_FIXED_SIZE_BINARY = _Type_FIXED_SIZE_BINARY
 * Type_LIST = _Type_LIST             # <<<<<<<<<<<<<<
 * Type_LARGE_LIST = _Type_LARGE_LIST
 * Type_MAP = _Type_MAP
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::LIST); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_LIST, __pyx_t_1) < 0) __PYX_ERR(9, 94, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":95
 * Type_FIXED_SIZE_BINARY = _Type_FIXED_SIZE_BINARY
 * Type_LIST = _Type_LIST
 * Type_LARGE_LIST = _Type_LARGE_LIST             # <<<<<<<<<<<<<<
 * Type_MAP = _Type_MAP
 * Type_FIXED_SIZE_LIST = _Type_FIXED_SIZE_LIST
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::LARGE_LIST); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_LARGE_LIST, __pyx_t_1) < 0) __PYX_ERR(9, 95, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":96
 * Type_LIST = _Type_LIST
 * Type_LARGE_LIST = _Type_LARGE_LIST
 * Type_MAP = _Type_MAP             # <<<<<<<<<<<<<<
 * Type_FIXED_SIZE_LIST = _Type_FIXED_SIZE_LIST
 * Type_STRUCT = _Type_STRUCT
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::MAP); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_MAP, __pyx_t_1) < 0) __PYX_ERR(9, 96, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":97
 * Type_LARGE_LIST = _Type_LARGE_LIST
 * Type_MAP = _Type_MAP
 * Type_FIXED_SIZE_LIST = _Type_FIXED_SIZE_LIST             # <<<<<<<<<<<<<<
 * Type_STRUCT = _Type_STRUCT
 * Type_UNION = _Type_UNION
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::FIXED_SIZE_LIST); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_FIXED_SIZE_LIST, __pyx_t_1) < 0) __PYX_ERR(9, 97, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":98
 * Type_MAP = _Type_MAP
 * Type_FIXED_SIZE_LIST = _Type_FIXED_SIZE_LIST
 * Type_STRUCT = _Type_STRUCT             # <<<<<<<<<<<<<<
 * Type_UNION = _Type_UNION
 * Type_DICTIONARY = _Type_DICTIONARY
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::STRUCT); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_STRUCT, __pyx_t_1) < 0) __PYX_ERR(9, 98, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":99
 * Type_FIXED_SIZE_LIST = _Type_FIXED_SIZE_LIST
 * Type_STRUCT = _Type_STRUCT
 * Type_UNION = _Type_UNION             # <<<<<<<<<<<<<<
 * Type_DICTIONARY = _Type_DICTIONARY
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UNION); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_UNION, __pyx_t_1) < 0) __PYX_ERR(9, 99, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":100
 * Type_STRUCT = _Type_STRUCT
 * Type_UNION = _Type_UNION
 * Type_DICTIONARY = _Type_DICTIONARY             # <<<<<<<<<<<<<<
 * 
 * UnionMode_SPARSE = _UnionMode_SPARSE
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DICTIONARY); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_DICTIONARY, __pyx_t_1) < 0) __PYX_ERR(9, 100, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":102
 * Type_DICTIONARY = _Type_DICTIONARY
 * 
 * UnionMode_SPARSE = _UnionMode_SPARSE             # <<<<<<<<<<<<<<
 * UnionMode_DENSE = _UnionMode_DENSE
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_UnionMode_3a__3a_type( arrow::UnionMode::SPARSE); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_UnionMode_SPARSE, __pyx_t_1) < 0) __PYX_ERR(9, 102, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":103
 * 
 * UnionMode_SPARSE = _UnionMode_SPARSE
 * UnionMode_DENSE = _UnionMode_DENSE             # <<<<<<<<<<<<<<
 * 
 * # pandas API shim
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_UnionMode_3a__3a_type( arrow::UnionMode::DENSE); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_UnionMode_DENSE, __pyx_t_1) < 0) __PYX_ERR(9, 103, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/pandas-shim.pxi":237
 * 
 * 
 * cdef _PandasAPIShim pandas_api = _PandasAPIShim()             # <<<<<<<<<<<<<<
 * _pandas_api = pandas_api
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyarrow_3lib__PandasAPIShim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XGOTREF(((PyObject *)__pyx_v_7pyarrow_3lib_pandas_api));
  __Pyx_DECREF_SET(__pyx_v_7pyarrow_3lib_pandas_api, ((struct __pyx_obj_7pyarrow_3lib__PandasAPIShim *)__pyx_t_1));
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/pandas-shim.pxi":238
 * 
 * cdef _PandasAPIShim pandas_api = _PandasAPIShim()
 * _pandas_api = pandas_api             # <<<<<<<<<<<<<<
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pandas_api, ((PyObject *)__pyx_v_7pyarrow_3lib_pandas_api)) < 0) __PYX_ERR(3, 238, __pyx_L1_error)

  /* "pyarrow/error.pxi":20
 * from pyarrow.includes.libarrow cimport CStatus, IsPyError, RestorePyError
 * from pyarrow.includes.common cimport c_string
 * from pyarrow.compat import frombytes             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_frombytes);
  __Pyx_GIVEREF(__pyx_n_s_frombytes);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_frombytes);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_pyarrow_compat, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_frombytes, __pyx_t_1) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/error.pxi":23
 * 
 * 
 * class ArrowException(Exception):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  __Pyx_GIVEREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_ArrowException, __pyx_n_s_ArrowException, (PyObject *) NULL, __pyx_n_s_pyarrow_lib, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ArrowException, __pyx_t_2, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ArrowException, __pyx_t_5) < 0) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/error.pxi":27
 * 
 * 
 * class ArrowInvalid(ValueError, ArrowException):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ArrowException); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_builtin_ValueError);
  __Pyx_GIVEREF(__pyx_builtin_ValueError);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_ValueError);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_ArrowInvalid, __pyx_n_s_ArrowInvalid, (PyObject *) NULL, __pyx_n_s_pyarrow_lib, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_ArrowInvalid, __pyx_t_1, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ArrowInvalid, __pyx_t_5) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/error.pxi":31
 * 
 * 
 * class ArrowMemoryError(MemoryError, ArrowException):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ArrowException); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_builtin_MemoryError);
  __Pyx_GIVEREF(__pyx_builtin_MemoryError);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_MemoryError);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_ArrowMemoryError, __pyx_n_s_ArrowMemoryError, (PyObject *) NULL, __pyx_n_s_pyarrow_lib, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ArrowMemoryError, __pyx_t_2, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ArrowMemoryError, __pyx_t_5) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/error.pxi":35
 * 
 * 
 * class ArrowKeyError(KeyError, ArrowException):             # <<<<<<<<<<<<<<
 *     def __str__(self):
 *         # Override KeyError.__str__, as it uses the repr() of the key
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ArrowException); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_builtin_KeyError);
  __Pyx_GIVEREF(__pyx_builtin_KeyError);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_KeyError);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_ArrowKeyError, __pyx_n_s_ArrowKeyError, (PyObject *) NULL, __pyx_n_s_pyarrow_lib, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "pyarrow/error.pxi":36
 * 
 * class ArrowKeyError(KeyError, ArrowException):
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         # Override KeyError.__str__, as it uses the repr() of the key
 *         return ArrowException.__str__(self)
 */
  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_13ArrowKeyError_1__str__, 0, __pyx_n_s_ArrowKeyError___str, NULL, __pyx_n_s_pyarrow_lib, __pyx_d, ((PyObject *)__pyx_codeobj__286)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_str, __pyx_t_5) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/error.pxi":35
 * 
 * 
 * class ArrowKeyError(KeyError, ArrowException):             # <<<<<<<<<<<<<<
 *     def __str__(self):
 *         # Override KeyError.__str__, as it uses the repr() of the key
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_ArrowKeyError, __pyx_t_1, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ArrowKeyError, __pyx_t_5) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/error.pxi":41
 * 
 * 
 * class ArrowTypeError(TypeError, ArrowException):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ArrowException); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_builtin_TypeError);
  __Pyx_GIVEREF(__pyx_builtin_TypeError);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_TypeError);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_ArrowTypeError, __pyx_n_s_ArrowTypeError, (PyObject *) NULL, __pyx_n_s_pyarrow_lib, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ArrowTypeError, __pyx_t_2, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ArrowTypeError, __pyx_t_5) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/error.pxi":45
 * 
 * 
 * class ArrowNotImplementedError(NotImplementedError, ArrowException):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ArrowException); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_builtin_NotImplementedError);
  __Pyx_GIVEREF(__pyx_builtin_NotImplementedError);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_NotImplementedError);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_ArrowNotImplementedError, __pyx_n_s_ArrowNotImplementedError, (PyObject *) NULL, __pyx_n_s_pyarrow_lib, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_ArrowNotImplementedError, __pyx_t_1, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ArrowNotImplementedError, __pyx_t_5) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/error.pxi":49
 * 
 * 
 * class ArrowCapacityError(ArrowException):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ArrowException); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_ArrowCapacityError, __pyx_n_s_ArrowCapacityError, (PyObject *) NULL, __pyx_n_s_pyarrow_lib, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ArrowCapacityError, __pyx_t_2, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ArrowCapacityError, __pyx_t_5) < 0) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/error.pxi":53
 * 
 * 
 * class ArrowIndexError(IndexError, ArrowException):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ArrowException); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_builtin_IndexError);
  __Pyx_GIVEREF(__pyx_builtin_IndexError);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_IndexError);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_ArrowIndexError, __pyx_n_s_ArrowIndexError, (PyObject *) NULL, __pyx_n_s_pyarrow_lib, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_ArrowIndexError, __pyx_t_1, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ArrowIndexError, __pyx_t_5) < 0) __PYX_ERR(0, 53, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/error.pxi":57
 * 
 * 
 * class ArrowSerializationError(ArrowException):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ArrowException); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_ArrowSerializationError, __pyx_n_s_ArrowSerializationError, (PyObject *) NULL, __pyx_n_s_pyarrow_lib, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ArrowSerializationError, __pyx_t_2, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ArrowSerializationError, __pyx_t_5) < 0) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/error.pxi":62
 * 
 * # Compatibility alias
 * ArrowIOError = IOError             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ArrowIOError, __pyx_builtin_IOError) < 0) __PYX_ERR(0, 62, __pyx_L1_error)

  /* "pyarrow/memory.pxi":90
 * 
 * 
 * def default_memory_pool():             # <<<<<<<<<<<<<<
 *     """
 *     Return the process-global memory pool.
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_5default_memory_pool, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_memory_pool, __pyx_t_2) < 0) __PYX_ERR(11, 90, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/memory.pxi":100
 * 
 * 
 * def proxy_memory_pool(MemoryPool parent):             # <<<<<<<<<<<<<<
 *     """
 *     Create and return a MemoryPool instance that redirects to the
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_7proxy_memory_pool, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_proxy_memory_pool, __pyx_t_2) < 0) __PYX_ERR(11, 100, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/memory.pxi":111
 * 
 * 
 * def logging_memory_pool(MemoryPool parent):             # <<<<<<<<<<<<<<
 *     """
 *     Create and return a MemoryPool instance that redirects to the
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_9logging_memory_pool, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_logging_memory_pool, __pyx_t_2) < 0) __PYX_ERR(11, 111, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/memory.pxi":123
 * 
 * 
 * def set_memory_pool(MemoryPool pool):             # <<<<<<<<<<<<<<
 *     c_set_default_memory_pool(pool.pool)
 * 
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_11set_memory_pool, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_memory_pool, __pyx_t_2) < 0) __PYX_ERR(11, 123, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/memory.pxi":127
 * 
 * 
 * cdef MemoryPool _default_memory_pool = default_memory_pool()             # <<<<<<<<<<<<<<
 * cdef LoggingMemoryPool _logging_memory_pool = logging_memory_pool(
 *     _default_memory_pool)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_default_memory_pool); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7pyarrow_3lib_MemoryPool))))) __PYX_ERR(11, 127, __pyx_L1_error)
  __Pyx_XGOTREF(((PyObject *)__pyx_v_7pyarrow_3lib__default_memory_pool));
  __Pyx_DECREF_SET(__pyx_v_7pyarrow_3lib__default_memory_pool, ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_t_1));
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/memory.pxi":128
 * 
 * cdef MemoryPool _default_memory_pool = default_memory_pool()
 * cdef LoggingMemoryPool _logging_memory_pool = logging_memory_pool(             # <<<<<<<<<<<<<<
 *     _default_memory_pool)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_logging_memory_pool); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyarrow/memory.pxi":129
 * cdef MemoryPool _default_memory_pool = default_memory_pool()
 * cdef LoggingMemoryPool _logging_memory_pool = logging_memory_pool(
 *     _default_memory_pool)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_v_7pyarrow_3lib__default_memory_pool)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/memory.pxi":128
 * 
 * cdef MemoryPool _default_memory_pool = default_memory_pool()
 * cdef LoggingMemoryPool _logging_memory_pool = logging_memory_pool(             # <<<<<<<<<<<<<<
 *     _default_memory_pool)
 * 
 */
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7pyarrow_3lib_LoggingMemoryPool))))) __PYX_ERR(11, 128, __pyx_L1_error)
  __Pyx_XGOTREF(((PyObject *)__pyx_v_7pyarrow_3lib__logging_memory_pool));
  __Pyx_DECREF_SET(__pyx_v_7pyarrow_3lib__logging_memory_pool, ((struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *)__pyx_t_2));
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/memory.pxi":132
 * 
 * 
 * def log_memory_allocations(enable=True):             # <<<<<<<<<<<<<<
 *     """
 *     Enable or disable memory allocator logging for debugging purposes
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_13log_memory_allocations, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_log_memory_allocations, __pyx_t_2) < 0) __PYX_ERR(11, 132, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/memory.pxi":147
 * 
 * 
 * def total_allocated_bytes():             # <<<<<<<<<<<<<<
 *     """
 *     Return the currently allocated bytes from the default memory pool.
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_15total_allocated_bytes, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_total_allocated_bytes, __pyx_t_2) < 0) __PYX_ERR(11, 147, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/memory.pxi":156
 * 
 * 
 * def jemalloc_set_decay_ms(decay_ms):             # <<<<<<<<<<<<<<
 *     """
 *     Set arenas.dirty_decay_ms and arenas.muzzy_decay_ms to indicated number of
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_17jemalloc_set_decay_ms, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_jemalloc_set_decay_ms, __pyx_t_2) < 0) __PYX_ERR(11, 156, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":18
 * # under the License.
 * 
 * import atexit             # <<<<<<<<<<<<<<
 * import re
 * import sys
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_atexit, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_atexit, __pyx_t_2) < 0) __PYX_ERR(4, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":19
 * 
 * import atexit
 * import re             # <<<<<<<<<<<<<<
 * import sys
 * import warnings
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_re, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_re, __pyx_t_2) < 0) __PYX_ERR(4, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":20
 * import atexit
 * import re
 * import sys             # <<<<<<<<<<<<<<
 * import warnings
 * 
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_2) < 0) __PYX_ERR(4, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":21
 * import re
 * import sys
 * import warnings             # <<<<<<<<<<<<<<
 * 
 * from pyarrow import compat
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_warnings, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_2) < 0) __PYX_ERR(4, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":23
 * import warnings
 * 
 * from pyarrow import compat             # <<<<<<<<<<<<<<
 * from pyarrow.compat import builtin_pickle
 * 
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_compat);
  __Pyx_GIVEREF(__pyx_n_s_compat);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_compat);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_pyarrow_2, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_compat); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_compat, __pyx_t_2) < 0) __PYX_ERR(4, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":24
 * 
 * from pyarrow import compat
 * from pyarrow.compat import builtin_pickle             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_builtin_pickle);
  __Pyx_GIVEREF(__pyx_n_s_builtin_pickle);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_builtin_pickle);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_pyarrow_compat, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_builtin_pickle); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_builtin_pickle, __pyx_t_1) < 0) __PYX_ERR(4, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":30
 * # of nulls
 * cdef dict _pandas_type_map = {
 *     _Type_NA: np.float64,  # NaNs             # <<<<<<<<<<<<<<
 *     _Type_BOOL: np.bool_,
 *     _Type_INT8: np.int8,
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(22); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::NA); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_5) < 0) __PYX_ERR(4, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":31
 * cdef dict _pandas_type_map = {
 *     _Type_NA: np.float64,  # NaNs
 *     _Type_BOOL: np.bool_,             # <<<<<<<<<<<<<<
 *     _Type_INT8: np.int8,
 *     _Type_INT16: np.int16,
 */
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::BOOL); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_bool); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_5, __pyx_t_4) < 0) __PYX_ERR(4, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/types.pxi":32
 *     _Type_NA: np.float64,  # NaNs
 *     _Type_BOOL: np.bool_,
 *     _Type_INT8: np.int8,             # <<<<<<<<<<<<<<
 *     _Type_INT16: np.int16,
 *     _Type_INT32: np.int32,
 */
  __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT8); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int8); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_4, __pyx_t_1) < 0) __PYX_ERR(4, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":33
 *     _Type_BOOL: np.bool_,
 *     _Type_INT8: np.int8,
 *     _Type_INT16: np.int16,             # <<<<<<<<<<<<<<
 *     _Type_INT32: np.int32,
 *     _Type_INT64: np.int64,
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT16); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int16); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_5) < 0) __PYX_ERR(4, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":34
 *     _Type_INT8: np.int8,
 *     _Type_INT16: np.int16,
 *     _Type_INT32: np.int32,             # <<<<<<<<<<<<<<
 *     _Type_INT64: np.int64,
 *     _Type_UINT8: np.uint8,
 */
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT32); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int32); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_5, __pyx_t_4) < 0) __PYX_ERR(4, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/types.pxi":35
 *     _Type_INT16: np.int16,
 *     _Type_INT32: np.int32,
 *     _Type_INT64: np.int64,             # <<<<<<<<<<<<<<
 *     _Type_UINT8: np.uint8,
 *     _Type_UINT16: np.uint16,
 */
  __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT64); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_4, __pyx_t_1) < 0) __PYX_ERR(4, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":36
 *     _Type_INT32: np.int32,
 *     _Type_INT64: np.int64,
 *     _Type_UINT8: np.uint8,             # <<<<<<<<<<<<<<
 *     _Type_UINT16: np.uint16,
 *     _Type_UINT32: np.uint32,
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT8); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint8); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_5) < 0) __PYX_ERR(4, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":37
 *     _Type_INT64: np.int64,
 *     _Type_UINT8: np.uint8,
 *     _Type_UINT16: np.uint16,             # <<<<<<<<<<<<<<
 *     _Type_UINT32: np.uint32,
 *     _Type_UINT64: np.uint64,
 */
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT16); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint16); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_5, __pyx_t_4) < 0) __PYX_ERR(4, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/types.pxi":38
 *     _Type_UINT8: np.uint8,
 *     _Type_UINT16: np.uint16,
 *     _Type_UINT32: np.uint32,             # <<<<<<<<<<<<<<
 *     _Type_UINT64: np.uint64,
 *     _Type_HALF_FLOAT: np.float16,
 */
  __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT32); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint32); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_4, __pyx_t_1) < 0) __PYX_ERR(4, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":39
 *     _Type_UINT16: np.uint16,
 *     _Type_UINT32: np.uint32,
 *     _Type_UINT64: np.uint64,             # <<<<<<<<<<<<<<
 *     _Type_HALF_FLOAT: np.float16,
 *     _Type_FLOAT: np.float32,
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT64); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint64); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_5) < 0) __PYX_ERR(4, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":40
 *     _Type_UINT32: np.uint32,
 *     _Type_UINT64: np.uint64,
 *     _Type_HALF_FLOAT: np.float16,             # <<<<<<<<<<<<<<
 *     _Type_FLOAT: np.float32,
 *     _Type_DOUBLE: np.float64,
 */
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::HALF_FLOAT); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float16); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_5, __pyx_t_4) < 0) __PYX_ERR(4, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/types.pxi":41
 *     _Type_UINT64: np.uint64,
 *     _Type_HALF_FLOAT: np.float16,
 *     _Type_FLOAT: np.float32,             # <<<<<<<<<<<<<<
 *     _Type_DOUBLE: np.float64,
 *     _Type_DATE32: np.dtype('datetime64[ns]'),
 */
  __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_4, __pyx_t_1) < 0) __PYX_ERR(4, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":42
 *     _Type_HALF_FLOAT: np.float16,
 *     _Type_FLOAT: np.float32,
 *     _Type_DOUBLE: np.float64,             # <<<<<<<<<<<<<<
 *     _Type_DATE32: np.dtype('datetime64[ns]'),
 *     _Type_DATE64: np.dtype('datetime64[ns]'),
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DOUBLE); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_5) < 0) __PYX_ERR(4, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":43
 *     _Type_FLOAT: np.float32,
 *     _Type_DOUBLE: np.float64,
 *     _Type_DATE32: np.dtype('datetime64[ns]'),             # <<<<<<<<<<<<<<
 *     _Type_DATE64: np.dtype('datetime64[ns]'),
 *     _Type_TIMESTAMP: np.dtype('datetime64[ns]'),
 */
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DATE32); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__301, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_5, __pyx_t_1) < 0) __PYX_ERR(4, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":44
 *     _Type_DOUBLE: np.float64,
 *     _Type_DATE32: np.dtype('datetime64[ns]'),
 *     _Type_DATE64: np.dtype('datetime64[ns]'),             # <<<<<<<<<<<<<<
 *     _Type_TIMESTAMP: np.dtype('datetime64[ns]'),
 *     _Type_DURATION: np.dtype('timedelta64[ns]'),
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DATE64); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__301, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_5) < 0) __PYX_ERR(4, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":45
 *     _Type_DATE32: np.dtype('datetime64[ns]'),
 *     _Type_DATE64: np.dtype('datetime64[ns]'),
 *     _Type_TIMESTAMP: np.dtype('datetime64[ns]'),             # <<<<<<<<<<<<<<
 *     _Type_DURATION: np.dtype('timedelta64[ns]'),
 *     _Type_BINARY: np.object_,
 */
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIMESTAMP); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__301, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_5, __pyx_t_1) < 0) __PYX_ERR(4, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":46
 *     _Type_DATE64: np.dtype('datetime64[ns]'),
 *     _Type_TIMESTAMP: np.dtype('datetime64[ns]'),
 *     _Type_DURATION: np.dtype('timedelta64[ns]'),             # <<<<<<<<<<<<<<
 *     _Type_BINARY: np.object_,
 *     _Type_FIXED_SIZE_BINARY: np.object_,
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DURATION); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__302, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_5) < 0) __PYX_ERR(4, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":47
 *     _Type_TIMESTAMP: np.dtype('datetime64[ns]'),
 *     _Type_DURATION: np.dtype('timedelta64[ns]'),
 *     _Type_BINARY: np.object_,             # <<<<<<<<<<<<<<
 *     _Type_FIXED_SIZE_BINARY: np.object_,
 *     _Type_STRING: np.object_,
 */
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::BINARY); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_object_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_5, __pyx_t_4) < 0) __PYX_ERR(4, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/types.pxi":48
 *     _Type_DURATION: np.dtype('timedelta64[ns]'),
 *     _Type_BINARY: np.object_,
 *     _Type_FIXED_SIZE_BINARY: np.object_,             # <<<<<<<<<<<<<<
 *     _Type_STRING: np.object_,
 *     _Type_LIST: np.object_,
 */
  __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::FIXED_SIZE_BINARY); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_object_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_4, __pyx_t_1) < 0) __PYX_ERR(4, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":49
 *     _Type_BINARY: np.object_,
 *     _Type_FIXED_SIZE_BINARY: np.object_,
 *     _Type_STRING: np.object_,             # <<<<<<<<<<<<<<
 *     _Type_LIST: np.object_,
 *     _Type_DECIMAL: np.object_,
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::STRING); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_object_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_5) < 0) __PYX_ERR(4, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":50
 *     _Type_FIXED_SIZE_BINARY: np.object_,
 *     _Type_STRING: np.object_,
 *     _Type_LIST: np.object_,             # <<<<<<<<<<<<<<
 *     _Type_DECIMAL: np.object_,
 * }
 */
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::LIST); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_object_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_5, __pyx_t_4) < 0) __PYX_ERR(4, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/types.pxi":51
 *     _Type_STRING: np.object_,
 *     _Type_LIST: np.object_,
 *     _Type_DECIMAL: np.object_,             # <<<<<<<<<<<<<<
 * }
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DECIMAL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_object_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_4, __pyx_t_1) < 0) __PYX_ERR(4, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_XGOTREF(__pyx_v_7pyarrow_3lib__pandas_type_map);
  __Pyx_DECREF_SET(__pyx_v_7pyarrow_3lib__pandas_type_map, ((PyObject*)__pyx_t_2));
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":55
 * 
 * cdef dict _pep3118_type_map = {
 *     _Type_INT8: b'b',             # <<<<<<<<<<<<<<
 *     _Type_INT16: b'h',
 *     _Type_INT32: b'i',
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(11); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT8); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_b_b) < 0) __PYX_ERR(4, 55, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":56
 * cdef dict _pep3118_type_map = {
 *     _Type_INT8: b'b',
 *     _Type_INT16: b'h',             # <<<<<<<<<<<<<<
 *     _Type_INT32: b'i',
 *     _Type_INT64: b'q',
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT16); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_b_h) < 0) __PYX_ERR(4, 55, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":57
 *     _Type_INT8: b'b',
 *     _Type_INT16: b'h',
 *     _Type_INT32: b'i',             # <<<<<<<<<<<<<<
 *     _Type_INT64: b'q',
 *     _Type_UINT8: b'B',
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT32); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_b_i) < 0) __PYX_ERR(4, 55, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":58
 *     _Type_INT16: b'h',
 *     _Type_INT32: b'i',
 *     _Type_INT64: b'q',             # <<<<<<<<<<<<<<
 *     _Type_UINT8: b'B',
 *     _Type_UINT16: b'H',
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT64); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_b_q) < 0) __PYX_ERR(4, 55, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":59
 *     _Type_INT32: b'i',
 *     _Type_INT64: b'q',
 *     _Type_UINT8: b'B',             # <<<<<<<<<<<<<<
 *     _Type_UINT16: b'H',
 *     _Type_UINT32: b'I',
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT8); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_b_B) < 0) __PYX_ERR(4, 55, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":60
 *     _Type_INT64: b'q',
 *     _Type_UINT8: b'B',
 *     _Type_UINT16: b'H',             # <<<<<<<<<<<<<<
 *     _Type_UINT32: b'I',
 *     _Type_UINT64: b'Q',
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT16); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_b_H) < 0) __PYX_ERR(4, 55, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":61
 *     _Type_UINT8: b'B',
 *     _Type_UINT16: b'H',
 *     _Type_UINT32: b'I',             # <<<<<<<<<<<<<<
 *     _Type_UINT64: b'Q',
 *     _Type_HALF_FLOAT: b'e',
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT32); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_b_I) < 0) __PYX_ERR(4, 55, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":62
 *     _Type_UINT16: b'H',
 *     _Type_UINT32: b'I',
 *     _Type_UINT64: b'Q',             # <<<<<<<<<<<<<<
 *     _Type_HALF_FLOAT: b'e',
 *     _Type_FLOAT: b'f',
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT64); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_b_Q) < 0) __PYX_ERR(4, 55, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":63
 *     _Type_UINT32: b'I',
 *     _Type_UINT64: b'Q',
 *     _Type_HALF_FLOAT: b'e',             # <<<<<<<<<<<<<<
 *     _Type_FLOAT: b'f',
 *     _Type_DOUBLE: b'd',
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::HALF_FLOAT); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_b_e) < 0) __PYX_ERR(4, 55, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":64
 *     _Type_UINT64: b'Q',
 *     _Type_HALF_FLOAT: b'e',
 *     _Type_FLOAT: b'f',             # <<<<<<<<<<<<<<
 *     _Type_DOUBLE: b'd',
 * }
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::FLOAT); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_b_f) < 0) __PYX_ERR(4, 55, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":65
 *     _Type_HALF_FLOAT: b'e',
 *     _Type_FLOAT: b'f',
 *     _Type_DOUBLE: b'd',             # <<<<<<<<<<<<<<
 * }
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DOUBLE); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_b_d) < 0) __PYX_ERR(4, 55, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_XGOTREF(__pyx_v_7pyarrow_3lib__pep3118_type_map);
  __Pyx_DECREF_SET(__pyx_v_7pyarrow_3lib__pep3118_type_map, ((PyObject*)__pyx_t_2));
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":86
 * 
 * 
 * def _is_primitive(Type type):             # <<<<<<<<<<<<<<
 *     # This is simply a redirect, the official API is in pyarrow.types.
 *     return is_primitive(type)
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_19_is_primitive, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_primitive, __pyx_t_2) < 0) __PYX_ERR(4, 86, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":677
 * 
 *     @classmethod
 *     def __arrow_ext_deserialize__(self, storage_type, serialized):             # <<<<<<<<<<<<<<
 *         """
 *         Return an extension type instance from the storage type and serialized
 */
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_7pyarrow_3lib_ExtensionType, __pyx_n_s_arrow_ext_deserialize); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 677, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "pyarrow/types.pxi":676
 *         return NotImplementedError
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def __arrow_ext_deserialize__(self, storage_type, serialized):
 *         """
 */
  __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_ExtensionType->tp_dict, __pyx_n_s_arrow_ext_deserialize, __pyx_t_1) < 0) __PYX_ERR(4, 677, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_ExtensionType);

  /* "pyarrow/types.pxi":711
 * 
 *     @classmethod
 *     def __arrow_ext_deserialize__(cls, storage_type, serialized):             # <<<<<<<<<<<<<<
 *         try:
 *             ty = builtin_pickle.loads(serialized)
 */
  __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_7pyarrow_3lib_PyExtensionType, __pyx_n_s_arrow_ext_deserialize); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 711, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyarrow/types.pxi":710
 *         return builtin_pickle.dumps(self)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def __arrow_ext_deserialize__(cls, storage_type, serialized):
 *         try:
 */
  __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_PyExtensionType->tp_dict, __pyx_n_s_arrow_ext_deserialize, __pyx_t_2) < 0) __PYX_ERR(4, 711, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_PyExtensionType);

  /* "pyarrow/types.pxi":745
 * 
 * 
 * _python_extension_types_registry = []             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_python_extension_types_registry, __pyx_t_2) < 0) __PYX_ERR(4, 745, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":748
 * 
 * 
 * def register_extension_type(ext_type):             # <<<<<<<<<<<<<<
 *     """
 *     Register a Python extension type.
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_21register_extension_type, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 748, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_register_extension_type, __pyx_t_2) < 0) __PYX_ERR(4, 748, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":777
 * 
 * 
 * def unregister_extension_type(type_name):             # <<<<<<<<<<<<<<
 *     """
 *     Unregister a Python extension type.
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_23unregister_extension_type, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 777, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_unregister_extension_type, __pyx_t_2) < 0) __PYX_ERR(4, 777, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":1045
 * 
 *     @classmethod
 *     def from_pandas(cls, df, preserve_index=None):             # <<<<<<<<<<<<<<
 *         """
 *         Returns implied schema from dataframe
 */
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_7pyarrow_3lib_Schema, __pyx_n_s_from_pandas); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1045, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "pyarrow/types.pxi":1044
 *                                            check_metadata)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_pandas(cls, df, preserve_index=None):
 *         """
 */
  __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1044, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Schema->tp_dict, __pyx_n_s_from_pandas, __pyx_t_1) < 0) __PYX_ERR(4, 1045, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Schema);

  /* "pyarrow/types.pxi":1334
 * 
 * 
 * cdef dict _type_cache = {}             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XGOTREF(__pyx_v_7pyarrow_3lib__type_cache);
  __Pyx_DECREF_SET(__pyx_v_7pyarrow_3lib__type_cache, ((PyObject*)__pyx_t_1));
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":1352
 * 
 * 
 * def field(name, type, bint nullable=True, metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create a pyarrow.Field instance
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_25field, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_field, __pyx_t_1) < 0) __PYX_ERR(4, 1352, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":1388
 * 
 * cdef set PRIMITIVE_TYPES = set([
 *     _Type_NA, _Type_BOOL,             # <<<<<<<<<<<<<<
 *     _Type_UINT8, _Type_INT8,
 *     _Type_UINT16, _Type_INT16,
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::NA); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::BOOL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "pyarrow/types.pxi":1389
 * cdef set PRIMITIVE_TYPES = set([
 *     _Type_NA, _Type_BOOL,
 *     _Type_UINT8, _Type_INT8,             # <<<<<<<<<<<<<<
 *     _Type_UINT16, _Type_INT16,
 *     _Type_UINT32, _Type_INT32,
 */
  __pyx_t_4 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT8); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT8); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "pyarrow/types.pxi":1390
 *     _Type_NA, _Type_BOOL,
 *     _Type_UINT8, _Type_INT8,
 *     _Type_UINT16, _Type_INT16,             # <<<<<<<<<<<<<<
 *     _Type_UINT32, _Type_INT32,
 *     _Type_UINT64, _Type_INT64,
 */
  __pyx_t_6 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT16); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT16); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 1390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "pyarrow/types.pxi":1391
 *     _Type_UINT8, _Type_INT8,
 *     _Type_UINT16, _Type_INT16,
 *     _Type_UINT32, _Type_INT32,             # <<<<<<<<<<<<<<
 *     _Type_UINT64, _Type_INT64,
 *     _Type_TIMESTAMP, _Type_DATE32,
 */
  __pyx_t_8 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT32); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT32); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 1391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);

  /* "pyarrow/types.pxi":1392
 *     _Type_UINT16, _Type_INT16,
 *     _Type_UINT32, _Type_INT32,
 *     _Type_UINT64, _Type_INT64,             # <<<<<<<<<<<<<<
 *     _Type_TIMESTAMP, _Type_DATE32,
 *     _Type_TIME32, _Type_TIME64,
 */
  __pyx_t_10 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT64); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 1392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT64); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 1392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);

  /* "pyarrow/types.pxi":1393
 *     _Type_UINT32, _Type_INT32,
 *     _Type_UINT64, _Type_INT64,
 *     _Type_TIMESTAMP, _Type_DATE32,             # <<<<<<<<<<<<<<
 *     _Type_TIME32, _Type_TIME64,
 *     _Type_DATE64,
 */
  __pyx_t_12 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIMESTAMP); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 1393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DATE32); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 1393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);

  /* "pyarrow/types.pxi":1394
 *     _Type_UINT64, _Type_INT64,
 *     _Type_TIMESTAMP, _Type_DATE32,
 *     _Type_TIME32, _Type_TIME64,             # <<<<<<<<<<<<<<
 *     _Type_DATE64,
 *     _Type_HALF_FLOAT,
 */
  __pyx_t_14 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIME32); if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 1394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_15 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIME64); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 1394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);

  /* "pyarrow/types.pxi":1395
 *     _Type_TIMESTAMP, _Type_DATE32,
 *     _Type_TIME32, _Type_TIME64,
 *     _Type_DATE64,             # <<<<<<<<<<<<<<
 *     _Type_HALF_FLOAT,
 *     _Type_FLOAT,
 */
  __pyx_t_16 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DATE64); if (unlikely(!__pyx_t_16)) __PYX_ERR(4, 1395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);

  /* "pyarrow/types.pxi":1396
 *     _Type_TIME32, _Type_TIME64,
 *     _Type_DATE64,
 *     _Type_HALF_FLOAT,             # <<<<<<<<<<<<<<
 *     _Type_FLOAT,
 *     _Type_DOUBLE])
 */
  __pyx_t_17 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::HALF_FLOAT); if (unlikely(!__pyx_t_17)) __PYX_ERR(4, 1396, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);

  /* "pyarrow/types.pxi":1397
 *     _Type_DATE64,
 *     _Type_HALF_FLOAT,
 *     _Type_FLOAT,             # <<<<<<<<<<<<<<
 *     _Type_DOUBLE])
 * 
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::FLOAT); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 1397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);

  /* "pyarrow/types.pxi":1398
 *     _Type_HALF_FLOAT,
 *     _Type_FLOAT,
 *     _Type_DOUBLE])             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DOUBLE); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_20 = PySet_New(0); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PySet_Add(__pyx_t_20, __pyx_t_1) < 0) __PYX_ERR(4, 1387, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_2) < 0) __PYX_ERR(4, 1387, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_4) < 0) __PYX_ERR(4, 1387, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_5) < 0) __PYX_ERR(4, 1387, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_6) < 0) __PYX_ERR(4, 1387, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_7) < 0) __PYX_ERR(4, 1387, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_8) < 0) __PYX_ERR(4, 1387, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_9) < 0) __PYX_ERR(4, 1387, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_10) < 0) __PYX_ERR(4, 1387, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_11) < 0) __PYX_ERR(4, 1387, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_12) < 0) __PYX_ERR(4, 1387, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_13) < 0) __PYX_ERR(4, 1387, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_14) < 0) __PYX_ERR(4, 1387, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_15) < 0) __PYX_ERR(4, 1387, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_16) < 0) __PYX_ERR(4, 1387, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_17) < 0) __PYX_ERR(4, 1387, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_18) < 0) __PYX_ERR(4, 1387, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_19) < 0) __PYX_ERR(4, 1387, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_XGOTREF(__pyx_v_7pyarrow_3lib_PRIMITIVE_TYPES);
  __Pyx_DECREF_SET(__pyx_v_7pyarrow_3lib_PRIMITIVE_TYPES, ((PyObject*)__pyx_t_20));
  __Pyx_GIVEREF(__pyx_t_20);
  __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1401
 * 
 * 
 * def null():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of null type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_27null, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_null, __pyx_t_20) < 0) __PYX_ERR(4, 1401, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1408
 * 
 * 
 * def bool_():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of boolean type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_29bool_, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_bool, __pyx_t_20) < 0) __PYX_ERR(4, 1408, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1415
 * 
 * 
 * def uint8():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned int8 type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_31uint8, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1415, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_uint8, __pyx_t_20) < 0) __PYX_ERR(4, 1415, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1422
 * 
 * 
 * def int8():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int8 type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_33int8, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_int8, __pyx_t_20) < 0) __PYX_ERR(4, 1422, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1429
 * 
 * 
 * def uint16():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned uint16 type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_35uint16, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_uint16, __pyx_t_20) < 0) __PYX_ERR(4, 1429, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1436
 * 
 * 
 * def int16():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int16 type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_37int16, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_int16, __pyx_t_20) < 0) __PYX_ERR(4, 1436, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1443
 * 
 * 
 * def uint32():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned uint32 type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_39uint32, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_uint32, __pyx_t_20) < 0) __PYX_ERR(4, 1443, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1450
 * 
 * 
 * def int32():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int32 type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_41int32, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_int32, __pyx_t_20) < 0) __PYX_ERR(4, 1450, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1457
 * 
 * 
 * def uint64():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned uint64 type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_43uint64, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_uint64, __pyx_t_20) < 0) __PYX_ERR(4, 1457, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1464
 * 
 * 
 * def int64():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int64 type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_45int64, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_int64, __pyx_t_20) < 0) __PYX_ERR(4, 1464, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1471
 * 
 * 
 * cdef dict _timestamp_type_cache = {}             # <<<<<<<<<<<<<<
 * cdef dict _time_type_cache = {}
 * cdef dict _duration_type_cache = {}
 */
  __pyx_t_20 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_XGOTREF(__pyx_v_7pyarrow_3lib__timestamp_type_cache);
  __Pyx_DECREF_SET(__pyx_v_7pyarrow_3lib__timestamp_type_cache, ((PyObject*)__pyx_t_20));
  __Pyx_GIVEREF(__pyx_t_20);
  __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1472
 * 
 * cdef dict _timestamp_type_cache = {}
 * cdef dict _time_type_cache = {}             # <<<<<<<<<<<<<<
 * cdef dict _duration_type_cache = {}
 * 
 */
  __pyx_t_20 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_XGOTREF(__pyx_v_7pyarrow_3lib__time_type_cache);
  __Pyx_DECREF_SET(__pyx_v_7pyarrow_3lib__time_type_cache, ((PyObject*)__pyx_t_20));
  __Pyx_GIVEREF(__pyx_t_20);
  __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1473
 * cdef dict _timestamp_type_cache = {}
 * cdef dict _time_type_cache = {}
 * cdef dict _duration_type_cache = {}             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_20 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_XGOTREF(__pyx_v_7pyarrow_3lib__duration_type_cache);
  __Pyx_DECREF_SET(__pyx_v_7pyarrow_3lib__duration_type_cache, ((PyObject*)__pyx_t_20));
  __Pyx_GIVEREF(__pyx_t_20);
  __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1487
 * 
 * 
 * _FIXED_OFFSET_RE = re.compile(r'([+-])(0[0-9]|1[0-9]|2[0-3]):([0-5][0-9])$')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_n_s_re); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1487, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_compile); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 1487, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_tuple__321, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1487, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FIXED_OFFSET_RE, __pyx_t_20) < 0) __PYX_ERR(4, 1487, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1490
 * 
 * 
 * def tzinfo_to_string(tz):             # <<<<<<<<<<<<<<
 *     """
 *     Converts a time zone object into a string indicating the name of a time
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_47tzinfo_to_string, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1490, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tzinfo_to_string, __pyx_t_20) < 0) __PYX_ERR(4, 1490, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1536
 * 
 * 
 * def string_to_tzinfo(name):             # <<<<<<<<<<<<<<
 *     """
 *     Converts a string indicating the name of a time zone into a time zone
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_49string_to_tzinfo, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_string_to_tzinfo, __pyx_t_20) < 0) __PYX_ERR(4, 1536, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1564
 * 
 * 
 * def timestamp(unit, tz=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of timestamp type with resolution and optional time zone
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_51timestamp, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1564, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_timestamp, __pyx_t_20) < 0) __PYX_ERR(4, 1564, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1619
 * 
 * 
 * def time32(unit):             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 32-bit time (time of day) type with unit resolution
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_53time32, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1619, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_time32, __pyx_t_20) < 0) __PYX_ERR(4, 1619, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1657
 * 
 * 
 * def time64(unit):             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 64-bit time (time of day) type with unit resolution
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_55time64, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_time64, __pyx_t_20) < 0) __PYX_ERR(4, 1657, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1695
 * 
 * 
 * def duration(unit):             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of a duration type with unit resolution.
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_57duration, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_duration, __pyx_t_20) < 0) __PYX_ERR(4, 1695, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1737
 * 
 * 
 * def date32():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 32-bit date (days since UNIX epoch 1970-01-01)
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_59date32, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1737, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_date32, __pyx_t_20) < 0) __PYX_ERR(4, 1737, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1744
 * 
 * 
 * def date64():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 64-bit date (milliseconds since UNIX epoch 1970-01-01)
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_61date64, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_date64, __pyx_t_20) < 0) __PYX_ERR(4, 1744, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1751
 * 
 * 
 * def float16():             # <<<<<<<<<<<<<<
 *     """
 *     Create half-precision floating point type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_63float16, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1751, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_float16, __pyx_t_20) < 0) __PYX_ERR(4, 1751, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1758
 * 
 * 
 * def float32():             # <<<<<<<<<<<<<<
 *     """
 *     Create single-precision floating point type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_65float32, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1758, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_float32, __pyx_t_20) < 0) __PYX_ERR(4, 1758, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1765
 * 
 * 
 * def float64():             # <<<<<<<<<<<<<<
 *     """
 *     Create double-precision floating point type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_67float64, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1765, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_float64, __pyx_t_20) < 0) __PYX_ERR(4, 1765, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1792
 * 
 * 
 * def string():             # <<<<<<<<<<<<<<
 *     """
 *     Create UTF8 variable-length string type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_71string, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1792, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_string, __pyx_t_20) < 0) __PYX_ERR(4, 1792, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1799
 * 
 * 
 * def utf8():             # <<<<<<<<<<<<<<
 *     """
 *     Alias for string()
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_73utf8, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1799, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_utf8, __pyx_t_20) < 0) __PYX_ERR(4, 1799, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1806
 * 
 * 
 * def binary(int length=-1):             # <<<<<<<<<<<<<<
 *     """
 *     Create variable-length binary type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_75binary, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_binary, __pyx_t_20) < 0) __PYX_ERR(4, 1806, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1825
 * 
 * 
 * def large_binary():             # <<<<<<<<<<<<<<
 *     """
 *     Create large variable-length binary type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_77large_binary, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1825, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_large_binary, __pyx_t_20) < 0) __PYX_ERR(4, 1825, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1835
 * 
 * 
 * def large_string():             # <<<<<<<<<<<<<<
 *     """
 *     Create large UTF8 variable-length string type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_79large_string, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_large_string, __pyx_t_20) < 0) __PYX_ERR(4, 1835, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1845
 * 
 * 
 * def large_utf8():             # <<<<<<<<<<<<<<
 *     """
 *     Alias for large_string()
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_81large_utf8, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1845, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_large_utf8, __pyx_t_20) < 0) __PYX_ERR(4, 1845, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1852
 * 
 * 
 * def list_(value_type, int list_size=-1):             # <<<<<<<<<<<<<<
 *     """
 *     Create ListType instance from child data type or field
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_83list_, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1852, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_list, __pyx_t_20) < 0) __PYX_ERR(4, 1852, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1977
 * 
 * 
 * def struct(fields):             # <<<<<<<<<<<<<<
 *     """
 *     Create StructType instance from fields
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_91struct, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 1977, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_struct, __pyx_t_20) < 0) __PYX_ERR(4, 1977, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":2025
 * 
 * 
 * def union(children_fields, mode, type_codes=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create UnionType from children fields.
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_93union, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 2025, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_union, __pyx_t_20) < 0) __PYX_ERR(4, 2025, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":2081
 * 
 * cdef dict _type_aliases = {
 *     'null': null,             # <<<<<<<<<<<<<<
 *     'bool': bool_,
 *     'boolean': bool_,
 */
  __pyx_t_20 = __Pyx_PyDict_NewPresized(52); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_null); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_null, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2082
 * cdef dict _type_aliases = {
 *     'null': null,
 *     'bool': bool_,             # <<<<<<<<<<<<<<
 *     'boolean': bool_,
 *     'i1': int8,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_bool); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2082, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_bool_2, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2083
 *     'null': null,
 *     'bool': bool_,
 *     'boolean': bool_,             # <<<<<<<<<<<<<<
 *     'i1': int8,
 *     'int8': int8,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_bool); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2083, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_boolean, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2084
 *     'bool': bool_,
 *     'boolean': bool_,
 *     'i1': int8,             # <<<<<<<<<<<<<<
 *     'int8': int8,
 *     'i2': int16,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_int8); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2084, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_i1, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2085
 *     'boolean': bool_,
 *     'i1': int8,
 *     'int8': int8,             # <<<<<<<<<<<<<<
 *     'i2': int16,
 *     'int16': int16,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_int8); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2085, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_int8, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2086
 *     'i1': int8,
 *     'int8': int8,
 *     'i2': int16,             # <<<<<<<<<<<<<<
 *     'int16': int16,
 *     'i4': int32,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_int16); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2086, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_i2, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2087
 *     'int8': int8,
 *     'i2': int16,
 *     'int16': int16,             # <<<<<<<<<<<<<<
 *     'i4': int32,
 *     'int32': int32,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_int16); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2087, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_int16, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2088
 *     'i2': int16,
 *     'int16': int16,
 *     'i4': int32,             # <<<<<<<<<<<<<<
 *     'int32': int32,
 *     'i8': int64,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_int32); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_i4, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2089
 *     'int16': int16,
 *     'i4': int32,
 *     'int32': int32,             # <<<<<<<<<<<<<<
 *     'i8': int64,
 *     'int64': int64,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_int32); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2089, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_int32, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2090
 *     'i4': int32,
 *     'int32': int32,
 *     'i8': int64,             # <<<<<<<<<<<<<<
 *     'int64': int64,
 *     'u1': uint8,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_int64); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2090, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_i8, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2091
 *     'int32': int32,
 *     'i8': int64,
 *     'int64': int64,             # <<<<<<<<<<<<<<
 *     'u1': uint8,
 *     'uint8': uint8,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_int64); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2091, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_int64, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2092
 *     'i8': int64,
 *     'int64': int64,
 *     'u1': uint8,             # <<<<<<<<<<<<<<
 *     'uint8': uint8,
 *     'u2': uint16,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_uint8); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2092, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_u1, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2093
 *     'int64': int64,
 *     'u1': uint8,
 *     'uint8': uint8,             # <<<<<<<<<<<<<<
 *     'u2': uint16,
 *     'uint16': uint16,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_uint8); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2093, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_uint8, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2094
 *     'u1': uint8,
 *     'uint8': uint8,
 *     'u2': uint16,             # <<<<<<<<<<<<<<
 *     'uint16': uint16,
 *     'u4': uint32,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_uint16); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2094, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_u2, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2095
 *     'uint8': uint8,
 *     'u2': uint16,
 *     'uint16': uint16,             # <<<<<<<<<<<<<<
 *     'u4': uint32,
 *     'uint32': uint32,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_uint16); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2095, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_uint16, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2096
 *     'u2': uint16,
 *     'uint16': uint16,
 *     'u4': uint32,             # <<<<<<<<<<<<<<
 *     'uint32': uint32,
 *     'u8': uint64,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_uint32); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2096, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_u4, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2097
 *     'uint16': uint16,
 *     'u4': uint32,
 *     'uint32': uint32,             # <<<<<<<<<<<<<<
 *     'u8': uint64,
 *     'uint64': uint64,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_uint32); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2097, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_uint32, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2098
 *     'u4': uint32,
 *     'uint32': uint32,
 *     'u8': uint64,             # <<<<<<<<<<<<<<
 *     'uint64': uint64,
 *     'f2': float16,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_uint64); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2098, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_u8, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2099
 *     'uint32': uint32,
 *     'u8': uint64,
 *     'uint64': uint64,             # <<<<<<<<<<<<<<
 *     'f2': float16,
 *     'halffloat': float16,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_uint64); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2099, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_uint64, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2100
 *     'u8': uint64,
 *     'uint64': uint64,
 *     'f2': float16,             # <<<<<<<<<<<<<<
 *     'halffloat': float16,
 *     'float16': float16,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_float16); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_f2, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2101
 *     'uint64': uint64,
 *     'f2': float16,
 *     'halffloat': float16,             # <<<<<<<<<<<<<<
 *     'float16': float16,
 *     'f4': float32,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_float16); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_halffloat, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2102
 *     'f2': float16,
 *     'halffloat': float16,
 *     'float16': float16,             # <<<<<<<<<<<<<<
 *     'f4': float32,
 *     'float': float32,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_float16); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_float16, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2103
 *     'halffloat': float16,
 *     'float16': float16,
 *     'f4': float32,             # <<<<<<<<<<<<<<
 *     'float': float32,
 *     'float32': float32,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_float32); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_f4, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2104
 *     'float16': float16,
 *     'f4': float32,
 *     'float': float32,             # <<<<<<<<<<<<<<
 *     'float32': float32,
 *     'f8': float64,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_float32); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_float, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2105
 *     'f4': float32,
 *     'float': float32,
 *     'float32': float32,             # <<<<<<<<<<<<<<
 *     'f8': float64,
 *     'double': float64,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_float32); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_float32, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2106
 *     'float': float32,
 *     'float32': float32,
 *     'f8': float64,             # <<<<<<<<<<<<<<
 *     'double': float64,
 *     'float64': float64,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_float64); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_f8, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2107
 *     'float32': float32,
 *     'f8': float64,
 *     'double': float64,             # <<<<<<<<<<<<<<
 *     'float64': float64,
 *     'string': string,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_float64); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_double, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2108
 *     'f8': float64,
 *     'double': float64,
 *     'float64': float64,             # <<<<<<<<<<<<<<
 *     'string': string,
 *     'str': string,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_float64); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_float64, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2109
 *     'double': float64,
 *     'float64': float64,
 *     'string': string,             # <<<<<<<<<<<<<<
 *     'str': string,
 *     'utf8': string,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_string); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_string, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2110
 *     'float64': float64,
 *     'string': string,
 *     'str': string,             # <<<<<<<<<<<<<<
 *     'utf8': string,
 *     'binary': binary,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_string); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_str_2, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2111
 *     'string': string,
 *     'str': string,
 *     'utf8': string,             # <<<<<<<<<<<<<<
 *     'binary': binary,
 *     'large_string': large_string,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_string); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_utf8, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2112
 *     'str': string,
 *     'utf8': string,
 *     'binary': binary,             # <<<<<<<<<<<<<<
 *     'large_string': large_string,
 *     'large_str': large_string,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_binary); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_binary, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2113
 *     'utf8': string,
 *     'binary': binary,
 *     'large_string': large_string,             # <<<<<<<<<<<<<<
 *     'large_str': large_string,
 *     'large_utf8': large_string,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_large_string); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_large_string, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2114
 *     'binary': binary,
 *     'large_string': large_string,
 *     'large_str': large_string,             # <<<<<<<<<<<<<<
 *     'large_utf8': large_string,
 *     'large_binary': large_binary,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_large_string); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_large_str, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2115
 *     'large_string': large_string,
 *     'large_str': large_string,
 *     'large_utf8': large_string,             # <<<<<<<<<<<<<<
 *     'large_binary': large_binary,
 *     'date32': date32,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_large_string); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_large_utf8, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2116
 *     'large_str': large_string,
 *     'large_utf8': large_string,
 *     'large_binary': large_binary,             # <<<<<<<<<<<<<<
 *     'date32': date32,
 *     'date64': date64,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_large_binary); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_large_binary, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2117
 *     'large_utf8': large_string,
 *     'large_binary': large_binary,
 *     'date32': date32,             # <<<<<<<<<<<<<<
 *     'date64': date64,
 *     'date32[day]': date32,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_date32); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_date32, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2118
 *     'large_binary': large_binary,
 *     'date32': date32,
 *     'date64': date64,             # <<<<<<<<<<<<<<
 *     'date32[day]': date32,
 *     'date64[ms]': date64,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_date64); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_u_date64, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2119
 *     'date32': date32,
 *     'date64': date64,
 *     'date32[day]': date32,             # <<<<<<<<<<<<<<
 *     'date64[ms]': date64,
 *     'time32[s]': time32('s'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_date32); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_date32_day, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2120
 *     'date64': date64,
 *     'date32[day]': date32,
 *     'date64[ms]': date64,             # <<<<<<<<<<<<<<
 *     'time32[s]': time32('s'),
 *     'time32[ms]': time32('ms'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_date64); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_date64_ms, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2121
 *     'date32[day]': date32,
 *     'date64[ms]': date64,
 *     'time32[s]': time32('s'),             # <<<<<<<<<<<<<<
 *     'time32[ms]': time32('ms'),
 *     'time64[us]': time64('us'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_time32); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_tuple__352, NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 2121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_time32_s, __pyx_t_18) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/types.pxi":2122
 *     'date64[ms]': date64,
 *     'time32[s]': time32('s'),
 *     'time32[ms]': time32('ms'),             # <<<<<<<<<<<<<<
 *     'time64[us]': time64('us'),
 *     'time64[ns]': time64('ns'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_time32); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 2122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_tuple__353, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_time32_ms, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2123
 *     'time32[s]': time32('s'),
 *     'time32[ms]': time32('ms'),
 *     'time64[us]': time64('us'),             # <<<<<<<<<<<<<<
 *     'time64[ns]': time64('ns'),
 *     'timestamp[s]': timestamp('s'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_time64); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_tuple__354, NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 2123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_time64_us, __pyx_t_18) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/types.pxi":2124
 *     'time32[ms]': time32('ms'),
 *     'time64[us]': time64('us'),
 *     'time64[ns]': time64('ns'),             # <<<<<<<<<<<<<<
 *     'timestamp[s]': timestamp('s'),
 *     'timestamp[ms]': timestamp('ms'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_time64); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 2124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_tuple__355, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_time64_ns, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2125
 *     'time64[us]': time64('us'),
 *     'time64[ns]': time64('ns'),
 *     'timestamp[s]': timestamp('s'),             # <<<<<<<<<<<<<<
 *     'timestamp[ms]': timestamp('ms'),
 *     'timestamp[us]': timestamp('us'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_timestamp); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_tuple__352, NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 2125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_timestamp_s, __pyx_t_18) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/types.pxi":2126
 *     'time64[ns]': time64('ns'),
 *     'timestamp[s]': timestamp('s'),
 *     'timestamp[ms]': timestamp('ms'),             # <<<<<<<<<<<<<<
 *     'timestamp[us]': timestamp('us'),
 *     'timestamp[ns]': timestamp('ns'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_timestamp); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 2126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_tuple__353, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_timestamp_ms, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2127
 *     'timestamp[s]': timestamp('s'),
 *     'timestamp[ms]': timestamp('ms'),
 *     'timestamp[us]': timestamp('us'),             # <<<<<<<<<<<<<<
 *     'timestamp[ns]': timestamp('ns'),
 *     'duration[s]': duration('s'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_timestamp); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_tuple__354, NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 2127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_timestamp_us, __pyx_t_18) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/types.pxi":2128
 *     'timestamp[ms]': timestamp('ms'),
 *     'timestamp[us]': timestamp('us'),
 *     'timestamp[ns]': timestamp('ns'),             # <<<<<<<<<<<<<<
 *     'duration[s]': duration('s'),
 *     'duration[ms]': duration('ms'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_timestamp); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 2128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_tuple__355, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_timestamp_ns, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2129
 *     'timestamp[us]': timestamp('us'),
 *     'timestamp[ns]': timestamp('ns'),
 *     'duration[s]': duration('s'),             # <<<<<<<<<<<<<<
 *     'duration[ms]': duration('ms'),
 *     'duration[us]': duration('us'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_duration); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_tuple__352, NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 2129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_duration_s, __pyx_t_18) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/types.pxi":2130
 *     'timestamp[ns]': timestamp('ns'),
 *     'duration[s]': duration('s'),
 *     'duration[ms]': duration('ms'),             # <<<<<<<<<<<<<<
 *     'duration[us]': duration('us'),
 *     'duration[ns]': duration('ns'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_duration); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 2130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_tuple__353, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_duration_ms, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2131
 *     'duration[s]': duration('s'),
 *     'duration[ms]': duration('ms'),
 *     'duration[us]': duration('us'),             # <<<<<<<<<<<<<<
 *     'duration[ns]': duration('ns'),
 * }
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_duration); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_tuple__354, NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 2131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_duration_us, __pyx_t_18) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/types.pxi":2132
 *     'duration[ms]': duration('ms'),
 *     'duration[us]': duration('us'),
 *     'duration[ns]': duration('ns'),             # <<<<<<<<<<<<<<
 * }
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_duration); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 2132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_tuple__355, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_duration_ns, __pyx_t_19) < 0) __PYX_ERR(4, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_XGOTREF(__pyx_v_7pyarrow_3lib__type_aliases);
  __Pyx_DECREF_SET(__pyx_v_7pyarrow_3lib__type_aliases, ((PyObject*)__pyx_t_20));
  __Pyx_GIVEREF(__pyx_t_20);
  __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":2136
 * 
 * 
 * def type_for_alias(name):             # <<<<<<<<<<<<<<
 *     """
 *     Return DataType given a string alias if one exists
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_95type_for_alias, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 2136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_type_for_alias, __pyx_t_20) < 0) __PYX_ERR(4, 2136, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":2166
 * 
 * 
 * def schema(fields, metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Construct pyarrow.Schema from collection of fields
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_97schema, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 2166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_schema, __pyx_t_20) < 0) __PYX_ERR(4, 2166, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":2222
 * 
 * 
 * def from_numpy_dtype(object dtype):             # <<<<<<<<<<<<<<
 *     """
 *     Convert NumPy dtype to pyarrow.DataType
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_99from_numpy_dtype, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 2222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_from_numpy_dtype, __pyx_t_20) < 0) __PYX_ERR(4, 2222, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":2234
 * 
 * 
 * def is_boolean_value(object obj):             # <<<<<<<<<<<<<<
 *     return IsPyBool(obj)
 * 
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_101is_boolean_value, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 2234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_boolean_value, __pyx_t_20) < 0) __PYX_ERR(4, 2234, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":2238
 * 
 * 
 * def is_integer_value(object obj):             # <<<<<<<<<<<<<<
 *     return IsPyInt(obj)
 * 
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_103is_integer_value, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 2238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_integer_value, __pyx_t_20) < 0) __PYX_ERR(4, 2238, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":2242
 * 
 * 
 * def is_float_value(object obj):             # <<<<<<<<<<<<<<
 *     return IsPyFloat(obj)
 * 
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_105is_float_value, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 2242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_float_value, __pyx_t_20) < 0) __PYX_ERR(4, 2242, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":2258
 * 
 * 
 * _registry_nanny = _ExtensionRegistryNanny()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_20 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyarrow_3lib__ExtensionRegistryNanny)); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 2258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_registry_nanny, __pyx_t_20) < 0) __PYX_ERR(4, 2258, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":2261
 * 
 * 
 * def _register_py_extension_type():             # <<<<<<<<<<<<<<
 *     cdef:
 *         DataType storage_type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_107_register_py_extension_type, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 2261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_register_py_extension_type, __pyx_t_20) < 0) __PYX_ERR(4, 2261, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":2276
 * 
 * 
 * def _unregister_py_extension_types():             # <<<<<<<<<<<<<<
 *     # This needs to be done explicitly before the Python interpreter is
 *     # finalized.  If the C++ type is destroyed later in the process
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_109_unregister_py_extension_types, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 2276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_unregister_py_extension_types, __pyx_t_20) < 0) __PYX_ERR(4, 2276, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":2290
 * 
 * 
 * _register_py_extension_type()             # <<<<<<<<<<<<<<
 * atexit.register(_unregister_py_extension_types)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_n_s_register_py_extension_type); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 2290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_19 = __Pyx_PyObject_CallNoArg(__pyx_t_20); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":2291
 * 
 * _register_py_extension_type()
 * atexit.register(_unregister_py_extension_types)             # <<<<<<<<<<<<<<
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_atexit); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_register); if (unlikely(!__pyx_t_20)) __PYX_ERR(4, 2291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_unregister_py_extension_types); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 2291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_CallOneArg(__pyx_t_20, __pyx_t_19); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 2291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/scalar.pxi":19
 * 
 * 
 * _NULL = NA = None             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NULL_2, Py_None) < 0) __PYX_ERR(5, 19, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NA, Py_None) < 0) __PYX_ERR(5, 19, __pyx_L1_error)

  /* "pyarrow/scalar.pxi":53
 * 
 * 
 * _NULL = NA = NullType()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_18 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_NullType)); if (unlikely(!__pyx_t_18)) __PYX_ERR(5, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NULL_2, __pyx_t_18) < 0) __PYX_ERR(5, 53, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NA, __pyx_t_18) < 0) __PYX_ERR(5, 53, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/scalar.pxi":299
 * 
 * 
 * cdef dict _DATETIME_CONVERSION_FUNCTIONS = {}             # <<<<<<<<<<<<<<
 * cdef c_bool _datetime_conversion_initialized = False
 * 
 */
  __pyx_t_18 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_18)) __PYX_ERR(5, 299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_XGOTREF(__pyx_v_7pyarrow_3lib__DATETIME_CONVERSION_FUNCTIONS);
  __Pyx_DECREF_SET(__pyx_v_7pyarrow_3lib__DATETIME_CONVERSION_FUNCTIONS, ((PyObject*)__pyx_t_18));
  __Pyx_GIVEREF(__pyx_t_18);
  __pyx_t_18 = 0;

  /* "pyarrow/scalar.pxi":300
 * 
 * cdef dict _DATETIME_CONVERSION_FUNCTIONS = {}
 * cdef c_bool _datetime_conversion_initialized = False             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_7pyarrow_3lib__datetime_conversion_initialized = 0;

  /* "pyarrow/scalar.pxi":317
 * 
 * 
 * def _nanoseconds_to_datetime_safe(v, tzinfo):             # <<<<<<<<<<<<<<
 *     if v % 1000 != 0:
 *         raise ValueError("Nanosecond timestamp {} is not safely convertible "
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_115_nanoseconds_to_datetime_safe, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(5, 317, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_nanoseconds_to_datetime_safe, __pyx_t_18) < 0) __PYX_ERR(5, 317, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/scalar.pxi":330
 * 
 * 
 * def _microseconds_to_datetime(v, tzinfo):             # <<<<<<<<<<<<<<
 *     micros = v % 1_000_000
 *     dt = _datetime_from_seconds(v // 1_000_000)
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_117_microseconds_to_datetime, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(5, 330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_microseconds_to_datetime, __pyx_t_18) < 0) __PYX_ERR(5, 330, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/scalar.pxi":336
 * 
 * 
 * def _millis_to_datetime(v, tzinfo):             # <<<<<<<<<<<<<<
 *     millis = v % 1_000
 *     dt = _datetime_from_seconds(v // 1000)
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_119_millis_to_datetime, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(5, 336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_millis_to_datetime, __pyx_t_18) < 0) __PYX_ERR(5, 336, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/scalar.pxi":342
 * 
 * 
 * def _seconds_to_datetime(v, tzinfo):             # <<<<<<<<<<<<<<
 *     dt = _datetime_from_seconds(v)
 *     return _add_micros_maybe_localize(dt, 0, tzinfo)
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_121_seconds_to_datetime, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(5, 342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_seconds_to_datetime, __pyx_t_18) < 0) __PYX_ERR(5, 342, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/scalar.pxi":347
 * 
 * 
 * def _datetime_conversion_functions():             # <<<<<<<<<<<<<<
 *     global _datetime_conversion_initialized
 *     if _datetime_conversion_initialized:
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_123_datetime_conversion_functions, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(5, 347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_datetime_conversion_functions, __pyx_t_18) < 0) __PYX_ERR(5, 347, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/scalar.pxi":408
 * 
 * 
 * cdef dict _TIMEDELTA_CONVERSION_FUNCTIONS = {}             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_18 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_18)) __PYX_ERR(5, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_XGOTREF(__pyx_v_7pyarrow_3lib__TIMEDELTA_CONVERSION_FUNCTIONS);
  __Pyx_DECREF_SET(__pyx_v_7pyarrow_3lib__TIMEDELTA_CONVERSION_FUNCTIONS, ((PyObject*)__pyx_t_18));
  __Pyx_GIVEREF(__pyx_t_18);
  __pyx_t_18 = 0;

  /* "pyarrow/scalar.pxi":411
 * 
 * 
 * def _nanoseconds_to_timedelta_safe(v):             # <<<<<<<<<<<<<<
 *     if v % 1000 != 0:
 *         raise ValueError(
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_125_nanoseconds_to_timedelta_safe, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(5, 411, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_nanoseconds_to_timedelta_safe, __pyx_t_18) < 0) __PYX_ERR(5, 411, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/scalar.pxi":423
 * 
 * 
 * def _timedelta_conversion_functions():             # <<<<<<<<<<<<<<
 *     if _TIMEDELTA_CONVERSION_FUNCTIONS:
 *         return _TIMEDELTA_CONVERSION_FUNCTIONS
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_127_timedelta_conversion_functions, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(5, 423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_timedelta_conversion_functions_2, __pyx_t_18) < 0) __PYX_ERR(5, 423, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/scalar.pxi":965
 * 
 * cdef dict _array_value_classes = {
 *     _Type_BOOL: BooleanValue,             # <<<<<<<<<<<<<<
 *     _Type_UINT8: UInt8Value,
 *     _Type_UINT16: UInt16Value,
 */
  __pyx_t_18 = __Pyx_PyDict_NewPresized(31); if (unlikely(!__pyx_t_18)) __PYX_ERR(5, 965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::BOOL); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_BooleanValue)) < 0) __PYX_ERR(5, 965, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":966
 * cdef dict _array_value_classes = {
 *     _Type_BOOL: BooleanValue,
 *     _Type_UINT8: UInt8Value,             # <<<<<<<<<<<<<<
 *     _Type_UINT16: UInt16Value,
 *     _Type_UINT32: UInt32Value,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT8); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 966, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_UInt8Value)) < 0) __PYX_ERR(5, 965, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":967
 *     _Type_BOOL: BooleanValue,
 *     _Type_UINT8: UInt8Value,
 *     _Type_UINT16: UInt16Value,             # <<<<<<<<<<<<<<
 *     _Type_UINT32: UInt32Value,
 *     _Type_UINT64: UInt64Value,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT16); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_UInt16Value)) < 0) __PYX_ERR(5, 965, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":968
 *     _Type_UINT8: UInt8Value,
 *     _Type_UINT16: UInt16Value,
 *     _Type_UINT32: UInt32Value,             # <<<<<<<<<<<<<<
 *     _Type_UINT64: UInt64Value,
 *     _Type_INT8: Int8Value,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT32); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_UInt32Value)) < 0) __PYX_ERR(5, 965, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":969
 *     _Type_UINT16: UInt16Value,
 *     _Type_UINT32: UInt32Value,
 *     _Type_UINT64: UInt64Value,             # <<<<<<<<<<<<<<
 *     _Type_INT8: Int8Value,
 *     _Type_INT16: Int16Value,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT64); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 969, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_UInt64Value)) < 0) __PYX_ERR(5, 965, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":970
 *     _Type_UINT32: UInt32Value,
 *     _Type_UINT64: UInt64Value,
 *     _Type_INT8: Int8Value,             # <<<<<<<<<<<<<<
 *     _Type_INT16: Int16Value,
 *     _Type_INT32: Int32Value,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT8); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Int8Value)) < 0) __PYX_ERR(5, 965, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":971
 *     _Type_UINT64: UInt64Value,
 *     _Type_INT8: Int8Value,
 *     _Type_INT16: Int16Value,             # <<<<<<<<<<<<<<
 *     _Type_INT32: Int32Value,
 *     _Type_INT64: Int64Value,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT16); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 971, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Int16Value)) < 0) __PYX_ERR(5, 965, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":972
 *     _Type_INT8: Int8Value,
 *     _Type_INT16: Int16Value,
 *     _Type_INT32: Int32Value,             # <<<<<<<<<<<<<<
 *     _Type_INT64: Int64Value,
 *     _Type_DATE32: Date32Value,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT32); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 972, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Int32Value)) < 0) __PYX_ERR(5, 965, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":973
 *     _Type_INT16: Int16Value,
 *     _Type_INT32: Int32Value,
 *     _Type_INT64: Int64Value,             # <<<<<<<<<<<<<<
 *     _Type_DATE32: Date32Value,
 *     _Type_DATE64: Date64Value,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT64); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 973, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Int64Value)) < 0) __PYX_ERR(5, 965, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":974
 *     _Type_INT32: Int32Value,
 *     _Type_INT64: Int64Value,
 *     _Type_DATE32: Date32Value,             # <<<<<<<<<<<<<<
 *     _Type_DATE64: Date64Value,
 *     _Type_TIME32: Time32Value,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DATE32); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Date32Value)) < 0) __PYX_ERR(5, 965, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":975
 *     _Type_INT64: Int64Value,
 *     _Type_DATE32: Date32Value,
 *     _Type_DATE64: Date64Value,             # <<<<<<<<<<<<<<
 *     _Type_TIME32: Time32Value,
 *     _Type_TIME64: Time64Value,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DATE64); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 975, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Date64Value)) < 0) __PYX_ERR(5, 965, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":976
 *     _Type_DATE32: Date32Value,
 *     _Type_DATE64: Date64Value,
 *     _Type_TIME32: Time32Value,             # <<<<<<<<<<<<<<
 *     _Type_TIME64: Time64Value,
 *     _Type_TIMESTAMP: TimestampValue,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIME32); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 976, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Time32Value)) < 0) __PYX_ERR(5, 965, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":977
 *     _Type_DATE64: Date64Value,
 *     _Type_TIME32: Time32Value,
 *     _Type_TIME64: Time64Value,             # <<<<<<<<<<<<<<
 *     _Type_TIMESTAMP: TimestampValue,
 *     _Type_DURATION: DurationValue,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIME64); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 977, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Time64Value)) < 0) __PYX_ERR(5, 965, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":978
 *     _Type_TIME32: Time32Value,
 *     _Type_TIME64: Time64Value,
 *     _Type_TIMESTAMP: TimestampValue,             # <<<<<<<<<<<<<<
 *     _Type_DURATION: DurationValue,
 *     _Type_HALF_FLOAT: HalfFloatValue,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIMESTAMP); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 978, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_TimestampValue)) < 0) __PYX_ERR(5, 965, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":979
 *     _Type_TIME64: Time64Value,
 *     _Type_TIMESTAMP: TimestampValue,
 *     _Type_DURATION: DurationValue,             # <<<<<<<<<<<<<<
 *     _Type_HALF_FLOAT: HalfFloatValue,
 *     _Type_FLOAT: FloatValue,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DURATION); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 979, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_DurationValue)) < 0) __PYX_ERR(5, 965, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":980
 *     _Type_TIMESTAMP: TimestampValue,
 *     _Type_DURATION: DurationValue,
 *     _Type_HALF_FLOAT: HalfFloatValue,             # <<<<<<<<<<<<<<
 *     _Type_FLOAT: FloatValue,
 *     _Type_DOUBLE: DoubleValue,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::HALF_FLOAT); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 980, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_HalfFloatValue)) < 0) __PYX_ERR(5, 965, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":981
 *     _Type_DURATION: DurationValue,
 *     _Type_HALF_FLOAT: HalfFloatValue,
 *     _Type_FLOAT: FloatValue,             # <<<<<<<<<<<<<<
 *     _Type_DOUBLE: DoubleValue,
 *     _Type_LIST: ListValue,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::FLOAT); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 981, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_FloatValue)) < 0) __PYX_ERR(5, 965, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":982
 *     _Type_HALF_FLOAT: HalfFloatValue,
 *     _Type_FLOAT: FloatValue,
 *     _Type_DOUBLE: DoubleValue,             # <<<<<<<<<<<<<<
 *     _Type_LIST: ListValue,
 *     _Type_LARGE_LIST: LargeListValue,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DOUBLE); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 982, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_DoubleValue)) < 0) __PYX_ERR(5, 965, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":983
 *     _Type_FLOAT: FloatValue,
 *     _Type_DOUBLE: DoubleValue,
 *     _Type_LIST: ListValue,             # <<<<<<<<<<<<<<
 *     _Type_LARGE_LIST: LargeListValue,
 *     _Type_MAP: MapValue,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::LIST); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 983, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_ListValue)) < 0) __PYX_ERR(5, 965, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":984
 *     _Type_DOUBLE: DoubleValue,
 *     _Type_LIST: ListValue,
 *     _Type_LARGE_LIST: LargeListValue,             # <<<<<<<<<<<<<<
 *     _Type_MAP: MapValue,
 *     _Type_FIXED_SIZE_LIST: FixedSizeListValue,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::LARGE_LIST); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 984, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_LargeListValue)) < 0) __PYX_ERR(5, 965, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":985
 *     _Type_LIST: ListValue,
 *     _Type_LARGE_LIST: LargeListValue,
 *     _Type_MAP: MapValue,             # <<<<<<<<<<<<<<
 *     _Type_FIXED_SIZE_LIST: FixedSizeListValue,
 *     _Type_UNION: UnionValue,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::MAP); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 985, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_MapValue)) < 0) __PYX_ERR(5, 965, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":986
 *     _Type_LARGE_LIST: LargeListValue,
 *     _Type_MAP: MapValue,
 *     _Type_FIXED_SIZE_LIST: FixedSizeListValue,             # <<<<<<<<<<<<<<
 *     _Type_UNION: UnionValue,
 *     _Type_BINARY: BinaryValue,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::FIXED_SIZE_LIST); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 986, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_FixedSizeListValue)) < 0) __PYX_ERR(5, 965, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":987
 *     _Type_MAP: MapValue,
 *     _Type_FIXED_SIZE_LIST: FixedSizeListValue,
 *     _Type_UNION: UnionValue,             # <<<<<<<<<<<<<<
 *     _Type_BINARY: BinaryValue,
 *     _Type_STRING: StringValue,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UNION); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 987, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_UnionValue)) < 0) __PYX_ERR(5, 965, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":988
 *     _Type_FIXED_SIZE_LIST: FixedSizeListValue,
 *     _Type_UNION: UnionValue,
 *     _Type_BINARY: BinaryValue,             # <<<<<<<<<<<<<<
 *     _Type_STRING: StringValue,
 *     _Type_LARGE_BINARY: LargeBinaryValue,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::BINARY); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 988, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_BinaryValue)) < 0) __PYX_ERR(5, 965, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":989
 *     _Type_UNION: UnionValue,
 *     _Type_BINARY: BinaryValue,
 *     _Type_STRING: StringValue,             # <<<<<<<<<<<<<<
 *     _Type_LARGE_BINARY: LargeBinaryValue,
 *     _Type_LARGE_STRING: LargeStringValue,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::STRING); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_StringValue)) < 0) __PYX_ERR(5, 965, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":990
 *     _Type_BINARY: BinaryValue,
 *     _Type_STRING: StringValue,
 *     _Type_LARGE_BINARY: LargeBinaryValue,             # <<<<<<<<<<<<<<
 *     _Type_LARGE_STRING: LargeStringValue,
 *     _Type_FIXED_SIZE_BINARY: FixedSizeBinaryValue,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::LARGE_BINARY); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 990, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_LargeBinaryValue)) < 0) __PYX_ERR(5, 965, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":991
 *     _Type_STRING: StringValue,
 *     _Type_LARGE_BINARY: LargeBinaryValue,
 *     _Type_LARGE_STRING: LargeStringValue,             # <<<<<<<<<<<<<<
 *     _Type_FIXED_SIZE_BINARY: FixedSizeBinaryValue,
 *     _Type_DECIMAL: DecimalValue,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::LARGE_STRING); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 991, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_LargeStringValue)) < 0) __PYX_ERR(5, 965, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":992
 *     _Type_LARGE_BINARY: LargeBinaryValue,
 *     _Type_LARGE_STRING: LargeStringValue,
 *     _Type_FIXED_SIZE_BINARY: FixedSizeBinaryValue,             # <<<<<<<<<<<<<<
 *     _Type_DECIMAL: DecimalValue,
 *     _Type_STRUCT: StructValue,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::FIXED_SIZE_BINARY); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 992, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_FixedSizeBinaryValue)) < 0) __PYX_ERR(5, 965, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":993
 *     _Type_LARGE_STRING: LargeStringValue,
 *     _Type_FIXED_SIZE_BINARY: FixedSizeBinaryValue,
 *     _Type_DECIMAL: DecimalValue,             # <<<<<<<<<<<<<<
 *     _Type_STRUCT: StructValue,
 *     _Type_DICTIONARY: DictionaryValue,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DECIMAL); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_DecimalValue)) < 0) __PYX_ERR(5, 965, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":994
 *     _Type_FIXED_SIZE_BINARY: FixedSizeBinaryValue,
 *     _Type_DECIMAL: DecimalValue,
 *     _Type_STRUCT: StructValue,             # <<<<<<<<<<<<<<
 *     _Type_DICTIONARY: DictionaryValue,
 * }
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::STRUCT); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 994, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_StructValue)) < 0) __PYX_ERR(5, 965, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":995
 *     _Type_DECIMAL: DecimalValue,
 *     _Type_STRUCT: StructValue,
 *     _Type_DICTIONARY: DictionaryValue,             # <<<<<<<<<<<<<<
 * }
 * 
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DICTIONARY); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_DictionaryValue)) < 0) __PYX_ERR(5, 965, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_XGOTREF(__pyx_v_7pyarrow_3lib__array_value_classes);
  __Pyx_DECREF_SET(__pyx_v_7pyarrow_3lib__array_value_classes, ((PyObject*)__pyx_t_18));
  __Pyx_GIVEREF(__pyx_t_18);
  __pyx_t_18 = 0;

  /* "pyarrow/scalar.pxi":1166
 * 
 * cdef dict _scalar_classes = {
 *     _Type_UINT8: UInt8Scalar,             # <<<<<<<<<<<<<<
 *     _Type_UINT16: UInt16Scalar,
 *     _Type_UINT32: UInt32Scalar,
 */
  __pyx_t_18 = __Pyx_PyDict_NewPresized(10); if (unlikely(!__pyx_t_18)) __PYX_ERR(5, 1166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT8); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 1166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_UInt8Scalar)) < 0) __PYX_ERR(5, 1166, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":1167
 * cdef dict _scalar_classes = {
 *     _Type_UINT8: UInt8Scalar,
 *     _Type_UINT16: UInt16Scalar,             # <<<<<<<<<<<<<<
 *     _Type_UINT32: UInt32Scalar,
 *     _Type_UINT64: UInt64Scalar,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT16); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 1167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_UInt16Scalar)) < 0) __PYX_ERR(5, 1166, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":1168
 *     _Type_UINT8: UInt8Scalar,
 *     _Type_UINT16: UInt16Scalar,
 *     _Type_UINT32: UInt32Scalar,             # <<<<<<<<<<<<<<
 *     _Type_UINT64: UInt64Scalar,
 *     _Type_INT8: Int8Scalar,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT32); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 1168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_UInt32Scalar)) < 0) __PYX_ERR(5, 1166, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":1169
 *     _Type_UINT16: UInt16Scalar,
 *     _Type_UINT32: UInt32Scalar,
 *     _Type_UINT64: UInt64Scalar,             # <<<<<<<<<<<<<<
 *     _Type_INT8: Int8Scalar,
 *     _Type_INT16: Int16Scalar,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT64); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 1169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_UInt64Scalar)) < 0) __PYX_ERR(5, 1166, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":1170
 *     _Type_UINT32: UInt32Scalar,
 *     _Type_UINT64: UInt64Scalar,
 *     _Type_INT8: Int8Scalar,             # <<<<<<<<<<<<<<
 *     _Type_INT16: Int16Scalar,
 *     _Type_INT32: Int32Scalar,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT8); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 1170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Int8Scalar)) < 0) __PYX_ERR(5, 1166, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":1171
 *     _Type_UINT64: UInt64Scalar,
 *     _Type_INT8: Int8Scalar,
 *     _Type_INT16: Int16Scalar,             # <<<<<<<<<<<<<<
 *     _Type_INT32: Int32Scalar,
 *     _Type_INT64: Int64Scalar,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT16); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 1171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Int16Scalar)) < 0) __PYX_ERR(5, 1166, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":1172
 *     _Type_INT8: Int8Scalar,
 *     _Type_INT16: Int16Scalar,
 *     _Type_INT32: Int32Scalar,             # <<<<<<<<<<<<<<
 *     _Type_INT64: Int64Scalar,
 *     _Type_FLOAT: FloatScalar,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT32); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 1172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Int32Scalar)) < 0) __PYX_ERR(5, 1166, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":1173
 *     _Type_INT16: Int16Scalar,
 *     _Type_INT32: Int32Scalar,
 *     _Type_INT64: Int64Scalar,             # <<<<<<<<<<<<<<
 *     _Type_FLOAT: FloatScalar,
 *     _Type_DOUBLE: DoubleScalar,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT64); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 1173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Int64Scalar)) < 0) __PYX_ERR(5, 1166, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":1174
 *     _Type_INT32: Int32Scalar,
 *     _Type_INT64: Int64Scalar,
 *     _Type_FLOAT: FloatScalar,             # <<<<<<<<<<<<<<
 *     _Type_DOUBLE: DoubleScalar,
 * }
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::FLOAT); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 1174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_FloatScalar)) < 0) __PYX_ERR(5, 1166, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":1175
 *     _Type_INT64: Int64Scalar,
 *     _Type_FLOAT: FloatScalar,
 *     _Type_DOUBLE: DoubleScalar,             # <<<<<<<<<<<<<<
 * }
 * 
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DOUBLE); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 1175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_18, __pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_DoubleScalar)) < 0) __PYX_ERR(5, 1166, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_XGOTREF(__pyx_v_7pyarrow_3lib__scalar_classes);
  __Pyx_DECREF_SET(__pyx_v_7pyarrow_3lib__scalar_classes, ((PyObject*)__pyx_t_18));
  __Pyx_GIVEREF(__pyx_t_18);
  __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":18
 * # under the License.
 * 
 * import warnings             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_18 = __Pyx_Import(__pyx_n_s_warnings, 0, 0); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_18) < 0) __PYX_ERR(1, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":52
 * 
 * 
 * def _ndarray_to_arrow_type(object values, DataType type):             # <<<<<<<<<<<<<<
 *     return pyarrow_wrap_data_type(_ndarray_to_type(values, type))
 * 
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_129_ndarray_to_arrow_type, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ndarray_to_arrow_type, __pyx_t_18) < 0) __PYX_ERR(1, 52, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":102
 * 
 * 
 * def _handle_arrow_array_protocol(obj, type, mask, size):             # <<<<<<<<<<<<<<
 *     if mask is not None or size is not None:
 *         raise ValueError(
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_131_handle_arrow_array_protocol, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_handle_arrow_array_protocol, __pyx_t_18) < 0) __PYX_ERR(1, 102, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":114
 * 
 * 
 * def array(object obj, type=None, mask=None, size=None, from_pandas=None,             # <<<<<<<<<<<<<<
 *           bint safe=True, MemoryPool memory_pool=None):
 *     """
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_133array, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_array, __pyx_t_18) < 0) __PYX_ERR(1, 114, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":272
 * 
 * 
 * def asarray(values, type=None):             # <<<<<<<<<<<<<<
 *     """
 *     Convert to pyarrow.Array, inferring type if not provided. Attempt to cast
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_135asarray, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 272, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_asarray, __pyx_t_18) < 0) __PYX_ERR(1, 272, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":298
 * 
 * 
 * def infer_type(values, mask=None, from_pandas=False):             # <<<<<<<<<<<<<<
 *     """
 *     Attempt to infer Arrow data type that can hold the passed Python
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_137infer_type, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_infer_type, __pyx_t_18) < 0) __PYX_ERR(1, 298, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":327
 * 
 * 
 * def _normalize_slice(object arrow_obj, slice key):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t start, stop, step
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_139_normalize_slice, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_normalize_slice, __pyx_t_18) < 0) __PYX_ERR(1, 327, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":373
 *         self.ctx.reset(new CFunctionContext(c_default_memory_pool()))
 * 
 * cdef _FunctionContext _global_ctx = _FunctionContext()             # <<<<<<<<<<<<<<
 * 
 * cdef CFunctionContext* _context() nogil:
 */
  __pyx_t_18 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyarrow_3lib__FunctionContext)); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_XGOTREF(((PyObject *)__pyx_v_7pyarrow_3lib__global_ctx));
  __Pyx_DECREF_SET(__pyx_v_7pyarrow_3lib__global_ctx, ((struct __pyx_obj_7pyarrow_3lib__FunctionContext *)__pyx_t_18));
  __Pyx_GIVEREF(__pyx_t_18);
  __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":472
 * 
 * 
 * def _restore_array(data):             # <<<<<<<<<<<<<<
 *     """
 *     Reconstruct an Array from pickled ArrayData.
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_141_restore_array, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_restore_array, __pyx_t_18) < 0) __PYX_ERR(1, 472, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":723
 * 
 *     @staticmethod
 *     def from_pandas(obj, mask=None, type=None, bint safe=True,             # <<<<<<<<<<<<<<
 *                     MemoryPool memory_pool=None):
 *         """
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_5Array_19from_pandas, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Array->tp_dict, __pyx_n_s_from_pandas, __pyx_t_18) < 0) __PYX_ERR(1, 723, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Array);

  /* "pyarrow/array.pxi":722
 *         return wrap_datum(out)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_pandas(obj, mask=None, type=None, bint safe=True,
 *                     MemoryPool memory_pool=None):
 */
  __Pyx_GetNameInClass(__pyx_t_18, (PyObject *)__pyx_ptype_7pyarrow_3lib_Array, __pyx_n_s_from_pandas); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 722, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Array->tp_dict, __pyx_n_s_from_pandas, __pyx_t_19) < 0) __PYX_ERR(1, 723, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Array);

  /* "pyarrow/array.pxi":763
 * 
 *     @staticmethod
 *     def from_buffers(DataType type, length, buffers, null_count=-1, offset=0,             # <<<<<<<<<<<<<<
 *                      children=None):
 *         """
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_5Array_23from_buffers, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 763, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Array->tp_dict, __pyx_n_s_from_buffers, __pyx_t_19) < 0) __PYX_ERR(1, 763, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Array);

  /* "pyarrow/array.pxi":762
 *             (_reduce_array_data(self.sp_array.get().data().get()),)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_buffers(DataType type, length, buffers, null_count=-1, offset=0,
 *                      children=None):
 */
  __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_7pyarrow_3lib_Array, __pyx_n_s_from_buffers); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 763, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_19); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 762, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Array->tp_dict, __pyx_n_s_from_buffers, __pyx_t_18) < 0) __PYX_ERR(1, 763, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Array);

  /* "pyarrow/array.pxi":1317
 * 
 *     @staticmethod
 *     def from_arrays(offsets, values, MemoryPool pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct ListArray from arrays of int32 offsets and values
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_9ListArray_1from_arrays, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1317, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_ListArray->tp_dict, __pyx_n_s_from_arrays, __pyx_t_18) < 0) __PYX_ERR(1, 1317, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_ListArray);

  /* "pyarrow/array.pxi":1316
 *     """
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_arrays(offsets, values, MemoryPool pool=None):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_18, (PyObject *)__pyx_ptype_7pyarrow_3lib_ListArray, __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1317, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 1316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_ListArray->tp_dict, __pyx_n_s_from_arrays, __pyx_t_19) < 0) __PYX_ERR(1, 1317, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_ListArray);

  /* "pyarrow/array.pxi":1398
 * 
 *     @staticmethod
 *     def from_arrays(offsets, values, MemoryPool pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct LargeListArray from arrays of int64 offsets and values
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_14LargeListArray_1from_arrays, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 1398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_LargeListArray->tp_dict, __pyx_n_s_from_arrays, __pyx_t_19) < 0) __PYX_ERR(1, 1398, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_LargeListArray);

  /* "pyarrow/array.pxi":1397
 *     """
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_arrays(offsets, values, MemoryPool pool=None):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_7pyarrow_3lib_LargeListArray, __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 1398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_19); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_LargeListArray->tp_dict, __pyx_n_s_from_arrays, __pyx_t_18) < 0) __PYX_ERR(1, 1398, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_LargeListArray);

  /* "pyarrow/array.pxi":1479
 * 
 *     @staticmethod
 *     def from_arrays(offsets, keys, items, MemoryPool pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct MapArray from arrays of int32 offsets and key, item arrays
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_8MapArray_1from_arrays, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1479, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_MapArray->tp_dict, __pyx_n_s_from_arrays, __pyx_t_18) < 0) __PYX_ERR(1, 1479, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_MapArray);

  /* "pyarrow/array.pxi":1478
 *     """
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_arrays(offsets, keys, items, MemoryPool pool=None):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_18, (PyObject *)__pyx_ptype_7pyarrow_3lib_MapArray, __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1479, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 1478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_MapArray->tp_dict, __pyx_n_s_from_arrays, __pyx_t_19) < 0) __PYX_ERR(1, 1479, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_MapArray);

  /* "pyarrow/array.pxi":1525
 * 
 *     @staticmethod
 *     def from_arrays(values, int32_t list_size):             # <<<<<<<<<<<<<<
 *         """
 *         Construct FixedSizeListArray from array of values and a list length.
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_18FixedSizeListArray_1from_arrays, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 1525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_FixedSizeListArray->tp_dict, __pyx_n_s_from_arrays, __pyx_t_19) < 0) __PYX_ERR(1, 1525, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_FixedSizeListArray);

  /* "pyarrow/array.pxi":1524
 *     """
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_arrays(values, int32_t list_size):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_7pyarrow_3lib_FixedSizeListArray, __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 1525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_19); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_FixedSizeListArray->tp_dict, __pyx_n_s_from_arrays, __pyx_t_18) < 0) __PYX_ERR(1, 1525, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_FixedSizeListArray);

  /* "pyarrow/array.pxi":1574
 * 
 *     @staticmethod
 *     def from_dense(Array types, Array value_offsets, list children,             # <<<<<<<<<<<<<<
 *                    list field_names=None, list type_codes=None):
 *         """
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_10UnionArray_1from_dense, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_UnionArray->tp_dict, __pyx_n_s_from_dense, __pyx_t_18) < 0) __PYX_ERR(1, 1574, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_UnionArray);

  /* "pyarrow/array.pxi":1573
 *     """
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_dense(Array types, Array value_offsets, list children,
 *                    list field_names=None, list type_codes=None):
 */
  __Pyx_GetNameInClass(__pyx_t_18, (PyObject *)__pyx_ptype_7pyarrow_3lib_UnionArray, __pyx_n_s_from_dense); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 1573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_UnionArray->tp_dict, __pyx_n_s_from_dense, __pyx_t_19) < 0) __PYX_ERR(1, 1574, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_UnionArray);

  /* "pyarrow/array.pxi":1614
 * 
 *     @staticmethod
 *     def from_sparse(Array types, list children, list field_names=None,             # <<<<<<<<<<<<<<
 *                     list type_codes=None):
 *         """
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_10UnionArray_3from_sparse, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 1614, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_UnionArray->tp_dict, __pyx_n_s_from_sparse, __pyx_t_19) < 0) __PYX_ERR(1, 1614, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_UnionArray);

  /* "pyarrow/array.pxi":1613
 *         return result
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_sparse(Array types, list children, list field_names=None,
 *                     list type_codes=None):
 */
  __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_7pyarrow_3lib_UnionArray, __pyx_n_s_from_sparse); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 1614, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_19); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_UnionArray->tp_dict, __pyx_n_s_from_sparse, __pyx_t_18) < 0) __PYX_ERR(1, 1614, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_UnionArray);

  /* "pyarrow/array.pxi":1660
 * 
 *     @staticmethod
 *     def from_buffers(int length, Buffer value_offsets, Buffer data,             # <<<<<<<<<<<<<<
 *                      Buffer null_bitmap=None, int null_count=-1,
 *                      int offset=0):
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_11StringArray_1from_buffers, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_StringArray->tp_dict, __pyx_n_s_from_buffers, __pyx_t_18) < 0) __PYX_ERR(1, 1660, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_StringArray);

  /* "pyarrow/array.pxi":1659
 *     """
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_buffers(int length, Buffer value_offsets, Buffer data,
 *                      Buffer null_bitmap=None, int null_count=-1,
 */
  __Pyx_GetNameInClass(__pyx_t_18, (PyObject *)__pyx_ptype_7pyarrow_3lib_StringArray, __pyx_n_s_from_buffers); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 1659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_StringArray->tp_dict, __pyx_n_s_from_buffers, __pyx_t_19) < 0) __PYX_ERR(1, 1660, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_StringArray);

  /* "pyarrow/array.pxi":1692
 * 
 *     @staticmethod
 *     def from_buffers(int length, Buffer value_offsets, Buffer data,             # <<<<<<<<<<<<<<
 *                      Buffer null_bitmap=None, int null_count=-1,
 *                      int offset=0):
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_16LargeStringArray_1from_buffers, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 1692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_LargeStringArray->tp_dict, __pyx_n_s_from_buffers, __pyx_t_19) < 0) __PYX_ERR(1, 1692, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_LargeStringArray);

  /* "pyarrow/array.pxi":1691
 *     """
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_buffers(int length, Buffer value_offsets, Buffer data,
 *                      Buffer null_bitmap=None, int null_count=-1,
 */
  __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_7pyarrow_3lib_LargeStringArray, __pyx_n_s_from_buffers); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 1692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_19); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_LargeStringArray->tp_dict, __pyx_n_s_from_buffers, __pyx_t_18) < 0) __PYX_ERR(1, 1692, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_LargeStringArray);

  /* "pyarrow/array.pxi":1757
 * 
 *     @staticmethod
 *     def from_arrays(indices, dictionary, mask=None, bint ordered=False,             # <<<<<<<<<<<<<<
 *                     bint from_pandas=False, bint safe=True,
 *                     MemoryPool memory_pool=None):
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_15DictionaryArray_3from_arrays, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_DictionaryArray->tp_dict, __pyx_n_s_from_arrays, __pyx_t_18) < 0) __PYX_ERR(1, 1757, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_DictionaryArray);

  /* "pyarrow/array.pxi":1756
 *         return self._indices
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_arrays(indices, dictionary, mask=None, bint ordered=False,
 *                     bint from_pandas=False, bint safe=True,
 */
  __Pyx_GetNameInClass(__pyx_t_18, (PyObject *)__pyx_ptype_7pyarrow_3lib_DictionaryArray, __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 1756, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_DictionaryArray->tp_dict, __pyx_n_s_from_arrays, __pyx_t_19) < 0) __PYX_ERR(1, 1757, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_DictionaryArray);

  /* "pyarrow/array.pxi":1888
 * 
 *     @staticmethod
 *     def from_arrays(arrays, names=None, fields=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct StructArray from collection of arrays representing
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_11StructArray_5from_arrays, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 1888, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_StructArray->tp_dict, __pyx_n_s_from_arrays, __pyx_t_19) < 0) __PYX_ERR(1, 1888, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_StructArray);

  /* "pyarrow/array.pxi":1887
 *         return [pyarrow_wrap_array(arr) for arr in arrays]
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_arrays(arrays, names=None, fields=None):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_7pyarrow_3lib_StructArray, __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 1888, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_19); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1887, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_StructArray->tp_dict, __pyx_n_s_from_arrays, __pyx_t_18) < 0) __PYX_ERR(1, 1888, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_StructArray);

  /* "pyarrow/array.pxi":1969
 * 
 *     @staticmethod
 *     def from_storage(BaseExtensionType typ, Array storage):             # <<<<<<<<<<<<<<
 *         """
 *         Construct ExtensionArray from type and storage array.
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_14ExtensionArray_1from_storage, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1969, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_ExtensionArray->tp_dict, __pyx_n_s_from_storage, __pyx_t_18) < 0) __PYX_ERR(1, 1969, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_ExtensionArray);

  /* "pyarrow/array.pxi":1968
 *         return pyarrow_wrap_array(ext_array.storage())
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_storage(BaseExtensionType typ, Array storage):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_18, (PyObject *)__pyx_ptype_7pyarrow_3lib_ExtensionArray, __pyx_n_s_from_storage); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 1969, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 1968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_ExtensionArray->tp_dict, __pyx_n_s_from_storage, __pyx_t_19) < 0) __PYX_ERR(1, 1969, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_ExtensionArray);

  /* "pyarrow/array.pxi":2010
 * 
 * cdef dict _array_classes = {
 *     _Type_NA: NullArray,             # <<<<<<<<<<<<<<
 *     _Type_BOOL: BooleanArray,
 *     _Type_UINT8: UInt8Array,
 */
  __pyx_t_19 = __Pyx_PyDict_NewPresized(33); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 2010, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::NA); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 2010, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_NullArray)) < 0) __PYX_ERR(1, 2010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":2011
 * cdef dict _array_classes = {
 *     _Type_NA: NullArray,
 *     _Type_BOOL: BooleanArray,             # <<<<<<<<<<<<<<
 *     _Type_UINT8: UInt8Array,
 *     _Type_UINT16: UInt16Array,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::BOOL); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 2011, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_BooleanArray)) < 0) __PYX_ERR(1, 2010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":2012
 *     _Type_NA: NullArray,
 *     _Type_BOOL: BooleanArray,
 *     _Type_UINT8: UInt8Array,             # <<<<<<<<<<<<<<
 *     _Type_UINT16: UInt16Array,
 *     _Type_UINT32: UInt32Array,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT8); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 2012, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_UInt8Array)) < 0) __PYX_ERR(1, 2010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":2013
 *     _Type_BOOL: BooleanArray,
 *     _Type_UINT8: UInt8Array,
 *     _Type_UINT16: UInt16Array,             # <<<<<<<<<<<<<<
 *     _Type_UINT32: UInt32Array,
 *     _Type_UINT64: UInt64Array,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT16); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 2013, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_UInt16Array)) < 0) __PYX_ERR(1, 2010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":2014
 *     _Type_UINT8: UInt8Array,
 *     _Type_UINT16: UInt16Array,
 *     _Type_UINT32: UInt32Array,             # <<<<<<<<<<<<<<
 *     _Type_UINT64: UInt64Array,
 *     _Type_INT8: Int8Array,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT32); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 2014, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_UInt32Array)) < 0) __PYX_ERR(1, 2010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":2015
 *     _Type_UINT16: UInt16Array,
 *     _Type_UINT32: UInt32Array,
 *     _Type_UINT64: UInt64Array,             # <<<<<<<<<<<<<<
 *     _Type_INT8: Int8Array,
 *     _Type_INT16: Int16Array,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT64); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 2015, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_UInt64Array)) < 0) __PYX_ERR(1, 2010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":2016
 *     _Type_UINT32: UInt32Array,
 *     _Type_UINT64: UInt64Array,
 *     _Type_INT8: Int8Array,             # <<<<<<<<<<<<<<
 *     _Type_INT16: Int16Array,
 *     _Type_INT32: Int32Array,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT8); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 2016, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Int8Array)) < 0) __PYX_ERR(1, 2010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":2017
 *     _Type_UINT64: UInt64Array,
 *     _Type_INT8: Int8Array,
 *     _Type_INT16: Int16Array,             # <<<<<<<<<<<<<<
 *     _Type_INT32: Int32Array,
 *     _Type_INT64: Int64Array,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT16); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 2017, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Int16Array)) < 0) __PYX_ERR(1, 2010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":2018
 *     _Type_INT8: Int8Array,
 *     _Type_INT16: Int16Array,
 *     _Type_INT32: Int32Array,             # <<<<<<<<<<<<<<
 *     _Type_INT64: Int64Array,
 *     _Type_DATE32: Date32Array,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT32); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 2018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Int32Array)) < 0) __PYX_ERR(1, 2010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":2019
 *     _Type_INT16: Int16Array,
 *     _Type_INT32: Int32Array,
 *     _Type_INT64: Int64Array,             # <<<<<<<<<<<<<<
 *     _Type_DATE32: Date32Array,
 *     _Type_DATE64: Date64Array,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT64); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 2019, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Int64Array)) < 0) __PYX_ERR(1, 2010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":2020
 *     _Type_INT32: Int32Array,
 *     _Type_INT64: Int64Array,
 *     _Type_DATE32: Date32Array,             # <<<<<<<<<<<<<<
 *     _Type_DATE64: Date64Array,
 *     _Type_TIMESTAMP: TimestampArray,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DATE32); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 2020, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Date32Array)) < 0) __PYX_ERR(1, 2010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":2021
 *     _Type_INT64: Int64Array,
 *     _Type_DATE32: Date32Array,
 *     _Type_DATE64: Date64Array,             # <<<<<<<<<<<<<<
 *     _Type_TIMESTAMP: TimestampArray,
 *     _Type_TIME32: Time32Array,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DATE64); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 2021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Date64Array)) < 0) __PYX_ERR(1, 2010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":2022
 *     _Type_DATE32: Date32Array,
 *     _Type_DATE64: Date64Array,
 *     _Type_TIMESTAMP: TimestampArray,             # <<<<<<<<<<<<<<
 *     _Type_TIME32: Time32Array,
 *     _Type_TIME64: Time64Array,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIMESTAMP); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 2022, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_TimestampArray)) < 0) __PYX_ERR(1, 2010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":2023
 *     _Type_DATE64: Date64Array,
 *     _Type_TIMESTAMP: TimestampArray,
 *     _Type_TIME32: Time32Array,             # <<<<<<<<<<<<<<
 *     _Type_TIME64: Time64Array,
 *     _Type_DURATION: DurationArray,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIME32); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 2023, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Time32Array)) < 0) __PYX_ERR(1, 2010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":2024
 *     _Type_TIMESTAMP: TimestampArray,
 *     _Type_TIME32: Time32Array,
 *     _Type_TIME64: Time64Array,             # <<<<<<<<<<<<<<
 *     _Type_DURATION: DurationArray,
 *     _Type_HALF_FLOAT: HalfFloatArray,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIME64); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 2024, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Time64Array)) < 0) __PYX_ERR(1, 2010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":2025
 *     _Type_TIME32: Time32Array,
 *     _Type_TIME64: Time64Array,
 *     _Type_DURATION: DurationArray,             # <<<<<<<<<<<<<<
 *     _Type_HALF_FLOAT: HalfFloatArray,
 *     _Type_FLOAT: FloatArray,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DURATION); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 2025, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_DurationArray)) < 0) __PYX_ERR(1, 2010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":2026
 *     _Type_TIME64: Time64Array,
 *     _Type_DURATION: DurationArray,
 *     _Type_HALF_FLOAT: HalfFloatArray,             # <<<<<<<<<<<<<<
 *     _Type_FLOAT: FloatArray,
 *     _Type_DOUBLE: DoubleArray,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::HALF_FLOAT); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 2026, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_HalfFloatArray)) < 0) __PYX_ERR(1, 2010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":2027
 *     _Type_DURATION: DurationArray,
 *     _Type_HALF_FLOAT: HalfFloatArray,
 *     _Type_FLOAT: FloatArray,             # <<<<<<<<<<<<<<
 *     _Type_DOUBLE: DoubleArray,
 *     _Type_LIST: ListArray,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::FLOAT); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 2027, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_FloatArray)) < 0) __PYX_ERR(1, 2010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":2028
 *     _Type_HALF_FLOAT: HalfFloatArray,
 *     _Type_FLOAT: FloatArray,
 *     _Type_DOUBLE: DoubleArray,             # <<<<<<<<<<<<<<
 *     _Type_LIST: ListArray,
 *     _Type_LARGE_LIST: LargeListArray,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DOUBLE); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 2028, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_DoubleArray)) < 0) __PYX_ERR(1, 2010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":2029
 *     _Type_FLOAT: FloatArray,
 *     _Type_DOUBLE: DoubleArray,
 *     _Type_LIST: ListArray,             # <<<<<<<<<<<<<<
 *     _Type_LARGE_LIST: LargeListArray,
 *     _Type_MAP: MapArray,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::LIST); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 2029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_ListArray)) < 0) __PYX_ERR(1, 2010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":2030
 *     _Type_DOUBLE: DoubleArray,
 *     _Type_LIST: ListArray,
 *     _Type_LARGE_LIST: LargeListArray,             # <<<<<<<<<<<<<<
 *     _Type_MAP: MapArray,
 *     _Type_FIXED_SIZE_LIST: FixedSizeListArray,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::LARGE_LIST); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 2030, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_LargeListArray)) < 0) __PYX_ERR(1, 2010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":2031
 *     _Type_LIST: ListArray,
 *     _Type_LARGE_LIST: LargeListArray,
 *     _Type_MAP: MapArray,             # <<<<<<<<<<<<<<
 *     _Type_FIXED_SIZE_LIST: FixedSizeListArray,
 *     _Type_UNION: UnionArray,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::MAP); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 2031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_MapArray)) < 0) __PYX_ERR(1, 2010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":2032
 *     _Type_LARGE_LIST: LargeListArray,
 *     _Type_MAP: MapArray,
 *     _Type_FIXED_SIZE_LIST: FixedSizeListArray,             # <<<<<<<<<<<<<<
 *     _Type_UNION: UnionArray,
 *     _Type_BINARY: BinaryArray,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::FIXED_SIZE_LIST); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 2032, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_FixedSizeListArray)) < 0) __PYX_ERR(1, 2010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":2033
 *     _Type_MAP: MapArray,
 *     _Type_FIXED_SIZE_LIST: FixedSizeListArray,
 *     _Type_UNION: UnionArray,             # <<<<<<<<<<<<<<
 *     _Type_BINARY: BinaryArray,
 *     _Type_STRING: StringArray,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UNION); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 2033, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_UnionArray)) < 0) __PYX_ERR(1, 2010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":2034
 *     _Type_FIXED_SIZE_LIST: FixedSizeListArray,
 *     _Type_UNION: UnionArray,
 *     _Type_BINARY: BinaryArray,             # <<<<<<<<<<<<<<
 *     _Type_STRING: StringArray,
 *     _Type_LARGE_BINARY: LargeBinaryArray,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::BINARY); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 2034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_BinaryArray)) < 0) __PYX_ERR(1, 2010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":2035
 *     _Type_UNION: UnionArray,
 *     _Type_BINARY: BinaryArray,
 *     _Type_STRING: StringArray,             # <<<<<<<<<<<<<<
 *     _Type_LARGE_BINARY: LargeBinaryArray,
 *     _Type_LARGE_STRING: LargeStringArray,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::STRING); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 2035, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_StringArray)) < 0) __PYX_ERR(1, 2010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":2036
 *     _Type_BINARY: BinaryArray,
 *     _Type_STRING: StringArray,
 *     _Type_LARGE_BINARY: LargeBinaryArray,             # <<<<<<<<<<<<<<
 *     _Type_LARGE_STRING: LargeStringArray,
 *     _Type_DICTIONARY: DictionaryArray,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::LARGE_BINARY); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 2036, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_LargeBinaryArray)) < 0) __PYX_ERR(1, 2010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":2037
 *     _Type_STRING: StringArray,
 *     _Type_LARGE_BINARY: LargeBinaryArray,
 *     _Type_LARGE_STRING: LargeStringArray,             # <<<<<<<<<<<<<<
 *     _Type_DICTIONARY: DictionaryArray,
 *     _Type_FIXED_SIZE_BINARY: FixedSizeBinaryArray,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::LARGE_STRING); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 2037, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_LargeStringArray)) < 0) __PYX_ERR(1, 2010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":2038
 *     _Type_LARGE_BINARY: LargeBinaryArray,
 *     _Type_LARGE_STRING: LargeStringArray,
 *     _Type_DICTIONARY: DictionaryArray,             # <<<<<<<<<<<<<<
 *     _Type_FIXED_SIZE_BINARY: FixedSizeBinaryArray,
 *     _Type_DECIMAL: Decimal128Array,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DICTIONARY); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 2038, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_DictionaryArray)) < 0) __PYX_ERR(1, 2010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":2039
 *     _Type_LARGE_STRING: LargeStringArray,
 *     _Type_DICTIONARY: DictionaryArray,
 *     _Type_FIXED_SIZE_BINARY: FixedSizeBinaryArray,             # <<<<<<<<<<<<<<
 *     _Type_DECIMAL: Decimal128Array,
 *     _Type_STRUCT: StructArray,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::FIXED_SIZE_BINARY); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 2039, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_FixedSizeBinaryArray)) < 0) __PYX_ERR(1, 2010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":2040
 *     _Type_DICTIONARY: DictionaryArray,
 *     _Type_FIXED_SIZE_BINARY: FixedSizeBinaryArray,
 *     _Type_DECIMAL: Decimal128Array,             # <<<<<<<<<<<<<<
 *     _Type_STRUCT: StructArray,
 *     _Type_EXTENSION: ExtensionArray,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DECIMAL); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 2040, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_Decimal128Array)) < 0) __PYX_ERR(1, 2010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":2041
 *     _Type_FIXED_SIZE_BINARY: FixedSizeBinaryArray,
 *     _Type_DECIMAL: Decimal128Array,
 *     _Type_STRUCT: StructArray,             # <<<<<<<<<<<<<<
 *     _Type_EXTENSION: ExtensionArray,
 * }
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::STRUCT); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 2041, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_StructArray)) < 0) __PYX_ERR(1, 2010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":2042
 *     _Type_DECIMAL: Decimal128Array,
 *     _Type_STRUCT: StructArray,
 *     _Type_EXTENSION: ExtensionArray,             # <<<<<<<<<<<<<<
 * }
 * 
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::EXTENSION); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 2042, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_19, __pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_ExtensionArray)) < 0) __PYX_ERR(1, 2010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __Pyx_XGOTREF(__pyx_v_7pyarrow_3lib__array_classes);
  __Pyx_DECREF_SET(__pyx_v_7pyarrow_3lib__array_classes, ((PyObject*)__pyx_t_19));
  __Pyx_GIVEREF(__pyx_t_19);
  __pyx_t_19 = 0;

  /* "pyarrow/array.pxi":2060
 * 
 * 
 * def concat_arrays(arrays, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *     """
 *     Returns a concatenation of the given arrays. The contents of those arrays
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_143concat_arrays, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 2060, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_concat_arrays, __pyx_t_19) < 0) __PYX_ERR(1, 2060, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/builder.pxi":18
 * # under the License.
 * 
 * import six             # <<<<<<<<<<<<<<
 * 
 * from pyarrow.compat import tobytes
 */
  __pyx_t_19 = __Pyx_Import(__pyx_n_s_six, 0, 0); if (unlikely(!__pyx_t_19)) __PYX_ERR(12, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_six, __pyx_t_19) < 0) __PYX_ERR(12, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/builder.pxi":20
 * import six
 * 
 * from pyarrow.compat import tobytes             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_19 = PyList_New(1); if (unlikely(!__pyx_t_19)) __PYX_ERR(12, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_INCREF(__pyx_n_s_tobytes);
  __Pyx_GIVEREF(__pyx_n_s_tobytes);
  PyList_SET_ITEM(__pyx_t_19, 0, __pyx_n_s_tobytes);
  __pyx_t_18 = __Pyx_Import(__pyx_n_s_pyarrow_compat, __pyx_t_19, 0); if (unlikely(!__pyx_t_18)) __PYX_ERR(12, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = __Pyx_ImportFrom(__pyx_t_18, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_19)) __PYX_ERR(12, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tobytes, __pyx_t_19) < 0) __PYX_ERR(12, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/table.pxi":18
 * # under the License.
 * 
 * import warnings             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_18 = __Pyx_Import(__pyx_n_s_warnings, 0, 0); if (unlikely(!__pyx_t_18)) __PYX_ERR(6, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_18) < 0) __PYX_ERR(6, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/table.pxi":376
 * 
 * 
 * def chunked_array(arrays, type=None):             # <<<<<<<<<<<<<<
 *     """
 *     Construct chunked array from list of array-like objects
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_145chunked_array, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(6, 376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_chunked_array, __pyx_t_18) < 0) __PYX_ERR(6, 376, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/table.pxi":735
 * 
 *     @classmethod
 *     def from_pandas(cls, df, Schema schema=None, preserve_index=None,             # <<<<<<<<<<<<<<
 *                     nthreads=None, columns=None):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_18, (PyObject *)__pyx_ptype_7pyarrow_3lib_RecordBatch, __pyx_n_s_from_pandas); if (unlikely(!__pyx_t_18)) __PYX_ERR(6, 735, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);

  /* "pyarrow/table.pxi":734
 *         return Table.from_batches([self])._to_pandas(options, **kwargs)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_pandas(cls, df, Schema schema=None, preserve_index=None,
 *                     nthreads=None, columns=None):
 */
  __pyx_t_19 = __Pyx_Method_ClassMethod(__pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 734, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_RecordBatch->tp_dict, __pyx_n_s_from_pandas, __pyx_t_19) < 0) __PYX_ERR(6, 735, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_RecordBatch);

  /* "pyarrow/table.pxi":773
 * 
 *     @staticmethod
 *     def from_arrays(list arrays, names=None, schema=None, metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a RecordBatch from multiple pyarrow.Arrays
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_11RecordBatch_31from_arrays, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 773, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_RecordBatch->tp_dict, __pyx_n_s_from_arrays, __pyx_t_19) < 0) __PYX_ERR(6, 773, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_RecordBatch);

  /* "pyarrow/table.pxi":772
 *         return cls.from_arrays(arrays, schema=schema)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_arrays(list arrays, names=None, schema=None, metadata=None):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_7pyarrow_3lib_RecordBatch, __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 773, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_19); if (unlikely(!__pyx_t_18)) __PYX_ERR(6, 772, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_RecordBatch->tp_dict, __pyx_n_s_from_arrays, __pyx_t_18) < 0) __PYX_ERR(6, 773, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_RecordBatch);

  /* "pyarrow/table.pxi":827
 * 
 *     @staticmethod
 *     def from_struct_array(StructArray struct_array):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a RecordBatch from a StructArray.
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_11RecordBatch_33from_struct_array, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(6, 827, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_RecordBatch->tp_dict, __pyx_n_s_from_struct_array, __pyx_t_18) < 0) __PYX_ERR(6, 827, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_RecordBatch);

  /* "pyarrow/table.pxi":826
 *         return result
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_struct_array(StructArray struct_array):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_18, (PyObject *)__pyx_ptype_7pyarrow_3lib_RecordBatch, __pyx_n_s_from_struct_array); if (unlikely(!__pyx_t_18)) __PYX_ERR(6, 827, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 826, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_RecordBatch->tp_dict, __pyx_n_s_from_struct_array, __pyx_t_19) < 0) __PYX_ERR(6, 827, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_RecordBatch);

  /* "pyarrow/table.pxi":850
 * 
 * 
 * def _reconstruct_record_batch(columns, schema):             # <<<<<<<<<<<<<<
 *     """
 *     Internal: reconstruct RecordBatch from pickled components.
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_147_reconstruct_record_batch, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reconstruct_record_batch, __pyx_t_19) < 0) __PYX_ERR(6, 850, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/table.pxi":857
 * 
 * 
 * def table_to_blocks(options, Table table, categories, extension_columns):             # <<<<<<<<<<<<<<
 *     cdef:
 *         PyObject* result_obj
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_149table_to_blocks, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 857, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_table_to_blocks, __pyx_t_19) < 0) __PYX_ERR(6, 857, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/table.pxi":1118
 * 
 *     @classmethod
 *     def from_pandas(cls, df, Schema schema=None, preserve_index=None,             # <<<<<<<<<<<<<<
 *                     nthreads=None, columns=None, bint safe=True):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_7pyarrow_3lib_Table, __pyx_n_s_from_pandas); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 1118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);

  /* "pyarrow/table.pxi":1117
 *         return Table.from_arrays(newcols, schema=target_schema)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_pandas(cls, df, Schema schema=None, preserve_index=None,
 *                     nthreads=None, columns=None, bint safe=True):
 */
  __pyx_t_18 = __Pyx_Method_ClassMethod(__pyx_t_19); if (unlikely(!__pyx_t_18)) __PYX_ERR(6, 1117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Table->tp_dict, __pyx_n_s_from_pandas, __pyx_t_18) < 0) __PYX_ERR(6, 1118, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Table);

  /* "pyarrow/table.pxi":1188
 * 
 *     @staticmethod
 *     def from_arrays(arrays, names=None, schema=None, metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a Table from Arrow arrays
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_5Table_29from_arrays, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(6, 1188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Table->tp_dict, __pyx_n_s_from_arrays, __pyx_t_18) < 0) __PYX_ERR(6, 1188, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Table);

  /* "pyarrow/table.pxi":1187
 *         return cls.from_arrays(arrays, schema=schema)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_arrays(arrays, names=None, schema=None, metadata=None):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_18, (PyObject *)__pyx_ptype_7pyarrow_3lib_Table, __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_18)) __PYX_ERR(6, 1188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 1187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Table->tp_dict, __pyx_n_s_from_arrays, __pyx_t_19) < 0) __PYX_ERR(6, 1188, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Table);

  /* "pyarrow/table.pxi":1234
 * 
 *     @staticmethod
 *     def from_pydict(mapping, schema=None, metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a Table from Arrow arrays or columns
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_5Table_31from_pydict, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 1234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Table->tp_dict, __pyx_n_s_from_pydict, __pyx_t_19) < 0) __PYX_ERR(6, 1234, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Table);

  /* "pyarrow/table.pxi":1233
 *         return result
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_pydict(mapping, schema=None, metadata=None):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_7pyarrow_3lib_Table, __pyx_n_s_from_pydict); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 1234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_19); if (unlikely(!__pyx_t_18)) __PYX_ERR(6, 1233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Table->tp_dict, __pyx_n_s_from_pydict, __pyx_t_18) < 0) __PYX_ERR(6, 1234, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Table);

  /* "pyarrow/table.pxi":1281
 * 
 *     @staticmethod
 *     def from_batches(batches, Schema schema=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a Table from a sequence or iterator of Arrow RecordBatches
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_5Table_33from_batches, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(6, 1281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Table->tp_dict, __pyx_n_s_from_batches, __pyx_t_18) < 0) __PYX_ERR(6, 1281, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Table);

  /* "pyarrow/table.pxi":1280
 *             raise TypeError('Schema must be an instance of pyarrow.Schema')
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_batches(batches, Schema schema=None):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_18, (PyObject *)__pyx_ptype_7pyarrow_3lib_Table, __pyx_n_s_from_batches); if (unlikely(!__pyx_t_18)) __PYX_ERR(6, 1281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 1280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Table->tp_dict, __pyx_n_s_from_batches, __pyx_t_19) < 0) __PYX_ERR(6, 1281, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Table);

  /* "pyarrow/table.pxi":1647
 * 
 * 
 * def _reconstruct_table(arrays, schema):             # <<<<<<<<<<<<<<
 *     """
 *     Internal: reconstruct pa.Table from pickled components.
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_151_reconstruct_table, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 1647, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reconstruct_table, __pyx_t_19) < 0) __PYX_ERR(6, 1647, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/table.pxi":1654
 * 
 * 
 * def record_batch(data, names=None, schema=None, metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create a pyarrow.RecordBatch from another Python data structure or sequence
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_153record_batch, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 1654, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_record_batch, __pyx_t_19) < 0) __PYX_ERR(6, 1654, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/table.pxi":1694
 * 
 * 
 * def table(data, names=None, schema=None, metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create a pyarrow.Table from another Python data structure or sequence of
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_155table, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 1694, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_table, __pyx_t_19) < 0) __PYX_ERR(6, 1694, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/table.pxi":1748
 * 
 * 
 * def concat_tables(tables, c_bool promote=False, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *     """
 *     Concatenate pyarrow.Table objects.
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_157concat_tables, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 1748, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_concat_tables, __pyx_t_19) < 0) __PYX_ERR(6, 1748, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/tensor.pxi":40
 * 
 *     @staticmethod
 *     def from_numpy(obj, dim_names=None):             # <<<<<<<<<<<<<<
 *         cdef:
 *             vector[c_string] c_dim_names
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_6Tensor_5from_numpy, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(13, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Tensor->tp_dict, __pyx_n_s_from_numpy, __pyx_t_19) < 0) __PYX_ERR(13, 40, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Tensor);

  /* "pyarrow/tensor.pxi":39
 * strides: {0.strides}""".format(self)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_numpy(obj, dim_names=None):
 *         cdef:
 */
  __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_7pyarrow_3lib_Tensor, __pyx_n_s_from_numpy); if (unlikely(!__pyx_t_19)) __PYX_ERR(13, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_19); if (unlikely(!__pyx_t_18)) __PYX_ERR(13, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Tensor->tp_dict, __pyx_n_s_from_numpy, __pyx_t_18) < 0) __PYX_ERR(13, 40, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Tensor);

  /* "pyarrow/tensor.pxi":150
 * 
 *     @classmethod
 *     def from_dense_numpy(cls, obj, dim_names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Convert numpy.ndarray to arrow::SparseCOOTensor
 */
  __Pyx_GetNameInClass(__pyx_t_18, (PyObject *)__pyx_ptype_7pyarrow_3lib_SparseCOOTensor, __pyx_n_s_from_dense_numpy); if (unlikely(!__pyx_t_18)) __PYX_ERR(13, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);

  /* "pyarrow/tensor.pxi":149
 * shape: {0.shape}""".format(self)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_dense_numpy(cls, obj, dim_names=None):
 *         """
 */
  __pyx_t_19 = __Pyx_Method_ClassMethod(__pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(13, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_SparseCOOTensor->tp_dict, __pyx_n_s_from_dense_numpy, __pyx_t_19) < 0) __PYX_ERR(13, 150, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_SparseCOOTensor);

  /* "pyarrow/tensor.pxi":157
 * 
 *     @staticmethod
 *     def from_numpy(data, coords, shape, dim_names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Create arrow::SparseCOOTensor from numpy.ndarrays
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_15SparseCOOTensor_7from_numpy, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(13, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_SparseCOOTensor->tp_dict, __pyx_n_s_from_numpy, __pyx_t_19) < 0) __PYX_ERR(13, 157, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_SparseCOOTensor);

  /* "pyarrow/tensor.pxi":156
 *         return cls.from_tensor(Tensor.from_numpy(obj, dim_names=dim_names))
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_numpy(data, coords, shape, dim_names=None):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_7pyarrow_3lib_SparseCOOTensor, __pyx_n_s_from_numpy); if (unlikely(!__pyx_t_19)) __PYX_ERR(13, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_19); if (unlikely(!__pyx_t_18)) __PYX_ERR(13, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_SparseCOOTensor->tp_dict, __pyx_n_s_from_numpy, __pyx_t_18) < 0) __PYX_ERR(13, 157, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_SparseCOOTensor);

  /* "pyarrow/tensor.pxi":183
 * 
 *     @staticmethod
 *     def from_scipy(obj, dim_names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Convert scipy.sparse.coo_matrix to arrow::SparseCOOTensor
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_15SparseCOOTensor_9from_scipy, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(13, 183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_SparseCOOTensor->tp_dict, __pyx_n_s_from_scipy, __pyx_t_18) < 0) __PYX_ERR(13, 183, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_SparseCOOTensor);

  /* "pyarrow/tensor.pxi":182
 *         return pyarrow_wrap_sparse_coo_tensor(csparse_tensor)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_scipy(obj, dim_names=None):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_18, (PyObject *)__pyx_ptype_7pyarrow_3lib_SparseCOOTensor, __pyx_n_s_from_scipy); if (unlikely(!__pyx_t_18)) __PYX_ERR(13, 183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(13, 182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_SparseCOOTensor->tp_dict, __pyx_n_s_from_scipy, __pyx_t_19) < 0) __PYX_ERR(13, 183, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_SparseCOOTensor);

  /* "pyarrow/tensor.pxi":211
 * 
 *     @staticmethod
 *     def from_pydata_sparse(obj, dim_names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Convert pydata/sparse.COO to arrow::SparseCOOTensor
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_15SparseCOOTensor_11from_pydata_sparse, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(13, 211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_SparseCOOTensor->tp_dict, __pyx_n_s_from_pydata_sparse, __pyx_t_19) < 0) __PYX_ERR(13, 211, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_SparseCOOTensor);

  /* "pyarrow/tensor.pxi":210
 *         return pyarrow_wrap_sparse_coo_tensor(csparse_tensor)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_pydata_sparse(obj, dim_names=None):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_7pyarrow_3lib_SparseCOOTensor, __pyx_n_s_from_pydata_sparse); if (unlikely(!__pyx_t_19)) __PYX_ERR(13, 211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_19); if (unlikely(!__pyx_t_18)) __PYX_ERR(13, 210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_SparseCOOTensor->tp_dict, __pyx_n_s_from_pydata_sparse, __pyx_t_18) < 0) __PYX_ERR(13, 211, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_SparseCOOTensor);

  /* "pyarrow/tensor.pxi":238
 * 
 *     @staticmethod
 *     def from_tensor(obj):             # <<<<<<<<<<<<<<
 *         """
 *         Convert arrow::Tensor to arrow::SparseCOOTensor
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_15SparseCOOTensor_13from_tensor, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(13, 238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_SparseCOOTensor->tp_dict, __pyx_n_s_from_tensor, __pyx_t_18) < 0) __PYX_ERR(13, 238, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_SparseCOOTensor);

  /* "pyarrow/tensor.pxi":237
 *         return pyarrow_wrap_sparse_coo_tensor(csparse_tensor)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_tensor(obj):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_18, (PyObject *)__pyx_ptype_7pyarrow_3lib_SparseCOOTensor, __pyx_n_s_from_tensor); if (unlikely(!__pyx_t_18)) __PYX_ERR(13, 238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(13, 237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_SparseCOOTensor->tp_dict, __pyx_n_s_from_tensor, __pyx_t_19) < 0) __PYX_ERR(13, 238, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_SparseCOOTensor);

  /* "pyarrow/tensor.pxi":364
 * 
 *     @classmethod
 *     def from_dense_numpy(cls, obj, dim_names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Convert numpy.ndarray to arrow::SparseCSRMatrix
 */
  __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_7pyarrow_3lib_SparseCSRMatrix, __pyx_n_s_from_dense_numpy); if (unlikely(!__pyx_t_19)) __PYX_ERR(13, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);

  /* "pyarrow/tensor.pxi":363
 * shape: {0.shape}""".format(self)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_dense_numpy(cls, obj, dim_names=None):
 *         """
 */
  __pyx_t_18 = __Pyx_Method_ClassMethod(__pyx_t_19); if (unlikely(!__pyx_t_18)) __PYX_ERR(13, 363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_SparseCSRMatrix->tp_dict, __pyx_n_s_from_dense_numpy, __pyx_t_18) < 0) __PYX_ERR(13, 364, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_SparseCSRMatrix);

  /* "pyarrow/tensor.pxi":371
 * 
 *     @staticmethod
 *     def from_numpy(data, indptr, indices, shape, dim_names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Create arrow::SparseCSRMatrix from numpy.ndarrays
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_15SparseCSRMatrix_7from_numpy, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(13, 371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_SparseCSRMatrix->tp_dict, __pyx_n_s_from_numpy, __pyx_t_18) < 0) __PYX_ERR(13, 371, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_SparseCSRMatrix);

  /* "pyarrow/tensor.pxi":370
 *         return cls.from_tensor(Tensor.from_numpy(obj, dim_names=dim_names))
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_numpy(data, indptr, indices, shape, dim_names=None):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_18, (PyObject *)__pyx_ptype_7pyarrow_3lib_SparseCSRMatrix, __pyx_n_s_from_numpy); if (unlikely(!__pyx_t_18)) __PYX_ERR(13, 371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(13, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_SparseCSRMatrix->tp_dict, __pyx_n_s_from_numpy, __pyx_t_19) < 0) __PYX_ERR(13, 371, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_SparseCSRMatrix);

  /* "pyarrow/tensor.pxi":401
 * 
 *     @staticmethod
 *     def from_scipy(obj, dim_names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Convert scipy.sparse.csr_matrix to arrow::SparseCSRMatrix
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_15SparseCSRMatrix_9from_scipy, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(13, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_SparseCSRMatrix->tp_dict, __pyx_n_s_from_scipy, __pyx_t_19) < 0) __PYX_ERR(13, 401, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_SparseCSRMatrix);

  /* "pyarrow/tensor.pxi":400
 *         return pyarrow_wrap_sparse_csr_matrix(csparse_tensor)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_scipy(obj, dim_names=None):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_7pyarrow_3lib_SparseCSRMatrix, __pyx_n_s_from_scipy); if (unlikely(!__pyx_t_19)) __PYX_ERR(13, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_19); if (unlikely(!__pyx_t_18)) __PYX_ERR(13, 400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_SparseCSRMatrix->tp_dict, __pyx_n_s_from_scipy, __pyx_t_18) < 0) __PYX_ERR(13, 401, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_SparseCSRMatrix);

  /* "pyarrow/tensor.pxi":430
 * 
 *     @staticmethod
 *     def from_tensor(obj):             # <<<<<<<<<<<<<<
 *         """
 *         Convert arrow::Tensor to arrow::SparseCSRMatrix
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_15SparseCSRMatrix_11from_tensor, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(13, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_SparseCSRMatrix->tp_dict, __pyx_n_s_from_tensor, __pyx_t_18) < 0) __PYX_ERR(13, 430, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_SparseCSRMatrix);

  /* "pyarrow/tensor.pxi":429
 *         return pyarrow_wrap_sparse_csr_matrix(csparse_tensor)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_tensor(obj):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_18, (PyObject *)__pyx_ptype_7pyarrow_3lib_SparseCSRMatrix, __pyx_n_s_from_tensor); if (unlikely(!__pyx_t_18)) __PYX_ERR(13, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(13, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_SparseCSRMatrix->tp_dict, __pyx_n_s_from_tensor, __pyx_t_19) < 0) __PYX_ERR(13, 430, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_SparseCSRMatrix);

  /* "pyarrow/compute.pxi":21
 * cdef class CastOptions:
 * 
 *     __slots__ = ()  # avoid mistakingly creating attributes             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, allow_int_overflow=None,
 */
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_CastOptions->tp_dict, __pyx_n_s_slots, __pyx_empty_tuple) < 0) __PYX_ERR(14, 21, __pyx_L1_error)
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_CastOptions);

  /* "pyarrow/compute.pxi":44
 * 
 *     @staticmethod
 *     def safe():             # <<<<<<<<<<<<<<
 *         return CastOptions.wrap(CCastOptions.Safe())
 * 
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_11CastOptions_3safe, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(14, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_CastOptions->tp_dict, __pyx_n_s_safe, __pyx_t_19) < 0) __PYX_ERR(14, 44, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_CastOptions);

  /* "pyarrow/compute.pxi":43
 *         return self
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def safe():
 *         return CastOptions.wrap(CCastOptions.Safe())
 */
  __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_7pyarrow_3lib_CastOptions, __pyx_n_s_safe); if (unlikely(!__pyx_t_19)) __PYX_ERR(14, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_19); if (unlikely(!__pyx_t_18)) __PYX_ERR(14, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_CastOptions->tp_dict, __pyx_n_s_safe, __pyx_t_18) < 0) __PYX_ERR(14, 44, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_CastOptions);

  /* "pyarrow/compute.pxi":48
 * 
 *     @staticmethod
 *     def unsafe():             # <<<<<<<<<<<<<<
 *         return CastOptions.wrap(CCastOptions.Unsafe())
 * 
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_11CastOptions_5unsafe, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(14, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_CastOptions->tp_dict, __pyx_n_s_unsafe, __pyx_t_18) < 0) __PYX_ERR(14, 48, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_CastOptions);

  /* "pyarrow/compute.pxi":47
 *         return CastOptions.wrap(CCastOptions.Safe())
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def unsafe():
 *         return CastOptions.wrap(CCastOptions.Unsafe())
 */
  __Pyx_GetNameInClass(__pyx_t_18, (PyObject *)__pyx_ptype_7pyarrow_3lib_CastOptions, __pyx_n_s_unsafe); if (unlikely(!__pyx_t_18)) __PYX_ERR(14, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(14, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_CastOptions->tp_dict, __pyx_n_s_unsafe, __pyx_t_19) < 0) __PYX_ERR(14, 48, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_CastOptions);

  /* "pyarrow/io.pxi":23
 * from libc.stdlib cimport malloc, free
 * 
 * import re             # <<<<<<<<<<<<<<
 * import six
 * import sys
 */
  __pyx_t_19 = __Pyx_Import(__pyx_n_s_re, 0, 0); if (unlikely(!__pyx_t_19)) __PYX_ERR(7, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_re, __pyx_t_19) < 0) __PYX_ERR(7, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io.pxi":24
 * 
 * import re
 * import six             # <<<<<<<<<<<<<<
 * import sys
 * import threading
 */
  __pyx_t_19 = __Pyx_Import(__pyx_n_s_six, 0, 0); if (unlikely(!__pyx_t_19)) __PYX_ERR(7, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_six, __pyx_t_19) < 0) __PYX_ERR(7, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io.pxi":25
 * import re
 * import six
 * import sys             # <<<<<<<<<<<<<<
 * import threading
 * import time
 */
  __pyx_t_19 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_19)) __PYX_ERR(7, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_19) < 0) __PYX_ERR(7, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io.pxi":26
 * import six
 * import sys
 * import threading             # <<<<<<<<<<<<<<
 * import time
 * import warnings
 */
  __pyx_t_19 = __Pyx_Import(__pyx_n_s_threading, 0, 0); if (unlikely(!__pyx_t_19)) __PYX_ERR(7, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_threading, __pyx_t_19) < 0) __PYX_ERR(7, 26, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io.pxi":27
 * import sys
 * import threading
 * import time             # <<<<<<<<<<<<<<
 * import warnings
 * from io import BufferedIOBase, IOBase, TextIOBase, UnsupportedOperation
 */
  __pyx_t_19 = __Pyx_Import(__pyx_n_s_time, 0, 0); if (unlikely(!__pyx_t_19)) __PYX_ERR(7, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_time, __pyx_t_19) < 0) __PYX_ERR(7, 27, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io.pxi":28
 * import threading
 * import time
 * import warnings             # <<<<<<<<<<<<<<
 * from io import BufferedIOBase, IOBase, TextIOBase, UnsupportedOperation
 * 
 */
  __pyx_t_19 = __Pyx_Import(__pyx_n_s_warnings, 0, 0); if (unlikely(!__pyx_t_19)) __PYX_ERR(7, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_19) < 0) __PYX_ERR(7, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io.pxi":29
 * import time
 * import warnings
 * from io import BufferedIOBase, IOBase, TextIOBase, UnsupportedOperation             # <<<<<<<<<<<<<<
 * 
 * from pyarrow.util import _stringify_path
 */
  __pyx_t_19 = PyList_New(4); if (unlikely(!__pyx_t_19)) __PYX_ERR(7, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_INCREF(__pyx_n_s_BufferedIOBase);
  __Pyx_GIVEREF(__pyx_n_s_BufferedIOBase);
  PyList_SET_ITEM(__pyx_t_19, 0, __pyx_n_s_BufferedIOBase);
  __Pyx_INCREF(__pyx_n_s_IOBase);
  __Pyx_GIVEREF(__pyx_n_s_IOBase);
  PyList_SET_ITEM(__pyx_t_19, 1, __pyx_n_s_IOBase);
  __Pyx_INCREF(__pyx_n_s_TextIOBase);
  __Pyx_GIVEREF(__pyx_n_s_TextIOBase);
  PyList_SET_ITEM(__pyx_t_19, 2, __pyx_n_s_TextIOBase);
  __Pyx_INCREF(__pyx_n_s_UnsupportedOperation);
  __Pyx_GIVEREF(__pyx_n_s_UnsupportedOperation);
  PyList_SET_ITEM(__pyx_t_19, 3, __pyx_n_s_UnsupportedOperation);
  __pyx_t_18 = __Pyx_Import(__pyx_n_s_io, __pyx_t_19, 0); if (unlikely(!__pyx_t_18)) __PYX_ERR(7, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = __Pyx_ImportFrom(__pyx_t_18, __pyx_n_s_BufferedIOBase); if (unlikely(!__pyx_t_19)) __PYX_ERR(7, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BufferedIOBase, __pyx_t_19) < 0) __PYX_ERR(7, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = __Pyx_ImportFrom(__pyx_t_18, __pyx_n_s_IOBase); if (unlikely(!__pyx_t_19)) __PYX_ERR(7, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_IOBase, __pyx_t_19) < 0) __PYX_ERR(7, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = __Pyx_ImportFrom(__pyx_t_18, __pyx_n_s_TextIOBase); if (unlikely(!__pyx_t_19)) __PYX_ERR(7, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_TextIOBase, __pyx_t_19) < 0) __PYX_ERR(7, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = __Pyx_ImportFrom(__pyx_t_18, __pyx_n_s_UnsupportedOperation); if (unlikely(!__pyx_t_19)) __PYX_ERR(7, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_UnsupportedOperation, __pyx_t_19) < 0) __PYX_ERR(7, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/io.pxi":31
 * from io import BufferedIOBase, IOBase, TextIOBase, UnsupportedOperation
 * 
 * from pyarrow.util import _stringify_path             # <<<<<<<<<<<<<<
 * from pyarrow.compat import (
 *     builtin_pickle, frombytes, tobytes, encode_file_path, file_type)
 */
  __pyx_t_18 = PyList_New(1); if (unlikely(!__pyx_t_18)) __PYX_ERR(7, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_INCREF(__pyx_n_s_stringify_path);
  __Pyx_GIVEREF(__pyx_n_s_stringify_path);
  PyList_SET_ITEM(__pyx_t_18, 0, __pyx_n_s_stringify_path);
  __pyx_t_19 = __Pyx_Import(__pyx_n_s_pyarrow_util, __pyx_t_18, 0); if (unlikely(!__pyx_t_19)) __PYX_ERR(7, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __pyx_t_18 = __Pyx_ImportFrom(__pyx_t_19, __pyx_n_s_stringify_path); if (unlikely(!__pyx_t_18)) __PYX_ERR(7, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_stringify_path, __pyx_t_18) < 0) __PYX_ERR(7, 31, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io.pxi":33
 * from pyarrow.util import _stringify_path
 * from pyarrow.compat import (
 *     builtin_pickle, frombytes, tobytes, encode_file_path, file_type)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_19 = PyList_New(5); if (unlikely(!__pyx_t_19)) __PYX_ERR(7, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_INCREF(__pyx_n_s_builtin_pickle);
  __Pyx_GIVEREF(__pyx_n_s_builtin_pickle);
  PyList_SET_ITEM(__pyx_t_19, 0, __pyx_n_s_builtin_pickle);
  __Pyx_INCREF(__pyx_n_s_frombytes);
  __Pyx_GIVEREF(__pyx_n_s_frombytes);
  PyList_SET_ITEM(__pyx_t_19, 1, __pyx_n_s_frombytes);
  __Pyx_INCREF(__pyx_n_s_tobytes);
  __Pyx_GIVEREF(__pyx_n_s_tobytes);
  PyList_SET_ITEM(__pyx_t_19, 2, __pyx_n_s_tobytes);
  __Pyx_INCREF(__pyx_n_s_encode_file_path);
  __Pyx_GIVEREF(__pyx_n_s_encode_file_path);
  PyList_SET_ITEM(__pyx_t_19, 3, __pyx_n_s_encode_file_path);
  __Pyx_INCREF(__pyx_n_s_file_type);
  __Pyx_GIVEREF(__pyx_n_s_file_type);
  PyList_SET_ITEM(__pyx_t_19, 4, __pyx_n_s_file_type);

  /* "pyarrow/io.pxi":32
 * 
 * from pyarrow.util import _stringify_path
 * from pyarrow.compat import (             # <<<<<<<<<<<<<<
 *     builtin_pickle, frombytes, tobytes, encode_file_path, file_type)
 * 
 */
  __pyx_t_18 = __Pyx_Import(__pyx_n_s_pyarrow_compat, __pyx_t_19, 0); if (unlikely(!__pyx_t_18)) __PYX_ERR(7, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = __Pyx_ImportFrom(__pyx_t_18, __pyx_n_s_builtin_pickle); if (unlikely(!__pyx_t_19)) __PYX_ERR(7, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_builtin_pickle, __pyx_t_19) < 0) __PYX_ERR(7, 33, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = __Pyx_ImportFrom(__pyx_t_18, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_19)) __PYX_ERR(7, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_frombytes, __pyx_t_19) < 0) __PYX_ERR(7, 33, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = __Pyx_ImportFrom(__pyx_t_18, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_19)) __PYX_ERR(7, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tobytes, __pyx_t_19) < 0) __PYX_ERR(7, 33, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = __Pyx_ImportFrom(__pyx_t_18, __pyx_n_s_encode_file_path); if (unlikely(!__pyx_t_19)) __PYX_ERR(7, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_encode_file_path, __pyx_t_19) < 0) __PYX_ERR(7, 33, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = __Pyx_ImportFrom(__pyx_t_18, __pyx_n_s_file_type); if (unlikely(!__pyx_t_19)) __PYX_ERR(7, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_file_type, __pyx_t_19) < 0) __PYX_ERR(7, 33, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/io.pxi":37
 * 
 * # 64K
 * DEFAULT_BUFFER_SIZE = 2 ** 16             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEFAULT_BUFFER_SIZE, __pyx_int_65536) < 0) __PYX_ERR(7, 37, __pyx_L1_error)

  /* "pyarrow/io.pxi":613
 *             raise exc_info[0], exc_info[1], exc_info[2]
 * 
 * BufferedIOBase.register(NativeFile)             # <<<<<<<<<<<<<<
 * 
 * # ----------------------------------------------------------------------
 */
  __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_BufferedIOBase); if (unlikely(!__pyx_t_18)) __PYX_ERR(7, 613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s_register); if (unlikely(!__pyx_t_19)) __PYX_ERR(7, 613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __pyx_t_18 = __Pyx_PyObject_CallOneArg(__pyx_t_19, ((PyObject *)__pyx_ptype_7pyarrow_3lib_NativeFile)); if (unlikely(!__pyx_t_18)) __PYX_ERR(7, 613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/io.pxi":712
 * 
 *     @staticmethod
 *     def create(path, size):             # <<<<<<<<<<<<<<
 *         cdef:
 *             shared_ptr[CMemoryMappedFile] handle
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_16MemoryMappedFile_1create, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(7, 712, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_MemoryMappedFile->tp_dict, __pyx_n_s_create, __pyx_t_18) < 0) __PYX_ERR(7, 712, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_MemoryMappedFile);

  /* "pyarrow/io.pxi":711
 *         object path
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def create(path, size):
 *         cdef:
 */
  __Pyx_GetNameInClass(__pyx_t_18, (PyObject *)__pyx_ptype_7pyarrow_3lib_MemoryMappedFile, __pyx_n_s_create); if (unlikely(!__pyx_t_18)) __PYX_ERR(7, 712, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(7, 711, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_MemoryMappedFile->tp_dict, __pyx_n_s_create, __pyx_t_19) < 0) __PYX_ERR(7, 712, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_MemoryMappedFile);

  /* "pyarrow/io.pxi":774
 * 
 * 
 * def memory_map(path, mode='r'):             # <<<<<<<<<<<<<<
 *     """
 *     Open memory map at file path. Size of the memory map cannot change
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_159memory_map, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(7, 774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_memory_map, __pyx_t_19) < 0) __PYX_ERR(7, 774, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io.pxi":794
 * 
 * 
 * def create_memory_map(path, size):             # <<<<<<<<<<<<<<
 *     """
 *     Create a file of the given size and memory-map it.
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_161create_memory_map, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(7, 794, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_create_memory_map, __pyx_t_19) < 0) __PYX_ERR(7, 794, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io.pxi":1097
 * 
 * 
 * def allocate_buffer(int64_t size, MemoryPool memory_pool=None,             # <<<<<<<<<<<<<<
 *                     resizable=False):
 *     """
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_163allocate_buffer, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(7, 1097, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_allocate_buffer, __pyx_t_19) < 0) __PYX_ERR(7, 1097, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io.pxi":1341
 * 
 * 
 * def py_buffer(object obj):             # <<<<<<<<<<<<<<
 *     """
 *     Construct an Arrow buffer from a Python bytes-like or buffer-like object
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_165py_buffer, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(7, 1341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_py_buffer, __pyx_t_19) < 0) __PYX_ERR(7, 1341, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io.pxi":1350
 * 
 * 
 * def foreign_buffer(address, size, base=None):             # <<<<<<<<<<<<<<
 *     """
 *     Construct an Arrow buffer with the given *address* and *size*,
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_167foreign_buffer, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(7, 1350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_foreign_buffer, __pyx_t_19) < 0) __PYX_ERR(7, 1350, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io.pxi":1369
 * 
 * 
 * def as_buffer(object o):             # <<<<<<<<<<<<<<
 *     if isinstance(o, Buffer):
 *         return o
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_169as_buffer, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(7, 1369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_as_buffer, __pyx_t_19) < 0) __PYX_ERR(7, 1369, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io.pxi":1484
 * 
 * 
 * def _detect_compression(path):             # <<<<<<<<<<<<<<
 *     if isinstance(path, six.string_types):
 *         if path.endswith('.bz2'):
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_171_detect_compression, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(7, 1484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_detect_compression, __pyx_t_19) < 0) __PYX_ERR(7, 1484, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io.pxi":1496
 * 
 * 
 * def compress(object buf, codec='lz4', asbytes=False, memory_pool=None):             # <<<<<<<<<<<<<<
 *     """
 *     Compress data from buffer-like object.
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_173compress, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(7, 1496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_compress, __pyx_t_19) < 0) __PYX_ERR(7, 1496, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io.pxi":1556
 * 
 * 
 * def decompress(object buf, decompressed_size=None, codec='lz4',             # <<<<<<<<<<<<<<
 *                asbytes=False, memory_pool=None):
 *     """
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_175decompress, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(7, 1556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_decompress, __pyx_t_19) < 0) __PYX_ERR(7, 1556, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io.pxi":1614
 * 
 * 
 * def input_stream(source, compression='detect', buffer_size=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create an Arrow input stream.
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_177input_stream, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(7, 1614, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_input_stream, __pyx_t_19) < 0) __PYX_ERR(7, 1614, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io.pxi":1666
 * 
 * 
 * def output_stream(source, compression='detect', buffer_size=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create an Arrow output stream.
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_179output_stream, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(7, 1666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_output_stream, __pyx_t_19) < 0) __PYX_ERR(7, 1666, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io-hdfs.pxi":21
 * # HDFS IO implementation
 * 
 * _HDFS_PATH_RE = re.compile(r'hdfs://(.*):(\d+)(.*)')             # <<<<<<<<<<<<<<
 * 
 * try:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_re); if (unlikely(!__pyx_t_19)) __PYX_ERR(2, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_compile); if (unlikely(!__pyx_t_18)) __PYX_ERR(2, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_tuple__494, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(2, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_HDFS_PATH_RE, __pyx_t_19) < 0) __PYX_ERR(2, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io-hdfs.pxi":23
 * _HDFS_PATH_RE = re.compile(r'hdfs://(.*):(\d+)(.*)')
 * 
 * try:             # <<<<<<<<<<<<<<
 *     # Python 3
 *     from queue import Queue, Empty as QueueEmpty, Full as QueueFull
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23);
    __Pyx_XGOTREF(__pyx_t_21);
    __Pyx_XGOTREF(__pyx_t_22);
    __Pyx_XGOTREF(__pyx_t_23);
    /*try:*/ {

      /* "pyarrow/io-hdfs.pxi":25
 * try:
 *     # Python 3
 *     from queue import Queue, Empty as QueueEmpty, Full as QueueFull             # <<<<<<<<<<<<<<
 * except ImportError:
 *     from Queue import Queue, Empty as QueueEmpty, Full as QueueFull
 */
      __pyx_t_19 = PyList_New(3); if (unlikely(!__pyx_t_19)) __PYX_ERR(2, 25, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_INCREF(__pyx_n_s_Queue);
      __Pyx_GIVEREF(__pyx_n_s_Queue);
      PyList_SET_ITEM(__pyx_t_19, 0, __pyx_n_s_Queue);
      __Pyx_INCREF(__pyx_n_s_Empty);
      __Pyx_GIVEREF(__pyx_n_s_Empty);
      PyList_SET_ITEM(__pyx_t_19, 1, __pyx_n_s_Empty);
      __Pyx_INCREF(__pyx_n_s_Full);
      __Pyx_GIVEREF(__pyx_n_s_Full);
      PyList_SET_ITEM(__pyx_t_19, 2, __pyx_n_s_Full);
      __pyx_t_18 = __Pyx_Import(__pyx_n_s_queue, __pyx_t_19, 0); if (unlikely(!__pyx_t_18)) __PYX_ERR(2, 25, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_18);
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __pyx_t_19 = __Pyx_ImportFrom(__pyx_t_18, __pyx_n_s_Queue); if (unlikely(!__pyx_t_19)) __PYX_ERR(2, 25, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_19);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_Queue, __pyx_t_19) < 0) __PYX_ERR(2, 25, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __pyx_t_19 = __Pyx_ImportFrom(__pyx_t_18, __pyx_n_s_Empty); if (unlikely(!__pyx_t_19)) __PYX_ERR(2, 25, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_19);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_QueueEmpty, __pyx_t_19) < 0) __PYX_ERR(2, 25, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __pyx_t_19 = __Pyx_ImportFrom(__pyx_t_18, __pyx_n_s_Full); if (unlikely(!__pyx_t_19)) __PYX_ERR(2, 25, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_19);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_QueueFull, __pyx_t_19) < 0) __PYX_ERR(2, 25, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

      /* "pyarrow/io-hdfs.pxi":23
 * _HDFS_PATH_RE = re.compile(r'hdfs://(.*):(\d+)(.*)')
 * 
 * try:             # <<<<<<<<<<<<<<
 *     # Python 3
 *     from queue import Queue, Empty as QueueEmpty, Full as QueueFull
 */
    }
    __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
    __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
    __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
    goto __pyx_L7_try_end;
    __pyx_L2_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
    __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
    __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
    __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "pyarrow/io-hdfs.pxi":26
 *     # Python 3
 *     from queue import Queue, Empty as QueueEmpty, Full as QueueFull
 * except ImportError:             # <<<<<<<<<<<<<<
 *     from Queue import Queue, Empty as QueueEmpty, Full as QueueFull
 * 
 */
    __pyx_t_3 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
    if (__pyx_t_3) {
      __Pyx_AddTraceback("pyarrow.lib", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20) < 0) __PYX_ERR(2, 26, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_18);
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_GOTREF(__pyx_t_20);

      /* "pyarrow/io-hdfs.pxi":27
 *     from queue import Queue, Empty as QueueEmpty, Full as QueueFull
 * except ImportError:
 *     from Queue import Queue, Empty as QueueEmpty, Full as QueueFull             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_17 = PyList_New(3); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 27, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_INCREF(__pyx_n_s_Queue);
      __Pyx_GIVEREF(__pyx_n_s_Queue);
      PyList_SET_ITEM(__pyx_t_17, 0, __pyx_n_s_Queue);
      __Pyx_INCREF(__pyx_n_s_Empty);
      __Pyx_GIVEREF(__pyx_n_s_Empty);
      PyList_SET_ITEM(__pyx_t_17, 1, __pyx_n_s_Empty);
      __Pyx_INCREF(__pyx_n_s_Full);
      __Pyx_GIVEREF(__pyx_n_s_Full);
      PyList_SET_ITEM(__pyx_t_17, 2, __pyx_n_s_Full);
      __pyx_t_16 = __Pyx_Import(__pyx_n_s_Queue, __pyx_t_17, 0); if (unlikely(!__pyx_t_16)) __PYX_ERR(2, 27, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_t_17 = __Pyx_ImportFrom(__pyx_t_16, __pyx_n_s_Queue); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 27, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_17);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_Queue, __pyx_t_17) < 0) __PYX_ERR(2, 27, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_t_17 = __Pyx_ImportFrom(__pyx_t_16, __pyx_n_s_Empty); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 27, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_17);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_QueueEmpty, __pyx_t_17) < 0) __PYX_ERR(2, 27, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_t_17 = __Pyx_ImportFrom(__pyx_t_16, __pyx_n_s_Full); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 27, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_17);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_QueueFull, __pyx_t_17) < 0) __PYX_ERR(2, 27, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
      __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
      goto __pyx_L3_exception_handled;
    }
    goto __pyx_L4_except_error;
    __pyx_L4_except_error:;

    /* "pyarrow/io-hdfs.pxi":23
 * _HDFS_PATH_RE = re.compile(r'hdfs://(.*):(\d+)(.*)')
 * 
 * try:             # <<<<<<<<<<<<<<
 *     # Python 3
 *     from queue import Queue, Empty as QueueEmpty, Full as QueueFull
 */
    __Pyx_XGIVEREF(__pyx_t_21);
    __Pyx_XGIVEREF(__pyx_t_22);
    __Pyx_XGIVEREF(__pyx_t_23);
    __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23);
    goto __pyx_L1_error;
    __pyx_L3_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_21);
    __Pyx_XGIVEREF(__pyx_t_22);
    __Pyx_XGIVEREF(__pyx_t_23);
    __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23);
    __pyx_L7_try_end:;
  }

  /* "pyarrow/io-hdfs.pxi":30
 * 
 * 
 * def have_libhdfs():             # <<<<<<<<<<<<<<
 *     try:
 *         with nogil:
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_181have_libhdfs, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(2, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_have_libhdfs, __pyx_t_20) < 0) __PYX_ERR(2, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/io-hdfs.pxi":39
 * 
 * 
 * def have_libhdfs3():             # <<<<<<<<<<<<<<
 *     try:
 *         with nogil:
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_183have_libhdfs3, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(2, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_have_libhdfs3, __pyx_t_20) < 0) __PYX_ERR(2, 39, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/io-hdfs.pxi":48
 * 
 * 
 * def strip_hdfs_abspath(path):             # <<<<<<<<<<<<<<
 *     m = _HDFS_PATH_RE.match(path)
 *     if m:
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_185strip_hdfs_abspath, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(2, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_strip_hdfs_abspath, __pyx_t_20) < 0) __PYX_ERR(2, 48, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/io-hdfs.pxi":109
 * 
 *     @classmethod
 *     def connect(cls, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         return cls(*args, **kwargs)
 * 
 */
  __Pyx_GetNameInClass(__pyx_t_20, (PyObject *)__pyx_ptype_7pyarrow_3lib_HadoopFileSystem, __pyx_n_s_connect); if (unlikely(!__pyx_t_20)) __PYX_ERR(2, 109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);

  /* "pyarrow/io-hdfs.pxi":108
 *         self.is_open = True
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def connect(cls, *args, **kwargs):
 *         return cls(*args, **kwargs)
 */
  __pyx_t_19 = __Pyx_Method_ClassMethod(__pyx_t_20); if (unlikely(!__pyx_t_19)) __PYX_ERR(2, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_HadoopFileSystem->tp_dict, __pyx_n_s_connect, __pyx_t_19) < 0) __PYX_ERR(2, 109, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_HadoopFileSystem);

  /* "pyarrow/ipc.pxi":18
 * # under the License.
 * 
 * import warnings             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_19 = __Pyx_Import(__pyx_n_s_warnings, 0, 0); if (unlikely(!__pyx_t_19)) __PYX_ERR(8, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_19) < 0) __PYX_ERR(8, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/ipc.pxi":139
 * 
 *     @staticmethod
 *     def open_stream(source):             # <<<<<<<<<<<<<<
 *         cdef:
 *             MessageReader result = MessageReader.__new__(MessageReader)
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_13MessageReader_5open_stream, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(8, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_MessageReader->tp_dict, __pyx_n_s_open_stream, __pyx_t_19) < 0) __PYX_ERR(8, 139, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_MessageReader);

  /* "pyarrow/ipc.pxi":138
 *                         "instead.".format(self.__class__.__name__))
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def open_stream(source):
 *         cdef:
 */
  __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_7pyarrow_3lib_MessageReader, __pyx_n_s_open_stream); if (unlikely(!__pyx_t_19)) __PYX_ERR(8, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_20 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_19); if (unlikely(!__pyx_t_20)) __PYX_ERR(8, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_MessageReader->tp_dict, __pyx_n_s_open_stream, __pyx_t_20) < 0) __PYX_ERR(8, 139, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_MessageReader);

  /* "pyarrow/ipc.pxi":420
 *     # TODO(wesm): ARROW-503: Function was renamed. Remove after a period of
 *     # time has passed
 *     get_record_batch = get_batch             # <<<<<<<<<<<<<<
 * 
 *     def read_all(self):
 */
  __Pyx_GetNameInClass(__pyx_t_20, (PyObject *)__pyx_ptype_7pyarrow_3lib__RecordBatchFileReader, __pyx_n_s_get_batch); if (unlikely(!__pyx_t_20)) __PYX_ERR(8, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib__RecordBatchFileReader->tp_dict, __pyx_n_s_get_record_batch, __pyx_t_20) < 0) __PYX_ERR(8, 420, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib__RecordBatchFileReader);

  /* "pyarrow/ipc.pxi":449
 * 
 * 
 * def get_tensor_size(Tensor tensor):             # <<<<<<<<<<<<<<
 *     """
 *     Return total size of serialized Tensor including metadata and padding
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_187get_tensor_size, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(8, 449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_tensor_size, __pyx_t_20) < 0) __PYX_ERR(8, 449, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/ipc.pxi":459
 * 
 * 
 * def get_record_batch_size(RecordBatch batch):             # <<<<<<<<<<<<<<
 *     """
 *     Return total size of serialized RecordBatch including metadata and padding
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_189get_record_batch_size, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(8, 459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_record_batch_size, __pyx_t_20) < 0) __PYX_ERR(8, 459, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/ipc.pxi":469
 * 
 * 
 * def write_tensor(Tensor tensor, NativeFile dest):             # <<<<<<<<<<<<<<
 *     """
 *     Write pyarrow.Tensor to pyarrow.NativeFile object its current position
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_191write_tensor, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(8, 469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_write_tensor, __pyx_t_20) < 0) __PYX_ERR(8, 469, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/ipc.pxi":510
 * 
 * 
 * def read_tensor(source):             # <<<<<<<<<<<<<<
 *     """Read pyarrow.Tensor from pyarrow.NativeFile object from current
 *     position. If the file source supports zero copy (e.g. a memory map), then
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_193read_tensor, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(8, 510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_read_tensor, __pyx_t_20) < 0) __PYX_ERR(8, 510, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/ipc.pxi":536
 * 
 * 
 * def read_message(source):             # <<<<<<<<<<<<<<
 *     """
 *     Read length-prefixed message from file or buffer-like object
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_195read_message, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(8, 536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_read_message, __pyx_t_20) < 0) __PYX_ERR(8, 536, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/ipc.pxi":564
 * 
 * 
 * def read_schema(obj, DictionaryMemo dictionary_memo=None):             # <<<<<<<<<<<<<<
 *     """
 *     Read Schema from message or buffer
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_197read_schema, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(8, 564, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_read_schema, __pyx_t_20) < 0) __PYX_ERR(8, 564, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/ipc.pxi":601
 * 
 * 
 * def read_record_batch(obj, Schema schema,             # <<<<<<<<<<<<<<
 *                       DictionaryMemo dictionary_memo=None):
 *     """
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_199read_record_batch, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(8, 601, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_read_record_batch, __pyx_t_20) < 0) __PYX_ERR(8, 601, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/feather.pxi":22
 * 
 * 
 * class FeatherError(Exception):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) __PYX_ERR(15, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_INCREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  __Pyx_GIVEREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  PyTuple_SET_ITEM(__pyx_t_20, 0, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  __pyx_t_19 = __Pyx_CalculateMetaclass(NULL, __pyx_t_20); if (unlikely(!__pyx_t_19)) __PYX_ERR(15, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_Py3MetaclassPrepare(__pyx_t_19, __pyx_t_20, __pyx_n_s_FeatherError, __pyx_n_s_FeatherError, (PyObject *) NULL, __pyx_n_s_pyarrow_lib, (PyObject *) NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(15, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_16 = __Pyx_Py3ClassCreate(__pyx_t_19, __pyx_n_s_FeatherError, __pyx_t_20, __pyx_t_18, NULL, 0, 0); if (unlikely(!__pyx_t_16)) __PYX_ERR(15, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FeatherError, __pyx_t_16) < 0) __PYX_ERR(15, 22, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/serialization.pxi":20
 * from cpython.ref cimport PyObject
 * 
 * import six             # <<<<<<<<<<<<<<
 * 
 * from pyarrow.compat import frombytes, pickle
 */
  __pyx_t_20 = __Pyx_Import(__pyx_n_s_six, 0, 0); if (unlikely(!__pyx_t_20)) __PYX_ERR(16, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_six, __pyx_t_20) < 0) __PYX_ERR(16, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/serialization.pxi":22
 * import six
 * 
 * from pyarrow.compat import frombytes, pickle             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_20 = PyList_New(2); if (unlikely(!__pyx_t_20)) __PYX_ERR(16, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_INCREF(__pyx_n_s_frombytes);
  __Pyx_GIVEREF(__pyx_n_s_frombytes);
  PyList_SET_ITEM(__pyx_t_20, 0, __pyx_n_s_frombytes);
  __Pyx_INCREF(__pyx_n_s_pickle);
  __Pyx_GIVEREF(__pyx_n_s_pickle);
  PyList_SET_ITEM(__pyx_t_20, 1, __pyx_n_s_pickle);
  __pyx_t_19 = __Pyx_Import(__pyx_n_s_pyarrow_compat, __pyx_t_20, 0); if (unlikely(!__pyx_t_19)) __PYX_ERR(16, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_t_20 = __Pyx_ImportFrom(__pyx_t_19, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_20)) __PYX_ERR(16, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_frombytes, __pyx_t_20) < 0) __PYX_ERR(16, 22, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_t_20 = __Pyx_ImportFrom(__pyx_t_19, __pyx_n_s_pickle); if (unlikely(!__pyx_t_20)) __PYX_ERR(16, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pickle, __pyx_t_20) < 0) __PYX_ERR(16, 22, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/serialization.pxi":25
 * 
 * 
 * def is_named_tuple(cls):             # <<<<<<<<<<<<<<
 *     """Return True if cls is a namedtuple and False otherwise."""
 *     b = cls.__bases__
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_201is_named_tuple, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(16, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_named_tuple, __pyx_t_19) < 0) __PYX_ERR(16, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/serialization.pxi":36
 * 
 * 
 * class SerializationCallbackError(ArrowSerializationError):             # <<<<<<<<<<<<<<
 *     def __init__(self, message, example_object):
 *         ArrowSerializationError.__init__(self, message)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_ArrowSerializationError); if (unlikely(!__pyx_t_19)) __PYX_ERR(16, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) __PYX_ERR(16, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_GIVEREF(__pyx_t_19);
  PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_19);
  __pyx_t_19 = 0;
  __pyx_t_19 = __Pyx_CalculateMetaclass(NULL, __pyx_t_20); if (unlikely(!__pyx_t_19)) __PYX_ERR(16, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_Py3MetaclassPrepare(__pyx_t_19, __pyx_t_20, __pyx_n_s_SerializationCallbackError, __pyx_n_s_SerializationCallbackError, (PyObject *) NULL, __pyx_n_s_pyarrow_lib, (PyObject *) NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(16, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);

  /* "pyarrow/serialization.pxi":37
 * 
 * class SerializationCallbackError(ArrowSerializationError):
 *     def __init__(self, message, example_object):             # <<<<<<<<<<<<<<
 *         ArrowSerializationError.__init__(self, message)
 *         self.example_object = example_object
 */
  __pyx_t_16 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_26SerializationCallbackError_1__init__, 0, __pyx_n_s_SerializationCallbackError___ini, NULL, __pyx_n_s_pyarrow_lib, __pyx_d, ((PyObject *)__pyx_codeobj__518)); if (unlikely(!__pyx_t_16)) __PYX_ERR(16, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  if (__Pyx_SetNameInClass(__pyx_t_18, __pyx_n_s_init, __pyx_t_16) < 0) __PYX_ERR(16, 37, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pyarrow/serialization.pxi":36
 * 
 * 
 * class SerializationCallbackError(ArrowSerializationError):             # <<<<<<<<<<<<<<
 *     def __init__(self, message, example_object):
 *         ArrowSerializationError.__init__(self, message)
 */
  __pyx_t_16 = __Pyx_Py3ClassCreate(__pyx_t_19, __pyx_n_s_SerializationCallbackError, __pyx_t_20, __pyx_t_18, NULL, 0, 0); if (unlikely(!__pyx_t_16)) __PYX_ERR(16, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SerializationCallbackError, __pyx_t_16) < 0) __PYX_ERR(16, 36, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/serialization.pxi":42
 * 
 * 
 * class DeserializationCallbackError(ArrowSerializationError):             # <<<<<<<<<<<<<<
 *     def __init__(self, message, type_id):
 *         ArrowSerializationError.__init__(self, message)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_n_s_ArrowSerializationError); if (unlikely(!__pyx_t_20)) __PYX_ERR(16, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) __PYX_ERR(16, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_GIVEREF(__pyx_t_20);
  PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_20);
  __pyx_t_20 = 0;
  __pyx_t_20 = __Pyx_CalculateMetaclass(NULL, __pyx_t_19); if (unlikely(!__pyx_t_20)) __PYX_ERR(16, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_18 = __Pyx_Py3MetaclassPrepare(__pyx_t_20, __pyx_t_19, __pyx_n_s_DeserializationCallbackError, __pyx_n_s_DeserializationCallbackError, (PyObject *) NULL, __pyx_n_s_pyarrow_lib, (PyObject *) NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(16, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);

  /* "pyarrow/serialization.pxi":43
 * 
 * class DeserializationCallbackError(ArrowSerializationError):
 *     def __init__(self, message, type_id):             # <<<<<<<<<<<<<<
 *         ArrowSerializationError.__init__(self, message)
 *         self.type_id = type_id
 */
  __pyx_t_16 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_28DeserializationCallbackError_1__init__, 0, __pyx_n_s_DeserializationCallbackError___i, NULL, __pyx_n_s_pyarrow_lib, __pyx_d, ((PyObject *)__pyx_codeobj__520)); if (unlikely(!__pyx_t_16)) __PYX_ERR(16, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  if (__Pyx_SetNameInClass(__pyx_t_18, __pyx_n_s_init, __pyx_t_16) < 0) __PYX_ERR(16, 43, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "pyarrow/serialization.pxi":42
 * 
 * 
 * class DeserializationCallbackError(ArrowSerializationError):             # <<<<<<<<<<<<<<
 *     def __init__(self, message, type_id):
 *         ArrowSerializationError.__init__(self, message)
 */
  __pyx_t_16 = __Pyx_Py3ClassCreate(__pyx_t_20, __pyx_n_s_DeserializationCallbackError, __pyx_t_19, __pyx_t_18, NULL, 0, 0); if (unlikely(!__pyx_t_16)) __PYX_ERR(16, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DeserializationCallbackError, __pyx_t_16) < 0) __PYX_ERR(16, 42, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/serialization.pxi":222
 * 
 * 
 * _default_serialization_context = SerializationContext()             # <<<<<<<<<<<<<<
 * _default_context_initialized = False
 * 
 */
  __pyx_t_19 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_SerializationContext)); if (unlikely(!__pyx_t_19)) __PYX_ERR(16, 222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_serialization_context, __pyx_t_19) < 0) __PYX_ERR(16, 222, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/serialization.pxi":223
 * 
 * _default_serialization_context = SerializationContext()
 * _default_context_initialized = False             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_context_initialized, Py_False) < 0) __PYX_ERR(16, 223, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":226
 * 
 * 
 * def _get_default_context():             # <<<<<<<<<<<<<<
 *     global _default_context_initialized
 *     from pyarrow.serialization import register_default_serialization_handlers
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_203_get_default_context, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(16, 226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_default_context, __pyx_t_19) < 0) __PYX_ERR(16, 226, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/serialization.pxi":294
 * 
 *     @staticmethod
 *     def from_components(components):             # <<<<<<<<<<<<<<
 *         """
 *         Reconstruct SerializedPyObject from output of
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_18SerializedPyObject_7from_components, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(16, 294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_SerializedPyObject->tp_dict, __pyx_n_s_from_components, __pyx_t_19) < 0) __PYX_ERR(16, 294, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_SerializedPyObject);

  /* "pyarrow/serialization.pxi":293
 *         return output
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_components(components):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_7pyarrow_3lib_SerializedPyObject, __pyx_n_s_from_components); if (unlikely(!__pyx_t_19)) __PYX_ERR(16, 294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_20 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_19); if (unlikely(!__pyx_t_20)) __PYX_ERR(16, 293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_SerializedPyObject->tp_dict, __pyx_n_s_from_components, __pyx_t_20) < 0) __PYX_ERR(16, 294, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_SerializedPyObject);

  /* "pyarrow/serialization.pxi":342
 * 
 * 
 * def serialize(object value, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Serialize a general Python sequence for transient storage
 *     and transport. This may have better performance and memory efficiency than
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_205serialize, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(16, 342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize, __pyx_t_20) < 0) __PYX_ERR(16, 342, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/serialization.pxi":376
 * 
 * 
 * def serialize_to(object value, sink, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Serialize a Python sequence to a file.
 * 
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_207serialize_to, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(16, 376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_to, __pyx_t_20) < 0) __PYX_ERR(16, 376, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/serialization.pxi":393
 * 
 * 
 * def read_serialized(source, base=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Read serialized Python sequence from file-like object
 * 
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_209read_serialized, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(16, 393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_read_serialized, __pyx_t_20) < 0) __PYX_ERR(16, 393, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/serialization.pxi":419
 * 
 * 
 * def deserialize_from(source, object base, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Deserialize a Python sequence from a file. This only can
 *     interact with data produced by pyarrow.serialize or pyarrow.serialize_to
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_211deserialize_from, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(16, 419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_deserialize_from, __pyx_t_20) < 0) __PYX_ERR(16, 419, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/serialization.pxi":442
 * 
 * 
 * def deserialize_components(components, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """
 *     Reconstruct Python object from output of SerializedPyObject.to_components
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_213deserialize_components, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(16, 442, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_deserialize_components, __pyx_t_20) < 0) __PYX_ERR(16, 442, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/serialization.pxi":460
 * 
 * 
 * def deserialize(obj, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Deserialize Python object from Buffer or other Python
 *     object supporting the buffer protocol. This only can interact with data
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_215deserialize, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(16, 460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_deserialize, __pyx_t_20) < 0) __PYX_ERR(16, 460, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/benchmark.pxi":19
 * 
 * 
 * def benchmark_PandasObjectIsNull(list obj):             # <<<<<<<<<<<<<<
 *     Benchmark_PandasObjectIsNull(obj)
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_217benchmark_PandasObjectIsNull, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(17, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_benchmark_PandasObjectIsNull, __pyx_t_20) < 0) __PYX_ERR(17, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "(tree fragment)":1
 * def __pyx_unpickle__PandasAPIShim(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_219__pyx_unpickle__PandasAPIShim, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(10, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle__PandasAPIShim, __pyx_t_20) < 0) __PYX_ERR(10, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "(tree fragment)":11
 *         __pyx_unpickle__PandasAPIShim__set_state(<_PandasAPIShim> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle__PandasAPIShim__set_state(_PandasAPIShim __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result._array_like_types = __pyx_state[0]; __pyx_result._categorical_type = __pyx_state[1]; __pyx_result._compat_module = __pyx_state[2]; __pyx_result._data_frame = __pyx_state[3]; __pyx_result._datetimetz_type = __pyx_state[4]; __pyx_result._extension_array = __pyx_state[5]; __pyx_result._extension_dtype = __pyx_state[6]; __pyx_result._have_pandas = __pyx_state[7]; __pyx_result._index = __pyx_state[8]; __pyx_result._loose_version = __pyx_state[9]; __pyx_result._pd = __pyx_state[10]; __pyx_result._pd024 = __pyx_state[11]; __pyx_result._series = __pyx_state[12]; __pyx_result._tried_importing_pandas = __pyx_state[13]; __pyx_result._types_api = __pyx_state[14]; __pyx_result._version = __pyx_state[15]; __pyx_result.has_sparse = __pyx_state[16]
 *     if len(__pyx_state) > 17 and hasattr(__pyx_result, '__dict__'):
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_221__pyx_unpickle_Scalar, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(10, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Scalar, __pyx_t_20) < 0) __PYX_ERR(10, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "(tree fragment)":1
 * def __pyx_unpickle__PandasConvertible(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_223__pyx_unpickle__PandasConvertible, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(10, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle__PandasConvertibl, __pyx_t_20) < 0) __PYX_ERR(10, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "(tree fragment)":11
 *         __pyx_unpickle__PandasConvertible__set_state(<_PandasConvertible> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle__PandasConvertible__set_state(_PandasConvertible __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[0])
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_225__pyx_unpickle_SerializationContext, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(10, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_SerializationCont, __pyx_t_20) < 0) __PYX_ERR(10, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/lib.pyx":1
 * # Licensed to the Apache Software Foundation (ASF) under one             # <<<<<<<<<<<<<<
 * # or more contributor license agreements.  See the NOTICE file
 * # distributed with this work for additional information
 */
  __pyx_t_20 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_20)) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_Schema_from_pandas_line_1045, __pyx_kp_u_Returns_implied_schema_from_dat) < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_array_line_114, __pyx_kp_u_Create_pyarrow_Array_instance_f) < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_Array_cast_line_611, __pyx_kp_u_Cast_array_values_to_another_da) < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_Array_take_line_923, __pyx_kp_u_Take_elements_from_an_array_The) < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_Array_filter_line_966, __pyx_kp_u_Filter_the_array_with_a_boolean) < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_Table_from_pandas_line_1118, __pyx_kp_u_Convert_pandas_DataFrame_to_an) < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_20) < 0) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "vector.from_py":45
 * 
 * @cname("__pyx_convert_vector_from_py_std_3a__3a_string")
 * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_string(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef vector[X] v
 *     for item in o:
 */

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_XDECREF(__pyx_t_20);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init pyarrow.lib", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_CLEAR(__pyx_m);
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init pyarrow.lib");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  return (__pyx_m != NULL) ? 0 : -1;
  #elif PY_MAJOR_VERSION >= 3
  return __pyx_m;
  #else
  return;
  #endif
}

/* --- Runtime support code --- */
/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule(modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, "RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

/* PyObjectGetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_getattr))
        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
    return PyObject_GetAttr(obj, attr_name);
}
#endif

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
    if (unlikely(!result)) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

/* PyObjectCall */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = func->ob_type->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyErrFetchRestore */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
}
#endif

/* RaiseException */
#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    __Pyx_PyThreadState_declare
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        type = (PyObject*) Py_TYPE(type);
        Py_INCREF(type);
        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: exception class must be a subclass of BaseException");
            goto raise_error;
        }
    }
    __Pyx_PyThreadState_assign
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
    if (cause) {
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#else
        PyThreadState *tstate = __Pyx_PyThreadState_Current;
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

/* RaiseArgTupleInvalid */
static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

/* KeywordStringCheck */
static int __Pyx_CheckKeywordStrings(
    PyObject *kwdict,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
#if CYTHON_COMPILING_IN_PYPY
    if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
        goto invalid_keyword;
    return 1;
#else
    while (PyDict_Next(kwdict, &pos, &key, 0)) {
        #if PY_MAJOR_VERSION < 3
        if (unlikely(!PyString_Check(key)))
        #endif
            if (unlikely(!PyUnicode_Check(key)))
                goto invalid_keyword_type;
    }
    if ((!kw_allowed) && unlikely(key))
        goto invalid_keyword;
    return 1;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    return 0;
#endif
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
}

/* Import */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    #if PY_MAJOR_VERSION < 3
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (!py_import)
        goto bad;
    #endif
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.')) {
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_MAJOR_VERSION < 3
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
bad:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

/* GetTopmostException */
#if CYTHON_USE_EXC_INFO_STACK
static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
{
    _PyErr_StackItem *exc_info = tstate->exc_info;
    while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
           exc_info->previous_item != NULL)
    {
        exc_info = exc_info->previous_item;
    }
    return exc_info;
}
#endif

/* SaveResetException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    *type = exc_info->exc_type;
    *value = exc_info->exc_value;
    *tb = exc_info->exc_traceback;
    #else
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    #endif
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = type;
    exc_info->exc_value = value;
    exc_info->exc_traceback = tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
#endif

/* PyErrExceptionMatches */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    PyObject *exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
    if (unlikely(PyTuple_Check(err)))
        return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
}
#endif

/* GetException */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
#endif
{
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_FAST_THREAD_STATE
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_FAST_THREAD_STATE
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_FAST_THREAD_STATE
    #if CYTHON_USE_EXC_INFO_STACK
    {
        _PyErr_StackItem *exc_info = tstate->exc_info;
        tmp_type = exc_info->exc_type;
        tmp_value = exc_info->exc_value;
        tmp_tb = exc_info->exc_traceback;
        exc_info->exc_type = local_type;
        exc_info->exc_value = local_value;
        exc_info->exc_traceback = local_tb;
    }
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

/* ImportFrom */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Format(PyExc_ImportError,
        #if PY_MAJOR_VERSION < 3
            "cannot import name %.230s", PyString_AS_STRING(name));
        #else
            "cannot import name %S", name);
        #endif
    }
    return value;
}

/* PyCFunctionFastCall */
#if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
    PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
    PyCFunction meth = PyCFunction_GET_FUNCTION(func);
    PyObject *self = PyCFunction_GET_SELF(func);
    int flags = PyCFunction_GET_FLAGS(func);
    assert(PyCFunction_Check(func));
    assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
    assert(nargs >= 0);
    assert(nargs == 0 || args != NULL);
    /* _PyCFunction_FastCallDict() must not be called with an exception set,
       because it may clear it (directly or indirectly) and so the
       caller loses its exception */
    assert(!PyErr_Occurred());
    if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
        return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
    } else {
        return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
    }
}
#endif

/* PyFunctionFastCall */
#if CYTHON_FAST_PYCALL
static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
                                               PyObject *globals) {
    PyFrameObject *f;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject **fastlocals;
    Py_ssize_t i;
    PyObject *result;
    assert(globals != NULL);
    /* XXX Perhaps we should create a specialized
       PyFrame_New() that doesn't take locals, but does
       take builtins without sanity checking them.
       */
    assert(tstate != NULL);
    f = PyFrame_New(tstate, co, globals, NULL);
    if (f == NULL) {
        return NULL;
    }
    fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
    for (i = 0; i < na; i++) {
        Py_INCREF(*args);
        fastlocals[i] = *args++;
    }
    result = PyEval_EvalFrameEx(f,0);
    ++tstate->recursion_depth;
    Py_DECREF(f);
    --tstate->recursion_depth;
    return result;
}
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
    PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
    PyObject *globals = PyFunction_GET_GLOBALS(func);
    PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
    PyObject *closure;
#if PY_MAJOR_VERSION >= 3
    PyObject *kwdefs;
#endif
    PyObject *kwtuple, **k;
    PyObject **d;
    Py_ssize_t nd;
    Py_ssize_t nk;
    PyObject *result;
    assert(kwargs == NULL || PyDict_Check(kwargs));
    nk = kwargs ? PyDict_Size(kwargs) : 0;
    if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
        return NULL;
    }
    if (
#if PY_MAJOR_VERSION >= 3
            co->co_kwonlyargcount == 0 &&
#endif
            likely(kwargs == NULL || nk == 0) &&
            co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
        if (argdefs == NULL && co->co_argcount == nargs) {
            result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
            goto done;
        }
        else if (nargs == 0 && argdefs != NULL
                 && co->co_argcount == Py_SIZE(argdefs)) {
            /* function called with no arguments, but all parameters have
               a default value: use default values as arguments .*/
            args = &PyTuple_GET_ITEM(argdefs, 0);
            result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
            goto done;
        }
    }
    if (kwargs != NULL) {
        Py_ssize_t pos, i;
        kwtuple = PyTuple_New(2 * nk);
        if (kwtuple == NULL) {
            result = NULL;
            goto done;
        }
        k = &PyTuple_GET_ITEM(kwtuple, 0);
        pos = i = 0;
        while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
            Py_INCREF(k[i]);
            Py_INCREF(k[i+1]);
            i += 2;
        }
        nk = i / 2;
    }
    else {
        kwtuple = NULL;
        k = NULL;
    }
    closure = PyFunction_GET_CLOSURE(func);
#if PY_MAJOR_VERSION >= 3
    kwdefs = PyFunction_GET_KW_DEFAULTS(func);
#endif
    if (argdefs != NULL) {
        d = &PyTuple_GET_ITEM(argdefs, 0);
        nd = Py_SIZE(argdefs);
    }
    else {
        d = NULL;
        nd = 0;
    }
#if PY_MAJOR_VERSION >= 3
    result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, kwdefs, closure);
#else
    result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, closure);
#endif
    Py_XDECREF(kwtuple);
done:
    Py_LeaveRecursiveCall();
    return result;
}
#endif
#endif

/* PyObjectCall2Args */
static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
    PyObject *args, *result = NULL;
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(function)) {
        PyObject *args[2] = {arg1, arg2};
        return __Pyx_PyFunction_FastCall(function, args, 2);
    }
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(function)) {
        PyObject *args[2] = {arg1, arg2};
        return __Pyx_PyCFunction_FastCall(function, args, 2);
    }
    #endif
    args = PyTuple_New(2);
    if (unlikely(!args)) goto done;
    Py_INCREF(arg1);
    PyTuple_SET_ITEM(args, 0, arg1);
    Py_INCREF(arg2);
    PyTuple_SET_ITEM(args, 1, arg2);
    Py_INCREF(function);
    result = __Pyx_PyObject_Call(function, args, NULL);
    Py_DECREF(args);
    Py_DECREF(function);
done:
    return result;
}

/* PyObjectCallMethO */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = PyCFunction_GET_FUNCTION(func);
    self = PyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallOneArg */
#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_New(1);
    if (unlikely(!args)) return NULL;
    Py_INCREF(arg);
    PyTuple_SET_ITEM(args, 0, arg);
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, &arg, 1);
    }
#endif
    if (likely(PyCFunction_Check(func))) {
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
#if CYTHON_FAST_PYCCALL
        } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
            return __Pyx_PyCFunction_FastCall(func, &arg, 1);
#endif
        }
    }
    return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_Pack(1, arg);
    if (unlikely(!args)) return NULL;
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
#endif

/* WriteUnraisableException */
static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
                                  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
                                  int full_traceback, CYTHON_UNUSED int nogil) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_PyThreadState_declare
#ifdef WITH_THREAD
    PyGILState_STATE state;
    if (nogil)
        state = PyGILState_Ensure();
#ifdef _MSC_VER
    else state = (PyGILState_STATE)-1;
#endif
#endif
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    if (full_traceback) {
        Py_XINCREF(old_exc);
        Py_XINCREF(old_val);
        Py_XINCREF(old_tb);
        __Pyx_ErrRestore(old_exc, old_val, old_tb);
        PyErr_PrintEx(1);
    }
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
#ifdef WITH_THREAD
    if (nogil)
        PyGILState_Release(state);
#endif
}

/* PyDictVersioning */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
    PyObject **dictptr = NULL;
    Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
    if (offset) {
#if CYTHON_COMPILING_IN_CPYTHON
        dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
#else
        dictptr = _PyObject_GetDictPtr(obj);
#endif
    }
    return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
}
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
        return 0;
    return obj_dict_version == __Pyx_get_object_dict_version(obj);
}
#endif

/* RaiseDoubleKeywords */
static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

/* ParseKeywords */
static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key);
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

/* GetAttr */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_USE_TYPE_SLOTS
#if PY_MAJOR_VERSION >= 3
    if (likely(PyUnicode_Check(n)))
#else
    if (likely(PyString_Check(n)))
#endif
        return __Pyx_PyObject_GetAttrStr(o, n);
#endif
    return PyObject_GetAttr(o, n);
}

/* HasAttr */
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
    PyObject *r;
    if (unlikely(!__Pyx_PyBaseString_Check(n))) {
        PyErr_SetString(PyExc_TypeError,
                        "hasattr(): attribute name must be string");
        return -1;
    }
    r = __Pyx_GetAttr(o, n);
    if (unlikely(!r)) {
        PyErr_Clear();
        return 0;
    } else {
        Py_DECREF(r);
        return 1;
    }
}

/* GetAttr3 */
static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        return NULL;
    __Pyx_PyErr_Clear();
    Py_INCREF(d);
    return d;
}
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
    PyObject *r = __Pyx_GetAttr(o, n);
    return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
}

/* GetModuleGlobalName */
#if CYTHON_USE_DICT_VERSIONS
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
#else
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
#endif
{
    PyObject *result;
#if !CYTHON_AVOID_BORROWED_REFS
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
    result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    } else if (unlikely(PyErr_Occurred())) {
        return NULL;
    }
#else
    result = PyDict_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
#endif
#else
    result = PyObject_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
    PyErr_Clear();
#endif
    return __Pyx_GetBuiltinName(name);
}

/* ArgTypeTest */
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
{
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    else if (exact) {
        #if PY_MAJOR_VERSION == 2
        if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
        #endif
    }
    else {
        if (likely(__Pyx_TypeCheck(obj, type))) return 1;
    }
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
    return 0;
}

/* DictGetItem */
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (!PyErr_Occurred()) {
            if (unlikely(PyTuple_Check(key))) {
                PyObject* args = PyTuple_Pack(1, key);
                if (likely(args)) {
                    PyErr_SetObject(PyExc_KeyError, args);
                    Py_DECREF(args);
                }
            } else {
                PyErr_SetObject(PyExc_KeyError, key);
            }
        }
        return NULL;
    }
    Py_INCREF(value);
    return value;
}
#endif

/* ExtTypeTest */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(__Pyx_TypeCheck(obj, type)))
        return 1;
    PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
                 Py_TYPE(obj)->tp_name, type->tp_name);
    return 0;
}

/* GetItemInt */
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyList_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyTuple_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     CYTHON_NCP_UNUSED int wraparound,
                                                     CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return NULL;
                    PyErr_Clear();
                }
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (is_list || PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

/* PyObjectGetMethod */
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
    PyObject *attr;
#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
    PyTypeObject *tp = Py_TYPE(obj);
    PyObject *descr;
    descrgetfunc f = NULL;
    PyObject **dictptr, *dict;
    int meth_found = 0;
    assert (*method == NULL);
    if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
        attr = __Pyx_PyObject_GetAttrStr(obj, name);
        goto try_unpack;
    }
    if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
        return 0;
    }
    descr = _PyType_Lookup(tp, name);
    if (likely(descr != NULL)) {
        Py_INCREF(descr);
#if PY_MAJOR_VERSION >= 3
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
        #endif
#else
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr)))
        #endif
#endif
        {
            meth_found = 1;
        } else {
            f = Py_TYPE(descr)->tp_descr_get;
            if (f != NULL && PyDescr_IsData(descr)) {
                attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
                Py_DECREF(descr);
                goto try_unpack;
            }
        }
    }
    dictptr = _PyObject_GetDictPtr(obj);
    if (dictptr != NULL && (dict = *dictptr) != NULL) {
        Py_INCREF(dict);
        attr = __Pyx_PyDict_GetItemStr(dict, name);
        if (attr != NULL) {
            Py_INCREF(attr);
            Py_DECREF(dict);
            Py_XDECREF(descr);
            goto try_unpack;
        }
        Py_DECREF(dict);
    }
    if (meth_found) {
        *method = descr;
        return 1;
    }
    if (f != NULL) {
        attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
        Py_DECREF(descr);
        goto try_unpack;
    }
    if (descr != NULL) {
        *method = descr;
        return 0;
    }
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'%.50s' object has no attribute '%U'",
                 tp->tp_name, name);
#else
                 "'%.50s' object has no attribute '%.400s'",
                 tp->tp_name, PyString_AS_STRING(name));
#endif
    return 0;
#else
    attr = __Pyx_PyObject_GetAttrStr(obj, name);
    goto try_unpack;
#endif
try_unpack:
#if CYTHON_UNPACK_METHODS
    if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
        PyObject *function = PyMethod_GET_FUNCTION(attr);
        Py_INCREF(function);
        Py_DECREF(attr);
        *method = function;
        return 1;
    }
#endif
    *method = attr;
    return 0;
}

/* PyObjectCallMethod1 */
static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
    PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
    Py_DECREF(method);
    return result;
}
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
    PyObject *method = NULL, *result;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_Call2Args(method, obj, arg);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) return NULL;
    return __Pyx__PyObject_CallMethod1(method, arg);
}

/* append */
static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
    if (likely(PyList_CheckExact(L))) {
        if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
    } else {
        PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x);
        if (unlikely(!retval))
            return -1;
        Py_DECREF(retval);
    }
    return 0;
}

/* PyObjectCallNoArg */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, NULL, 0);
    }
#endif
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
#else
    if (likely(PyCFunction_Check(func)))
#endif
    {
        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
            return __Pyx_PyObject_CallMethO(func, NULL);
        }
    }
    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif

/* IterFinish */
static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_FAST_THREAD_STATE
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
            PyObject *exc_value, *exc_tb;
            exc_value = tstate->curexc_value;
            exc_tb = tstate->curexc_traceback;
            tstate->curexc_type = 0;
            tstate->curexc_value = 0;
            tstate->curexc_traceback = 0;
            Py_DECREF(exc_type);
            Py_XDECREF(exc_value);
            Py_XDECREF(exc_tb);
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#else
    if (unlikely(PyErr_Occurred())) {
        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
            PyErr_Clear();
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#endif
}

/* PyObjectCallMethod0 */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
    PyObject *method = NULL, *result = NULL;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_CallOneArg(method, obj);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) goto bad;
    result = __Pyx_PyObject_CallNoArg(method);
    Py_DECREF(method);
bad:
    return result;
}

/* RaiseNeedMoreValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

/* RaiseTooManyValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

/* UnpackItemEndCheck */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    } else {
        return __Pyx_IterFinish();
    }
    return 0;
}

/* RaiseNoneIterError */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

/* UnpackTupleError */
static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
    if (t == Py_None) {
      __Pyx_RaiseNoneNotIterableError();
    } else if (PyTuple_GET_SIZE(t) < index) {
      __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
    } else {
      __Pyx_RaiseTooManyValuesError(index);
    }
}

/* UnpackTuple2 */
static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
        PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) {
    PyObject *value1 = NULL, *value2 = NULL;
#if CYTHON_COMPILING_IN_PYPY
    value1 = PySequence_ITEM(tuple, 0);  if (unlikely(!value1)) goto bad;
    value2 = PySequence_ITEM(tuple, 1);  if (unlikely(!value2)) goto bad;
#else
    value1 = PyTuple_GET_ITEM(tuple, 0);  Py_INCREF(value1);
    value2 = PyTuple_GET_ITEM(tuple, 1);  Py_INCREF(value2);
#endif
    if (decref_tuple) {
        Py_DECREF(tuple);
    }
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
#if CYTHON_COMPILING_IN_PYPY
bad:
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
#endif
}
static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
                                       int has_known_size, int decref_tuple) {
    Py_ssize_t index;
    PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
    iternextfunc iternext;
    iter = PyObject_GetIter(tuple);
    if (unlikely(!iter)) goto bad;
    if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
    iternext = Py_TYPE(iter)->tp_iternext;
    value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
    value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
    if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
    Py_DECREF(iter);
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
unpacking_failed:
    if (!has_known_size && __Pyx_IterFinish() == 0)
        __Pyx_RaiseNeedMoreValuesError(index);
bad:
    Py_XDECREF(iter);
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
}

/* dict_iter */
static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
                                                   Py_ssize_t* p_orig_length, int* p_source_is_dict) {
    is_dict = is_dict || likely(PyDict_CheckExact(iterable));
    *p_source_is_dict = is_dict;
    if (is_dict) {
#if !CYTHON_COMPILING_IN_PYPY
        *p_orig_length = PyDict_Size(iterable);
        Py_INCREF(iterable);
        return iterable;
#elif PY_MAJOR_VERSION >= 3
        static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL;
        PyObject **pp = NULL;
        if (method_name) {
            const char *name = PyUnicode_AsUTF8(method_name);
            if (strcmp(name, "iteritems") == 0) pp = &py_items;
            else if (strcmp(name, "iterkeys") == 0) pp = &py_keys;
            else if (strcmp(name, "itervalues") == 0) pp = &py_values;
            if (pp) {
                if (!*pp) {
                    *pp = PyUnicode_FromString(name + 4);
                    if (!*pp)
                        return NULL;
                }
                method_name = *pp;
            }
        }
#endif
    }
    *p_orig_length = 0;
    if (method_name) {
        PyObject* iter;
        iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
        if (!iterable)
            return NULL;
#if !CYTHON_COMPILING_IN_PYPY
        if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
            return iterable;
#endif
        iter = PyObject_GetIter(iterable);
        Py_DECREF(iterable);
        return iter;
    }
    return PyObject_GetIter(iterable);
}
static CYTHON_INLINE int __Pyx_dict_iter_next(
        PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
        PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
    PyObject* next_item;
#if !CYTHON_COMPILING_IN_PYPY
    if (source_is_dict) {
        PyObject *key, *value;
        if (unlikely(orig_length != PyDict_Size(iter_obj))) {
            PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
            return -1;
        }
        if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
            return 0;
        }
        if (pitem) {
            PyObject* tuple = PyTuple_New(2);
            if (unlikely(!tuple)) {
                return -1;
            }
            Py_INCREF(key);
            Py_INCREF(value);
            PyTuple_SET_ITEM(tuple, 0, key);
            PyTuple_SET_ITEM(tuple, 1, value);
            *pitem = tuple;
        } else {
            if (pkey) {
                Py_INCREF(key);
                *pkey = key;
            }
            if (pvalue) {
                Py_INCREF(value);
                *pvalue = value;
            }
        }
        return 1;
    } else if (PyTuple_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0;
        *ppos = pos + 1;
        next_item = PyTuple_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
    } else if (PyList_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;
        *ppos = pos + 1;
        next_item = PyList_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
    } else
#endif
    {
        next_item = PyIter_Next(iter_obj);
        if (unlikely(!next_item)) {
            return __Pyx_IterFinish();
        }
    }
    if (pitem) {
        *pitem = next_item;
    } else if (pkey && pvalue) {
        if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
            return -1;
    } else if (pkey) {
        *pkey = next_item;
    } else {
        *pvalue = next_item;
    }
    return 1;
}

/* ObjectGetItem */
#if CYTHON_USE_TYPE_SLOTS
static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
    PyObject *runerr;
    Py_ssize_t key_value;
    PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
    if (unlikely(!(m && m->sq_item))) {
        PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
        return NULL;
    }
    key_value = __Pyx_PyIndex_AsSsize_t(index);
    if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
        return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
    }
    if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
        PyErr_Clear();
        PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
    }
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
    PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
    if (likely(m && m->mp_subscript)) {
        return m->mp_subscript(obj, key);
    }
    return __Pyx_PyObject_GetIndex(obj, key);
}
#endif

/* py_abs */
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject *__Pyx_PyLong_AbsNeg(PyObject *n) {
    if (likely(Py_SIZE(n) == -1)) {
        return PyLong_FromLong(((PyLongObject*)n)->ob_digit[0]);
    }
#if CYTHON_COMPILING_IN_CPYTHON
    {
        PyObject *copy = _PyLong_Copy((PyLongObject*)n);
        if (likely(copy)) {
            Py_SIZE(copy) = -(Py_SIZE(copy));
        }
        return copy;
    }
#else
    return PyNumber_Negative(n);
#endif
}
#endif

/* FetchCommonType */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
    PyObject* fake_module;
    PyTypeObject* cached_type = NULL;
    fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
    if (!fake_module) return NULL;
    Py_INCREF(fake_module);
    cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
    if (cached_type) {
        if (!PyType_Check((PyObject*)cached_type)) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s is not a type object",
                type->tp_name);
            goto bad;
        }
        if (cached_type->tp_basicsize != type->tp_basicsize) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s has the wrong size, try recompiling",
                type->tp_name);
            goto bad;
        }
    } else {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
        PyErr_Clear();
        if (PyType_Ready(type) < 0) goto bad;
        if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
            goto bad;
        Py_INCREF(type);
        cached_type = type;
    }
done:
    Py_DECREF(fake_module);
    return cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

/* CythonFunction */
#include <structmember.h>
static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
{
    if (unlikely(op->func_doc == NULL)) {
        if (op->func.m_ml->ml_doc) {
#if PY_MAJOR_VERSION >= 3
            op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
#else
            op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
#endif
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp = op->func_doc;
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    op->func_doc = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    if (unlikely(op->func_name == NULL)) {
#if PY_MAJOR_VERSION >= 3
        op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
#else
        op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
#endif
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = op->func_name;
    Py_INCREF(value);
    op->func_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(op->func_qualname);
    return op->func_qualname;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = op->func_qualname;
    Py_INCREF(value);
    op->func_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
{
    PyObject *self;
    self = m->func_closure;
    if (self == NULL)
        self = Py_None;
    Py_INCREF(self);
    return self;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    if (unlikely(op->func_dict == NULL)) {
        op->func_dict = PyDict_New();
        if (unlikely(op->func_dict == NULL))
            return NULL;
    }
    Py_INCREF(op->func_dict);
    return op->func_dict;
}
static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
    if (unlikely(value == NULL)) {
        PyErr_SetString(PyExc_TypeError,
               "function's dictionary may not be deleted");
        return -1;
    }
    if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
               "setting function's dictionary to a non-dict");
        return -1;
    }
    tmp = op->func_dict;
    Py_INCREF(value);
    op->func_dict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
    int result = 0;
    PyObject *res = op->defaults_getter((PyObject *) op);
    if (unlikely(!res))
        return -1;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
    Py_INCREF(op->defaults_tuple);
    op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
    Py_INCREF(op->defaults_kwdict);
    #else
    op->defaults_tuple = PySequence_ITEM(res, 0);
    if (unlikely(!op->defaults_tuple)) result = -1;
    else {
        op->defaults_kwdict = PySequence_ITEM(res, 1);
        if (unlikely(!op->defaults_kwdict)) result = -1;
    }
    #endif
    Py_DECREF(res);
    return result;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyTuple_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__defaults__ must be set to a tuple object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_tuple;
    op->defaults_tuple = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    PyObject* result = op->defaults_tuple;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_tuple;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__kwdefaults__ must be set to a dict object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_kwdict;
    op->defaults_kwdict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    PyObject* result = op->defaults_kwdict;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_kwdict;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value || value == Py_None) {
        value = NULL;
    } else if (!PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__annotations__ must be set to a dict object");
        return -1;
    }
    Py_XINCREF(value);
    tmp = op->func_annotations;
    op->func_annotations = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    PyObject* result = op->func_annotations;
    if (unlikely(!result)) {
        result = PyDict_New();
        if (unlikely(!result)) return NULL;
        op->func_annotations = result;
    }
    Py_INCREF(result);
    return result;
}
static PyGetSetDef __pyx_CyFunction_getsets[] = {
    {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
    {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
    {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_CyFunction_members[] = {
    {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromString(m->func.m_ml->ml_name);
#else
    return PyString_FromString(m->func.m_ml->ml_name);
#endif
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if PY_VERSION_HEX < 0x030500A0
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
    if (op == NULL)
        return NULL;
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
    op->func.m_ml = ml;
    op->func.m_self = (PyObject *) op;
    Py_XINCREF(closure);
    op->func_closure = closure;
    Py_XINCREF(module);
    op->func.m_module = module;
    op->func_dict = NULL;
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
    op->func_classobj = NULL;
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults_pyobjects = 0;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    PyObject_GC_Track(op);
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
    Py_CLEAR(m->func.m_module);
    Py_CLEAR(m->func_dict);
    Py_CLEAR(m->func_name);
    Py_CLEAR(m->func_qualname);
    Py_CLEAR(m->func_doc);
    Py_CLEAR(m->func_globals);
    Py_CLEAR(m->func_code);
    Py_CLEAR(m->func_classobj);
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_XDECREF(pydefaults[i]);
        PyObject_Free(m->defaults);
        m->defaults = NULL;
    }
    return 0;
}
static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    if (__Pyx_CyFunction_weakreflist(m) != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    PyObject_GC_Del(m);
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    __Pyx__CyFunction_dealloc(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
    Py_VISIT(m->func_closure);
    Py_VISIT(m->func.m_module);
    Py_VISIT(m->func_dict);
    Py_VISIT(m->func_name);
    Py_VISIT(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    Py_VISIT(m->func_code);
    Py_VISIT(m->func_classobj);
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_VISIT(pydefaults[i]);
    }
    return 0;
}
static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
{
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
        Py_INCREF(func);
        return func;
    }
    if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
        if (type == NULL)
            type = (PyObject *)(Py_TYPE(obj));
        return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
    }
    if (obj == Py_None)
        obj = NULL;
    return __Pyx_PyMethod_New(func, obj, type);
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
#else
    return PyString_FromFormat("<cyfunction %s at %p>",
                               PyString_AsString(op->func_qualname), (void *)op);
#endif
}
static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    Py_ssize_t size;
    switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
    case METH_VARARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0))
            return (*meth)(self, arg);
        break;
    case METH_VARARGS | METH_KEYWORDS:
        return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 0))
                return (*meth)(self, NULL);
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 1)) {
                PyObject *result, *arg0;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                arg0 = PyTuple_GET_ITEM(arg, 0);
                #else
                arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
                #endif
                result = (*meth)(self, arg0);
                #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
                Py_DECREF(arg0);
                #endif
                return result;
            }
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags in "
                        "__Pyx_CyFunction_Call. METH_OLDARGS is no "
                        "longer supported!");
        return NULL;
    }
    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
                 f->m_ml->ml_name);
    return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
}
static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
    PyObject *result;
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        Py_ssize_t argc;
        PyObject *new_args;
        PyObject *self;
        argc = PyTuple_GET_SIZE(args);
        new_args = PyTuple_GetSlice(args, 1, argc);
        if (unlikely(!new_args))
            return NULL;
        self = PyTuple_GetItem(args, 0);
        if (unlikely(!self)) {
            Py_DECREF(new_args);
            return NULL;
        }
        result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
        Py_DECREF(new_args);
    } else {
        result = __Pyx_CyFunction_Call(func, args, kw);
    }
    return result;
}
static PyTypeObject __pyx_CyFunctionType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
    (destructor) __Pyx_CyFunction_dealloc,
    0,
    0,
    0,
#if PY_MAJOR_VERSION < 3
    0,
#else
    0,
#endif
    (reprfunc) __Pyx_CyFunction_repr,
    0,
    0,
    0,
    0,
    __Pyx_CyFunction_CallAsMethod,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
    0,
    (traverseproc) __Pyx_CyFunction_traverse,
    (inquiry) __Pyx_CyFunction_clear,
    0,
#if PY_VERSION_HEX < 0x030500A0
    offsetof(__pyx_CyFunctionObject, func_weakreflist),
#else
    offsetof(PyCFunctionObject, m_weakreflist),
#endif
    0,
    0,
    __pyx_CyFunction_methods,
    __pyx_CyFunction_members,
    __pyx_CyFunction_getsets,
    0,
    0,
    __Pyx_CyFunction_descr_get,
    0,
    offsetof(__pyx_CyFunctionObject, func_dict),
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
    0,
#endif
};
static int __pyx_CyFunction_init(void) {
    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
    if (unlikely(__pyx_CyFunctionType == NULL)) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyObject_Malloc(size);
    if (unlikely(!m->defaults))
        return PyErr_NoMemory();
    memset(m->defaults, 0, size);
    m->defaults_pyobjects = pyobjects;
    return m->defaults;
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_tuple = tuple;
    Py_INCREF(tuple);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_kwdict = dict;
    Py_INCREF(dict);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->func_annotations = dict;
    Py_INCREF(dict);
}

/* BytesEquals */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    if (s1 == s2) {
        return (equals == Py_EQ);
    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
        const char *ps1, *ps2;
        Py_ssize_t length = PyBytes_GET_SIZE(s1);
        if (length != PyBytes_GET_SIZE(s2))
            return (equals == Py_NE);
        ps1 = PyBytes_AS_STRING(s1);
        ps2 = PyBytes_AS_STRING(s2);
        if (ps1[0] != ps2[0]) {
            return (equals == Py_NE);
        } else if (length == 1) {
            return (equals == Py_EQ);
        } else {
            int result;
#if CYTHON_USE_UNICODE_INTERNALS
            Py_hash_t hash1, hash2;
            hash1 = ((PyBytesObject*)s1)->ob_shash;
            hash2 = ((PyBytesObject*)s2)->ob_shash;
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                return (equals == Py_NE);
            }
#endif
            result = memcmp(ps1, ps2, (size_t)length);
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
#endif
}

/* UnicodeEquals */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
#if PY_MAJOR_VERSION < 3
    PyObject* owned_ref = NULL;
#endif
    int s1_is_unicode, s2_is_unicode;
    if (s1 == s2) {
        goto return_eq;
    }
    s1_is_unicode = PyUnicode_CheckExact(s1);
    s2_is_unicode = PyUnicode_CheckExact(s2);
#if PY_MAJOR_VERSION < 3
    if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
        owned_ref = PyUnicode_FromObject(s2);
        if (unlikely(!owned_ref))
            return -1;
        s2 = owned_ref;
        s2_is_unicode = 1;
    } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
        owned_ref = PyUnicode_FromObject(s1);
        if (unlikely(!owned_ref))
            return -1;
        s1 = owned_ref;
        s1_is_unicode = 1;
    } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
        return __Pyx_PyBytes_Equals(s1, s2, equals);
    }
#endif
    if (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length;
        int kind;
        void *data1, *data2;
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
            goto return_ne;
        }
#if CYTHON_USE_UNICODE_INTERNALS
        {
            Py_hash_t hash1, hash2;
        #if CYTHON_PEP393_ENABLED
            hash1 = ((PyASCIIObject*)s1)->hash;
            hash2 = ((PyASCIIObject*)s2)->hash;
        #else
            hash1 = ((PyUnicodeObject*)s1)->hash;
            hash2 = ((PyUnicodeObject*)s2)->hash;
        #endif
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                goto return_ne;
            }
        }
#endif
        kind = __Pyx_PyUnicode_KIND(s1);
        if (kind != __Pyx_PyUnicode_KIND(s2)) {
            goto return_ne;
        }
        data1 = __Pyx_PyUnicode_DATA(s1);
        data2 = __Pyx_PyUnicode_DATA(s2);
        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
            goto return_ne;
        } else if (length == 1) {
            goto return_eq;
        } else {
            int result = memcmp(data1, data2, (size_t)(length * kind));
            #if PY_MAJOR_VERSION < 3
            Py_XDECREF(owned_ref);
            #endif
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & s2_is_unicode) {
        goto return_ne;
    } else if ((s2 == Py_None) & s1_is_unicode) {
        goto return_ne;
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        #if PY_MAJOR_VERSION < 3
        Py_XDECREF(owned_ref);
        #endif
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_EQ);
return_ne:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_NE);
#endif
}

/* PyIntCompare */
static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) {
    if (op1 == op2) {
        Py_RETURN_FALSE;
    }
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
        if (a != b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        int unequal;
        unsigned long uintval;
        Py_ssize_t size = Py_SIZE(op1);
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        if (intval == 0) {
            if (size != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
        } else if (intval < 0) {
            if (size >= 0)
                Py_RETURN_TRUE;
            intval = -intval;
            size = -size;
        } else {
            if (size <= 0)
                Py_RETURN_TRUE;
        }
        uintval = (unsigned long) intval;
#if PyLong_SHIFT * 4 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 4)) {
            unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 3 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 3)) {
            unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 2 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 2)) {
            unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 1 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 1)) {
            unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
            unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
        if (unequal != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
        if ((double)a != (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    return (
        PyObject_RichCompare(op1, op2, Py_NE));
}

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
#if PY_MAJOR_VERSION < 3 || CYTHON_USE_PYLONG_INTERNALS
#define __Pyx_PyInt_RemainderObjC_ZeroDivisionError(operand)\
    if (unlikely(zerodivision_check && ((operand) == 0))) {\
        PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");\
        return NULL;\
    }
#endif
static PyObject* __Pyx_PyInt_RemainderObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
    (void)inplace;
    (void)zerodivision_check;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            __Pyx_PyInt_RemainderObjC_ZeroDivisionError(b)
            x = a % b;
            x += ((x != 0) & ((x ^ b) < 0)) * b;
            return PyInt_FromLong(x);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_remainder(op1, op2);
            }
        }
                __Pyx_PyInt_RemainderObjC_ZeroDivisionError(b)
                x = a % b;
                x += ((x != 0) & ((x ^ b) < 0)) * b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla % llb;
                llx += ((llx != 0) & ((llx ^ llb) < 0)) * llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    return (inplace ? PyNumber_InPlaceRemainder : PyNumber_Remainder)(op1, op2);
}
#endif

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
#if PY_MAJOR_VERSION < 3 || CYTHON_USE_PYLONG_INTERNALS
#define __Pyx_PyInt_FloorDivideObjC_ZeroDivisionError(operand)\
    if (unlikely(zerodivision_check && ((operand) == 0))) {\
        PyErr_SetString(PyExc_ZeroDivisionError, "integer division by zero");\
        return NULL;\
    }
#endif
static PyObject* __Pyx_PyInt_FloorDivideObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
    (void)inplace;
    (void)zerodivision_check;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            __Pyx_PyInt_FloorDivideObjC_ZeroDivisionError(b)
            if (unlikely(b == -1 && ((unsigned long)a) == 0-(unsigned long)a))
                return PyInt_Type.tp_as_number->nb_floor_divide(op1, op2);
            else {
                long q, r;
                q = a / b;
                r = a - q*b;
                q -= ((r != 0) & ((r ^ b) < 0));
                x = q;
            }
            return PyInt_FromLong(x);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_floor_divide(op1, op2);
            }
        }
                __Pyx_PyInt_FloorDivideObjC_ZeroDivisionError(b)
                {
                    long q, r;
                    q = a / b;
                    r = a - q*b;
                    q -= ((r != 0) & ((r ^ b) < 0));
                    x = q;
                }
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                {
                    PY_LONG_LONG q, r;
                    q = lla / llb;
                    r = lla - q*llb;
                    q -= ((r != 0) & ((r ^ llb) < 0));
                    llx = q;
                }
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    return (inplace ? PyNumber_InPlaceFloorDivide : PyNumber_FloorDivide)(op1, op2);
}
#endif

/* None */
static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

/* UnpackUnboundCMethod */
static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
    PyObject *method;
    method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
    if (unlikely(!method))
        return -1;
    target->method = method;
#if CYTHON_COMPILING_IN_CPYTHON
    #if PY_MAJOR_VERSION >= 3
    if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
    #endif
    {
        PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
        target->func = descr->d_method->ml_meth;
        target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS);
    }
#endif
    return 0;
}

/* CallUnboundCMethod1 */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) {
    if (likely(cfunc->func)) {
        int flag = cfunc->flag;
        if (flag == METH_O) {
            return (*(cfunc->func))(self, arg);
        } else if (PY_VERSION_HEX >= 0x030600B1 && flag == METH_FASTCALL) {
            if (PY_VERSION_HEX >= 0x030700A0) {
                return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1);
            } else {
                return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL);
            }
        } else if (PY_VERSION_HEX >= 0x030700A0 && flag == (METH_FASTCALL | METH_KEYWORDS)) {
            return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL);
        }
    }
    return __Pyx__CallUnboundCMethod1(cfunc, self, arg);
}
#endif
static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){
    PyObject *args, *result = NULL;
    if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
        args = PyTuple_New(1);
        if (unlikely(!args)) goto bad;
        Py_INCREF(arg);
        PyTuple_SET_ITEM(args, 0, arg);
        if (cfunc->flag & METH_KEYWORDS)
            result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL);
        else
            result = (*cfunc->func)(self, args);
    } else {
        args = PyTuple_New(2);
        if (unlikely(!args)) goto bad;
        Py_INCREF(self);
        PyTuple_SET_ITEM(args, 0, self);
        Py_INCREF(arg);
        PyTuple_SET_ITEM(args, 1, arg);
        result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
    }
#else
    args = PyTuple_Pack(2, self, arg);
    if (unlikely(!args)) goto bad;
    result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
#endif
bad:
    Py_XDECREF(args);
    return result;
}

/* decode_c_bytes */
static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
         const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
    if (unlikely((start < 0) | (stop < 0))) {
        if (start < 0) {
            start += length;
            if (start < 0)
                start = 0;
        }
        if (stop < 0)
            stop += length;
    }
    if (stop > length)
        stop = length;
    length = stop - start;
    if (unlikely(length <= 0))
        return PyUnicode_FromUnicode(NULL, 0);
    cstring += start;
    if (decode_func) {
        return decode_func(cstring, length, errors);
    } else {
        return PyUnicode_Decode(cstring, length, encoding, errors);
    }
}

/* PyIntCompare */
static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) {
    if (op1 == op2) {
        Py_RETURN_TRUE;
    }
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
        if (a == b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        int unequal;
        unsigned long uintval;
        Py_ssize_t size = Py_SIZE(op1);
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        if (intval == 0) {
            if (size == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
        } else if (intval < 0) {
            if (size >= 0)
                Py_RETURN_FALSE;
            intval = -intval;
            size = -size;
        } else {
            if (size <= 0)
                Py_RETURN_FALSE;
        }
        uintval = (unsigned long) intval;
#if PyLong_SHIFT * 4 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 4)) {
            unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 3 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 3)) {
            unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 2 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 2)) {
            unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 1 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 1)) {
            unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
            unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
        if (unequal == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
        if ((double)a == (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    return (
        PyObject_RichCompare(op1, op2, Py_EQ));
}

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
    (void)inplace;
    (void)zerodivision_check;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            x = (long)((unsigned long)a + b);
            if (likely((x^a) >= 0 || (x^b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
            }
        }
                x = a + b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla + llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            double result;
            PyFPE_START_PROTECT("add", return NULL)
            result = ((double)a) + (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#endif

/* PyObjectFormatAndDecref */
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) {
    if (unlikely(!s)) return NULL;
    if (likely(PyUnicode_CheckExact(s))) return s;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyString_CheckExact(s))) {
        PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict");
        Py_DECREF(s);
        return result;
    }
    #endif
    return __Pyx_PyObject_FormatAndDecref(s, f);
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) {
    PyObject *result = PyObject_Format(s, f);
    Py_DECREF(s);
    return result;
}

/* JoinPyUnicode */
static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      CYTHON_UNUSED Py_UCS4 max_char) {
#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    PyObject *result_uval;
    int result_ukind;
    Py_ssize_t i, char_pos;
    void *result_udata;
#if CYTHON_PEP393_ENABLED
    result_uval = PyUnicode_New(result_ulength, max_char);
    if (unlikely(!result_uval)) return NULL;
    result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
    result_udata = PyUnicode_DATA(result_uval);
#else
    result_uval = PyUnicode_FromUnicode(NULL, result_ulength);
    if (unlikely(!result_uval)) return NULL;
    result_ukind = sizeof(Py_UNICODE);
    result_udata = PyUnicode_AS_UNICODE(result_uval);
#endif
    char_pos = 0;
    for (i=0; i < value_count; i++) {
        int ukind;
        Py_ssize_t ulength;
        void *udata;
        PyObject *uval = PyTuple_GET_ITEM(value_tuple, i);
        if (unlikely(__Pyx_PyUnicode_READY(uval)))
            goto bad;
        ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
        if (unlikely(!ulength))
            continue;
        if (unlikely(char_pos + ulength < 0))
            goto overflow;
        ukind = __Pyx_PyUnicode_KIND(uval);
        udata = __Pyx_PyUnicode_DATA(uval);
        if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) {
            memcpy((char *)result_udata + char_pos * result_ukind, udata, (size_t) (ulength * result_ukind));
        } else {
            #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters)
            _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
            #else
            Py_ssize_t j;
            for (j=0; j < ulength; j++) {
                Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
                __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
            }
            #endif
        }
        char_pos += ulength;
    }
    return result_uval;
overflow:
    PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
bad:
    Py_DECREF(result_uval);
    return NULL;
#else
    result_ulength++;
    value_count++;
    return PyUnicode_Join(__pyx_empty_unicode, value_tuple);
#endif
}

/* PyObjectSetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_setattro))
        return tp->tp_setattro(obj, attr_name, value);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_setattr))
        return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
#endif
    return PyObject_SetAttr(obj, attr_name, value);
}
#endif

/* StringJoin */
#if !CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
    return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL);
}
#endif

/* FastTypeChecks */
#if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
    while (a) {
        a = a->tp_base;
        if (a == b)
            return 1;
    }
    return b == &PyBaseObject_Type;
}
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (a == b) return 1;
    mro = a->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(a, b);
}
#if PY_MAJOR_VERSION == 2
static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
    PyObject *exception, *value, *tb;
    int res;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&exception, &value, &tb);
    res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
    if (unlikely(res == -1)) {
        PyErr_WriteUnraisable(err);
        res = 0;
    }
    if (!res) {
        res = PyObject_IsSubclass(err, exc_type2);
        if (unlikely(res == -1)) {
            PyErr_WriteUnraisable(err);
            res = 0;
        }
    }
    __Pyx_ErrRestore(exception, value, tb);
    return res;
}
#else
static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
    int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
    if (!res) {
        res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
    }
    return res;
}
#endif
static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    assert(PyExceptionClass_Check(exc_type));
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        PyObject *t = PyTuple_GET_ITEM(tuple, i);
        #if PY_MAJOR_VERSION < 3
        if (likely(exc_type == t)) return 1;
        #endif
        if (likely(PyExceptionClass_Check(t))) {
            if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
        } else {
        }
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
    if (likely(err == exc_type)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        if (likely(PyExceptionClass_Check(exc_type))) {
            return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
        } else if (likely(PyTuple_Check(exc_type))) {
            return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
        } else {
        }
    }
    return PyErr_GivenExceptionMatches(err, exc_type);
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
    assert(PyExceptionClass_Check(exc_type1));
    assert(PyExceptionClass_Check(exc_type2));
    if (likely(err == exc_type1 || err == exc_type2)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
    }
    return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
}
#endif

/* SwapException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = *type;
    exc_info->exc_value = *value;
    exc_info->exc_traceback = *tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = *type;
    tstate->exc_value = *value;
    tstate->exc_traceback = *tb;
    #endif
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
    PyErr_SetExcInfo(*type, *value, *tb);
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#endif

/* None */
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

/* CallNextTpTraverse */
static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) {
    PyTypeObject* type = Py_TYPE(obj);
    while (type && type->tp_traverse != current_tp_traverse)
        type = type->tp_base;
    while (type && type->tp_traverse == current_tp_traverse)
        type = type->tp_base;
    if (type && type->tp_traverse)
        return type->tp_traverse(obj, v, a);
    return 0;
}

/* CallNextTpClear */
static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) {
    PyTypeObject* type = Py_TYPE(obj);
    while (type && type->tp_clear != current_tp_clear)
        type = type->tp_base;
    while (type && type->tp_clear == current_tp_clear)
        type = type->tp_base;
    if (type && type->tp_clear)
        type->tp_clear(obj);
}

/* PyObject_GenericGetAttrNoDict */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'%.50s' object has no attribute '%U'",
                 tp->tp_name, attr_name);
#else
                 "'%.50s' object has no attribute '%.400s'",
                 tp->tp_name, PyString_AS_STRING(attr_name));
#endif
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
    PyObject *descr;
    PyTypeObject *tp = Py_TYPE(obj);
    if (unlikely(!PyString_Check(attr_name))) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    assert(!tp->tp_dictoffset);
    descr = _PyType_Lookup(tp, attr_name);
    if (unlikely(!descr)) {
        return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
    }
    Py_INCREF(descr);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
    #endif
    {
        descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
        if (unlikely(f)) {
            PyObject *res = f(descr, obj, (PyObject *)tp);
            Py_DECREF(descr);
            return res;
        }
    }
    return descr;
}
#endif

/* PyObject_GenericGetAttr */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
    if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
}
#endif

/* SetupReduce */
static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
  int ret;
  PyObject *name_attr;
  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
  if (likely(name_attr)) {
      ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
  } else {
      ret = -1;
  }
  if (unlikely(ret < 0)) {
      PyErr_Clear();
      ret = 0;
  }
  Py_XDECREF(name_attr);
  return ret;
}
static int __Pyx_setup_reduce(PyObject* type_obj) {
    int ret = 0;
    PyObject *object_reduce = NULL;
    PyObject *object_reduce_ex = NULL;
    PyObject *reduce = NULL;
    PyObject *reduce_ex = NULL;
    PyObject *reduce_cython = NULL;
    PyObject *setstate = NULL;
    PyObject *setstate_cython = NULL;
#if CYTHON_USE_PYTYPE_LOOKUP
    if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
#else
    if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
#endif
#if CYTHON_USE_PYTYPE_LOOKUP
    object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#else
    object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#endif
    reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
    if (reduce_ex == object_reduce_ex) {
#if CYTHON_USE_PYTYPE_LOOKUP
        object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
#else
        object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
#endif
        reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
        if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
            reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto __PYX_BAD;
            ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
            ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
            setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
            if (!setstate) PyErr_Clear();
            if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
                setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto __PYX_BAD;
                ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
            }
            PyType_Modified((PyTypeObject*)type_obj);
        }
    }
    goto __PYX_GOOD;
__PYX_BAD:
    if (!PyErr_Occurred())
        PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
    ret = -1;
__PYX_GOOD:
#if !CYTHON_USE_PYTYPE_LOOKUP
    Py_XDECREF(object_reduce);
    Py_XDECREF(object_reduce_ex);
#endif
    Py_XDECREF(reduce);
    Py_XDECREF(reduce_ex);
    Py_XDECREF(reduce_cython);
    Py_XDECREF(setstate);
    Py_XDECREF(setstate_cython);
    return ret;
}

/* SetVTable */
static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#endif
    if (!ob)
        goto bad;
    if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

/* TypeImport */
#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
    size_t size, enum __Pyx_ImportType_CheckSize check_size)
{
    PyObject *result = 0;
    char warning[200];
    Py_ssize_t basicsize;
#ifdef Py_LIMITED_API
    PyObject *py_basicsize;
#endif
    result = PyObject_GetAttrString(module, class_name);
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s.%.200s is not a type object",
            module_name, class_name);
        goto bad;
    }
#ifndef Py_LIMITED_API
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
#else
    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
    if (!py_basicsize)
        goto bad;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = 0;
    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if ((size_t)basicsize < size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize);
        goto bad;
    }
    if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize);
        goto bad;
    }
    else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize);
        if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(result);
    return NULL;
}
#endif

/* CalculateMetaclass */
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
    Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
    for (i=0; i < nbases; i++) {
        PyTypeObject *tmptype;
        PyObject *tmp = PyTuple_GET_ITEM(bases, i);
        tmptype = Py_TYPE(tmp);
#if PY_MAJOR_VERSION < 3
        if (tmptype == &PyClass_Type)
            continue;
#endif
        if (!metaclass) {
            metaclass = tmptype;
            continue;
        }
        if (PyType_IsSubtype(metaclass, tmptype))
            continue;
        if (PyType_IsSubtype(tmptype, metaclass)) {
            metaclass = tmptype;
            continue;
        }
        PyErr_SetString(PyExc_TypeError,
                        "metaclass conflict: "
                        "the metaclass of a derived class "
                        "must be a (non-strict) subclass "
                        "of the metaclasses of all its bases");
        return NULL;
    }
    if (!metaclass) {
#if PY_MAJOR_VERSION < 3
        metaclass = &PyClass_Type;
#else
        metaclass = &PyType_Type;
#endif
    }
    Py_INCREF((PyObject*) metaclass);
    return (PyObject*) metaclass;
}

/* Py3ClassCreate */
static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
                                           PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
    PyObject *ns;
    if (metaclass) {
        PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
        if (prep) {
            PyObject *pargs = PyTuple_Pack(2, name, bases);
            if (unlikely(!pargs)) {
                Py_DECREF(prep);
                return NULL;
            }
            ns = PyObject_Call(prep, pargs, mkw);
            Py_DECREF(prep);
            Py_DECREF(pargs);
        } else {
            if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
                return NULL;
            PyErr_Clear();
            ns = PyDict_New();
        }
    } else {
        ns = PyDict_New();
    }
    if (unlikely(!ns))
        return NULL;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
    if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
    return ns;
bad:
    Py_DECREF(ns);
    return NULL;
}
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
                                      PyObject *dict, PyObject *mkw,
                                      int calculate_metaclass, int allow_py2_metaclass) {
    PyObject *result, *margs;
    PyObject *owned_metaclass = NULL;
    if (allow_py2_metaclass) {
        owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
        if (owned_metaclass) {
            metaclass = owned_metaclass;
        } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
            PyErr_Clear();
        } else {
            return NULL;
        }
    }
    if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
        metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
        Py_XDECREF(owned_metaclass);
        if (unlikely(!metaclass))
            return NULL;
        owned_metaclass = metaclass;
    }
    margs = PyTuple_Pack(3, name, bases, dict);
    if (unlikely(!margs)) {
        result = NULL;
    } else {
        result = PyObject_Call(metaclass, margs, mkw);
        Py_DECREF(margs);
    }
    Py_XDECREF(owned_metaclass);
    return result;
}

/* ClassMethod */
static PyObject* __Pyx_Method_ClassMethod(PyObject *method) {
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM <= 0x05080000
    if (PyObject_TypeCheck(method, &PyWrapperDescr_Type)) {
        return PyClassMethod_New(method);
    }
#else
#if CYTHON_COMPILING_IN_PYSTON || CYTHON_COMPILING_IN_PYPY
    if (PyMethodDescr_Check(method))
#else
    static PyTypeObject *methoddescr_type = NULL;
    if (methoddescr_type == NULL) {
       PyObject *meth = PyObject_GetAttrString((PyObject*)&PyList_Type, "append");
       if (!meth) return NULL;
       methoddescr_type = Py_TYPE(meth);
       Py_DECREF(meth);
    }
    if (__Pyx_TypeCheck(method, methoddescr_type))
#endif
    {
        PyMethodDescrObject *descr = (PyMethodDescrObject *)method;
        #if PY_VERSION_HEX < 0x03020000
        PyTypeObject *d_type = descr->d_type;
        #else
        PyTypeObject *d_type = descr->d_common.d_type;
        #endif
        return PyDescr_NewClassMethod(d_type, descr->d_method);
    }
#endif
    else if (PyMethod_Check(method)) {
        return PyClassMethod_New(PyMethod_GET_FUNCTION(method));
    }
    else if (PyCFunction_Check(method)) {
        return PyClassMethod_New(method);
    }
#ifdef __Pyx_CyFunction_USED
    else if (__Pyx_CyFunction_Check(method)) {
        return PyClassMethod_New(method);
    }
#endif
    PyErr_SetString(PyExc_TypeError,
                   "Class-level classmethod() can only be called on "
                   "a method_descriptor or instance method.");
    return NULL;
}

/* GetNameInClass */
static PyObject *__Pyx_GetGlobalNameAfterAttributeLookup(PyObject *name) {
    PyObject *result;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        return NULL;
    __Pyx_PyErr_Clear();
    __Pyx_GetModuleGlobalNameUncached(result, name);
    return result;
}
static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) {
    PyObject *result;
    result = __Pyx_PyObject_GetAttrStr(nmspace, name);
    if (!result) {
        result = __Pyx_GetGlobalNameAfterAttributeLookup(name);
    }
    return result;
}

/* CLineInTraceback */
#ifndef CYTHON_CLINE_IN_TRACEBACK
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
    PyObject *use_cline;
    PyObject *ptype, *pvalue, *ptraceback;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject **cython_runtime_dict;
#endif
    if (unlikely(!__pyx_cython_runtime)) {
        return c_line;
    }
    __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
#if CYTHON_COMPILING_IN_CPYTHON
    cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
    if (likely(cython_runtime_dict)) {
        __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
            use_cline, *cython_runtime_dict,
            __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
    } else
#endif
    {
      PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
      if (use_cline_obj) {
        use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
        Py_DECREF(use_cline_obj);
      } else {
        PyErr_Clear();
        use_cline = NULL;
      }
    }
    if (!use_cline) {
        c_line = 0;
        PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
    }
    else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
        c_line = 0;
    }
    __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
    return c_line;
}
#endif

/* CodeObjectCache */
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

/* AddTraceback */
#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_code = __Pyx_PyCode_New(
        0,
        0,
        0,
        0,
        0,
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(tstate, c_line);
    }
    py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        tstate,            /*PyThreadState *tstate,*/
        py_code,           /*PyCodeObject *code,*/
        __pyx_d,    /*PyObject *globals,*/
        0                  /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

/* CIntFromPyVerify */
#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type(enum  arrow::Type::type value) {
    const enum  arrow::Type::type neg_one = (enum  arrow::Type::type) ((enum  arrow::Type::type) 0 - (enum  arrow::Type::type) 1), const_zero = (enum  arrow::Type::type) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(enum  arrow::Type::type) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum  arrow::Type::type) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum  arrow::Type::type) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(enum  arrow::Type::type) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum  arrow::Type::type) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(enum  arrow::Type::type),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____arrow_3a__3a_UnionMode_3a__3a_type(enum  arrow::UnionMode::type value) {
    const enum  arrow::UnionMode::type neg_one = (enum  arrow::UnionMode::type) ((enum  arrow::UnionMode::type) 0 - (enum  arrow::UnionMode::type) 1), const_zero = (enum  arrow::UnionMode::type) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(enum  arrow::UnionMode::type) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum  arrow::UnionMode::type) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum  arrow::UnionMode::type) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(enum  arrow::UnionMode::type) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum  arrow::UnionMode::type) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(enum  arrow::UnionMode::type),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
    const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value) {
    const int64_t neg_one = (int64_t) ((int64_t) 0 - (int64_t) 1), const_zero = (int64_t) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int64_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int64_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int64_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int64_t),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value) {
    const int32_t neg_one = (int32_t) ((int32_t) 0 - (int32_t) 1), const_zero = (int32_t) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int32_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int32_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int32_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int32_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int32_t),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int8_t(int8_t value) {
    const int8_t neg_one = (int8_t) ((int8_t) 0 - (int8_t) 1), const_zero = (int8_t) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int8_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int8_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int8_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int8_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int8_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int8_t),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type(enum  arrow::TimeUnit::type value) {
    const enum  arrow::TimeUnit::type neg_one = (enum  arrow::TimeUnit::type) ((enum  arrow::TimeUnit::type) 0 - (enum  arrow::TimeUnit::type) 1), const_zero = (enum  arrow::TimeUnit::type) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(enum  arrow::TimeUnit::type) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum  arrow::TimeUnit::type) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum  arrow::TimeUnit::type) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(enum  arrow::TimeUnit::type) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum  arrow::TimeUnit::type) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(enum  arrow::TimeUnit::type),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) {
    const uint8_t neg_one = (uint8_t) ((uint8_t) 0 - (uint8_t) 1), const_zero = (uint8_t) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(uint8_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(uint8_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(uint8_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(uint8_t),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int16_t(int16_t value) {
    const int16_t neg_one = (int16_t) ((int16_t) 0 - (int16_t) 1), const_zero = (int16_t) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int16_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int16_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int16_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int16_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int16_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int16_t),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value) {
    const uint16_t neg_one = (uint16_t) ((uint16_t) 0 - (uint16_t) 1), const_zero = (uint16_t) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(uint16_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(uint16_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint16_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(uint16_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint16_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(uint16_t),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) {
    const uint32_t neg_one = (uint32_t) ((uint32_t) 0 - (uint32_t) 1), const_zero = (uint32_t) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(uint32_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(uint32_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(uint32_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(uint32_t),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value) {
    const uint64_t neg_one = (uint64_t) ((uint64_t) 0 - (uint64_t) 1), const_zero = (uint64_t) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(uint64_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(uint64_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(uint64_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint64_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(uint64_t),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
    const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

/* None */
static CYTHON_INLINE int __Pyx_ErrOccurredWithGIL(void) {
  int err;
  #ifdef WITH_THREAD
  PyGILState_STATE _save = PyGILState_Ensure();
  #endif
  err = !!PyErr_Occurred();
  #ifdef WITH_THREAD
  PyGILState_Release(_save);
  #endif
  return err;
}

/* CIntFromPy */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
    const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int) -1;
        }
    } else {
        int val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

/* CIntFromPy */
static CYTHON_INLINE enum  arrow::Type::type __Pyx_PyInt_As_enum____arrow_3a__3a_Type_3a__3a_type(PyObject *x) {
    const enum  arrow::Type::type neg_one = (enum  arrow::Type::type) ((enum  arrow::Type::type) 0 - (enum  arrow::Type::type) 1), const_zero = (enum  arrow::Type::type) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(enum  arrow::Type::type) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(enum  arrow::Type::type, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (enum  arrow::Type::type) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (enum  arrow::Type::type) 0;
                case  1: __PYX_VERIFY_RETURN_INT(enum  arrow::Type::type, digit, digits[0])
                case 2:
                    if (8 * sizeof(enum  arrow::Type::type) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum  arrow::Type::type, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum  arrow::Type::type) >= 2 * PyLong_SHIFT) {
                            return (enum  arrow::Type::type) (((((enum  arrow::Type::type)digits[1]) << PyLong_SHIFT) | (enum  arrow::Type::type)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(enum  arrow::Type::type) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum  arrow::Type::type, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum  arrow::Type::type) >= 3 * PyLong_SHIFT) {
                            return (enum  arrow::Type::type) (((((((enum  arrow::Type::type)digits[2]) << PyLong_SHIFT) | (enum  arrow::Type::type)digits[1]) << PyLong_SHIFT) | (enum  arrow::Type::type)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(enum  arrow::Type::type) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum  arrow::Type::type, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum  arrow::Type::type) >= 4 * PyLong_SHIFT) {
                            return (enum  arrow::Type::type) (((((((((enum  arrow::Type::type)digits[3]) << PyLong_SHIFT) | (enum  arrow::Type::type)digits[2]) << PyLong_SHIFT) | (enum  arrow::Type::type)digits[1]) << PyLong_SHIFT) | (enum  arrow::Type::type)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (enum  arrow::Type::type) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(enum  arrow::Type::type) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum  arrow::Type::type, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(enum  arrow::Type::type) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum  arrow::Type::type, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (enum  arrow::Type::type) 0;
                case -1: __PYX_VERIFY_RETURN_INT(enum  arrow::Type::type, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(enum  arrow::Type::type,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(enum  arrow::Type::type) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum  arrow::Type::type, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum  arrow::Type::type) - 1 > 2 * PyLong_SHIFT) {
                            return (enum  arrow::Type::type) (((enum  arrow::Type::type)-1)*(((((enum  arrow::Type::type)digits[1]) << PyLong_SHIFT) | (enum  arrow::Type::type)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(enum  arrow::Type::type) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum  arrow::Type::type, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum  arrow::Type::type) - 1 > 2 * PyLong_SHIFT) {
                            return (enum  arrow::Type::type) ((((((enum  arrow::Type::type)digits[1]) << PyLong_SHIFT) | (enum  arrow::Type::type)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(enum  arrow::Type::type) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum  arrow::Type::type, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum  arrow::Type::type) - 1 > 3 * PyLong_SHIFT) {
                            return (enum  arrow::Type::type) (((enum  arrow::Type::type)-1)*(((((((enum  arrow::Type::type)digits[2]) << PyLong_SHIFT) | (enum  arrow::Type::type)digits[1]) << PyLong_SHIFT) | (enum  arrow::Type::type)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(enum  arrow::Type::type) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum  arrow::Type::type, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum  arrow::Type::type) - 1 > 3 * PyLong_SHIFT) {
                            return (enum  arrow::Type::type) ((((((((enum  arrow::Type::type)digits[2]) << PyLong_SHIFT) | (enum  arrow::Type::type)digits[1]) << PyLong_SHIFT) | (enum  arrow::Type::type)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(enum  arrow::Type::type) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum  arrow::Type::type, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum  arrow::Type::type) - 1 > 4 * PyLong_SHIFT) {
                            return (enum  arrow::Type::type) (((enum  arrow::Type::type)-1)*(((((((((enum  arrow::Type::type)digits[3]) << PyLong_SHIFT) | (enum  arrow::Type::type)digits[2]) << PyLong_SHIFT) | (enum  arrow::Type::type)digits[1]) << PyLong_SHIFT) | (enum  arrow::Type::type)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(enum  arrow::Type::type) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum  arrow::Type::type, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum  arrow::Type::type) - 1 > 4 * PyLong_SHIFT) {
                            return (enum  arrow::Type::type) ((((((((((enum  arrow::Type::type)digits[3]) << PyLong_SHIFT) | (enum  arrow::Type::type)digits[2]) << PyLong_SHIFT) | (enum  arrow::Type::type)digits[1]) << PyLong_SHIFT) | (enum  arrow::Type::type)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(enum  arrow::Type::type) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum  arrow::Type::type, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(enum  arrow::Type::type) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum  arrow::Type::type, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            enum  arrow::Type::type val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (enum  arrow::Type::type) -1;
        }
    } else {
        enum  arrow::Type::type val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (enum  arrow::Type::type) -1;
        val = __Pyx_PyInt_As_enum____arrow_3a__3a_Type_3a__3a_type(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to enum  arrow::Type::type");
    return (enum  arrow::Type::type) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to enum  arrow::Type::type");
    return (enum  arrow::Type::type) -1;
}

/* CIntFromPy */
static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *x) {
    const int64_t neg_one = (int64_t) ((int64_t) 0 - (int64_t) 1), const_zero = (int64_t) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int64_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int64_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int64_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int64_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int64_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(int64_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int64_t) >= 2 * PyLong_SHIFT) {
                            return (int64_t) (((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int64_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int64_t) >= 3 * PyLong_SHIFT) {
                            return (int64_t) (((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int64_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int64_t) >= 4 * PyLong_SHIFT) {
                            return (int64_t) (((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int64_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int64_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int64_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int64_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(int64_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int64_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) {
                            return (int64_t) (((int64_t)-1)*(((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int64_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) {
                            return (int64_t) ((((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) {
                            return (int64_t) (((int64_t)-1)*(((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int64_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) {
                            return (int64_t) ((((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int64_t) - 1 > 4 * PyLong_SHIFT) {
                            return (int64_t) (((int64_t)-1)*(((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int64_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int64_t) - 1 > 4 * PyLong_SHIFT) {
                            return (int64_t) ((((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int64_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int64_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int64_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int64_t val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int64_t) -1;
        }
    } else {
        int64_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int64_t) -1;
        val = __Pyx_PyInt_As_int64_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int64_t");
    return (int64_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int64_t");
    return (int64_t) -1;
}

/* CIntFromPy */
static CYTHON_INLINE int32_t __Pyx_PyInt_As_int32_t(PyObject *x) {
    const int32_t neg_one = (int32_t) ((int32_t) 0 - (int32_t) 1), const_zero = (int32_t) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int32_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int32_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int32_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int32_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int32_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(int32_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int32_t) >= 2 * PyLong_SHIFT) {
                            return (int32_t) (((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int32_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int32_t) >= 3 * PyLong_SHIFT) {
                            return (int32_t) (((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int32_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int32_t) >= 4 * PyLong_SHIFT) {
                            return (int32_t) (((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int32_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int32_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int32_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int32_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int32_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(int32_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int32_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT) {
                            return (int32_t) (((int32_t)-1)*(((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int32_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT) {
                            return (int32_t) ((((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT) {
                            return (int32_t) (((int32_t)-1)*(((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int32_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT) {
                            return (int32_t) ((((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int32_t) - 1 > 4 * PyLong_SHIFT) {
                            return (int32_t) (((int32_t)-1)*(((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int32_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int32_t) - 1 > 4 * PyLong_SHIFT) {
                            return (int32_t) ((((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int32_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int32_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int32_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int32_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int32_t val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int32_t) -1;
        }
    } else {
        int32_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int32_t) -1;
        val = __Pyx_PyInt_As_int32_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int32_t");
    return (int32_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int32_t");
    return (int32_t) -1;
}

/* CIntFromPy */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
    const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (long) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            long val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (long) -1;
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

/* CIntFromPy */
static CYTHON_INLINE int8_t __Pyx_PyInt_As_int8_t(PyObject *x) {
    const int8_t neg_one = (int8_t) ((int8_t) 0 - (int8_t) 1), const_zero = (int8_t) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int8_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int8_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int8_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int8_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int8_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(int8_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int8_t) >= 2 * PyLong_SHIFT) {
                            return (int8_t) (((((int8_t)digits[1]) << PyLong_SHIFT) | (int8_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int8_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int8_t) >= 3 * PyLong_SHIFT) {
                            return (int8_t) (((((((int8_t)digits[2]) << PyLong_SHIFT) | (int8_t)digits[1]) << PyLong_SHIFT) | (int8_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int8_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int8_t) >= 4 * PyLong_SHIFT) {
                            return (int8_t) (((((((((int8_t)digits[3]) << PyLong_SHIFT) | (int8_t)digits[2]) << PyLong_SHIFT) | (int8_t)digits[1]) << PyLong_SHIFT) | (int8_t)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int8_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int8_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int8_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int8_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int8_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int8_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int8_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(int8_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int8_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int8_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int8_t) - 1 > 2 * PyLong_SHIFT) {
                            return (int8_t) (((int8_t)-1)*(((((int8_t)digits[1]) << PyLong_SHIFT) | (int8_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int8_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int8_t) - 1 > 2 * PyLong_SHIFT) {
                            return (int8_t) ((((((int8_t)digits[1]) << PyLong_SHIFT) | (int8_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int8_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int8_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int8_t) - 1 > 3 * PyLong_SHIFT) {
                            return (int8_t) (((int8_t)-1)*(((((((int8_t)digits[2]) << PyLong_SHIFT) | (int8_t)digits[1]) << PyLong_SHIFT) | (int8_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int8_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int8_t) - 1 > 3 * PyLong_SHIFT) {
                            return (int8_t) ((((((((int8_t)digits[2]) << PyLong_SHIFT) | (int8_t)digits[1]) << PyLong_SHIFT) | (int8_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int8_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int8_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int8_t) - 1 > 4 * PyLong_SHIFT) {
                            return (int8_t) (((int8_t)-1)*(((((((((int8_t)digits[3]) << PyLong_SHIFT) | (int8_t)digits[2]) << PyLong_SHIFT) | (int8_t)digits[1]) << PyLong_SHIFT) | (int8_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int8_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int8_t) - 1 > 4 * PyLong_SHIFT) {
                            return (int8_t) ((((((((((int8_t)digits[3]) << PyLong_SHIFT) | (int8_t)digits[2]) << PyLong_SHIFT) | (int8_t)digits[1]) << PyLong_SHIFT) | (int8_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int8_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int8_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int8_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int8_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int8_t val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int8_t) -1;
        }
    } else {
        int8_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int8_t) -1;
        val = __Pyx_PyInt_As_int8_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int8_t");
    return (int8_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int8_t");
    return (int8_t) -1;
}

/* CIntFromPy */
static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
    const size_t neg_one = (size_t) ((size_t) 0 - (size_t) 1), const_zero = (size_t) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(size_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (size_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (size_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) >= 2 * PyLong_SHIFT) {
                            return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) >= 3 * PyLong_SHIFT) {
                            return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) >= 4 * PyLong_SHIFT) {
                            return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (size_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(size_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (size_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(size_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
                            return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
                            return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
                            return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
                            return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
                            return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
                            return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(size_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            size_t val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (size_t) -1;
        }
    } else {
        size_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (size_t) -1;
        val = __Pyx_PyInt_As_size_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to size_t");
    return (size_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to size_t");
    return (size_t) -1;
}

/* CIntFromPy */
static CYTHON_INLINE int16_t __Pyx_PyInt_As_int16_t(PyObject *x) {
    const int16_t neg_one = (int16_t) ((int16_t) 0 - (int16_t) 1), const_zero = (int16_t) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int16_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int16_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int16_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int16_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int16_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(int16_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int16_t) >= 2 * PyLong_SHIFT) {
                            return (int16_t) (((((int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int16_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int16_t) >= 3 * PyLong_SHIFT) {
                            return (int16_t) (((((((int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int16_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int16_t) >= 4 * PyLong_SHIFT) {
                            return (int16_t) (((((((((int16_t)digits[3]) << PyLong_SHIFT) | (int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int16_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int16_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int16_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int16_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int16_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int16_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int16_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(int16_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int16_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int16_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int16_t) - 1 > 2 * PyLong_SHIFT) {
                            return (int16_t) (((int16_t)-1)*(((((int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int16_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int16_t) - 1 > 2 * PyLong_SHIFT) {
                            return (int16_t) ((((((int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int16_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int16_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int16_t) - 1 > 3 * PyLong_SHIFT) {
                            return (int16_t) (((int16_t)-1)*(((((((int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int16_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int16_t) - 1 > 3 * PyLong_SHIFT) {
                            return (int16_t) ((((((((int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int16_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int16_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int16_t) - 1 > 4 * PyLong_SHIFT) {
                            return (int16_t) (((int16_t)-1)*(((((((((int16_t)digits[3]) << PyLong_SHIFT) | (int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int16_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int16_t) - 1 > 4 * PyLong_SHIFT) {
                            return (int16_t) ((((((((((int16_t)digits[3]) << PyLong_SHIFT) | (int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int16_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int16_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int16_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int16_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int16_t val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int16_t) -1;
        }
    } else {
        int16_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int16_t) -1;
        val = __Pyx_PyInt_As_int16_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int16_t");
    return (int16_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int16_t");
    return (int16_t) -1;
}

/* CoroutineBase */
#include <structmember.h>
#include <frameobject.h>
#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) {
    PyObject *et, *ev, *tb;
    PyObject *value = NULL;
    __Pyx_ErrFetch(&et, &ev, &tb);
    if (!et) {
        Py_XDECREF(tb);
        Py_XDECREF(ev);
        Py_INCREF(Py_None);
        *pvalue = Py_None;
        return 0;
    }
    if (likely(et == PyExc_StopIteration)) {
        if (!ev) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#if PY_VERSION_HEX >= 0x030300A0
        else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
            value = ((PyStopIterationObject *)ev)->value;
            Py_INCREF(value);
            Py_DECREF(ev);
        }
#endif
        else if (unlikely(PyTuple_Check(ev))) {
            if (PyTuple_GET_SIZE(ev) >= 1) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                value = PyTuple_GET_ITEM(ev, 0);
                Py_INCREF(value);
#else
                value = PySequence_ITEM(ev, 0);
#endif
            } else {
                Py_INCREF(Py_None);
                value = Py_None;
            }
            Py_DECREF(ev);
        }
        else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
            value = ev;
        }
        if (likely(value)) {
            Py_XDECREF(tb);
            Py_DECREF(et);
            *pvalue = value;
            return 0;
        }
    } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    PyErr_NormalizeException(&et, &ev, &tb);
    if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    Py_XDECREF(tb);
    Py_DECREF(et);
#if PY_VERSION_HEX >= 0x030300A0
    value = ((PyStopIterationObject *)ev)->value;
    Py_INCREF(value);
    Py_DECREF(ev);
#else
    {
        PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
        Py_DECREF(ev);
        if (likely(args)) {
            value = PySequence_GetItem(args, 0);
            Py_DECREF(args);
        }
        if (unlikely(!value)) {
            __Pyx_ErrRestore(NULL, NULL, NULL);
            Py_INCREF(Py_None);
            value = Py_None;
        }
    }
#endif
    *pvalue = value;
    return 0;
}
static CYTHON_INLINE
void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
    PyObject *t, *v, *tb;
    t = exc_state->exc_type;
    v = exc_state->exc_value;
    tb = exc_state->exc_traceback;
    exc_state->exc_type = NULL;
    exc_state->exc_value = NULL;
    exc_state->exc_traceback = NULL;
    Py_XDECREF(t);
    Py_XDECREF(v);
    Py_XDECREF(tb);
}
#define __Pyx_Coroutine_AlreadyRunningError(gen)  (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) {
    const char *msg;
    if ((0)) {
    #ifdef __Pyx_Coroutine_USED
    } else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
        msg = "coroutine already executing";
    #endif
    #ifdef __Pyx_AsyncGen_USED
    } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
        msg = "async generator already executing";
    #endif
    } else {
        msg = "generator already executing";
    }
    PyErr_SetString(PyExc_ValueError, msg);
}
#define __Pyx_Coroutine_NotStartedError(gen)  (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) {
    const char *msg;
    if ((0)) {
    #ifdef __Pyx_Coroutine_USED
    } else if (__Pyx_Coroutine_Check(gen)) {
        msg = "can't send non-None value to a just-started coroutine";
    #endif
    #ifdef __Pyx_AsyncGen_USED
    } else if (__Pyx_AsyncGen_CheckExact(gen)) {
        msg = "can't send non-None value to a just-started async generator";
    #endif
    } else {
        msg = "can't send non-None value to a just-started generator";
    }
    PyErr_SetString(PyExc_TypeError, msg);
}
#define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing)  (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED int closing) {
    #ifdef __Pyx_Coroutine_USED
    if (!closing && __Pyx_Coroutine_Check(gen)) {
        PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine");
    } else
    #endif
    if (value) {
        #ifdef __Pyx_AsyncGen_USED
        if (__Pyx_AsyncGen_CheckExact(gen))
            PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
        else
        #endif
        PyErr_SetNone(PyExc_StopIteration);
    }
}
static
PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) {
    __Pyx_PyThreadState_declare
    PyThreadState *tstate;
    __Pyx_ExcInfoStruct *exc_state;
    PyObject *retval;
    assert(!self->is_running);
    if (unlikely(self->resume_label == 0)) {
        if (unlikely(value && value != Py_None)) {
            return __Pyx_Coroutine_NotStartedError((PyObject*)self);
        }
    }
    if (unlikely(self->resume_label == -1)) {
        return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing);
    }
#if CYTHON_FAST_THREAD_STATE
    __Pyx_PyThreadState_assign
    tstate = __pyx_tstate;
#else
    tstate = __Pyx_PyThreadState_Current;
#endif
    exc_state = &self->gi_exc_state;
    if (exc_state->exc_type) {
        #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
        #else
        if (exc_state->exc_traceback) {
            PyTracebackObject *tb = (PyTracebackObject *) exc_state->exc_traceback;
            PyFrameObject *f = tb->tb_frame;
            Py_XINCREF(tstate->frame);
            assert(f->f_back == NULL);
            f->f_back = tstate->frame;
        }
        #endif
    }
#if CYTHON_USE_EXC_INFO_STACK
    exc_state->previous_item = tstate->exc_info;
    tstate->exc_info = exc_state;
#else
    if (exc_state->exc_type) {
        __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
    } else {
        __Pyx_Coroutine_ExceptionClear(exc_state);
        __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
    }
#endif
    self->is_running = 1;
    retval = self->body((PyObject *) self, tstate, value);
    self->is_running = 0;
#if CYTHON_USE_EXC_INFO_STACK
    exc_state = &self->gi_exc_state;
    tstate->exc_info = exc_state->previous_item;
    exc_state->previous_item = NULL;
    __Pyx_Coroutine_ResetFrameBackpointer(exc_state);
#endif
    return retval;
}
static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
    PyObject *exc_tb = exc_state->exc_traceback;
    if (likely(exc_tb)) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
#else
        PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
        PyFrameObject *f = tb->tb_frame;
        Py_CLEAR(f->f_back);
#endif
    }
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) {
    if (unlikely(!retval)) {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        if (!__Pyx_PyErr_Occurred()) {
            PyObject *exc = PyExc_StopIteration;
            #ifdef __Pyx_AsyncGen_USED
            if (__Pyx_AsyncGen_CheckExact(gen))
                exc = __Pyx_PyExc_StopAsyncIteration;
            #endif
            __Pyx_PyErr_SetNone(exc);
        }
    }
    return retval;
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
    PyObject *ret;
    PyObject *val = NULL;
    __Pyx_Coroutine_Undelegate(gen);
    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
    ret = __Pyx_Coroutine_SendEx(gen, val, 0);
    Py_XDECREF(val);
    return ret;
}
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
    PyObject *retval;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_Check(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_AsyncGen_USED
        if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
            ret = __Pyx_async_gen_asend_send(yf, value);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyGen_CheckExact(yf)) {
            ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyCoro_CheckExact(yf)) {
            ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
        {
            if (value == Py_None)
                ret = Py_TYPE(yf)->tp_iternext(yf);
            else
                ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
        }
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        retval = __Pyx_Coroutine_FinishDelegation(gen);
    } else {
        retval = __Pyx_Coroutine_SendEx(gen, value, 0);
    }
    return __Pyx_Coroutine_MethodReturn(self, retval);
}
static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
    PyObject *retval = NULL;
    int err = 0;
    #ifdef __Pyx_Generator_USED
    if (__Pyx_Generator_CheckExact(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    #endif
    #ifdef __Pyx_Coroutine_USED
    if (__Pyx_Coroutine_Check(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    if (__Pyx_CoroutineAwait_CheckExact(yf)) {
        retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL);
        if (!retval)
            return -1;
    } else
    #endif
    #ifdef __Pyx_AsyncGen_USED
    if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
        retval = __Pyx_async_gen_asend_close(yf, NULL);
    } else
    if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
        retval = __Pyx_async_gen_athrow_close(yf, NULL);
    } else
    #endif
    {
        PyObject *meth;
        gen->is_running = 1;
        meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
        if (unlikely(!meth)) {
            if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                PyErr_WriteUnraisable(yf);
            }
            PyErr_Clear();
        } else {
            retval = PyObject_CallFunction(meth, NULL);
            Py_DECREF(meth);
            if (!retval)
                err = -1;
        }
        gen->is_running = 0;
    }
    Py_XDECREF(retval);
    return err;
}
static PyObject *__Pyx_Generator_Next(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Generator_Next(yf);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyGen_CheckExact(yf)) {
            ret = _PyGen_Send((PyGenObject*)yf, NULL);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_Check(yf)) {
            ret = __Pyx_Coroutine_Send(yf, Py_None);
        } else
        #endif
            ret = Py_TYPE(yf)->tp_iternext(yf);
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        return __Pyx_Coroutine_FinishDelegation(gen);
    }
    return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
}
static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, CYTHON_UNUSED PyObject *arg) {
    return __Pyx_Coroutine_Close(self);
}
static PyObject *__Pyx_Coroutine_Close(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *retval, *raised_exception;
    PyObject *yf = gen->yieldfrom;
    int err = 0;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        Py_INCREF(yf);
        err = __Pyx_Coroutine_CloseIter(gen, yf);
        __Pyx_Coroutine_Undelegate(gen);
        Py_DECREF(yf);
    }
    if (err == 0)
        PyErr_SetNone(PyExc_GeneratorExit);
    retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
    if (unlikely(retval)) {
        const char *msg;
        Py_DECREF(retval);
        if ((0)) {
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_Coroutine_Check(self)) {
            msg = "coroutine ignored GeneratorExit";
        #endif
        #ifdef __Pyx_AsyncGen_USED
        } else if (__Pyx_AsyncGen_CheckExact(self)) {
#if PY_VERSION_HEX < 0x03060000
            msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
#else
            msg = "async generator ignored GeneratorExit";
#endif
        #endif
        } else {
            msg = "generator ignored GeneratorExit";
        }
        PyErr_SetString(PyExc_RuntimeError, msg);
        return NULL;
    }
    raised_exception = PyErr_Occurred();
    if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
        if (raised_exception) PyErr_Clear();
        Py_INCREF(Py_None);
        return Py_None;
    }
    return NULL;
}
static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb,
                                        PyObject *args, int close_on_genexit) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        Py_INCREF(yf);
        if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
            int err = __Pyx_Coroutine_CloseIter(gen, yf);
            Py_DECREF(yf);
            __Pyx_Coroutine_Undelegate(gen);
            if (err < 0)
                return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
            goto throw_here;
        }
        gen->is_running = 1;
        if (0
        #ifdef __Pyx_Generator_USED
            || __Pyx_Generator_CheckExact(yf)
        #endif
        #ifdef __Pyx_Coroutine_USED
            || __Pyx_Coroutine_Check(yf)
        #endif
            ) {
            ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
            ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
        #endif
        } else {
            PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
            if (unlikely(!meth)) {
                Py_DECREF(yf);
                if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                    gen->is_running = 0;
                    return NULL;
                }
                PyErr_Clear();
                __Pyx_Coroutine_Undelegate(gen);
                gen->is_running = 0;
                goto throw_here;
            }
            if (likely(args)) {
                ret = PyObject_CallObject(meth, args);
            } else {
                ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL);
            }
            Py_DECREF(meth);
        }
        gen->is_running = 0;
        Py_DECREF(yf);
        if (!ret) {
            ret = __Pyx_Coroutine_FinishDelegation(gen);
        }
        return __Pyx_Coroutine_MethodReturn(self, ret);
    }
throw_here:
    __Pyx_Raise(typ, val, tb, NULL);
    return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
}
static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
    PyObject *typ;
    PyObject *val = NULL;
    PyObject *tb = NULL;
    if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
        return NULL;
    return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1);
}
static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) {
    Py_VISIT(exc_state->exc_type);
    Py_VISIT(exc_state->exc_value);
    Py_VISIT(exc_state->exc_traceback);
    return 0;
}
static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) {
    Py_VISIT(gen->closure);
    Py_VISIT(gen->classobj);
    Py_VISIT(gen->yieldfrom);
    return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg);
}
static int __Pyx_Coroutine_clear(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    Py_CLEAR(gen->closure);
    Py_CLEAR(gen->classobj);
    Py_CLEAR(gen->yieldfrom);
    __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
    }
#endif
    Py_CLEAR(gen->gi_code);
    Py_CLEAR(gen->gi_name);
    Py_CLEAR(gen->gi_qualname);
    Py_CLEAR(gen->gi_modulename);
    return 0;
}
static void __Pyx_Coroutine_dealloc(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject_GC_UnTrack(gen);
    if (gen->gi_weakreflist != NULL)
        PyObject_ClearWeakRefs(self);
    if (gen->resume_label >= 0) {
        PyObject_GC_Track(self);
#if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE
        if (PyObject_CallFinalizerFromDealloc(self))
#else
        Py_TYPE(gen)->tp_del(self);
        if (self->ob_refcnt > 0)
#endif
        {
            return;
        }
        PyObject_GC_UnTrack(self);
    }
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        /* We have to handle this case for asynchronous generators
           right here, because this code has to be between UNTRACK
           and GC_Del. */
        Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer);
    }
#endif
    __Pyx_Coroutine_clear(self);
    PyObject_GC_Del(gen);
}
static void __Pyx_Coroutine_del(PyObject *self) {
    PyObject *error_type, *error_value, *error_traceback;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    __Pyx_PyThreadState_declare
    if (gen->resume_label < 0) {
        return;
    }
#if !CYTHON_USE_TP_FINALIZE
    assert(self->ob_refcnt == 0);
    self->ob_refcnt = 1;
#endif
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self;
        PyObject *finalizer = agen->ag_finalizer;
        if (finalizer && !agen->ag_closed) {
            PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self);
            if (unlikely(!res)) {
                PyErr_WriteUnraisable(self);
            } else {
                Py_DECREF(res);
            }
            __Pyx_ErrRestore(error_type, error_value, error_traceback);
            return;
        }
    }
#endif
    if (unlikely(gen->resume_label == 0 && !error_value)) {
#ifdef __Pyx_Coroutine_USED
#ifdef __Pyx_Generator_USED
    if (!__Pyx_Generator_CheckExact(self))
#endif
        {
        PyObject_GC_UnTrack(self);
#if PY_MAJOR_VERSION >= 3  || defined(PyErr_WarnFormat)
        if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
            PyErr_WriteUnraisable(self);
#else
        {PyObject *msg;
        char *cmsg;
        #if CYTHON_COMPILING_IN_PYPY
        msg = NULL;
        cmsg = (char*) "coroutine was never awaited";
        #else
        char *cname;
        PyObject *qualname;
        qualname = gen->gi_qualname;
        cname = PyString_AS_STRING(qualname);
        msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname);
        if (unlikely(!msg)) {
            PyErr_Clear();
            cmsg = (char*) "coroutine was never awaited";
        } else {
            cmsg = PyString_AS_STRING(msg);
        }
        #endif
        if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
            PyErr_WriteUnraisable(self);
        Py_XDECREF(msg);}
#endif
        PyObject_GC_Track(self);
        }
#endif
    } else {
        PyObject *res = __Pyx_Coroutine_Close(self);
        if (unlikely(!res)) {
            if (PyErr_Occurred())
                PyErr_WriteUnraisable(self);
        } else {
            Py_DECREF(res);
        }
    }
    __Pyx_ErrRestore(error_type, error_value, error_traceback);
#if !CYTHON_USE_TP_FINALIZE
    assert(self->ob_refcnt > 0);
    if (--self->ob_refcnt == 0) {
        return;
    }
    {
        Py_ssize_t refcnt = self->ob_refcnt;
        _Py_NewReference(self);
        self->ob_refcnt = refcnt;
    }
#if CYTHON_COMPILING_IN_CPYTHON
    assert(PyType_IS_GC(self->ob_type) &&
           _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
    _Py_DEC_REFTOTAL;
#endif
#ifdef COUNT_ALLOCS
    --Py_TYPE(self)->tp_frees;
    --Py_TYPE(self)->tp_allocs;
#endif
#endif
}
static PyObject *
__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
{
    PyObject *name = self->gi_name;
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = self->gi_name;
    Py_INCREF(value);
    self->gi_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
{
    PyObject *name = self->gi_qualname;
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = self->gi_qualname;
    Py_INCREF(value);
    self->gi_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
            PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
    if (unlikely(!gen))
        return NULL;
    return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
}
static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    gen->body = body;
    gen->closure = closure;
    Py_XINCREF(closure);
    gen->is_running = 0;
    gen->resume_label = 0;
    gen->classobj = NULL;
    gen->yieldfrom = NULL;
    gen->gi_exc_state.exc_type = NULL;
    gen->gi_exc_state.exc_value = NULL;
    gen->gi_exc_state.exc_traceback = NULL;
#if CYTHON_USE_EXC_INFO_STACK
    gen->gi_exc_state.previous_item = NULL;
#endif
    gen->gi_weakreflist = NULL;
    Py_XINCREF(qualname);
    gen->gi_qualname = qualname;
    Py_XINCREF(name);
    gen->gi_name = name;
    Py_XINCREF(module_name);
    gen->gi_modulename = module_name;
    Py_XINCREF(code);
    gen->gi_code = code;
    PyObject_GC_Track(gen);
    return gen;
}

/* PatchModuleWithCoroutine */
static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) {
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
    int result;
    PyObject *globals, *result_obj;
    globals = PyDict_New();  if (unlikely(!globals)) goto ignore;
    result = PyDict_SetItemString(globals, "_cython_coroutine_type",
    #ifdef __Pyx_Coroutine_USED
        (PyObject*)__pyx_CoroutineType);
    #else
        Py_None);
    #endif
    if (unlikely(result < 0)) goto ignore;
    result = PyDict_SetItemString(globals, "_cython_generator_type",
    #ifdef __Pyx_Generator_USED
        (PyObject*)__pyx_GeneratorType);
    #else
        Py_None);
    #endif
    if (unlikely(result < 0)) goto ignore;
    if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore;
    if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore;
    result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
    if (unlikely(!result_obj)) goto ignore;
    Py_DECREF(result_obj);
    Py_DECREF(globals);
    return module;
ignore:
    Py_XDECREF(globals);
    PyErr_WriteUnraisable(module);
    if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) {
        Py_DECREF(module);
        module = NULL;
    }
#else
    py_code++;
#endif
    return module;
}

/* PatchGeneratorABC */
#ifndef CYTHON_REGISTER_ABCS
#define CYTHON_REGISTER_ABCS 1
#endif
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
static PyObject* __Pyx_patch_abc_module(PyObject *module);
static PyObject* __Pyx_patch_abc_module(PyObject *module) {
    module = __Pyx_Coroutine_patch_module(
        module, ""
"if _cython_generator_type is not None:\n"
"    try: Generator = _module.Generator\n"
"    except AttributeError: pass\n"
"    else: Generator.register(_cython_generator_type)\n"
"if _cython_coroutine_type is not None:\n"
"    try: Coroutine = _module.Coroutine\n"
"    except AttributeError: pass\n"
"    else: Coroutine.register(_cython_coroutine_type)\n"
    );
    return module;
}
#endif
static int __Pyx_patch_abc(void) {
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
    static int abc_patched = 0;
    if (CYTHON_REGISTER_ABCS && !abc_patched) {
        PyObject *module;
        module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections");
        if (!module) {
            PyErr_WriteUnraisable(NULL);
            if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
                    ((PY_MAJOR_VERSION >= 3) ?
                        "Cython module failed to register with collections.abc module" :
                        "Cython module failed to register with collections module"), 1) < 0)) {
                return -1;
            }
        } else {
            module = __Pyx_patch_abc_module(module);
            abc_patched = 1;
            if (unlikely(!module))
                return -1;
            Py_DECREF(module);
        }
        module = PyImport_ImportModule("backports_abc");
        if (module) {
            module = __Pyx_patch_abc_module(module);
            Py_XDECREF(module);
        }
        if (!module) {
            PyErr_Clear();
        }
    }
#else
    if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL);
#endif
    return 0;
}

/* Generator */
static PyMethodDef __pyx_Generator_methods[] = {
    {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
     (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
    {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
     (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
    {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
     (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
    {0, 0, 0, 0}
};
static PyMemberDef __pyx_Generator_memberlist[] = {
    {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
    {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
     (char*) PyDoc_STR("object being iterated by 'yield from', or None")},
    {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
    {0, 0, 0, 0, 0}
};
static PyGetSetDef __pyx_Generator_getsets[] = {
    {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
     (char*) PyDoc_STR("name of the generator"), 0},
    {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
     (char*) PyDoc_STR("qualified name of the generator"), 0},
    {0, 0, 0, 0, 0}
};
static PyTypeObject __pyx_GeneratorType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "generator",
    sizeof(__pyx_CoroutineObject),
    0,
    (destructor) __Pyx_Coroutine_dealloc,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
    0,
    (traverseproc) __Pyx_Coroutine_traverse,
    0,
    0,
    offsetof(__pyx_CoroutineObject, gi_weakreflist),
    0,
    (iternextfunc) __Pyx_Generator_Next,
    __pyx_Generator_methods,
    __pyx_Generator_memberlist,
    __pyx_Generator_getsets,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if CYTHON_USE_TP_FINALIZE
    0,
#else
    __Pyx_Coroutine_del,
#endif
    0,
#if CYTHON_USE_TP_FINALIZE
    __Pyx_Coroutine_del,
#elif PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
    0,
#endif
};
static int __pyx_Generator_init(void) {
    __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
    __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
    __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
    if (unlikely(!__pyx_GeneratorType)) {
        return -1;
    }
    return 0;
}

/* CheckBinaryVersion */
static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        return PyErr_WarnEx(NULL, message, 1);
    }
    return 0;
}

/* FunctionExport */
static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
    PyObject *d = 0;
    PyObject *cobj = 0;
    union {
        void (*fp)(void);
        void *p;
    } tmp;
    d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__");
    if (!d) {
        PyErr_Clear();
        d = PyDict_New();
        if (!d)
            goto bad;
        Py_INCREF(d);
        if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0)
            goto bad;
    }
    tmp.fp = f;
#if PY_VERSION_HEX >= 0x02070000
    cobj = PyCapsule_New(tmp.p, sig, 0);
#else
    cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0);
#endif
    if (!cobj)
        goto bad;
    if (PyDict_SetItemString(d, name, cobj) < 0)
        goto bad;
    Py_DECREF(cobj);
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(cobj);
    Py_XDECREF(d);
    return -1;
}

/* InitStrings */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        if (PyObject_Hash(*t->p) == -1)
            return -1;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
#if !CYTHON_PEP393_ENABLED
static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    char* defenc_c;
    PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
    if (!defenc) return NULL;
    defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    {
        char* end = defenc_c + PyBytes_GET_SIZE(defenc);
        char* c;
        for (c = defenc_c; c < end; c++) {
            if ((unsigned char) (*c) >= 128) {
                PyUnicode_AsASCIIString(o);
                return NULL;
            }
        }
    }
#endif
    *length = PyBytes_GET_SIZE(defenc);
    return defenc_c;
}
#else
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    if (likely(PyUnicode_IS_ASCII(o))) {
        *length = PyUnicode_GET_LENGTH(o);
        return PyUnicode_AsUTF8(o);
    } else {
        PyUnicode_AsASCIIString(o);
        return NULL;
    }
#else
    return PyUnicode_AsUTF8AndSize(o, length);
#endif
}
#endif
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
        return __Pyx_PyUnicode_AsStringAndSize(o, length);
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
    int retval;
    if (unlikely(!x)) return -1;
    retval = __Pyx_PyObject_IsTrue(x);
    Py_DECREF(x);
    return retval;
}
static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
#if PY_MAJOR_VERSION >= 3
    if (PyLong_Check(result)) {
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "__int__ returned non-int (type %.200s).  "
                "The ability to return an instance of a strict subclass of int "
                "is deprecated, and may be removed in a future version of Python.",
                Py_TYPE(result)->tp_name)) {
            Py_DECREF(result);
            return NULL;
        }
        return result;
    }
#endif
    PyErr_Format(PyExc_TypeError,
                 "__%.4s__ returned non-%.4s (type %.200s)",
                 type_name, type_name, Py_TYPE(result)->tp_name);
    Py_DECREF(result);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_Check(x) || PyLong_Check(x)))
#else
  if (likely(PyLong_Check(x)))
#endif
    return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  #if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = m->nb_int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = m->nb_long(x);
  }
  #else
  if (likely(m && m->nb_int)) {
    name = "int";
    res = m->nb_int(x);
  }
  #endif
#else
  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
    res = PyNumber_Int(x);
  }
#endif
  if (likely(res)) {
#if PY_MAJOR_VERSION < 3
    if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
#else
    if (unlikely(!PyLong_CheckExact(res))) {
#endif
        return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(b);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    const digit* digits = ((PyLongObject*)b)->ob_digit;
    const Py_ssize_t size = Py_SIZE(b);
    if (likely(__Pyx_sst_abs(size) <= 1)) {
        ival = likely(size) ? digits[0] : 0;
        if (size == -1) ival = -ival;
        return ival;
    } else {
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
